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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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 &)
 
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, protons_cff::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 150 of file EcalDQMonitorTask.cc.

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

References edm::SortedCollection< T, SORT >::begin(), collectionTokens_, edm::SortedCollection< T, SORT >::end(), edm::EventID::event(), ecaldqm::EcalDQMonitor::executeOnWorkers_(), 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, protons_cff::time, and ecaldqm::EcalDQMonitor::verbosity_.

◆ bookHistograms()

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

Implements DQMOneEDAnalyzer< edm::LuminosityBlockCache< ecaldqm::EcalLSCache > >.

Definition at line 101 of file EcalDQMonitorTask.cc.

101  {
102  executeOnWorkers_([&_es](ecaldqm::DQWorker* worker) { worker->setSetupObjects(_es); },
103  "ecaldqmGetSetupObjects",
104  "Getting EventSetup Objects");
105 
106  executeOnWorkers_([&_ibooker](ecaldqm::DQWorker* worker) { worker->bookMEs(_ibooker); }, "bookMEs", "Booking MEs");
107 }

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

◆ dqmBeginRun()

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

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

Definition at line 109 of file EcalDQMonitorTask.cc.

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

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

◆ dqmEndRun()

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

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

Definition at line 118 of file EcalDQMonitorTask.cc.

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

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 124 of file EcalDQMonitorTask.cc.

125  {
126  std::shared_ptr<ecaldqm::EcalLSCache> tmpCache = std::make_shared<ecaldqm::EcalLSCache>();
128  [&tmpCache](ecaldqm::DQWorker* worker) { (tmpCache->ByLumiPlotsResetSwitches)[worker->getName()] = true; },
129  "globalBeginLuminosityBlock");
130  if (this->verbosity_ > 2)
131  edm::LogInfo("EcalDQM") << "Set LS cache.";
132 
133  // 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
134  tmpCache->lhcStatusSet_ = false;
135  ecaldqmBeginLuminosityBlock(_lumi, _es);
136  return tmpCache;
137 }

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 139 of file EcalDQMonitorTask.cc.

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

References ecaldqm::EcalDQMonitor::ecaldqmEndLuminosityBlock(), lastResetTime_, ecaldqm::EcalDQMonitor::moduleName_, resetInterval_, protons_cff::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:45
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:50
ecaldqm::kEEReducedRecHit
Definition: Collections.h:39
ecaldqm::kEEDigi
Definition: Collections.h:26
ecaldqm::EcalDQMonitor::verbosity_
const int verbosity_
Definition: EcalDQMonitor.h:46
ecaldqm::EcalDQMonitor::ecaldqmBeginRun
void ecaldqmBeginRun(edm::Run const &, edm::EventSetup const &)
Definition: EcalDQMonitor.cc:64
ecaldqm::kMEMChIdErrors
Definition: Collections.h:21
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ecaldqm::kEBGainErrors
Definition: Collections.h:11
ecaldqm::kEESrFlag
Definition: Collections.h:24
protons_cff.time
time
Definition: protons_cff.py:39
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:47
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:78
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
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:72
ecaldqm::kEEGainErrors
Definition: Collections.h:12
ecaldqm::DQWorker
Definition: DQWorker.h:33
ecaldqm::kEETestPulseUncalibRecHit
Definition: Collections.h:35
EcalDQMonitorTask::processedEvents_
int processedEvents_
Definition: EcalDQMonitorTask.h:50
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
ecaldqm::DQWorker::setSetupObjects
void setSetupObjects(edm::EventSetup const &)
Definition: DQWorker.cc:86
ecaldqm::kTowerIdErrors
Definition: Collections.h:17
ecaldqm::DQWorker::setEventNumber
void setEventNumber(edm::EventNumber_t _e)
Definition: DQWorker.h:95
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:98
ecaldqm::kEBRecHit
Definition: Collections.h:36
ecaldqm::kEEChIdErrors
Definition: Collections.h:14
processEvent
dispatcher processEvent(e, inputTag, standby)
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:112
ecaldqm::EcalDQMonitor::ecaldqmEndLuminosityBlock
void ecaldqmEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: EcalDQMonitor.cc:106
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:92
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:78
ecaldqm::kEBDigi
Definition: Collections.h:25
ecaldqm::DQWorker::getName
const std::string & getName() const
Definition: DQWorker.h:97
EcalDQMonitorTask::schedule_
std::vector< std::pair< Processor, ecaldqm::Collections > > schedule_
Definition: EcalDQMonitorTask.h:48
Exception
Definition: hltDiff.cc:245
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:91
EcalDQMonitorTask::allowMissingCollections_
bool allowMissingCollections_
Definition: EcalDQMonitorTask.h:49
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:155
EcalCondDBWriter_cfi.runType
runType
Definition: EcalCondDBWriter_cfi.py:64
ecaldqm::DQWorker::setTime
void setTime(time_t _t)
Definition: DQWorker.h:92
ecaldqm::kEEBasicCluster
Definition: Collections.h:41
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
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
EcalDQMonitorTask::resetInterval_
float resetInterval_
Definition: EcalDQMonitorTask.h:54