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:
DQMOneEDAnalyzer< edm::LuminosityBlockCache< ecaldqm::EcalLSCache > > ecaldqm::EcalDQMonitor 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 DQMOneEDAnalyzer< edm::LuminosityBlockCache< ecaldqm::EcalLSCache > >
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
 
virtual bool getCanSaveByLumi ()
 
- 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 hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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 dqmEndRun (edm::Run const &, edm::EventSetup const &) override
 
void formSchedule (std::vector< ecaldqm::Collections > const &, edm::ParameterSet const &)
 
std::shared_ptr< ecaldqm::EcalLSCacheglobalBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) const override
 
void globalEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
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::LuminosityBlockCache< ecaldqm::EcalLSCache > >
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 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 = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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 &) 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) const
 
- Protected Attributes inherited from DQMOneEDAnalyzer< edm::LuminosityBlockCache< ecaldqm::EcalLSCache > >
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 36 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 22 of file EcalDQMonitorTask.h.

22 {}

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMOneEDAnalyzer< edm::LuminosityBlockCache< ecaldqm::EcalLSCache > >.

Definition at line 148 of file EcalDQMonitorTask.cc.

148  {
149  if (verbosity_ > 2)
150  edm::LogInfo("EcalDQM") << moduleName_ << "::analyze: Run " << _evt.id().run() << " Lumisection "
151  << _evt.id().luminosityBlock() << " Event " << _evt.id().event() << ": processed "
152  << processedEvents_;
153 
154  if (schedule_.empty())
155  return;
156 
157  std::set<ecaldqm::DQWorker*> enabledTasks;
158 
160  if (_evt.getByToken(collectionTokens_[ecaldqm::kEcalRawData], dcchsHndl)) {
161  // determine event type (called run type in DCCHeader for some reason) for each FED
162  std::stringstream ss;
163  if (verbosity_ > 2)
164  ss << moduleName_ << ": Event type ";
165 
166  short runType[ecaldqm::nDCC];
167  std::fill_n(runType, ecaldqm::nDCC, -1);
168  for (EcalRawDataCollection::const_iterator dcchItr = dcchsHndl->begin(); dcchItr != dcchsHndl->end(); ++dcchItr) {
169  if (verbosity_ > 2)
170  ss << dcchItr->getRunType() << " ";
171  runType[dcchItr->id() - 1] = dcchItr->getRunType();
172  }
173  if (verbosity_ > 2)
174  edm::LogInfo("EcalDQM") << ss.str();
175 
176  bool processEvent(false);
177 
179  [&enabledTasks, &runType, &processEvent, this](ecaldqm::DQWorker* worker) {
180  if (static_cast<ecaldqm::DQWorkerTask*>(worker)->filterRunType(runType)) {
181  if (this->verbosity_ > 2)
182  edm::LogInfo("EcalDQM") << worker->getName() << " will run on this event";
183  enabledTasks.insert(worker);
184  processEvent = true;
185  }
186  },
187  "filterRunType");
188 
189  if (!processEvent)
190  return;
191  } else {
192  edm::LogWarning("EcalDQM") << "EcalRawDataCollection does not exist. No event-type filtering will be applied";
193  executeOnWorkers_([&enabledTasks](ecaldqm::DQWorker* worker) { enabledTasks.insert(worker); }, "");
194  }
195 
197 
198  // start event processing
199  auto lumiCache = luminosityBlockCache(_evt.getLuminosityBlock().index());
201  [&_evt, &_es, &enabledTasks, &lumiCache](ecaldqm::DQWorker* worker) {
202  if (enabledTasks.find(worker) != enabledTasks.end()) {
203  if (worker->onlineMode())
204  worker->setTime(time(nullptr));
205  worker->setEventNumber(_evt.id().event());
206  bool ByLumiResetSwitch = (lumiCache->ByLumiPlotsResetSwitches).at(worker->getName());
207  bool lhcStatusSet = lumiCache->lhcStatusSet_;
208  static_cast<ecaldqm::DQWorkerTask*>(worker)->beginEvent(_evt, _es, ByLumiResetSwitch, lhcStatusSet);
209  (lumiCache->ByLumiPlotsResetSwitches)[worker->getName()] = false;
210  lumiCache->lhcStatusSet_ = lhcStatusSet;
211  }
212  },
213  "beginEvent");
214 
215  // run on collections
216  for (unsigned iSch(0); iSch < schedule_.size(); iSch++) {
217  Processor processor(schedule_[iSch].first);
218  (this->*processor)(_evt, schedule_[iSch].second, enabledTasks);
219  }
220 
221  // close event processing
223  [&_evt, &_es, &enabledTasks](ecaldqm::DQWorker* worker) {
224  if (enabledTasks.find(worker) != enabledTasks.end())
225  static_cast<ecaldqm::DQWorkerTask*>(worker)->endEvent(_evt, _es);
226  },
227  "endEvent");
228 
229  if (verbosity_ > 2)
230  edm::LogInfo("EcalDQM") << moduleName_ << "::analyze: Closing Event " << _evt.id().event();
231 }

References edm::SortedCollection< T, SORT >::begin(), collectionTokens_, edm::SortedCollection< T, SORT >::end(), edm::EventID::event(), ecaldqm::EcalDQMonitor::executeOnWorkers_(), dqmdumpme::first, edm::Event::getByToken(), edm::Event::getLuminosityBlock(), ecaldqm::DQWorker::getName(), edm::EventBase::id(), edm::LuminosityBlock::index(), 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 
)
overridevirtual

◆ dqmBeginRun()

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

Reimplemented from DQMOneEDAnalyzer< edm::LuminosityBlockCache< ecaldqm::EcalLSCache > >.

Definition at line 107 of file EcalDQMonitorTask.cc.

107  {
108  ecaldqmBeginRun(_run, _es);
109 
110  processedEvents_ = 0;
111 
112  if (lastResetTime_ != 0)
113  lastResetTime_ = time(nullptr);
114 }

References ecaldqm::EcalDQMonitor::ecaldqmBeginRun(), lastResetTime_, processedEvents_, and ntuplemaker::time.

◆ dqmEndRun()

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

Reimplemented from DQMOneEDAnalyzer< edm::LuminosityBlockCache< ecaldqm::EcalLSCache > >.

Definition at line 116 of file EcalDQMonitorTask.cc.

116  {
117  ecaldqmEndRun(_run, _es);
118 
119  executeOnWorkers_([](ecaldqm::DQWorker* worker) { worker->releaseMEs(); }, "releaseMEs", "releasing histograms");
120 }

References ecaldqm::EcalDQMonitor::ecaldqmEndRun(), ecaldqm::EcalDQMonitor::executeOnWorkers_(), and ecaldqm::DQWorker::releaseMEs().

◆ fillDescriptions()

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

Definition at line 80 of file EcalDQMonitorTask.cc.

80  {
83 
84  edm::ParameterSetDescription taskParameters;
87  allWorkers.addNode(
89  desc.addUntracked("workerParameters", allWorkers);
90 
92  collectionTags.addWildcardUntracked<edm::InputTag>("*");
93  desc.add("collectionTags", collectionTags);
94 
95  desc.addUntracked<bool>("allowMissingCollections", true);
96  desc.addUntracked<double>("resetInterval", 0.);
97 
98  _descs.addDefault(desc);
99 }

References edm::ConfigurationDescriptions::addDefault(), edm::ParameterSetDescription::addNode(), EcalCalibMonitorTasks_cfi::collectionTags, submitPVResolutionJobs::desc, ecaldqm::EcalDQMonitor::fillDescriptions(), ecaldqm::DQWorkerTask::fillDescriptions(), and edm::RequireZeroOrMore.

◆ 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().

◆ globalBeginLuminosityBlock()

std::shared_ptr< ecaldqm::EcalLSCache > EcalDQMonitorTask::globalBeginLuminosityBlock ( edm::LuminosityBlock const &  _lumi,
edm::EventSetup const &  _es 
) const
overrideprivate

Definition at line 122 of file EcalDQMonitorTask.cc.

123  {
124  std::shared_ptr<ecaldqm::EcalLSCache> tmpCache = std::make_shared<ecaldqm::EcalLSCache>();
126  [&tmpCache](ecaldqm::DQWorker* worker) { (tmpCache->ByLumiPlotsResetSwitches)[worker->getName()] = true; },
127  "globalBeginLuminosityBlock");
128  if (this->verbosity_ > 2)
129  edm::LogInfo("EcalDQM") << "Set LS cache.";
130 
131  // Reset lhcStatusSet_ to false at the beginning of each LS; when LHC status is set in some event this variable will be set to tru
132  tmpCache->lhcStatusSet_ = false;
133  ecaldqmBeginLuminosityBlock(_lumi, _es);
134  return tmpCache;
135 }

References ecaldqm::EcalDQMonitor::ecaldqmBeginLuminosityBlock(), ecaldqm::EcalDQMonitor::executeOnWorkers_(), ecaldqm::DQWorker::getName(), and ecaldqm::EcalDQMonitor::verbosity_.

◆ globalEndLuminosityBlock()

void EcalDQMonitorTask::globalEndLuminosityBlock ( edm::LuminosityBlock const &  _lumi,
edm::EventSetup const &  _es 
)
overrideprivate

Definition at line 137 of file EcalDQMonitorTask.cc.

137  {
138  ecaldqmEndLuminosityBlock(_lumi, _es);
139 
140  if (lastResetTime_ != 0 && (time(nullptr) - lastResetTime_) / 3600. > resetInterval_) {
141  if (verbosity_ > 0)
142  edm::LogInfo("EcalDQM") << moduleName_ << ": Soft-resetting the histograms";
143  // TODO: soft-reset is no longer supported.
144  lastResetTime_ = time(nullptr);
145  }
146 }

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

◆ 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 49 of file EcalDQMonitorTask.h.

Referenced by runOnCollection().

◆ collectionTokens_

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

Definition at line 47 of file EcalDQMonitorTask.h.

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

◆ lastResetTime_

time_t EcalDQMonitorTask::lastResetTime_
private

Definition at line 53 of file EcalDQMonitorTask.h.

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

◆ processedEvents_

int EcalDQMonitorTask::processedEvents_
private

Definition at line 50 of file EcalDQMonitorTask.h.

Referenced by analyze(), and dqmBeginRun().

◆ resetInterval_

float EcalDQMonitorTask::resetInterval_
private

Definition at line 54 of file EcalDQMonitorTask.h.

Referenced by globalEndLuminosityBlock().

◆ schedule_

std::vector<std::pair<Processor, ecaldqm::Collections> > EcalDQMonitorTask::schedule_
private
ecaldqm::kEBTestPulseUncalibRecHit
Definition: Collections.h:34
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:46
edm::Handle::product
T const * product() const
Definition: Handle.h:70
ecaldqm::collectionName
const std::string collectionName[nCollections]
Definition: Collections.h:47
ecaldqm::kEBBasicCluster
Definition: Collections.h:40
edm::ParameterWildcard
Definition: ParameterWildcard.h:23
EcalDQMonitorTask::lastResetTime_
time_t lastResetTime_
Definition: EcalDQMonitorTask.h:53
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:47
ecaldqm::EcalDQMonitor::executeOnWorkers_
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1) const
Definition: EcalDQMonitor.h:51
ecaldqm::kEEReducedRecHit
Definition: Collections.h:39
ecaldqm::kEEDigi
Definition: Collections.h:26
ecaldqm::EcalDQMonitor::verbosity_
const int verbosity_
Definition: EcalDQMonitor.h:47
ecaldqm::EcalDQMonitor::ecaldqmBeginRun
void ecaldqmBeginRun(edm::Run const &, edm::EventSetup const &)
Definition: EcalDQMonitor.cc:87
ecaldqm::kMEMChIdErrors
Definition: Collections.h:21
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ecaldqm::kEBGainErrors
Definition: Collections.h:11
ecaldqm::kEESrFlag
Definition: Collections.h:24
DQMOneEDAnalyzer
Definition: DQMOneEDAnalyzer.h:20
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:46
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
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
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
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
ecaldqm::kEBChIdErrors
Definition: Collections.h:13
ecaldqm::EcalDQMonitor
Definition: EcalDQMonitor.h:25
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:50
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
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::View
Definition: CaloClusterFwd.h:14
edm::ParameterSet
Definition: ParameterSet.h:47
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
ecaldqm::EcalDQMonitor::ecaldqmBeginLuminosityBlock
void ecaldqmBeginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) const
Definition: EcalDQMonitor.cc:115
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:36
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
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
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:48
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:49
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:153
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
edm::Log
Definition: MessageLogger.h:70
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:45
EcalDQMonitorTask::resetInterval_
float resetInterval_
Definition: EcalDQMonitorTask.h:54