Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-24 02:18:50

0001 /*
0002  *  proxyfactoryproducer_t.cc
0003  *  EDMProto
0004  *
0005  *  Created by Chris Jones on 4/8/05.
0006  *  Changed by Viji Sundararajan on 28-Jun-05
0007  */
0008 #include <iostream>
0009 #include <atomic>
0010 #include <vector>
0011 #include <map>
0012 #include <functional>
0013 #include "oneapi/tbb/global_control.h"
0014 #include "FWCore/Framework/interface/global/EDFilter.h"
0015 #include "FWCore/Framework/interface/maker/WorkerT.h"
0016 #include "FWCore/Framework/interface/maker/ModuleHolder.h"
0017 #include "FWCore/Framework/interface/PreallocationConfiguration.h"
0018 #include "FWCore/Framework/interface/TransitionInfoTypes.h"
0019 #include "FWCore/Framework/interface/OccurrenceTraits.h"
0020 #include "DataFormats/Provenance/interface/ProductRegistry.h"
0021 #include "DataFormats/Provenance/interface/BranchIDListHelper.h"
0022 #include "DataFormats/Provenance/interface/ThinnedAssociationsHelper.h"
0023 #include "FWCore/Framework/interface/HistoryAppender.h"
0024 #include "FWCore/ServiceRegistry/interface/ParentContext.h"
0025 #include "FWCore/ServiceRegistry/interface/StreamContext.h"
0026 #include "FWCore/ServiceRegistry/interface/ActivityRegistry.h"
0027 #include "FWCore/Utilities/interface/GlobalIdentifier.h"
0028 
0029 #include "FWCore/Utilities/interface/Exception.h"
0030 
0031 #include "cppunit/extensions/HelperMacros.h"
0032 
0033 namespace {
0034   struct ShadowStreamID {
0035     constexpr ShadowStreamID() : value(0) {}
0036     unsigned int value;
0037   };
0038 
0039   union IDUnion {
0040     IDUnion() : m_shadow() {}
0041     ShadowStreamID m_shadow;
0042     edm::StreamID m_id;
0043   };
0044 }  // namespace
0045 static edm::StreamID makeID() {
0046   IDUnion u;
0047   assert(u.m_id.value() == 0);
0048   return u.m_id;
0049 }
0050 static const edm::StreamID s_streamID0 = makeID();
0051 
0052 class testGlobalFilter : public CppUnit::TestFixture {
0053   CPPUNIT_TEST_SUITE(testGlobalFilter);
0054 
0055   CPPUNIT_TEST(basicTest);
0056   CPPUNIT_TEST(streamTest);
0057   CPPUNIT_TEST(runTest);
0058   CPPUNIT_TEST(runSummaryTest);
0059   CPPUNIT_TEST(lumiTest);
0060   CPPUNIT_TEST(lumiSummaryTest);
0061   CPPUNIT_TEST(beginRunProdTest);
0062   CPPUNIT_TEST(beginLumiProdTest);
0063   CPPUNIT_TEST(endRunProdTest);
0064   CPPUNIT_TEST(endLumiProdTest);
0065   CPPUNIT_TEST(endRunSummaryProdTest);
0066   CPPUNIT_TEST(endLumiSummaryProdTest);
0067 
0068   CPPUNIT_TEST_SUITE_END();
0069 
0070 public:
0071   testGlobalFilter();
0072 
0073   void setUp() {}
0074   void tearDown() {}
0075 
0076   void basicTest();
0077   void streamTest();
0078   void runTest();
0079   void runSummaryTest();
0080   void lumiTest();
0081   void lumiSummaryTest();
0082   void beginRunProdTest();
0083   void beginLumiProdTest();
0084   void endRunProdTest();
0085   void endLumiProdTest();
0086   void endRunSummaryProdTest();
0087   void endLumiSummaryProdTest();
0088 
0089   enum class Trans {
0090     kBeginJob,
0091     kBeginStream,
0092     kGlobalBeginRun,
0093     kGlobalBeginRunProduce,
0094     kStreamBeginRun,
0095     kGlobalBeginLuminosityBlock,
0096     kStreamBeginLuminosityBlock,
0097     kEvent,
0098     kStreamEndLuminosityBlock,
0099     kGlobalEndLuminosityBlock,
0100     kStreamEndRun,
0101     kGlobalEndRun,
0102     kEndStream,
0103     kEndJob
0104   };
0105   typedef std::vector<Trans> Expectations;
0106 
0107 private:
0108   std::map<Trans, std::function<void(edm::Worker*)>> m_transToFunc;
0109 
0110   edm::ProcessConfiguration m_procConfig;
0111   edm::PreallocationConfiguration m_preallocConfig;
0112   std::shared_ptr<edm::ProductRegistry> m_prodReg;
0113   std::shared_ptr<edm::BranchIDListHelper> m_idHelper;
0114   std::shared_ptr<edm::ThinnedAssociationsHelper> m_associationsHelper;
0115   std::unique_ptr<edm::EventPrincipal> m_ep;
0116   edm::HistoryAppender historyAppender_;
0117   std::shared_ptr<edm::LuminosityBlockPrincipal> m_lbp;
0118   std::shared_ptr<edm::RunPrincipal> m_rp;
0119   std::shared_ptr<edm::ActivityRegistry>
0120       m_actReg;  // We do not use propagate_const because the registry itself is mutable.
0121   edm::EventSetupImpl* m_es = nullptr;
0122   edm::ModuleDescription m_desc = {"Dummy", "dummy"};
0123 
0124   template <typename T>
0125   void testTransitions(std::shared_ptr<T> iMod, Expectations const& iExpect);
0126 
0127   template <typename Traits, typename Info>
0128   void doWork(edm::Worker* iBase, Info const& info, edm::ParentContext const& iContext) {
0129     edm::FinalWaitingTask task;
0130     oneapi::tbb::task_group group;
0131     edm::ServiceToken token;
0132     iBase->doWorkAsync<Traits>(edm::WaitingTaskHolder(group, &task), info, token, s_streamID0, iContext, nullptr);
0133     do {
0134       group.wait();
0135     } while (not task.done());
0136     if (auto e = task.exceptionPtr()) {
0137       std::rethrow_exception(*e);
0138     }
0139   }
0140 
0141   class BasicProd : public edm::global::EDFilter<> {
0142   public:
0143     mutable unsigned int m_count = 0;  //[[cms-thread-safe]]
0144 
0145     bool filter(edm::StreamID, edm::Event&, edm::EventSetup const&) const override {
0146       ++m_count;
0147       return true;
0148     }
0149   };
0150   class StreamProd : public edm::global::EDFilter<edm::StreamCache<int>> {
0151   public:
0152     mutable unsigned int m_count = 0;
0153     bool filter(edm::StreamID, edm::Event&, edm::EventSetup const&) const override {
0154       ++m_count;
0155       return true;
0156     }
0157 
0158     std::unique_ptr<int> beginStream(edm::StreamID) const override {
0159       ++m_count;
0160       return std::unique_ptr<int>{};
0161     }
0162 
0163     virtual void streamBeginRun(edm::StreamID, edm::Run const&, edm::EventSetup const&) const override { ++m_count; }
0164     virtual void streamBeginLuminosityBlock(edm::StreamID,
0165                                             edm::LuminosityBlock const&,
0166                                             edm::EventSetup const&) const override {
0167       ++m_count;
0168     }
0169     virtual void streamEndLuminosityBlock(edm::StreamID,
0170                                           edm::LuminosityBlock const&,
0171                                           edm::EventSetup const&) const override {
0172       ++m_count;
0173     }
0174     virtual void streamEndRun(edm::StreamID, edm::Run const&, edm::EventSetup const&) const override { ++m_count; }
0175     void endStream(edm::StreamID) const override { ++m_count; }
0176   };
0177 
0178   class RunProd : public edm::global::EDFilter<edm::RunCache<int>> {
0179   public:
0180     mutable unsigned int m_count = 0;
0181     bool filter(edm::StreamID, edm::Event&, edm::EventSetup const&) const override {
0182       ++m_count;
0183       return true;
0184     }
0185 
0186     std::shared_ptr<int> globalBeginRun(edm::Run const&, edm::EventSetup const&) const override {
0187       ++m_count;
0188       return std::shared_ptr<int>{};
0189     }
0190 
0191     void globalEndRun(edm::Run const&, edm::EventSetup const&) const override { ++m_count; }
0192   };
0193 
0194   class LumiProd : public edm::global::EDFilter<edm::LuminosityBlockCache<int>> {
0195   public:
0196     mutable unsigned int m_count = 0;
0197     bool filter(edm::StreamID, edm::Event&, edm::EventSetup const&) const override {
0198       ++m_count;
0199       return true;
0200     }
0201 
0202     std::shared_ptr<int> globalBeginLuminosityBlock(edm::LuminosityBlock const&,
0203                                                     edm::EventSetup const&) const override {
0204       ++m_count;
0205       return std::shared_ptr<int>{};
0206     }
0207 
0208     void globalEndLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) const override { ++m_count; }
0209   };
0210 
0211   class RunSummaryProd : public edm::global::EDFilter<edm::RunSummaryCache<int>> {
0212   public:
0213     mutable unsigned int m_count = 0;
0214     bool filter(edm::StreamID, edm::Event&, edm::EventSetup const&) const override {
0215       ++m_count;
0216       return true;
0217     }
0218 
0219     std::shared_ptr<int> globalBeginRunSummary(edm::Run const&, edm::EventSetup const&) const override {
0220       ++m_count;
0221       return std::shared_ptr<int>{};
0222     }
0223 
0224     void streamEndRunSummary(edm::StreamID, edm::Run const&, edm::EventSetup const&, int*) const override { ++m_count; }
0225 
0226     void globalEndRunSummary(edm::Run const&, edm::EventSetup const&, int*) const override { ++m_count; }
0227   };
0228 
0229   class LumiSummaryProd : public edm::global::EDFilter<edm::LuminosityBlockSummaryCache<int>> {
0230   public:
0231     mutable unsigned int m_count = 0;
0232     bool filter(edm::StreamID, edm::Event&, edm::EventSetup const&) const override {
0233       ++m_count;
0234       return true;
0235     }
0236 
0237     std::shared_ptr<int> globalBeginLuminosityBlockSummary(edm::LuminosityBlock const&,
0238                                                            edm::EventSetup const&) const override {
0239       ++m_count;
0240       return std::shared_ptr<int>{};
0241     }
0242 
0243     void streamEndLuminosityBlockSummary(edm::StreamID,
0244                                          edm::LuminosityBlock const&,
0245                                          edm::EventSetup const&,
0246                                          int*) const override {
0247       ++m_count;
0248     }
0249 
0250     void globalEndLuminosityBlockSummary(edm::LuminosityBlock const&, edm::EventSetup const&, int*) const override {
0251       ++m_count;
0252     }
0253   };
0254 
0255   class BeginRunProd : public edm::global::EDFilter<edm::BeginRunProducer> {
0256   public:
0257     mutable unsigned int m_count = 0;
0258     bool filter(edm::StreamID, edm::Event&, edm::EventSetup const&) const override {
0259       ++m_count;
0260       return true;
0261     }
0262 
0263     void globalBeginRunProduce(edm::Run&, edm::EventSetup const&) const override { ++m_count; }
0264   };
0265 
0266   class BeginLumiProd : public edm::global::EDFilter<edm::BeginLuminosityBlockProducer> {
0267   public:
0268     mutable unsigned int m_count = 0;
0269     bool filter(edm::StreamID, edm::Event&, edm::EventSetup const&) const override {
0270       ++m_count;
0271       return true;
0272     }
0273 
0274     void globalBeginLuminosityBlockProduce(edm::LuminosityBlock&, edm::EventSetup const&) const override { ++m_count; }
0275   };
0276 
0277   class EndRunProd : public edm::global::EDFilter<edm::EndRunProducer> {
0278   public:
0279     mutable unsigned int m_count = 0;
0280     bool filter(edm::StreamID, edm::Event&, edm::EventSetup const&) const override {
0281       ++m_count;
0282       return true;
0283     }
0284 
0285     void globalEndRunProduce(edm::Run&, edm::EventSetup const&) const override { ++m_count; }
0286   };
0287 
0288   class EndLumiProd : public edm::global::EDFilter<edm::EndLuminosityBlockProducer> {
0289   public:
0290     mutable unsigned int m_count = 0;
0291     bool filter(edm::StreamID, edm::Event&, edm::EventSetup const&) const override {
0292       ++m_count;
0293       return true;
0294     }
0295 
0296     void globalEndLuminosityBlockProduce(edm::LuminosityBlock&, edm::EventSetup const&) const override { ++m_count; }
0297   };
0298 
0299   class EndRunSummaryProd : public edm::global::EDFilter<edm::EndRunProducer, edm::RunSummaryCache<int>> {
0300   public:
0301     mutable unsigned int m_count = 0;
0302     mutable bool m_globalEndRunSummaryCalled = false;
0303     bool filter(edm::StreamID, edm::Event&, edm::EventSetup const&) const override {
0304       ++m_count;
0305       return true;
0306     }
0307 
0308     std::shared_ptr<int> globalBeginRunSummary(edm::Run const&, edm::EventSetup const&) const override {
0309       ++m_count;
0310       return std::shared_ptr<int>{};
0311     }
0312 
0313     void streamEndRunSummary(edm::StreamID, edm::Run const&, edm::EventSetup const&, int*) const override { ++m_count; }
0314 
0315     void globalEndRunSummary(edm::Run const&, edm::EventSetup const&, int*) const override {
0316       ++m_count;
0317       CPPUNIT_ASSERT(m_globalEndRunSummaryCalled == false);
0318       m_globalEndRunSummaryCalled = true;
0319     }
0320 
0321     void globalEndRunProduce(edm::Run&, edm::EventSetup const&, int const*) const override {
0322       ++m_count;
0323       CPPUNIT_ASSERT(m_globalEndRunSummaryCalled == true);
0324       m_globalEndRunSummaryCalled = false;
0325     }
0326   };
0327 
0328   class EndLumiSummaryProd
0329       : public edm::global::EDFilter<edm::EndLuminosityBlockProducer, edm::LuminosityBlockSummaryCache<int>> {
0330   public:
0331     mutable unsigned int m_count = 0;
0332     mutable bool m_globalEndLuminosityBlockSummaryCalled = false;
0333     bool filter(edm::StreamID, edm::Event&, edm::EventSetup const&) const override {
0334       ++m_count;
0335       return true;
0336     }
0337 
0338     std::shared_ptr<int> globalBeginLuminosityBlockSummary(edm::LuminosityBlock const&,
0339                                                            edm::EventSetup const&) const override {
0340       ++m_count;
0341       return std::shared_ptr<int>{};
0342     }
0343 
0344     void streamEndLuminosityBlockSummary(edm::StreamID,
0345                                          edm::LuminosityBlock const&,
0346                                          edm::EventSetup const&,
0347                                          int*) const override {
0348       ++m_count;
0349     }
0350 
0351     void globalEndLuminosityBlockSummary(edm::LuminosityBlock const&, edm::EventSetup const&, int*) const override {
0352       ++m_count;
0353       CPPUNIT_ASSERT(m_globalEndLuminosityBlockSummaryCalled == false);
0354       m_globalEndLuminosityBlockSummaryCalled = true;
0355     }
0356 
0357     void globalEndLuminosityBlockProduce(edm::LuminosityBlock&, edm::EventSetup const&, int const*) const override {
0358       ++m_count;
0359       CPPUNIT_ASSERT(m_globalEndLuminosityBlockSummaryCalled == true);
0360       m_globalEndLuminosityBlockSummaryCalled = false;
0361     }
0362   };
0363 };
0364 
0365 ///registration of the test so that the runner can find it
0366 CPPUNIT_TEST_SUITE_REGISTRATION(testGlobalFilter);
0367 
0368 testGlobalFilter::testGlobalFilter()
0369     : m_preallocConfig{},
0370       m_prodReg(new edm::ProductRegistry{}),
0371       m_idHelper(new edm::BranchIDListHelper{}),
0372       m_associationsHelper(new edm::ThinnedAssociationsHelper{}),
0373       m_ep() {
0374   //Setup the principals
0375   m_prodReg->setFrozen();
0376   m_idHelper->updateFromRegistry(*m_prodReg);
0377   edm::EventID eventID = edm::EventID::firstValidEvent();
0378 
0379   std::string uuid = edm::createGlobalIdentifier();
0380   edm::Timestamp now(1234567UL);
0381   auto runAux = std::make_shared<edm::RunAuxiliary>(eventID.run(), now, now);
0382   m_rp.reset(new edm::RunPrincipal(runAux, m_prodReg, m_procConfig, &historyAppender_, 0));
0383   auto lumiAux = std::make_shared<edm::LuminosityBlockAuxiliary>(m_rp->run(), 1, now, now);
0384   m_lbp.reset(new edm::LuminosityBlockPrincipal(m_prodReg, m_procConfig, &historyAppender_, 0));
0385   m_lbp->setAux(*lumiAux);
0386   m_lbp->setRunPrincipal(m_rp);
0387   edm::EventAuxiliary eventAux(eventID, uuid, now, true);
0388 
0389   m_ep.reset(new edm::EventPrincipal(m_prodReg, m_idHelper, m_associationsHelper, m_procConfig, nullptr));
0390   m_ep->fillEventPrincipal(eventAux, nullptr);
0391   m_ep->setLuminosityBlockPrincipal(m_lbp.get());
0392   m_actReg.reset(new edm::ActivityRegistry);
0393 
0394   //For each transition, bind a lambda which will call the proper method of the Worker
0395   m_transToFunc[Trans::kBeginStream] = [](edm::Worker* iBase) {
0396     edm::StreamContext streamContext(s_streamID0, nullptr);
0397     iBase->beginStream(s_streamID0, streamContext);
0398   };
0399 
0400   m_transToFunc[Trans::kGlobalBeginRun] = [this](edm::Worker* iBase) {
0401     typedef edm::OccurrenceTraits<edm::RunPrincipal, edm::BranchActionGlobalBegin> Traits;
0402     edm::ParentContext nullParentContext;
0403     edm::RunTransitionInfo info(*m_rp, *m_es);
0404     doWork<Traits>(iBase, info, nullParentContext);
0405   };
0406   m_transToFunc[Trans::kStreamBeginRun] = [this](edm::Worker* iBase) {
0407     typedef edm::OccurrenceTraits<edm::RunPrincipal, edm::BranchActionStreamBegin> Traits;
0408     edm::ParentContext nullParentContext;
0409     edm::RunTransitionInfo info(*m_rp, *m_es);
0410     doWork<Traits>(iBase, info, nullParentContext);
0411   };
0412 
0413   m_transToFunc[Trans::kGlobalBeginLuminosityBlock] = [this](edm::Worker* iBase) {
0414     typedef edm::OccurrenceTraits<edm::LuminosityBlockPrincipal, edm::BranchActionGlobalBegin> Traits;
0415     edm::ParentContext nullParentContext;
0416     edm::LumiTransitionInfo info(*m_lbp, *m_es);
0417     doWork<Traits>(iBase, info, nullParentContext);
0418   };
0419   m_transToFunc[Trans::kStreamBeginLuminosityBlock] = [this](edm::Worker* iBase) {
0420     typedef edm::OccurrenceTraits<edm::LuminosityBlockPrincipal, edm::BranchActionStreamBegin> Traits;
0421     edm::ParentContext nullParentContext;
0422     edm::LumiTransitionInfo info(*m_lbp, *m_es);
0423     doWork<Traits>(iBase, info, nullParentContext);
0424   };
0425 
0426   m_transToFunc[Trans::kEvent] = [this](edm::Worker* iBase) {
0427     typedef edm::OccurrenceTraits<edm::EventPrincipal, edm::BranchActionStreamBegin> Traits;
0428     edm::StreamContext streamContext(s_streamID0, nullptr);
0429     edm::ParentContext nullParentContext(&streamContext);
0430     iBase->setActivityRegistry(m_actReg);
0431     edm::EventTransitionInfo info(*m_ep, *m_es);
0432     doWork<Traits>(iBase, info, nullParentContext);
0433   };
0434 
0435   m_transToFunc[Trans::kStreamEndLuminosityBlock] = [this](edm::Worker* iBase) {
0436     typedef edm::OccurrenceTraits<edm::LuminosityBlockPrincipal, edm::BranchActionStreamEnd> Traits;
0437     edm::ParentContext nullParentContext;
0438     edm::LumiTransitionInfo info(*m_lbp, *m_es);
0439     doWork<Traits>(iBase, info, nullParentContext);
0440   };
0441   m_transToFunc[Trans::kGlobalEndLuminosityBlock] = [this](edm::Worker* iBase) {
0442     typedef edm::OccurrenceTraits<edm::LuminosityBlockPrincipal, edm::BranchActionGlobalEnd> Traits;
0443     edm::ParentContext nullParentContext;
0444     edm::LumiTransitionInfo info(*m_lbp, *m_es);
0445     doWork<Traits>(iBase, info, nullParentContext);
0446   };
0447 
0448   m_transToFunc[Trans::kStreamEndRun] = [this](edm::Worker* iBase) {
0449     typedef edm::OccurrenceTraits<edm::RunPrincipal, edm::BranchActionStreamEnd> Traits;
0450     edm::ParentContext nullParentContext;
0451     edm::RunTransitionInfo info(*m_rp, *m_es);
0452     doWork<Traits>(iBase, info, nullParentContext);
0453   };
0454   m_transToFunc[Trans::kGlobalEndRun] = [this](edm::Worker* iBase) {
0455     typedef edm::OccurrenceTraits<edm::RunPrincipal, edm::BranchActionGlobalEnd> Traits;
0456     edm::ParentContext nullParentContext;
0457     edm::RunTransitionInfo info(*m_rp, *m_es);
0458     doWork<Traits>(iBase, info, nullParentContext);
0459   };
0460 
0461   m_transToFunc[Trans::kEndStream] = [](edm::Worker* iBase) {
0462     edm::StreamContext streamContext(s_streamID0, nullptr);
0463     iBase->endStream(s_streamID0, streamContext);
0464   };
0465 }
0466 
0467 namespace {
0468   template <typename T>
0469   void testTransition(std::shared_ptr<T> iMod,
0470                       edm::Worker* iWorker,
0471                       testGlobalFilter::Trans iTrans,
0472                       testGlobalFilter::Expectations const& iExpect,
0473                       std::function<void(edm::Worker*)> iFunc) {
0474     assert(0 == iMod->m_count);
0475     iFunc(iWorker);
0476     auto count = std::count(iExpect.begin(), iExpect.end(), iTrans);
0477     if (count != iMod->m_count) {
0478       std::cout << "For trans " << static_cast<std::underlying_type<testGlobalFilter::Trans>::type>(iTrans)
0479                 << " expected " << count << " and got " << iMod->m_count << std::endl;
0480     }
0481     CPPUNIT_ASSERT(iMod->m_count == count);
0482     iMod->m_count = 0;
0483     iWorker->reset();
0484   }
0485 }  // namespace
0486 
0487 template <typename T>
0488 void testGlobalFilter::testTransitions(std::shared_ptr<T> iMod, Expectations const& iExpect) {
0489   oneapi::tbb::global_control control(oneapi::tbb::global_control::max_allowed_parallelism, 1);
0490   edm::maker::ModuleHolderT<edm::global::EDFilterBase> h(iMod, nullptr);
0491   h.preallocate(edm::PreallocationConfiguration{});
0492 
0493   edm::WorkerT<edm::global::EDFilterBase> w{iMod, m_desc, nullptr};
0494   for (auto& keyVal : m_transToFunc) {
0495     testTransition(iMod, &w, keyVal.first, iExpect, keyVal.second);
0496   }
0497 }
0498 
0499 void testGlobalFilter::basicTest() {
0500   auto testProd = std::make_shared<BasicProd>();
0501 
0502   CPPUNIT_ASSERT(0 == testProd->m_count);
0503   testTransitions(testProd, {Trans::kEvent});
0504 }
0505 
0506 void testGlobalFilter::streamTest() {
0507   auto testProd = std::make_shared<StreamProd>();
0508 
0509   CPPUNIT_ASSERT(0 == testProd->m_count);
0510   testTransitions(testProd,
0511                   {Trans::kBeginStream,
0512                    Trans::kStreamBeginRun,
0513                    Trans::kStreamBeginLuminosityBlock,
0514                    Trans::kEvent,
0515                    Trans::kStreamEndLuminosityBlock,
0516                    Trans::kStreamEndRun,
0517                    Trans::kEndStream});
0518 }
0519 
0520 void testGlobalFilter::runTest() {
0521   auto testProd = std::make_shared<RunProd>();
0522 
0523   CPPUNIT_ASSERT(0 == testProd->m_count);
0524   testTransitions(testProd, {Trans::kGlobalBeginRun, Trans::kEvent, Trans::kGlobalEndRun});
0525 }
0526 
0527 void testGlobalFilter::runSummaryTest() {
0528   auto testProd = std::make_shared<RunSummaryProd>();
0529 
0530   CPPUNIT_ASSERT(0 == testProd->m_count);
0531   testTransitions(testProd, {Trans::kGlobalBeginRun, Trans::kEvent, Trans::kStreamEndRun, Trans::kGlobalEndRun});
0532 }
0533 
0534 void testGlobalFilter::lumiTest() {
0535   auto testProd = std::make_shared<LumiProd>();
0536 
0537   CPPUNIT_ASSERT(0 == testProd->m_count);
0538   testTransitions(testProd, {Trans::kGlobalBeginLuminosityBlock, Trans::kEvent, Trans::kGlobalEndLuminosityBlock});
0539 }
0540 
0541 void testGlobalFilter::lumiSummaryTest() {
0542   auto testProd = std::make_shared<LumiSummaryProd>();
0543 
0544   CPPUNIT_ASSERT(0 == testProd->m_count);
0545   testTransitions(testProd,
0546                   {Trans::kGlobalBeginLuminosityBlock,
0547                    Trans::kEvent,
0548                    Trans::kStreamEndLuminosityBlock,
0549                    Trans::kGlobalEndLuminosityBlock});
0550 }
0551 
0552 void testGlobalFilter::beginRunProdTest() {
0553   auto testProd = std::make_shared<BeginRunProd>();
0554 
0555   CPPUNIT_ASSERT(0 == testProd->m_count);
0556   testTransitions(testProd, {Trans::kGlobalBeginRun, Trans::kEvent});
0557 }
0558 
0559 void testGlobalFilter::beginLumiProdTest() {
0560   auto testProd = std::make_shared<BeginLumiProd>();
0561 
0562   CPPUNIT_ASSERT(0 == testProd->m_count);
0563   testTransitions(testProd, {Trans::kGlobalBeginLuminosityBlock, Trans::kEvent});
0564 }
0565 
0566 void testGlobalFilter::endRunProdTest() {
0567   auto testProd = std::make_shared<EndRunProd>();
0568 
0569   CPPUNIT_ASSERT(0 == testProd->m_count);
0570   testTransitions(testProd, {Trans::kGlobalEndRun, Trans::kEvent});
0571 }
0572 
0573 void testGlobalFilter::endLumiProdTest() {
0574   auto testProd = std::make_shared<EndLumiProd>();
0575 
0576   CPPUNIT_ASSERT(0 == testProd->m_count);
0577   testTransitions(testProd, {Trans::kGlobalEndLuminosityBlock, Trans::kEvent});
0578 }
0579 
0580 void testGlobalFilter::endRunSummaryProdTest() {
0581   auto testProd = std::make_shared<EndRunSummaryProd>();
0582 
0583   CPPUNIT_ASSERT(0 == testProd->m_count);
0584   testTransitions(
0585       testProd,
0586       {Trans::kGlobalEndRun, Trans::kEvent, Trans::kGlobalBeginRun, Trans::kStreamEndRun, Trans::kGlobalEndRun});
0587 }
0588 
0589 void testGlobalFilter::endLumiSummaryProdTest() {
0590   auto testProd = std::make_shared<EndLumiSummaryProd>();
0591 
0592   CPPUNIT_ASSERT(0 == testProd->m_count);
0593   testTransitions(testProd,
0594                   {Trans::kGlobalEndLuminosityBlock,
0595                    Trans::kEvent,
0596                    Trans::kGlobalBeginLuminosityBlock,
0597                    Trans::kStreamEndLuminosityBlock,
0598                    Trans::kGlobalEndLuminosityBlock});
0599 }