CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
EcalDQMonitorTask Class Reference

#include <EcalDQMonitorTask.h>

Inheritance diagram for EcalDQMonitorTask:
DQMOneLumiEDAnalyzer<> ecaldqm::EcalDQMonitor DQMOneEDAnalyzer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... > edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &) override
 
 EcalDQMonitorTask (edm::ParameterSet const &)
 
 ~EcalDQMonitorTask () override
 
- Public Member Functions inherited from DQMOneLumiEDAnalyzer<>
void accumulate (edm::Event const &event, edm::EventSetup const &setup) override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
 DQMOneLumiEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
bool getCanSaveByLumi () override
 
- Public Member Functions inherited from DQMOneEDAnalyzer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... >
void accumulate (edm::Event const &event, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
 DQMOneEDAnalyzer ()
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 
- Public Member Functions inherited from ecaldqm::EcalDQMonitor
 EcalDQMonitor (edm::ParameterSet const &)
 
virtual ~EcalDQMonitor () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from ecaldqm::EcalDQMonitor
static void fillDescriptions (edm::ParameterSetDescription &)
 

Private Types

typedef void(EcalDQMonitorTask::* Processor) (edm::Event const &, ecaldqm::Collections, std::set< ecaldqm::DQWorker * > const &)
 

Private Member Functions

void analyze (edm::Event const &, edm::EventSetup const &) override
 
void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void dqmEndRun (edm::Run const &, edm::EventSetup const &) override
 
void formSchedule (std::vector< ecaldqm::Collections > const &, edm::ParameterSet const &)
 
template<typename CollectionClass >
void runOnCollection (edm::Event const &, ecaldqm::Collections, std::set< ecaldqm::DQWorker * > const &)
 

Private Attributes

bool allowMissingCollections_
 
edm::EDGetToken collectionTokens_ [ecaldqm::nCollections]
 
time_t lastResetTime_
 
int processedEvents_
 
float resetInterval_
 
std::vector< std::pair< Processor, ecaldqm::Collections > > schedule_
 

Additional Inherited Members

- Public Types inherited from DQMOneEDAnalyzer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... >
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from DQMOneEDAnalyzer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... >
virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)=0
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
- Protected Member Functions inherited from ecaldqm::EcalDQMonitor
void ecaldqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
void ecaldqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
void ecaldqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
void ecaldqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void ecaldqmGetSetupObjects (edm::EventSetup const &)
 
template<typename FuncOnWorker >
void executeOnWorkers_ (FuncOnWorker, std::string const &, std::string const &="", int=1)
 
- Protected Attributes inherited from DQMOneLumiEDAnalyzer<>
edm::EDPutTokenT< DQMTokenlumiToken_
 
- Protected Attributes inherited from DQMOneEDAnalyzer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... >
edm::EDPutTokenT< DQMTokenrunToken_
 
- Protected Attributes inherited from ecaldqm::EcalDQMonitor
const std::string moduleName_
 
const int verbosity_
 
std::vector< DQWorker * > workers_
 

Detailed Description

Definition at line 18 of file EcalDQMonitorTask.h.

Member Typedef Documentation

◆ Processor

typedef void(EcalDQMonitorTask::* EcalDQMonitorTask::Processor) (edm::Event const &, ecaldqm::Collections, std::set< ecaldqm::DQWorker * > const &)
private

Definition at line 34 of file EcalDQMonitorTask.h.

Constructor & Destructor Documentation

◆ EcalDQMonitorTask()

EcalDQMonitorTask::EcalDQMonitorTask ( edm::ParameterSet const &  _ps)

Definition at line 27 of file EcalDQMonitorTask.cc.

30  schedule_(),
31  allowMissingCollections_(_ps.getUntrackedParameter<bool>("allowMissingCollections")),
33  lastResetTime_(0),
34  resetInterval_(_ps.getUntrackedParameter<double>("resetInterval")) {
36  std::bitset<ecaldqm::nCollections> hasTaskToRun;
38 
40  [&dependencies, &hasTaskToRun, &collector](ecaldqm::DQWorker* worker) {
41  ecaldqm::DQWorkerTask* task(dynamic_cast<ecaldqm::DQWorkerTask*>(worker));
42  if (!task)
43  throw cms::Exception("InvalidConfiguration") << "Non-task DQWorker " << worker->getName() << " passed";
44 
45  task->addDependencies(dependencies);
46  for (unsigned iCol(0); iCol < ecaldqm::nCollections; ++iCol) {
47  if (task->analyze(nullptr, ecaldqm::Collections(iCol))) // "dry run" mode
48  hasTaskToRun.set(iCol);
49  }
50 
51  task->setTokens(collector);
52  },
53  "initialization");
54 
55  edm::ParameterSet const& collectionTags(_ps.getParameterSet("collectionTags"));
56 
57  for (unsigned iCol(0); iCol < ecaldqm::nCollections; iCol++) {
58  if (hasTaskToRun[iCol])
60  }
61  if (collectionTags.existsAs<edm::InputTag>("EcalRawData", false))
63 
64  formSchedule(dependencies.formSequence(), collectionTags);
65 
66  if (verbosity_ > 0) {
67  std::stringstream ss;
68  ss << moduleName_ << ": Using collections" << std::endl;
69  for (unsigned iCol(0); iCol < schedule_.size(); iCol++)
70  ss << ecaldqm::collectionName[schedule_[iCol].second] << std::endl;
71  edm::LogInfo("EcalDQM") << ss.str();
72  }
73 
74  edm::ParameterSet const& commonParams(_ps.getUntrackedParameterSet("commonParameters"));
75  if (commonParams.getUntrackedParameter<bool>("onlineMode"))
76  lastResetTime_ = time(nullptr);
77 }

References ecaldqm::collectionName, EcalCalibMonitorTasks_cfi::collectionTags, edm::EDConsumerBase::consumesCollector(), symbols::dependencies, Exception, ecaldqm::EcalDQMonitor::executeOnWorkers_(), formSchedule(), ecaldqm::DQWorker::getName(), edm::ParameterSet::getParameterSet(), edm::ParameterSet::getUntrackedParameterSet(), ecaldqm::kEcalRawData, lastResetTime_, ecaldqm::EcalDQMonitor::moduleName_, ecaldqm::nCollections, schedule_, edm::second(), contentValuesCheck::ss, TrackValidation_cff::task, ntuplemaker::time, and ecaldqm::EcalDQMonitor::verbosity_.

◆ ~EcalDQMonitorTask()

EcalDQMonitorTask::~EcalDQMonitorTask ( )
inlineoverride

Definition at line 21 of file EcalDQMonitorTask.h.

21 {}

Member Function Documentation

◆ analyze()

void EcalDQMonitorTask::analyze ( edm::Event const &  _evt,
edm::EventSetup const &  _es 
)
overrideprivatevirtual

Reimplemented from DQMOneEDAnalyzer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... >.

Definition at line 137 of file EcalDQMonitorTask.cc.

137  {
138  if (verbosity_ > 2)
139  edm::LogInfo("EcalDQM") << moduleName_ << "::analyze: Run " << _evt.id().run() << " Lumisection "
140  << _evt.id().luminosityBlock() << " Event " << _evt.id().event() << ": processed "
141  << processedEvents_;
142 
143  if (schedule_.empty())
144  return;
145 
146  std::set<ecaldqm::DQWorker*> enabledTasks;
147 
149  if (_evt.getByToken(collectionTokens_[ecaldqm::kEcalRawData], dcchsHndl)) {
150  // determine event type (called run type in DCCHeader for some reason) for each FED
151  std::stringstream ss;
152  if (verbosity_ > 2)
153  ss << moduleName_ << ": Event type ";
154 
155  short runType[ecaldqm::nDCC];
156  std::fill_n(runType, ecaldqm::nDCC, -1);
157  for (EcalRawDataCollection::const_iterator dcchItr = dcchsHndl->begin(); dcchItr != dcchsHndl->end(); ++dcchItr) {
158  if (verbosity_ > 2)
159  ss << dcchItr->getRunType() << " ";
160  runType[dcchItr->id() - 1] = dcchItr->getRunType();
161  }
162  if (verbosity_ > 2)
163  edm::LogInfo("EcalDQM") << ss.str();
164 
165  bool processEvent(false);
166 
168  [&enabledTasks, &runType, &processEvent, this](ecaldqm::DQWorker* worker) {
169  if (static_cast<ecaldqm::DQWorkerTask*>(worker)->filterRunType(runType)) {
170  if (this->verbosity_ > 2)
171  edm::LogInfo("EcalDQM") << worker->getName() << " will run on this event";
172  enabledTasks.insert(worker);
173  processEvent = true;
174  }
175  },
176  "filterRunType");
177 
178  if (!processEvent)
179  return;
180  } else {
181  edm::LogWarning("EcalDQM") << "EcalRawDataCollection does not exist. No event-type filtering will be applied";
182  executeOnWorkers_([&enabledTasks](ecaldqm::DQWorker* worker) { enabledTasks.insert(worker); }, "");
183  }
184 
186 
187  // start event processing
189  [&_evt, &_es, &enabledTasks](ecaldqm::DQWorker* worker) {
190  if (enabledTasks.find(worker) != enabledTasks.end()) {
191  if (worker->onlineMode())
192  worker->setTime(time(nullptr));
193  worker->setEventNumber(_evt.id().event());
194  static_cast<ecaldqm::DQWorkerTask*>(worker)->beginEvent(_evt, _es);
195  }
196  },
197  "beginEvent");
198 
199  // run on collections
200  for (unsigned iSch(0); iSch < schedule_.size(); iSch++) {
201  Processor processor(schedule_[iSch].first);
202  (this->*processor)(_evt, schedule_[iSch].second, enabledTasks);
203  }
204 
205  // close event processing
207  [&_evt, &_es, &enabledTasks](ecaldqm::DQWorker* worker) {
208  if (enabledTasks.find(worker) != enabledTasks.end())
209  static_cast<ecaldqm::DQWorkerTask*>(worker)->endEvent(_evt, _es);
210  },
211  "endEvent");
212 
213  if (verbosity_ > 2)
214  edm::LogInfo("EcalDQM") << moduleName_ << "::analyze: Closing Event " << _evt.id().event();
215 }

References edm::SortedCollection< T, SORT >::begin(), collectionTokens_, edm::SortedCollection< T, SORT >::end(), edm::EventID::event(), ecaldqm::EcalDQMonitor::executeOnWorkers_(), dqmdumpme::first, edm::Event::getByToken(), ecaldqm::DQWorker::getName(), edm::EventBase::id(), ecaldqm::kEcalRawData, edm::EventID::luminosityBlock(), ecaldqm::EcalDQMonitor::moduleName_, ecaldqm::nDCC, ecaldqm::DQWorker::onlineMode(), processedEvents_, processEvent(), edm::EventID::run(), EcalCondDBWriter_cfi::runType, schedule_, edm::second(), ecaldqm::DQWorker::setEventNumber(), ecaldqm::DQWorker::setTime(), contentValuesCheck::ss, ntuplemaker::time, and ecaldqm::EcalDQMonitor::verbosity_.

◆ bookHistograms()

void EcalDQMonitorTask::bookHistograms ( DQMStore::IBooker _ibooker,
edm::Run const &  ,
edm::EventSetup const &  _es 
)
override

Definition at line 101 of file EcalDQMonitorTask.cc.

101  {
103 
104  executeOnWorkers_([&_ibooker](ecaldqm::DQWorker* worker) { worker->bookMEs(_ibooker); }, "bookMEs", "Booking MEs");
105 }

References ecaldqm::DQWorker::bookMEs(), ecaldqm::EcalDQMonitor::ecaldqmGetSetupObjects(), and ecaldqm::EcalDQMonitor::executeOnWorkers_().

◆ dqmBeginLuminosityBlock()

void EcalDQMonitorTask::dqmBeginLuminosityBlock ( edm::LuminosityBlock const &  _lumi,
edm::EventSetup const &  _es 
)
overrideprivatevirtual

Reimplemented from DQMOneLumiEDAnalyzer<>.

Definition at line 122 of file EcalDQMonitorTask.cc.

122  {
123  ecaldqmBeginLuminosityBlock(_lumi, _es);
124 }

References ecaldqm::EcalDQMonitor::ecaldqmBeginLuminosityBlock().

◆ dqmBeginRun()

void EcalDQMonitorTask::dqmBeginRun ( edm::Run const &  _run,
edm::EventSetup const &  _es 
)
overridevirtual

◆ dqmEndLuminosityBlock()

void EcalDQMonitorTask::dqmEndLuminosityBlock ( edm::LuminosityBlock const &  _lumi,
edm::EventSetup const &  _es 
)
overrideprivatevirtual

Reimplemented from DQMOneLumiEDAnalyzer<>.

Definition at line 126 of file EcalDQMonitorTask.cc.

126  {
127  ecaldqmEndLuminosityBlock(_lumi, _es);
128 
129  if (lastResetTime_ != 0 && (time(nullptr) - lastResetTime_) / 3600. > resetInterval_) {
130  if (verbosity_ > 0)
131  edm::LogInfo("EcalDQM") << moduleName_ << ": Soft-resetting the histograms";
132  // TODO: soft-reset is no longer supported.
133  lastResetTime_ = time(nullptr);
134  }
135 }

References ecaldqm::EcalDQMonitor::ecaldqmEndLuminosityBlock(), lastResetTime_, ecaldqm::EcalDQMonitor::moduleName_, resetInterval_, ntuplemaker::time, and ecaldqm::EcalDQMonitor::verbosity_.

◆ dqmEndRun()

void EcalDQMonitorTask::dqmEndRun ( edm::Run const &  _run,
edm::EventSetup const &  _es 
)
overrideprivatevirtual

◆ fillDescriptions()

void EcalDQMonitorTask::fillDescriptions ( edm::ConfigurationDescriptions _descs)
static

◆ formSchedule()

void EcalDQMonitorTask::formSchedule ( std::vector< ecaldqm::Collections > const &  _preSchedule,
edm::ParameterSet const &  _tagPSet 
)
private

Definition at line 46 of file EcalDQMonitorTask2.cc.

47  {
48  for (std::vector<ecaldqm::Collections>::const_iterator colItr(_preSchedule.begin()); colItr != _preSchedule.end();
49  ++colItr) {
50  std::pair<Processor, ecaldqm::Collections> sch;
51 
52  edm::InputTag tag(_tagPSet.getUntrackedParameter<edm::InputTag>(ecaldqm::collectionName[*colItr]));
53 
54  switch (*colItr) {
55  case ecaldqm::kSource:
56  collectionTokens_[*colItr] = edm::EDGetToken(consumes<FEDRawDataCollection>(tag));
57  sch.first = &EcalDQMonitorTask::runOnCollection<FEDRawDataCollection>;
58  break;
60  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EcalRawDataCollection>(tag));
61  sch.first = &EcalDQMonitorTask::runOnCollection<EcalRawDataCollection>;
62  break;
66  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EBDetIdCollection>(tag));
67  sch.first = &EcalDQMonitorTask::runOnCollection<EBDetIdCollection>;
68  break;
72  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EEDetIdCollection>(tag));
73  sch.first = &EcalDQMonitorTask::runOnCollection<EEDetIdCollection>;
74  break;
81  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EcalElectronicsIdCollection>(tag));
82  sch.first = &EcalDQMonitorTask::runOnCollection<EcalElectronicsIdCollection>;
83  break;
84  case ecaldqm::kEBSrFlag:
85  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EBSrFlagCollection>(tag));
86  sch.first = &EcalDQMonitorTask::runOnCollection<EBSrFlagCollection>;
87  break;
88  case ecaldqm::kEESrFlag:
89  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EESrFlagCollection>(tag));
90  sch.first = &EcalDQMonitorTask::runOnCollection<EESrFlagCollection>;
91  break;
92  case ecaldqm::kEBDigi:
93  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EBDigiCollection>(tag));
94  sch.first = &EcalDQMonitorTask::runOnCollection<EBDigiCollection>;
95  break;
96  case ecaldqm::kEEDigi:
97  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EEDigiCollection>(tag));
98  sch.first = &EcalDQMonitorTask::runOnCollection<EEDigiCollection>;
99  break;
101  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EcalPnDiodeDigiCollection>(tag));
102  sch.first = &EcalDQMonitorTask::runOnCollection<EcalPnDiodeDigiCollection>;
103  break;
106  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EcalTrigPrimDigiCollection>(tag));
107  sch.first = &EcalDQMonitorTask::runOnCollection<EcalTrigPrimDigiCollection>;
108  break;
115  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EcalUncalibratedRecHitCollection>(tag));
116  sch.first = &EcalDQMonitorTask::runOnCollection<EcalUncalibratedRecHitCollection>;
117  break;
118  case ecaldqm::kEBRecHit:
120  case ecaldqm::kEERecHit:
122  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EcalRecHitCollection>(tag));
123  sch.first = &EcalDQMonitorTask::runOnCollection<EcalRecHitCollection>;
124  break;
128  sch.first = &EcalDQMonitorTask::runOnCollection<edm::View<reco::CaloCluster> >;
129  break;
132  collectionTokens_[*colItr] = edm::EDGetToken(consumes<reco::SuperClusterCollection>(tag));
133  sch.first = &EcalDQMonitorTask::runOnCollection<reco::SuperClusterCollection>;
134  break;
135  default:
136  throw cms::Exception("InvalidConfiguration") << "Undefined collection " << *colItr;
137  }
138 
139  sch.second = *colItr;
140 
141  schedule_.push_back(sch);
142  }
143 }

References ecaldqm::collectionName, collectionTokens_, edm::EDConsumerBase::consumes(), Exception, edm::ParameterSet::getUntrackedParameter(), ecaldqm::kBlockSizeErrors, ecaldqm::kEBBasicCluster, ecaldqm::kEBChIdErrors, ecaldqm::kEBDigi, ecaldqm::kEBGainErrors, ecaldqm::kEBGainSwitchErrors, ecaldqm::kEBLaserLedUncalibRecHit, ecaldqm::kEBRecHit, ecaldqm::kEBReducedRecHit, ecaldqm::kEBSrFlag, ecaldqm::kEBSuperCluster, ecaldqm::kEBTestPulseUncalibRecHit, ecaldqm::kEBUncalibRecHit, ecaldqm::kEcalRawData, ecaldqm::kEEBasicCluster, ecaldqm::kEEChIdErrors, ecaldqm::kEEDigi, ecaldqm::kEEGainErrors, ecaldqm::kEEGainSwitchErrors, ecaldqm::kEELaserLedUncalibRecHit, ecaldqm::kEERecHit, ecaldqm::kEEReducedRecHit, ecaldqm::kEESrFlag, ecaldqm::kEESuperCluster, ecaldqm::kEETestPulseUncalibRecHit, ecaldqm::kEEUncalibRecHit, ecaldqm::kMEMBlockSizeErrors, ecaldqm::kMEMChIdErrors, ecaldqm::kMEMGainErrors, ecaldqm::kMEMTowerIdErrors, ecaldqm::kPnDiodeDigi, ecaldqm::kSource, ecaldqm::kTowerIdErrors, ecaldqm::kTrigPrimDigi, ecaldqm::kTrigPrimEmulDigi, schedule_, and GlobalPosition_Frontier_DevDB_cff::tag.

Referenced by EcalDQMonitorTask().

◆ runOnCollection()

template<typename CollectionClass >
void EcalDQMonitorTask::runOnCollection ( edm::Event const &  _evt,
ecaldqm::Collections  _col,
std::set< ecaldqm::DQWorker * > const &  _enabledTasks 
)
private

Definition at line 20 of file EcalDQMonitorTask2.cc.

22  {
24  if (!_evt.getByToken(collectionTokens_[_col], hndl)) {
26  throw cms::Exception("ObjectNotFound")
27  << moduleName_ << "::runOnCollection: " << ecaldqm::collectionName[_col] << " does not exist";
28  edm::LogWarning("EcalDQM") << moduleName_ << "::runOnCollection: " << ecaldqm::collectionName[_col]
29  << " does not exist";
30  return;
31  }
32 
33  CollectionClass const* collection(hndl.product());
34 
36  [collection, _col, &_enabledTasks](ecaldqm::DQWorker* worker) {
37  if (_enabledTasks.find(worker) != _enabledTasks.end())
38  static_cast<ecaldqm::DQWorkerTask*>(worker)->analyze(collection, _col);
39  },
40  "analyze");
41 
42  if (verbosity_ > 1)
43  edm::LogInfo("EcalDQM") << moduleName_ << "::runOn" << ecaldqm::collectionName[_col] << " returning";
44 }

References allowMissingCollections_, universalConfigTemplate::collection, ecaldqm::collectionName, collectionTokens_, Exception, ecaldqm::EcalDQMonitor::executeOnWorkers_(), edm::Event::getByToken(), ecaldqm::EcalDQMonitor::moduleName_, edm::Handle< T >::product(), and ecaldqm::EcalDQMonitor::verbosity_.

Member Data Documentation

◆ allowMissingCollections_

bool EcalDQMonitorTask::allowMissingCollections_
private

Definition at line 47 of file EcalDQMonitorTask.h.

Referenced by runOnCollection().

◆ collectionTokens_

edm::EDGetToken EcalDQMonitorTask::collectionTokens_[ecaldqm::nCollections]
private

Definition at line 45 of file EcalDQMonitorTask.h.

Referenced by analyze(), formSchedule(), and runOnCollection().

◆ lastResetTime_

time_t EcalDQMonitorTask::lastResetTime_
private

Definition at line 51 of file EcalDQMonitorTask.h.

Referenced by dqmBeginRun(), dqmEndLuminosityBlock(), and EcalDQMonitorTask().

◆ processedEvents_

int EcalDQMonitorTask::processedEvents_
private

Definition at line 48 of file EcalDQMonitorTask.h.

Referenced by analyze(), and dqmBeginRun().

◆ resetInterval_

float EcalDQMonitorTask::resetInterval_
private

Definition at line 52 of file EcalDQMonitorTask.h.

Referenced by dqmEndLuminosityBlock().

◆ schedule_

std::vector<std::pair<Processor, ecaldqm::Collections> > EcalDQMonitorTask::schedule_
private
ecaldqm::kEBTestPulseUncalibRecHit
Definition: Collections.h:34
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
edm::SortedCollection::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: SortedCollection.h:80
ecaldqm::EcalDQMonitor::moduleName_
const std::string moduleName_
Definition: EcalDQMonitor.h:41
edm::Handle::product
T const * product() const
Definition: Handle.h:70
ecaldqm::collectionName
const std::string collectionName[nCollections]
Definition: Collections.h:47
ecaldqm::EcalDQMonitor::ecaldqmBeginLuminosityBlock
void ecaldqmBeginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: EcalDQMonitor.cc:115
ecaldqm::kEBBasicCluster
Definition: Collections.h:40
edm::ParameterWildcard
Definition: ParameterWildcard.h:23
EcalDQMonitorTask::lastResetTime_
time_t lastResetTime_
Definition: EcalDQMonitorTask.h:51
ecaldqm::DependencySet
Definition: DQWorkerTask.h:44
ecaldqm::kEESuperCluster
Definition: Collections.h:43
ecaldqm::kSource
Definition: Collections.h:9
ecaldqm::kEEGainSwitchErrors
Definition: Collections.h:16
EcalDQMonitorTask::collectionTokens_
edm::EDGetToken collectionTokens_[ecaldqm::nCollections]
Definition: EcalDQMonitorTask.h:45
ecaldqm::kEEReducedRecHit
Definition: Collections.h:39
ecaldqm::kEEDigi
Definition: Collections.h:26
ecaldqm::EcalDQMonitor::verbosity_
const int verbosity_
Definition: EcalDQMonitor.h:42
ecaldqm::EcalDQMonitor::ecaldqmBeginRun
void ecaldqmBeginRun(edm::Run const &, edm::EventSetup const &)
Definition: EcalDQMonitor.cc:87
ecaldqm::kMEMChIdErrors
Definition: Collections.h:21
edm::LogInfo
Definition: MessageLogger.h:254
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ecaldqm::kEBGainErrors
Definition: Collections.h:11
ecaldqm::kEESrFlag
Definition: Collections.h:24
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:71
ecaldqm::Dependency
Definition: DQWorkerTask.h:19
ecaldqm::EcalDQMonitor::fillDescriptions
static void fillDescriptions(edm::ParameterSetDescription &)
Definition: EcalDQMonitor.cc:53
ecaldqm::DQWorker::bookMEs
virtual void bookMEs(DQMStore::IBooker &)
Definition: DQWorker.cc:66
ecaldqm::kEcalRawData
Definition: Collections.h:10
ecaldqm::kEELaserLedUncalibRecHit
Definition: Collections.h:33
edm::Handle
Definition: AssociativeIterator.h:50
EcalDQMonitorTask::formSchedule
void formSchedule(std::vector< ecaldqm::Collections > const &, edm::ParameterSet const &)
Definition: EcalDQMonitorTask2.cc:46
dqmdumpme.first
first
Definition: dqmdumpme.py:55
ecaldqm::EcalDQMonitor::executeOnWorkers_
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1)
Definition: EcalDQMonitor.h:46
ecaldqm::kEBChIdErrors
Definition: Collections.h:13
ecaldqm::EcalDQMonitor
Definition: EcalDQMonitor.h:20
ecaldqm::DQWorker::releaseMEs
virtual void releaseMEs()
Definition: DQWorker.cc:60
ecaldqm::kEEGainErrors
Definition: Collections.h:12
ecaldqm::DQWorker
Definition: DQWorker.h:28
ecaldqm::kEETestPulseUncalibRecHit
Definition: Collections.h:35
EcalDQMonitorTask::processedEvents_
int processedEvents_
Definition: EcalDQMonitorTask.h:48
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
DQMOneLumiEDAnalyzer<>::DQMOneLumiEDAnalyzer
DQMOneLumiEDAnalyzer()
Definition: DQMOneEDAnalyzer.h:96
ecaldqm::kTowerIdErrors
Definition: Collections.h:17
ecaldqm::DQWorker::setEventNumber
void setEventNumber(edm::EventNumber_t _e)
Definition: DQWorker.h:69
ecaldqm::DQWorkerTask
Definition: DQWorkerTask.h:71
ecaldqm::kEBUncalibRecHit
Definition: Collections.h:30
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
TrackValidation_cff.task
task
Definition: TrackValidation_cff.py:252
dependencies
Definition: dependencies.py:1
symbols.dependencies
dependencies
Definition: symbols.py:20
ecaldqm::DQWorker::onlineMode
bool onlineMode() const
Definition: DQWorker.h:72
ecaldqm::kEBRecHit
Definition: Collections.h:36
ecaldqm::kEEChIdErrors
Definition: Collections.h:14
processEvent
dispatcher processEvent(e, inputTag, standby)
ecaldqm::EcalDQMonitor::ecaldqmEndLuminosityBlock
void ecaldqmEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: EcalDQMonitor.cc:129
ecaldqm::nCollections
Definition: Collections.h:44
edm::LogWarning
Definition: MessageLogger.h:141
edm::View
Definition: CaloClusterFwd.h:14
edm::ParameterSetDescription::addUntracked
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:100
edm::ParameterSet
Definition: ParameterSet.h:36
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
ecaldqm::kEBSrFlag
Definition: Collections.h:23
universalConfigTemplate.collection
collection
Definition: universalConfigTemplate.py:81
ecaldqm::Collections
Collections
Definition: Collections.h:8
ecaldqm::kPnDiodeDigi
Definition: Collections.h:27
ecaldqm::kEBLaserLedUncalibRecHit
Definition: Collections.h:32
EcalCalibMonitorTasks_cfi.collectionTags
collectionTags
Definition: EcalCalibMonitorTasks_cfi.py:21
EcalDQMonitorTask::Processor
void(EcalDQMonitorTask::* Processor)(edm::Event const &, ecaldqm::Collections, std::set< ecaldqm::DQWorker * > const &)
Definition: EcalDQMonitorTask.h:34
edm::ParameterSetDescription::addNode
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
Definition: ParameterSetDescription.cc:41
ecaldqm::kTrigPrimDigi
Definition: Collections.h:28
edm::EDGetToken
Definition: EDGetToken.h:35
ecaldqm::kMEMBlockSizeErrors
Definition: Collections.h:20
ecaldqm::kEERecHit
Definition: Collections.h:37
ecaldqm::kTrigPrimEmulDigi
Definition: Collections.h:29
ecaldqm::kEBSuperCluster
Definition: Collections.h:42
ecaldqm::EcalDQMonitor::ecaldqmEndRun
void ecaldqmEndRun(edm::Run const &, edm::EventSetup const &)
Definition: EcalDQMonitor.cc:101
ecaldqm::kEBDigi
Definition: Collections.h:25
ecaldqm::DQWorker::getName
const std::string & getName() const
Definition: DQWorker.h:71
EcalDQMonitorTask::schedule_
std::vector< std::pair< Processor, ecaldqm::Collections > > schedule_
Definition: EcalDQMonitorTask.h:46
Exception
Definition: hltDiff.cc:246
ecaldqm::kMEMGainErrors
Definition: Collections.h:22
ecaldqm::kEEUncalibRecHit
Definition: Collections.h:31
ecaldqm::kMEMTowerIdErrors
Definition: Collections.h:19
ecaldqm::DQWorkerTask::fillDescriptions
static void fillDescriptions(edm::ParameterSetDescription &)
Definition: DQWorkerTask.cc:11
ecaldqm::kEBReducedRecHit
Definition: Collections.h:38
ecaldqm::nDCC
Definition: EcalDQMCommonUtils.h:92
EcalDQMonitorTask::allowMissingCollections_
bool allowMissingCollections_
Definition: EcalDQMonitorTask.h:47
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:126
EcalCondDBWriter_cfi.runType
runType
Definition: EcalCondDBWriter_cfi.py:64
ecaldqm::DQWorker::setTime
void setTime(time_t _t)
Definition: DQWorker.h:66
ecaldqm::kEEBasicCluster
Definition: Collections.h:41
ntuplemaker.time
time
Definition: ntuplemaker.py:310
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
ecaldqm::kBlockSizeErrors
Definition: Collections.h:18
edm::RequireZeroOrMore
Definition: ParameterWildcardBase.h:17
ecaldqm::kEBGainSwitchErrors
Definition: Collections.h:15
ecaldqm::EcalDQMonitor::ecaldqmGetSetupObjects
void ecaldqmGetSetupObjects(edm::EventSetup const &)
Definition: EcalDQMonitor.cc:64
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
EcalDQMonitorTask::resetInterval_
float resetInterval_
Definition: EcalDQMonitorTask.h:52