Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef EcalDQMonitorTask_H
0002 #define EcalDQMonitorTask_H
0003 
0004 #include "DQM/EcalCommon/interface/EcalDQMonitor.h"
0005 #include "DQMServices/Core/interface/DQMOneEDAnalyzer.h"
0006 
0007 #include "DQWorkerTask.h"
0008 #include "Collections.h"
0009 
0010 #include <set>
0011 #include <map>
0012 
0013 namespace edm {
0014   class InputTag;
0015   class ParameterSetDescription;
0016 }  // namespace edm
0017 
0018 class EcalDQMonitorTask : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<ecaldqm::EcalLSCache>>,
0019                           public ecaldqm::EcalDQMonitor {
0020 public:
0021   EcalDQMonitorTask(edm::ParameterSet const&);
0022   ~EcalDQMonitorTask() override {}
0023 
0024   static void fillDescriptions(edm::ConfigurationDescriptions&);
0025 
0026   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0027   void dqmBeginRun(edm::Run const&, edm::EventSetup const&) override;
0028 
0029 private:
0030   void dqmEndRun(edm::Run const&, edm::EventSetup const&) override;
0031   std::shared_ptr<ecaldqm::EcalLSCache> globalBeginLuminosityBlock(edm::LuminosityBlock const&,
0032                                                                    edm::EventSetup const&) const override;
0033   void globalEndLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
0034   void analyze(edm::Event const&, edm::EventSetup const&) override;
0035 
0036   typedef void (EcalDQMonitorTask::*Processor)(edm::Event const&,
0037                                                ecaldqm::Collections,
0038                                                std::set<ecaldqm::DQWorker*> const&);
0039 
0040   template <typename CollectionClass>
0041   void runOnCollection(edm::Event const&, ecaldqm::Collections, std::set<ecaldqm::DQWorker*> const&);
0042 
0043   void formSchedule(std::vector<ecaldqm::Collections> const&, edm::ParameterSet const&);
0044 
0045   /* DATA MEMBERS */
0046 
0047   edm::EDGetToken collectionTokens_[ecaldqm::nCollections];           // list of EDGetTokens
0048   std::vector<std::pair<Processor, ecaldqm::Collections>> schedule_;  // schedule of collections to run
0049 
0050   std::vector<std::string> skipCollections_;  // list of collections to explicitly remove from schedule
0051                                               // note: skipping a collection here will result in
0052                                               // EcalDQMonitorTask not consuming it, which may lead the
0053                                               // module producing the collection to not run at all
0054 
0055   bool allowMissingCollections_;  // when true (default), skip missing collections and log as warning
0056                                   // note: collections skipped by the parameter skipCollections will
0057                                   // bypass this check and not issue warnings
0058 
0059   int processedEvents_;
0060 
0061   /* TASK TIME PROFILING */
0062   time_t lastResetTime_;
0063   float resetInterval_;
0064 };
0065 
0066 #endif