CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
 EDProducer (const EDProducer &)=delete
 
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
 
const EDProduceroperator= (const EDProducer &)=delete
 
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
 
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)
 
 ~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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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::EcalLSCache
globalBeginLuminosityBlock (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
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, 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)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
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...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 
- 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
std::string const moduleName_
 
const int verbosity_
 
std::vector< DQWorker * > workers_
 

Detailed Description

Definition at line 18 of file EcalDQMonitorTask.h.

Member Typedef Documentation

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 ( edm::ParameterSet const &  _ps)

Definition at line 27 of file EcalDQMonitorTask.cc.

References ecaldqm::DQWorkerTask::addDependencies(), ecaldqm::DQWorkerTask::analyze(), ecaldqm::collectionName, edm::EDConsumerBase::consumesCollector(), symbols::dependencies, Exception, ecaldqm::EcalDQMonitor::executeOnWorkers_(), formSchedule(), ecaldqm::DependencySet::formSequence(), ecaldqm::DQWorker::getName(), edm::ParameterSet::getParameterSet(), edm::ParameterSet::getUntrackedParameterSet(), ecaldqm::kEcalRawData, lastResetTime_, ecaldqm::EcalDQMonitor::moduleName_, ecaldqm::nCollections, ecaldqm::DependencySet::push_back(), schedule_, edm::second(), ecaldqm::DQWorker::setTokens(), ecaldqm::DQWorkerTask::setTokens(), contentValuesCheck::ss, and ecaldqm::EcalDQMonitor::verbosity_.

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  worker->setTokens(collector);
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 }
void formSchedule(std::vector< ecaldqm::Collections > const &, edm::ParameterSet const &)
tuple dependencies
Definition: symbols.py:21
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1) const
Definition: EcalDQMonitor.h:50
U second(std::pair< T, U > const &p)
std::string const collectionName[nCollections]
Definition: Collections.h:47
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::string const moduleName_
Definition: EcalDQMonitor.h:45
std::vector< Collections > formSequence() const
Definition: DQWorkerTask.h:55
Log< level::Info, false > LogInfo
std::vector< std::pair< Processor, ecaldqm::Collections > > schedule_
std::string const & getName() const
Definition: DQWorker.h:118
void setTokens(edm::ConsumesCollector &)
Definition: DQWorker.cc:53
void push_back(Dependency const &_d)
Definition: DQWorkerTask.h:46
EcalDQMonitorTask::~EcalDQMonitorTask ( )
inlineoverride

Definition at line 22 of file EcalDQMonitorTask.h.

22 {}

Member Function Documentation

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.

References collectionTokens_, 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(), runPedHist::runType, schedule_, edm::second(), ecaldqm::DQWorker::setEventNumber(), ecaldqm::DQWorker::setTime(), contentValuesCheck::ss, and ecaldqm::EcalDQMonitor::verbosity_.

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 }
dispatcher processEvent(e, inputTag, standby)
std::vector< T >::const_iterator const_iterator
edm::EDGetToken collectionTokens_[ecaldqm::nCollections]
tuple runType
Definition: runPedHist.py:37
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1) const
Definition: EcalDQMonitor.h:50
U second(std::pair< T, U > const &p)
void setEventNumber(edm::EventNumber_t _e)
Definition: DQWorker.h:116
void(EcalDQMonitorTask::* Processor)(edm::Event const &, ecaldqm::Collections, std::set< ecaldqm::DQWorker * > const &)
std::string const moduleName_
Definition: EcalDQMonitor.h:45
bool onlineMode() const
Definition: DQWorker.h:119
Log< level::Info, false > LogInfo
std::vector< std::pair< Processor, ecaldqm::Collections > > schedule_
std::string const & getName() const
Definition: DQWorker.h:118
Log< level::Warning, false > LogWarning
void setTime(time_t _t)
Definition: DQWorker.h:113
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.

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

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 }
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1) const
Definition: EcalDQMonitor.h:50
virtual void bookMEs(DQMStore::IBooker &)
Definition: DQWorker.cc:96
void setSetupObjects(edm::EventSetup const &)
Definition: DQWorker.cc:104
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.

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

109  {
110  ecaldqmBeginRun(_run, _es);
111 
112  processedEvents_ = 0;
113 
114  if (lastResetTime_ != 0)
115  lastResetTime_ = time(nullptr);
116 }
void ecaldqmBeginRun(edm::Run const &, edm::EventSetup const &)
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.

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

118  {
119  ecaldqmEndRun(_run, _es);
120 
121  executeOnWorkers_([](ecaldqm::DQWorker* worker) { worker->releaseMEs(); }, "releaseMEs", "releasing histograms");
122 }
void ecaldqmEndRun(edm::Run const &, edm::EventSetup const &)
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1) const
Definition: EcalDQMonitor.h:50
virtual void releaseMEs()
Definition: DQWorker.cc:90
void EcalDQMonitorTask::fillDescriptions ( edm::ConfigurationDescriptions _descs)
static

Definition at line 80 of file EcalDQMonitorTask.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), edm::ParameterSetDescription::addNode(), edm::ParameterSetDescription::addUntracked(), edm::ParameterSetDescription::addWildcardUntracked(), submitPVResolutionJobs::desc, ecaldqm::EcalDQMonitor::fillDescriptions(), ecaldqm::DQWorkerTask::fillDescriptions(), and edm::RequireZeroOrMore.

80  {
83 
84  edm::ParameterSetDescription taskParameters;
87  allWorkers.addNode(
89  desc.addUntracked("workerParameters", allWorkers);
90 
91  edm::ParameterSetDescription collectionTags;
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 }
static void fillDescriptions(edm::ParameterSetDescription &)
Definition: DQWorkerTask.cc:11
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
static void fillDescriptions(edm::ParameterSetDescription &)
ParameterWildcardBase * addWildcardUntracked(U const &pattern)
void addDefault(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void EcalDQMonitorTask::formSchedule ( std::vector< ecaldqm::Collections > const &  _preSchedule,
edm::ParameterSet const &  _tagPSet 
)
private

Definition at line 46 of file EcalDQMonitorTask2.cc.

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

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 }
edm::EDGetToken collectionTokens_[ecaldqm::nCollections]
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::string const collectionName[nCollections]
Definition: Collections.h:47
std::vector< std::pair< Processor, ecaldqm::Collections > > schedule_
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.

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

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 }
void ecaldqmBeginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) const
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1) const
Definition: EcalDQMonitor.h:50
Log< level::Info, false > LogInfo
std::string const & getName() const
Definition: DQWorker.h:118
void EcalDQMonitorTask::globalEndLuminosityBlock ( edm::LuminosityBlock const &  _lumi,
edm::EventSetup const &  _es 
)
overrideprivate

Definition at line 139 of file EcalDQMonitorTask.cc.

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

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 }
std::string const moduleName_
Definition: EcalDQMonitor.h:45
Log< level::Info, false > LogInfo
void ecaldqmEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
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.

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_.

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 }
edm::EDGetToken collectionTokens_[ecaldqm::nCollections]
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1) const
Definition: EcalDQMonitor.h:50
std::string const collectionName[nCollections]
Definition: Collections.h:47
std::string const moduleName_
Definition: EcalDQMonitor.h:45
Log< level::Info, false > LogInfo
T const * product() const
Definition: Handle.h:70
Log< level::Warning, false > LogWarning

Member Data Documentation

bool EcalDQMonitorTask::allowMissingCollections_
private

Definition at line 49 of file EcalDQMonitorTask.h.

Referenced by runOnCollection().

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

Definition at line 47 of file EcalDQMonitorTask.h.

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

time_t EcalDQMonitorTask::lastResetTime_
private

Definition at line 53 of file EcalDQMonitorTask.h.

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

int EcalDQMonitorTask::processedEvents_
private

Definition at line 50 of file EcalDQMonitorTask.h.

Referenced by analyze(), and dqmBeginRun().

float EcalDQMonitorTask::resetInterval_
private

Definition at line 54 of file EcalDQMonitorTask.h.

Referenced by globalEndLuminosityBlock().

std::vector<std::pair<Processor, ecaldqm::Collections> > EcalDQMonitorTask::schedule_
private