CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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:
DQMEDAnalyzer ecaldqm::EcalDQMonitor edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

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 ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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 & 
itemsToGetFromEvent () 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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 
- Public Member Functions inherited from ecaldqm::EcalDQMonitor
 EcalDQMonitor (edm::ParameterSet const &)
 
virtual ~EcalDQMonitor ()(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
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 beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void formSchedule (std::vector< ecaldqm::Collections > const &, edm::ParameterSet const &)
 
template<typename CollectionClass >
void runOnCollection (edm::Event const &, ecaldqm::Collections, std::set< ecaldqm::DQWorker * > const &)
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 
- Protected Member Functions inherited from ecaldqm::EcalDQMonitor
void ecaldqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
void ecaldqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
void ecaldqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
void ecaldqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void ecaldqmGetSetupObjects (edm::EventSetup const &)
 
template<typename FuncOnWorker >
void executeOnWorkers_ (FuncOnWorker, std::string const &, std::string const &="", int=1)
 
- Protected Attributes inherited from ecaldqm::EcalDQMonitor
std::string const moduleName_
 
int const verbosity_
 
std::vector< DQWorker * > workers_
 

Detailed Description

Definition at line 19 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 35 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::getUntrackedParameterSet(), ecaldqm::kEcalRawData, lastResetTime_, ecaldqm::EcalDQMonitor::moduleName_, ecaldqm::nCollections, ecaldqm::DependencySet::push_back(), schedule_, edm::second(), ecaldqm::DQWorkerTask::setTokens(), contentValuesCheck::ss, and ecaldqm::EcalDQMonitor::verbosity_.

27  :
28  DQMEDAnalyzer(),
30  schedule_(),
31  allowMissingCollections_(_ps.getUntrackedParameter<bool>("allowMissingCollections")),
33  lastResetTime_(0),
34  resetInterval_(_ps.getUntrackedParameter<double>("resetInterval"))
35 {
37  std::bitset<ecaldqm::nCollections> hasTaskToRun;
39 
40  executeOnWorkers_([&dependencies, &hasTaskToRun, &collector, this](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(0, ecaldqm::Collections(iCol))) // "dry run" mode
48  hasTaskToRun.set(iCol);
49  }
50 
51  task->setTokens(collector);
52  }, "initialization");
53 
54  edm::ParameterSet const& collectionTags(_ps.getUntrackedParameterSet("collectionTags"));
55 
56  for(unsigned iCol(0); iCol < ecaldqm::nCollections; iCol++){
57  if(hasTaskToRun[iCol])
59  }
60  if(collectionTags.existsAs<edm::InputTag>("EcalRawData", false))
62 
63  formSchedule(dependencies.formSequence(), collectionTags);
64 
65  if(verbosity_ > 0){
66  std::stringstream ss;
67  ss << moduleName_ << ": Using collections" << std::endl;
68  for(unsigned iCol(0); iCol < schedule_.size(); iCol++)
69  ss << ecaldqm::collectionName[schedule_[iCol].second] << std::endl;
70  edm::LogInfo("EcalDQM") << ss.str();
71  }
72 
73  edm::ParameterSet const& commonParams(_ps.getUntrackedParameterSet("commonParameters"));
74  if(commonParams.getUntrackedParameter<bool>("onlineMode"))
75  lastResetTime_ = time(0);
76 }
void formSchedule(std::vector< ecaldqm::Collections > const &, edm::ParameterSet const &)
tuple dependencies
Definition: symbols.py:19
U second(std::pair< T, U > const &p)
std::string const collectionName[nCollections]
Definition: Collections.h:45
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::string const moduleName_
Definition: EcalDQMonitor.h:39
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1)
Definition: EcalDQMonitor.h:45
std::vector< Collections > formSequence() const
Definition: DQWorkerTask.h:58
std::vector< std::pair< Processor, ecaldqm::Collections > > schedule_
std::string const & getName() const
Definition: DQWorker.h:68
void push_back(Dependency const &_d)
Definition: DQWorkerTask.h:50
EcalDQMonitorTask::~EcalDQMonitorTask ( )
inline

Definition at line 22 of file EcalDQMonitorTask.h.

22 {}

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 158 of file EcalDQMonitorTask.cc.

References collectionTokens_, edm::EventID::event(), ecaldqm::EcalDQMonitor::executeOnWorkers_(), plotBeamSpotDB::first, edm::Event::getByToken(), ecaldqm::DQWorker::getName(), edm::EventBase::id(), ecaldqm::kEcalRawData, edm::EventID::luminosityBlock(), ecaldqm::EcalDQMonitor::moduleName_, ecaldqm::nDCC, ecaldqm::DQWorker::onlineMode(), processedEvents_, processEvent(), edm::EventID::run(), runPedHist::runType, schedule_, edm::second(), ecaldqm::DQWorker::setEventNumber(), ecaldqm::DQWorker::setTime(), contentValuesCheck::ss, and ecaldqm::EcalDQMonitor::verbosity_.

159 {
160  if(verbosity_ > 2) edm::LogInfo("EcalDQM") << moduleName_ << "::analyze: Run " << _evt.id().run() << " Lumisection " << _evt.id().luminosityBlock() << " Event " << _evt.id().event() << ": processed " << processedEvents_;
161 
162  if(schedule_.size() == 0) return;
163 
164  std::set<ecaldqm::DQWorker*> enabledTasks;
165 
167  if(_evt.getByToken(collectionTokens_[ecaldqm::kEcalRawData], dcchsHndl)){
168  // determine event type (called run type in DCCHeader for some reason) for each FED
169  std::stringstream ss;
170  if(verbosity_ > 2) ss << moduleName_ << ": Event type ";
171 
172  short runType[ecaldqm::nDCC];
173  std::fill_n(runType, ecaldqm::nDCC, -1);
174  for(EcalRawDataCollection::const_iterator dcchItr = dcchsHndl->begin(); dcchItr != dcchsHndl->end(); ++dcchItr){
175  if(verbosity_ > 2) ss << dcchItr->getRunType() << " ";
176  runType[dcchItr->id() - 1] = dcchItr->getRunType();
177  }
178  if(verbosity_ > 2) edm::LogInfo("EcalDQM") << ss.str();
179 
180  bool processEvent(false);
181 
182  executeOnWorkers_([&enabledTasks, &runType, &processEvent, this](ecaldqm::DQWorker* worker){
183  if(static_cast<ecaldqm::DQWorkerTask*>(worker)->filterRunType(runType)){
184  if(this->verbosity_ > 2) edm::LogInfo("EcalDQM") << worker->getName() << " will run on this event";
185  enabledTasks.insert(worker);
186  processEvent = true;
187  }
188  }, "filterRunType");
189 
190  if(!processEvent) return;
191  }
192  else{
193  edm::LogWarning("EcalDQM") << "EcalRawDataCollection does not exist. No event-type filtering will be applied";
194  executeOnWorkers_([&enabledTasks](ecaldqm::DQWorker* worker){
195  enabledTasks.insert(worker);
196  }, "");
197  }
198 
200 
201  // start event processing
202  executeOnWorkers_([&_evt, &_es, &enabledTasks](ecaldqm::DQWorker* worker){
203  if(enabledTasks.find(worker) != enabledTasks.end()){
204  if(worker->onlineMode()) worker->setTime(time(0));
205  worker->setEventNumber(_evt.id().event());
206  static_cast<ecaldqm::DQWorkerTask*>(worker)->beginEvent(_evt, _es);
207  }
208  }, "beginEvent");
209 
210  // run on collections
211  for(unsigned iSch(0); iSch < schedule_.size(); iSch++){
212  Processor processor(schedule_[iSch].first);
213  (this->*processor)(_evt, schedule_[iSch].second, enabledTasks);
214  }
215 
216  // close event processing
217  executeOnWorkers_([&_evt, &_es, &enabledTasks](ecaldqm::DQWorker* worker){
218  if(enabledTasks.find(worker) != enabledTasks.end())
219  static_cast<ecaldqm::DQWorkerTask*>(worker)->endEvent(_evt, _es);
220  }, "endEvent");
221 
222  if(verbosity_ > 2) edm::LogInfo("EcalDQM") << moduleName_ << "::analyze: Closing Event " << _evt.id().event();
223 }
dispatcher processEvent(e, inputTag, standby)
std::vector< EcalDCCHeaderBlock >::const_iterator const_iterator
edm::EDGetToken collectionTokens_[ecaldqm::nCollections]
tuple runType
Definition: runPedHist.py:30
U second(std::pair< T, U > const &p)
void setEventNumber(edm::EventNumber_t _e)
Definition: DQWorker.h:66
void(EcalDQMonitorTask::* Processor)(edm::Event const &, ecaldqm::Collections, std::set< ecaldqm::DQWorker * > const &)
std::string const moduleName_
Definition: EcalDQMonitor.h:39
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1)
Definition: EcalDQMonitor.h:45
bool onlineMode() const
Definition: DQWorker.h:69
std::vector< std::pair< Processor, ecaldqm::Collections > > schedule_
std::string const & getName() const
Definition: DQWorker.h:68
void setTime(time_t _t)
Definition: DQWorker.h:63
void EcalDQMonitorTask::beginLuminosityBlock ( edm::LuminosityBlock const &  _lumi,
edm::EventSetup const &  _es 
)
overrideprivatevirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 137 of file EcalDQMonitorTask.cc.

References ecaldqm::EcalDQMonitor::ecaldqmBeginLuminosityBlock().

138 {
139  ecaldqmBeginLuminosityBlock(_lumi, _es);
140 }
void ecaldqmBeginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
void EcalDQMonitorTask::bookHistograms ( DQMStore::IBooker _ibooker,
edm::Run const &  ,
edm::EventSetup const &  _es 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 102 of file EcalDQMonitorTask.cc.

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

103 {
105 
106  executeOnWorkers_([&_ibooker](ecaldqm::DQWorker* worker){
107  worker->bookMEs(_ibooker);
108  }, "bookMEs", "Booking MEs");
109 }
void ecaldqmGetSetupObjects(edm::EventSetup const &)
virtual void bookMEs(DQMStore::IBooker &)
Definition: DQWorker.cc:85
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1)
Definition: EcalDQMonitor.h:45
void EcalDQMonitorTask::dqmBeginRun ( edm::Run const &  _run,
edm::EventSetup const &  _es 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 112 of file EcalDQMonitorTask.cc.

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

113 {
114  ecaldqmBeginRun(_run, _es);
115 
116  processedEvents_ = 0;
117 
118  if(lastResetTime_ != 0) lastResetTime_ = time(0);
119 }
void ecaldqmBeginRun(edm::Run const &, edm::EventSetup const &)
void EcalDQMonitorTask::endLuminosityBlock ( edm::LuminosityBlock const &  _lumi,
edm::EventSetup const &  _es 
)
overrideprivatevirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 143 of file EcalDQMonitorTask.cc.

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

144 {
145  ecaldqmEndLuminosityBlock(_lumi, _es);
146 
147  if(lastResetTime_ != 0 && (time(0) - lastResetTime_) / 3600. > resetInterval_){
148  if(verbosity_ > 0) edm::LogInfo("EcalDQM") << moduleName_ << ": Soft-resetting the histograms";
150  static_cast<ecaldqm::DQWorkerTask*>(worker)->softReset();
151  }, "softReset");
152 
153  lastResetTime_ = time(0);
154  }
155 }
std::string const moduleName_
Definition: EcalDQMonitor.h:39
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1)
Definition: EcalDQMonitor.h:45
void ecaldqmEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
void EcalDQMonitorTask::endRun ( edm::Run const &  _run,
edm::EventSetup const &  _es 
)
overrideprivatevirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 122 of file EcalDQMonitorTask.cc.

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

123 {
124  if(lastResetTime_ != 0)
126  static_cast<ecaldqm::DQWorkerTask*>(worker)->recoverStats();
127  }, "recoverStats");
128 
129  ecaldqmEndRun(_run, _es);
130 
132  worker->releaseMEs();
133  }, "releaseMEs", "releasing histograms");
134 }
void ecaldqmEndRun(edm::Run const &, edm::EventSetup const &)
virtual void releaseMEs()
Definition: DQWorker.cc:77
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1)
Definition: EcalDQMonitor.h:45
void EcalDQMonitorTask::fillDescriptions ( edm::ConfigurationDescriptions _descs)
static

Definition at line 80 of file EcalDQMonitorTask.cc.

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

81 {
84 
85  edm::ParameterSetDescription taskParameters;
89  desc.addUntracked("workerParameters", allWorkers);
90 
91  edm::ParameterSetDescription collectionTags;
92  collectionTags.addWildcardUntracked<edm::InputTag>("*");
93  desc.addUntracked("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:17
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)
void EcalDQMonitorTask::formSchedule ( std::vector< ecaldqm::Collections > const &  _preSchedule,
edm::ParameterSet const &  _tagPSet 
)
private

Definition at line 42 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().

43 {
44  for(std::vector<ecaldqm::Collections>::const_iterator colItr(_preSchedule.begin()); colItr != _preSchedule.end(); ++colItr){
45  std::pair<Processor, ecaldqm::Collections> sch;
46 
47  edm::InputTag tag(_tagPSet.getUntrackedParameter<edm::InputTag>(ecaldqm::collectionName[*colItr]));
48 
49  switch(*colItr){
50  case ecaldqm::kSource:
51  collectionTokens_[*colItr] = edm::EDGetToken(consumes<FEDRawDataCollection>(tag));
52  sch.first = &EcalDQMonitorTask::runOnCollection<FEDRawDataCollection>;
53  break;
55  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EcalRawDataCollection>(tag));
56  sch.first = &EcalDQMonitorTask::runOnCollection<EcalRawDataCollection>;
57  break;
61  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EBDetIdCollection>(tag));
62  sch.first = &EcalDQMonitorTask::runOnCollection<EBDetIdCollection>;
63  break;
67  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EEDetIdCollection>(tag));
68  sch.first = &EcalDQMonitorTask::runOnCollection<EEDetIdCollection>;
69  break;
76  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EcalElectronicsIdCollection>(tag));
77  sch.first = &EcalDQMonitorTask::runOnCollection<EcalElectronicsIdCollection>;
78  break;
79  case ecaldqm::kEBSrFlag:
80  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EBSrFlagCollection>(tag));
81  sch.first = &EcalDQMonitorTask::runOnCollection<EBSrFlagCollection>;
82  break;
83  case ecaldqm::kEESrFlag:
84  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EESrFlagCollection>(tag));
85  sch.first = &EcalDQMonitorTask::runOnCollection<EESrFlagCollection>;
86  break;
87  case ecaldqm::kEBDigi:
88  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EBDigiCollection>(tag));
89  sch.first = &EcalDQMonitorTask::runOnCollection<EBDigiCollection>;
90  break;
91  case ecaldqm::kEEDigi:
92  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EEDigiCollection>(tag));
93  sch.first = &EcalDQMonitorTask::runOnCollection<EEDigiCollection>;
94  break;
96  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EcalPnDiodeDigiCollection>(tag));
97  sch.first = &EcalDQMonitorTask::runOnCollection<EcalPnDiodeDigiCollection>;
98  break;
101  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EcalTrigPrimDigiCollection>(tag));
102  sch.first = &EcalDQMonitorTask::runOnCollection<EcalTrigPrimDigiCollection>;
103  break;
110  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EcalUncalibratedRecHitCollection>(tag));
111  sch.first = &EcalDQMonitorTask::runOnCollection<EcalUncalibratedRecHitCollection>;
112  break;
113  case ecaldqm::kEBRecHit:
115  case ecaldqm::kEERecHit:
117  collectionTokens_[*colItr] = edm::EDGetToken(consumes<EcalRecHitCollection>(tag));
118  sch.first = &EcalDQMonitorTask::runOnCollection<EcalRecHitCollection>;
119  break;
123  sch.first = &EcalDQMonitorTask::runOnCollection<edm::View<reco::CaloCluster> >;
124  break;
127  collectionTokens_[*colItr] = edm::EDGetToken(consumes<reco::SuperClusterCollection>(tag));
128  sch.first = &EcalDQMonitorTask::runOnCollection<reco::SuperClusterCollection>;
129  break;
130  default:
131  throw cms::Exception("InvalidConfiguration") << "Undefined collection " << *colItr;
132  }
133 
134  sch.second = *colItr;
135 
136  schedule_.push_back(sch);
137  }
138 }
edm::EDGetToken collectionTokens_[ecaldqm::nCollections]
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::string const collectionName[nCollections]
Definition: Collections.h:45
std::vector< std::pair< Processor, ecaldqm::Collections > > schedule_
template<typename CollectionClass >
void EcalDQMonitorTask::runOnCollection ( edm::Event const &  _evt,
ecaldqm::Collections  _col,
std::set< ecaldqm::DQWorker * > const &  _enabledTasks 
)
private

Definition at line 21 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") << moduleName_ << "::runOnCollection: " << ecaldqm::collectionName[_col] << " does not exist";
27  edm::LogWarning("EcalDQM") << moduleName_ << "::runOnCollection: " << ecaldqm::collectionName[_col] << " does not exist";
28  return;
29  }
30 
31  CollectionClass const* collection(hndl.product());
32 
33  executeOnWorkers_([collection, _col, &_enabledTasks, this](ecaldqm::DQWorker* worker){
34  if(_enabledTasks.find(worker) != _enabledTasks.end())
35  static_cast<ecaldqm::DQWorkerTask*>(worker)->analyze(collection, _col);
36  }, "analyze");
37 
38  if(verbosity_ > 1) edm::LogInfo("EcalDQM") << moduleName_ << "::runOn" << ecaldqm::collectionName[_col] << " returning";
39 }
edm::EDGetToken collectionTokens_[ecaldqm::nCollections]
std::string const collectionName[nCollections]
Definition: Collections.h:45
std::string const moduleName_
Definition: EcalDQMonitor.h:39
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1)
Definition: EcalDQMonitor.h:45
T const * product() const
Definition: Handle.h:81

Member Data Documentation

bool EcalDQMonitorTask::allowMissingCollections_
private

Definition at line 45 of file EcalDQMonitorTask.h.

Referenced by runOnCollection().

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

Definition at line 43 of file EcalDQMonitorTask.h.

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

time_t EcalDQMonitorTask::lastResetTime_
private

Definition at line 49 of file EcalDQMonitorTask.h.

Referenced by dqmBeginRun(), EcalDQMonitorTask(), endLuminosityBlock(), and endRun().

int EcalDQMonitorTask::processedEvents_
private

Definition at line 46 of file EcalDQMonitorTask.h.

Referenced by analyze(), and dqmBeginRun().

float EcalDQMonitorTask::resetInterval_
private

Definition at line 50 of file EcalDQMonitorTask.h.

Referenced by endLuminosityBlock().

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