Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:12:19

0001 
0002 /*----------------------------------------------------------------------
0003 
0004 Toy edm::one::EDAnalyzer modules of
0005 edm::one cache templates
0006 for testing purposes only.
0007 
0008 ----------------------------------------------------------------------*/
0009 #include <atomic>
0010 #include <iostream>
0011 #include <memory>
0012 #include <tuple>
0013 #include <vector>
0014 
0015 #include "DataFormats/Provenance/interface/BranchDescription.h"
0016 #include "DataFormats/TestObjects/interface/ToyProducts.h"
0017 #include "FWCore/Framework/interface/CacheHandle.h"
0018 #include "FWCore/Framework/interface/Event.h"
0019 #include "FWCore/Framework/interface/LuminosityBlock.h"
0020 #include "FWCore/Framework/interface/MakerMacros.h"
0021 #include "FWCore/Framework/interface/moduleAbilities.h"
0022 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0023 #include "FWCore/Framework/interface/ProcessBlock.h"
0024 #include "FWCore/Framework/interface/Run.h"
0025 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0026 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0027 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0028 #include "FWCore/Utilities/interface/BranchType.h"
0029 #include "FWCore/Utilities/interface/EDMException.h"
0030 #include "FWCore/Utilities/interface/EDGetToken.h"
0031 #include "FWCore/Utilities/interface/InputTag.h"
0032 
0033 namespace edmtest {
0034   namespace one {
0035 
0036     class SharedResourcesAnalyzer : public edm::one::EDAnalyzer<edm::one::SharedResources> {
0037     public:
0038       explicit SharedResourcesAnalyzer(edm::ParameterSet const& p) : trans_(p.getParameter<int>("transitions")) {
0039         usesResource("foo");
0040         callWhenNewProductsRegistered([](edm::BranchDescription const& desc) {
0041           std::cout << "one::SharedResourcesAnalyzer " << desc.moduleLabel() << std::endl;
0042         });
0043       }
0044       const unsigned int trans_;
0045       unsigned int m_count = 0;
0046 
0047       void analyze(edm::Event const&, edm::EventSetup const&) override { ++m_count; }
0048 
0049       ~SharedResourcesAnalyzer() {
0050         if (m_count != trans_) {
0051           throw cms::Exception("transitions")
0052               << "SharedResourcesAnalyzer transitions " << m_count << " but it was supposed to be " << trans_;
0053         }
0054       }
0055     };
0056 
0057     class WatchRunsAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
0058     public:
0059       explicit WatchRunsAnalyzer(edm::ParameterSet const& p) : trans_(p.getParameter<int>("transitions")) {}
0060       bool br = false;
0061       bool er = false;
0062       const unsigned int trans_;
0063       unsigned int m_count = 0;
0064 
0065       void analyze(edm::Event const&, edm::EventSetup const&) override {
0066         ++m_count;
0067         if (!br || er) {
0068           throw cms::Exception("out of sequence") << " produce before beginRun or after endRun";
0069         }
0070       }
0071 
0072       void beginRun(edm::Run const&, edm::EventSetup const&) override {
0073         ++m_count;
0074         if (br) {
0075           throw cms::Exception("out of sequence") << " beginRun seen multiple times";
0076         }
0077         br = true;
0078         er = false;
0079       }
0080 
0081       void endRun(edm::Run const&, edm::EventSetup const&) override {
0082         ++m_count;
0083         if (!br) {
0084           throw cms::Exception("out of sequence") << " endRun before beginRun";
0085         }
0086         br = false;
0087         er = true;
0088       }
0089 
0090       ~WatchRunsAnalyzer() {
0091         if (m_count != trans_) {
0092           throw cms::Exception("transitions")
0093               << "WatchRunsAnalyzer transitions " << m_count << " but it was supposed to be " << trans_;
0094         }
0095       }
0096     };
0097 
0098     class WatchLumiBlocksAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchLuminosityBlocks> {
0099     public:
0100       explicit WatchLumiBlocksAnalyzer(edm::ParameterSet const& p) : trans_(p.getParameter<int>("transitions")) {
0101         // just to create a data dependence
0102         auto const& tag = p.getParameter<edm::InputTag>("moduleLabel");
0103         if (not tag.label().empty()) {
0104           consumes<unsigned int, edm::InLumi>(tag);
0105         }
0106       }
0107       const unsigned int trans_;
0108       bool bl = false;
0109       bool el = false;
0110       unsigned int m_count = 0;
0111 
0112       void analyze(edm::Event const&, edm::EventSetup const&) override {
0113         ++m_count;
0114         if (!bl || el) {
0115           throw cms::Exception("out of sequence") << " produce before beginLumiBlock or after endLumiBlock";
0116         }
0117       }
0118 
0119       void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override {
0120         ++m_count;
0121         if (bl) {
0122           throw cms::Exception("out of sequence") << " beginLumiBlock seen mutiple times";
0123         }
0124         bl = true;
0125         el = false;
0126       }
0127 
0128       void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override {
0129         ++m_count;
0130         if (!bl) {
0131           throw cms::Exception("out of sequence") << " endLumiBlock before beginLumiBlock";
0132         }
0133         bl = false;
0134         el = true;
0135       }
0136 
0137       ~WatchLumiBlocksAnalyzer() {
0138         if (m_count != trans_) {
0139           throw cms::Exception("transitions")
0140               << "WatchLumiBlocksAnalyzer transitions " << m_count << " but it was supposed to be " << trans_;
0141         }
0142       }
0143     };
0144 
0145     namespace an {
0146       struct Cache {
0147         bool begin = true;
0148         bool end = false;
0149       };
0150     }  // namespace an
0151     class RunCacheAnalyzer : public edm::one::EDAnalyzer<edm::RunCache<an::Cache>> {
0152     public:
0153       explicit RunCacheAnalyzer(edm::ParameterSet const& p) : trans_(p.getParameter<int>("transitions")) {}
0154       const unsigned int trans_;
0155       mutable std::atomic<unsigned int> m_count = 0;
0156 
0157       void analyze(edm::Event const& iEvent, edm::EventSetup const&) override {
0158         ++m_count;
0159         auto c = runCache(iEvent.getRun().index());
0160         if (nullptr == c) {
0161           throw cms::Exception("Missing cache") << " no cache in analyze";
0162         }
0163 
0164         if (!c->begin || c->end) {
0165           throw cms::Exception("out of sequence") << " produce before beginRun or after endRun";
0166         }
0167       }
0168 
0169       std::shared_ptr<an::Cache> globalBeginRun(edm::Run const&, edm::EventSetup const&) const final {
0170         ++m_count;
0171         return std::make_shared<an::Cache>();
0172       }
0173 
0174       void globalEndRun(edm::Run const& iRun, edm::EventSetup const&) final {
0175         ++m_count;
0176         auto c = runCache(iRun.index());
0177         if (nullptr == c) {
0178           throw cms::Exception("Missing cache") << " no cache in globalEndRun";
0179         }
0180         if (!c->begin) {
0181           throw cms::Exception("out of sequence") << " endRun before beginRun";
0182         }
0183         c->begin = false;
0184         c->end = true;
0185       }
0186 
0187       ~RunCacheAnalyzer() {
0188         if (m_count != trans_) {
0189           throw cms::Exception("transitions")
0190               << "WatchRunsAnalyzer transitions " << m_count << " but it was supposed to be " << trans_;
0191         }
0192       }
0193     };
0194 
0195     class LumiBlockCacheAnalyzer : public edm::one::EDAnalyzer<edm::LuminosityBlockCache<an::Cache>> {
0196     public:
0197       explicit LumiBlockCacheAnalyzer(edm::ParameterSet const& p) : trans_(p.getParameter<int>("transitions")) {}
0198       const unsigned int trans_;
0199       mutable std::atomic<unsigned int> m_count = 0;
0200 
0201       void analyze(edm::Event const& iEvent, edm::EventSetup const&) override {
0202         ++m_count;
0203 
0204         auto c = luminosityBlockCache(iEvent.getLuminosityBlock().index());
0205         if (nullptr == c) {
0206           throw cms::Exception("Missing cache") << " no cache in analyze";
0207         }
0208 
0209         if (!c->begin || c->end) {
0210           throw cms::Exception("out of sequence") << " produce before beginLumiBlock or after endLumiBlock";
0211         }
0212       }
0213 
0214       std::shared_ptr<an::Cache> globalBeginLuminosityBlock(edm::LuminosityBlock const&,
0215                                                             edm::EventSetup const&) const final {
0216         ++m_count;
0217         return std::make_shared<an::Cache>();
0218       }
0219 
0220       void globalEndLuminosityBlock(edm::LuminosityBlock const& iLumi, edm::EventSetup const&) override {
0221         ++m_count;
0222         auto c = luminosityBlockCache(iLumi.index());
0223         if (!c->begin) {
0224           throw cms::Exception("out of sequence") << " endLumiBlock before beginLumiBlock";
0225         }
0226         c->begin = false;
0227         c->end = true;
0228       }
0229 
0230       ~LumiBlockCacheAnalyzer() {
0231         if (m_count != trans_) {
0232           throw cms::Exception("transitions")
0233               << "WatchLumiBlocksAnalyzer transitions " << m_count << " but it was supposed to be " << trans_;
0234         }
0235       }
0236     };
0237 
0238     class ProcessBlockIntAnalyzer : public edm::one::EDAnalyzer<edm::WatchProcessBlock> {
0239     public:
0240       explicit ProcessBlockIntAnalyzer(edm::ParameterSet const& pset) : trans_(pset.getParameter<int>("transitions")) {
0241         {
0242           auto tag = pset.getParameter<edm::InputTag>("consumesBeginProcessBlock");
0243           if (not tag.label().empty()) {
0244             getTokenBegin_ = consumes<unsigned int, edm::InProcess>(tag);
0245           }
0246         }
0247         {
0248           auto tag = pset.getParameter<edm::InputTag>("consumesEndProcessBlock");
0249           if (not tag.label().empty()) {
0250             getTokenEnd_ = consumes<unsigned int, edm::InProcess>(tag);
0251           }
0252         }
0253       }
0254 
0255       void beginProcessBlock(edm::ProcessBlock const& processBlock) override {
0256         if (m_count != 0) {
0257           throw cms::Exception("transitions")
0258               << "ProcessBlockIntAnalyzer::begin transitions " << m_count << " but it was supposed to be " << 0;
0259         }
0260         ++m_count;
0261 
0262         const unsigned int valueToGet = 11;
0263         if (not getTokenBegin_.isUninitialized()) {
0264           if (processBlock.get(getTokenBegin_) != valueToGet) {
0265             throw cms::Exception("BadValue")
0266                 << "expected " << valueToGet << " but got " << processBlock.get(getTokenBegin_);
0267           }
0268         }
0269       }
0270 
0271       void analyze(edm::Event const&, edm::EventSetup const&) override {
0272         if (m_count < 1u) {
0273           throw cms::Exception("out of sequence") << "analyze before beginProcessBlock " << m_count;
0274         }
0275         ++m_count;
0276       }
0277 
0278       void endProcessBlock(edm::ProcessBlock const& processBlock) override {
0279         ++m_count;
0280         if (m_count != trans_) {
0281           throw cms::Exception("transitions")
0282               << "ProcessBlockIntAnalyzer::end transitions " << m_count << " but it was supposed to be " << trans_;
0283         }
0284 
0285         {
0286           const unsigned int valueToGet = 11;
0287           if (not getTokenBegin_.isUninitialized()) {
0288             if (processBlock.get(getTokenBegin_) != valueToGet) {
0289               throw cms::Exception("BadValue")
0290                   << "expected " << valueToGet << " but got " << processBlock.get(getTokenBegin_);
0291             }
0292           }
0293         }
0294         {
0295           const unsigned int valueToGet = 21;
0296           if (not getTokenEnd_.isUninitialized()) {
0297             if (processBlock.get(getTokenEnd_) != valueToGet) {
0298               throw cms::Exception("BadValue")
0299                   << "expected " << valueToGet << " but got " << processBlock.get(getTokenEnd_);
0300             }
0301           }
0302         }
0303       }
0304 
0305       ~ProcessBlockIntAnalyzer() {
0306         if (m_count != trans_) {
0307           throw cms::Exception("transitions")
0308               << "ProcessBlockIntAnalyzer transitions " << m_count << " but it was supposed to be " << trans_;
0309         }
0310       }
0311 
0312     private:
0313       const unsigned int trans_;
0314       mutable std::atomic<unsigned int> m_count{0};
0315       edm::EDGetTokenT<unsigned int> getTokenBegin_;
0316       edm::EDGetTokenT<unsigned int> getTokenEnd_;
0317     };
0318 
0319     class TestInputProcessBlockCache {
0320     public:
0321       long long int value_ = 0;
0322     };
0323 
0324     class TestInputProcessBlockCache1 {
0325     public:
0326       long long int value_ = 0;
0327     };
0328 
0329     class InputProcessBlockIntAnalyzer
0330         : public edm::one::EDAnalyzer<
0331               edm::WatchProcessBlock,
0332               edm::InputProcessBlockCache<int, TestInputProcessBlockCache, TestInputProcessBlockCache1>> {
0333     public:
0334       explicit InputProcessBlockIntAnalyzer(edm::ParameterSet const& pset) {
0335         expectedTransitions_ = pset.getParameter<int>("transitions");
0336         expectedByRun_ = pset.getParameter<std::vector<int>>("expectedByRun");
0337         expectedSum_ = pset.getParameter<int>("expectedSum");
0338         expectedFillerSum_ = pset.getUntrackedParameter<int>("expectedFillerSum", 0);
0339         expectedCacheSize_ = pset.getUntrackedParameter<unsigned int>("expectedCacheSize", 0);
0340         {
0341           auto tag = pset.getParameter<edm::InputTag>("consumesBeginProcessBlock");
0342           if (not tag.label().empty()) {
0343             getTokenBegin_ = consumes<IntProduct, edm::InProcess>(tag);
0344           }
0345         }
0346         {
0347           auto tag = pset.getParameter<edm::InputTag>("consumesEndProcessBlock");
0348           if (not tag.label().empty()) {
0349             getTokenEnd_ = consumes<IntProduct, edm::InProcess>(tag);
0350           }
0351         }
0352         {
0353           auto tag = pset.getParameter<edm::InputTag>("consumesBeginProcessBlockM");
0354           if (not tag.label().empty()) {
0355             getTokenBeginM_ = consumes<IntProduct, edm::InProcess>(tag);
0356           }
0357         }
0358         {
0359           auto tag = pset.getParameter<edm::InputTag>("consumesEndProcessBlockM");
0360           if (not tag.label().empty()) {
0361             getTokenEndM_ = consumes<IntProduct, edm::InProcess>(tag);
0362           }
0363         }
0364         {
0365           auto tag = pset.getParameter<edm::InputTag>("consumesBeginProcessBlockNotFound");
0366           if (not tag.label().empty()) {
0367             getTokenBeginNotFound_ = consumes<IntProduct, edm::InProcess>(tag);
0368           }
0369         }
0370         {
0371           auto tag = pset.getParameter<edm::InputTag>("consumesEndProcessBlockNotFound");
0372           if (not tag.label().empty()) {
0373             getTokenEndNotFound_ = consumes<IntProduct, edm::InProcess>(tag);
0374           }
0375         }
0376         {
0377           auto tag = pset.getParameter<edm::InputTag>("consumesProcessBlockNotFound1");
0378           if (not tag.label().empty()) {
0379             getTokenNotFound1_ = consumes<IntProduct, edm::InProcess>(tag);
0380           }
0381         }
0382         {
0383           auto tag = pset.getParameter<edm::InputTag>("consumesProcessBlockNotFound2");
0384           if (not tag.label().empty()) {
0385             getTokenNotFound2_ = consumes<IntProduct, edm::InProcess>(tag);
0386           }
0387         }
0388         {
0389           auto tag = pset.getParameter<edm::InputTag>("consumesProcessBlockNotFound3");
0390           if (not tag.label().empty()) {
0391             getTokenNotFound3_ = consumes<IntProduct, edm::InProcess>(tag);
0392           }
0393         }
0394         {
0395           auto tag = pset.getParameter<edm::InputTag>("consumesProcessBlockNotFound4");
0396           if (not tag.label().empty()) {
0397             getTokenNotFound4_ = consumes<IntProduct, edm::InProcess>(tag);
0398           }
0399         }
0400 
0401         if (!getTokenBegin_.isUninitialized()) {
0402           registerProcessBlockCacheFiller<int>(
0403               getTokenBegin_, [this](edm::ProcessBlock const& processBlock, std::shared_ptr<int> const& previousCache) {
0404                 auto returnValue = std::make_shared<int>(0);
0405                 *returnValue += processBlock.get(getTokenBegin_).value;
0406                 *returnValue += processBlock.get(getTokenEnd_).value;
0407                 fillerSum_ += processBlock.get(getTokenBegin_).value;
0408                 fillerSum_ += processBlock.get(getTokenEnd_).value;
0409                 ++transitions_;
0410                 return returnValue;
0411               });
0412         }
0413         if (!getTokenBegin_.isUninitialized()) {
0414           registerProcessBlockCacheFiller<1>(getTokenBegin_,
0415                                              [this](edm::ProcessBlock const& processBlock,
0416                                                     std::shared_ptr<TestInputProcessBlockCache> const& previousCache) {
0417                                                auto returnValue = std::make_shared<TestInputProcessBlockCache>();
0418                                                returnValue->value_ += processBlock.get(getTokenBegin_).value;
0419                                                returnValue->value_ += processBlock.get(getTokenEnd_).value;
0420                                                fillerSum_ += processBlock.get(getTokenBegin_).value;
0421                                                fillerSum_ += processBlock.get(getTokenEnd_).value;
0422                                                ++transitions_;
0423                                                return returnValue;
0424                                              });
0425         }
0426         if (!getTokenBegin_.isUninitialized()) {
0427           registerProcessBlockCacheFiller<TestInputProcessBlockCache1>(
0428               getTokenBegin_,
0429               [this](edm::ProcessBlock const& processBlock,
0430                      std::shared_ptr<TestInputProcessBlockCache1> const& previousCache) {
0431                 auto returnValue = std::make_shared<TestInputProcessBlockCache1>();
0432                 returnValue->value_ += processBlock.get(getTokenBegin_).value;
0433                 returnValue->value_ += processBlock.get(getTokenEnd_).value;
0434                 fillerSum_ += processBlock.get(getTokenBegin_).value;
0435                 fillerSum_ += processBlock.get(getTokenEnd_).value;
0436                 ++transitions_;
0437                 return returnValue;
0438               });
0439         }
0440       }
0441 
0442       void beginProcessBlock(edm::ProcessBlock const& processBlock) override {
0443         if (!getTokenBeginNotFound_.isUninitialized() && processBlock.getHandle(getTokenBeginNotFound_).isValid()) {
0444           throw cms::Exception("TestFailure") << "Expected handle to be invalid but it is valid (begin)";
0445         }
0446       }
0447 
0448       void endProcessBlock(edm::ProcessBlock const& processBlock) override {
0449         if (!getTokenEndNotFound_.isUninitialized() && processBlock.getHandle(getTokenEndNotFound_).isValid()) {
0450           throw cms::Exception("TestFailure") << "Expected handle to be invalid but it is valid (end)";
0451         }
0452       }
0453 
0454       void accessInputProcessBlock(edm::ProcessBlock const& processBlock) override {
0455         if (processBlock.processName() == "PROD1") {
0456           if (!getTokenBegin_.isUninitialized() && processBlock.getHandle(getTokenBegin_).isValid()) {
0457             sum_ += processBlock.get(getTokenBegin_).value;
0458             sum_ += processBlock.get(getTokenEnd_).value;
0459           }
0460         }
0461         if (processBlock.processName() == "MERGE") {
0462           if (!getTokenBeginM_.isUninitialized() && processBlock.getHandle(getTokenBeginM_).isValid()) {
0463             sum_ += processBlock.get(getTokenBeginM_).value;
0464             sum_ += processBlock.get(getTokenEndM_).value;
0465           }
0466         }
0467 
0468         if (!getTokenNotFound1_.isUninitialized() && processBlock.getHandle(getTokenNotFound1_).isValid()) {
0469           throw cms::Exception("TestFailure") << "Expected handle to be invalid but it is valid (token 1)";
0470         }
0471         if (!getTokenNotFound2_.isUninitialized() && processBlock.getHandle(getTokenNotFound2_).isValid()) {
0472           throw cms::Exception("TestFailure") << "Expected handle to be invalid but it is valid (token 2)";
0473         }
0474         if (!getTokenNotFound3_.isUninitialized() && processBlock.getHandle(getTokenNotFound3_).isValid()) {
0475           throw cms::Exception("TestFailure") << "Expected handle to be invalid but it is valid (token 3)";
0476         }
0477         if (!getTokenNotFound4_.isUninitialized() && processBlock.getHandle(getTokenNotFound4_).isValid()) {
0478           throw cms::Exception("TestFailure") << "Expected handle to be invalid but it is valid (token 4)";
0479         }
0480 
0481         ++transitions_;
0482       }
0483 
0484       void analyze(edm::Event const& event, edm::EventSetup const&) override {
0485         auto cacheTuple = processBlockCaches(event);
0486         if (!expectedByRun_.empty()) {
0487           if (expectedByRun_.at(event.run() - 1) != *std::get<edm::CacheHandle<int>>(cacheTuple)) {
0488             throw cms::Exception("UnexpectedValue")
0489                 << "InputProcessBlockIntAnalyzer::analyze cached value was "
0490                 << *std::get<edm::CacheHandle<int>>(cacheTuple) << " but it was supposed to be "
0491                 << expectedByRun_.at(event.run() - 1);
0492           }
0493           if (expectedByRun_.at(event.run() - 1) != std::get<1>(cacheTuple)->value_) {
0494             throw cms::Exception("UnexpectedValue")
0495                 << "InputProcessBlockIntAnalyzer::analyze second cached value was " << std::get<1>(cacheTuple)->value_
0496                 << " but it was supposed to be " << expectedByRun_.at(event.run() - 1);
0497           }
0498           if (expectedByRun_.at(event.run() - 1) !=
0499               std::get<edm::CacheHandle<TestInputProcessBlockCache1>>(cacheTuple)->value_) {
0500             throw cms::Exception("UnexpectedValue")
0501                 << "InputProcessBlockIntAnalyzer::analyze third cached value was "
0502                 << std::get<edm::CacheHandle<TestInputProcessBlockCache1>>(cacheTuple)->value_
0503                 << " but it was supposed to be " << expectedByRun_.at(event.run() - 1);
0504           }
0505         }
0506 
0507         if (expectedCacheSize_ != 0u && expectedCacheSize_ != cacheSize()) {
0508           throw cms::Exception("UnexpectedValue") << "InputProcessBlockIntAnalyzer::analyze, unexpected cacheSize "
0509                                                   << cacheSize() << " but it was supposed to be " << expectedCacheSize_;
0510         }
0511         ++transitions_;
0512       }
0513 
0514       void endJob() override {
0515         if (transitions_ != expectedTransitions_) {
0516           throw cms::Exception("transitions") << "InputProcessBlockIntAnalyzer transitions " << transitions_
0517                                               << " but it was supposed to be " << expectedTransitions_;
0518         }
0519         if (sum_ != expectedSum_) {
0520           throw cms::Exception("UnexpectedValue")
0521               << "InputProcessBlockIntAnalyzer sum " << sum_ << " but it was supposed to be " << expectedSum_;
0522         }
0523         if (expectedFillerSum_ != 0 && fillerSum_ != expectedFillerSum_) {
0524           throw cms::Exception("UnexpectedValue") << "InputProcessBlockIntAnalyzer fillerSum " << fillerSum_
0525                                                   << " but it was supposed to be " << expectedFillerSum_;
0526         }
0527         if (cacheSize() > 0u) {
0528           throw cms::Exception("UnexpectedValue")
0529               << "InputProcessBlockIntAnalyzer cache size not zero at endJob " << cacheSize();
0530         }
0531       }
0532 
0533       static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0534         edm::ParameterSetDescription desc;
0535         desc.add<int>("transitions");
0536         desc.add<std::vector<int>>("expectedByRun", std::vector<int>());
0537         desc.add<int>("expectedSum");
0538         edm::InputTag defaultInputTag;
0539         desc.addUntracked<int>("expectedFillerSum", 0);
0540         desc.addUntracked<unsigned int>("expectedCacheSize", 0);
0541         desc.add<edm::InputTag>("consumesBeginProcessBlock", defaultInputTag);
0542         desc.add<edm::InputTag>("consumesEndProcessBlock", defaultInputTag);
0543         desc.add<edm::InputTag>("consumesBeginProcessBlockM", defaultInputTag);
0544         desc.add<edm::InputTag>("consumesEndProcessBlockM", defaultInputTag);
0545         desc.add<edm::InputTag>("consumesBeginProcessBlockNotFound", defaultInputTag);
0546         desc.add<edm::InputTag>("consumesEndProcessBlockNotFound", defaultInputTag);
0547         desc.add<edm::InputTag>("consumesProcessBlockNotFound1", defaultInputTag);
0548         desc.add<edm::InputTag>("consumesProcessBlockNotFound2", defaultInputTag);
0549         desc.add<edm::InputTag>("consumesProcessBlockNotFound3", defaultInputTag);
0550         desc.add<edm::InputTag>("consumesProcessBlockNotFound4", defaultInputTag);
0551         descriptions.addDefault(desc);
0552       }
0553 
0554     private:
0555       edm::EDGetTokenT<IntProduct> getTokenBegin_;
0556       edm::EDGetTokenT<IntProduct> getTokenEnd_;
0557       edm::EDGetTokenT<IntProduct> getTokenBeginM_;
0558       edm::EDGetTokenT<IntProduct> getTokenEndM_;
0559       edm::EDGetTokenT<IntProduct> getTokenBeginNotFound_;
0560       edm::EDGetTokenT<IntProduct> getTokenEndNotFound_;
0561       edm::EDGetTokenT<IntProduct> getTokenNotFound1_;
0562       edm::EDGetTokenT<IntProduct> getTokenNotFound2_;
0563       edm::EDGetTokenT<IntProduct> getTokenNotFound3_;
0564       edm::EDGetTokenT<IntProduct> getTokenNotFound4_;
0565       mutable std::atomic<unsigned int> transitions_{0};
0566       int sum_{0};
0567       unsigned int expectedTransitions_{0};
0568       std::vector<int> expectedByRun_;
0569       int expectedSum_{0};
0570       int fillerSum_{0};
0571       int expectedFillerSum_{0};
0572       unsigned int expectedCacheSize_{0};
0573     };
0574 
0575   }  // namespace one
0576 }  // namespace edmtest
0577 
0578 DEFINE_FWK_MODULE(edmtest::one::SharedResourcesAnalyzer);
0579 DEFINE_FWK_MODULE(edmtest::one::WatchRunsAnalyzer);
0580 DEFINE_FWK_MODULE(edmtest::one::WatchLumiBlocksAnalyzer);
0581 DEFINE_FWK_MODULE(edmtest::one::RunCacheAnalyzer);
0582 DEFINE_FWK_MODULE(edmtest::one::LumiBlockCacheAnalyzer);
0583 DEFINE_FWK_MODULE(edmtest::one::ProcessBlockIntAnalyzer);
0584 DEFINE_FWK_MODULE(edmtest::one::InputProcessBlockIntAnalyzer);