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:
EcalDQMonitor edm::EDAnalyzer

Public Member Functions

 EcalDQMonitorTask (const edm::ParameterSet &)
 
 ~EcalDQMonitorTask ()
 
- Public Member Functions inherited from EcalDQMonitor
 EcalDQMonitor (const edm::ParameterSet &)
 
virtual ~EcalDQMonitor ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Private Types

typedef void(EcalDQMonitorTask::* Processor )(const edm::Event &, ecaldqm::Collections)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 
void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 
void beginRun (const edm::Run &, const edm::EventSetup &)
 
void endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 
void endRun (const edm::Run &, const edm::EventSetup &)
 
void formSchedule_ (const std::vector< ecaldqm::Collections > &, const std::multimap< ecaldqm::Collections, ecaldqm::Collections > &)
 
template<class C >
void runOnCollection (const edm::Event &, ecaldqm::Collections)
 
template<>
void runOnCollection (const edm::Event &_evt, Collections _colName)
 

Private Attributes

bool allowMissingCollections_
 
edm::InputTag collectionTags_ [ecaldqm::nCollections]
 
std::map
< ecaldqm::DQWorkerTask
*, bool > 
enabled_
 
bool evaluateTime_
 
int ievt_
 
std::vector< std::pair
< Processor,
ecaldqm::Collections > > 
schedule_
 
std::vector
< ecaldqm::DQWorkerTask * > 
taskLists_ [ecaldqm::nCollections]
 
std::map
< ecaldqm::DQWorkerTask
*, double > 
taskTimes_
 
std::vector
< ecaldqm::DQWorkerTask * > 
workers_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 
- Protected Attributes inherited from EcalDQMonitor
bool initialized_
 
const bool mergeRuns_
 
std::string moduleName_
 
const int verbosity_
 

Detailed Description

Definition at line 24 of file EcalDQMonitorTask.h.

Member Typedef Documentation

typedef void(EcalDQMonitorTask::* EcalDQMonitorTask::Processor)(const edm::Event &, ecaldqm::Collections)
private

Definition at line 40 of file EcalDQMonitorTask.h.

Constructor & Destructor Documentation

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

Definition at line 29 of file EcalDQMonitorTask.cc.

References ecaldqm::collectionName, collectionTags_, gather_cfg::cout, formSchedule_(), ecaldqm::DQWorkerTask::getDependencies(), ecaldqm::DQWorker::getName(), edm::ParameterSet::getUntrackedParameter(), edm::ParameterSet::getUntrackedParameterSet(), ecaldqm::kEcalRawData, EcalDQMonitor::moduleName_, ecaldqm::nCollections, schedule_, edm::second(), ecaldqm::DQWorker::setVerbosity(), taskLists_, EcalDQMonitor::verbosity_, and workers_.

29  :
30  EcalDQMonitor(_ps),
31  ievt_(0),
32  workers_(0),
33  schedule_(),
34  enabled_(),
35  taskTimes_(),
36  evaluateTime_(_ps.getUntrackedParameter<bool>("evaluateTime")),
37  allowMissingCollections_(_ps.getUntrackedParameter<bool>("allowMissingCollections"))
38 {
39  using namespace std;
40 
41  vector<string> taskNames(_ps.getUntrackedParameter<vector<string> >("tasks"));
42  const edm::ParameterSet& taskParams(_ps.getUntrackedParameterSet("taskParameters"));
43  const edm::ParameterSet& mePaths(_ps.getUntrackedParameterSet("mePaths"));
44 
45  WorkerFactory factory(0);
46  std::multimap<Collections, Collections> dependencies;
47 
48  for(vector<string>::iterator tItr(taskNames.begin()); tItr != taskNames.end(); ++tItr){
49  if (!(factory = SetWorker::findFactory(*tItr))) continue;
50 
51  if(verbosity_ > 0) cout << moduleName_ << ": Setting up " << *tItr << endl;
52 
53  DQWorker* worker(factory(taskParams, mePaths.getUntrackedParameterSet(*tItr)));
54  if(worker->getName() != *tItr){
55  delete worker;
56 
57  if(verbosity_ > 0) cout << moduleName_ << ": " << *tItr << " could not be configured" << endl;
58  continue;
59  }
60  DQWorkerTask* task(static_cast<DQWorkerTask*>(worker));
61  task->setVerbosity(verbosity_);
62 
63  workers_.push_back(task);
64 
65  const std::vector<std::pair<Collections, Collections> >& dep(task->getDependencies());
66  for(std::vector<std::pair<Collections, Collections> >::const_iterator depItr(dep.begin()); depItr != dep.end(); ++depItr)
67  dependencies.insert(*depItr);
68  }
69 
70  const edm::ParameterSet& collectionTags(_ps.getUntrackedParameterSet("collectionTags"));
71 
72  std::vector<Collections> usedCollections;
73 
74  for(unsigned iCol(0); iCol < nCollections; iCol++){
75 
77  taskLists_[iCol] = vector<DQWorkerTask*>();
78 
79  bool use(iCol == kEcalRawData);
80 
81  for(vector<DQWorkerTask*>::iterator wItr(workers_.begin()); wItr != workers_.end(); ++wItr){
82  if((*wItr)->runsOn(iCol)){
83  taskLists_[iCol].push_back(*wItr);
84  use = true;
85  }
86  }
87  if(use){
88  collectionTags_[iCol] = collectionTags.getUntrackedParameter<edm::InputTag>(collectionName[iCol]);
89  usedCollections.push_back(Collections(iCol));
90  }
91 
92  }
93 
94  formSchedule_(usedCollections, dependencies);
95 
96  if(verbosity_ > 0){
97  cout << moduleName_ << ": Using collections" << endl;
98  for(unsigned iCol(0); iCol < schedule_.size(); iCol++)
99  cout << collectionName[schedule_[iCol].second] << endl;
100  cout << endl;
101  }
102 }
T getUntrackedParameter(std::string const &, T const &) const
std::vector< ecaldqm::DQWorkerTask * > workers_
std::map< ecaldqm::DQWorkerTask *, bool > enabled_
std::string moduleName_
Definition: EcalDQMonitor.h:22
EcalDQMonitor(const edm::ParameterSet &)
void formSchedule_(const std::vector< ecaldqm::Collections > &, const std::multimap< ecaldqm::Collections, ecaldqm::Collections > &)
U second(std::pair< T, U > const &p)
std::map< ecaldqm::DQWorkerTask *, double > taskTimes_
std::string const collectionName[nCollections]
Definition: Collections.h:39
ParameterSet const & getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
DQWorker *(* WorkerFactory)(const edm::ParameterSet &, const edm::ParameterSet &)
Definition: DQWorker.h:64
std::vector< std::pair< Processor, ecaldqm::Collections > > schedule_
std::vector< ecaldqm::DQWorkerTask * > taskLists_[ecaldqm::nCollections]
tuple cout
Definition: gather_cfg.py:121
const int verbosity_
Definition: EcalDQMonitor.h:24
edm::InputTag collectionTags_[ecaldqm::nCollections]
EcalDQMonitorTask::~EcalDQMonitorTask ( )

Definition at line 104 of file EcalDQMonitorTask.cc.

References workers_.

105 {
106  for(std::vector<DQWorkerTask *>::iterator wItr(workers_.begin()); wItr != workers_.end(); ++wItr)
107  delete *wItr;
108 }
std::vector< ecaldqm::DQWorkerTask * > workers_

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 188 of file EcalDQMonitorTask.cc.

References ecaldqm::DQWorkerTask::beginEvent(), ecaldqm::DQWorker::bookMEs(), collectionTags_, gather_cfg::cout, enabled_, ecaldqm::DQWorkerTask::endEvent(), ecaldqm::DQWorkerTask::filterRunType(), first, edm::Event::getByLabel(), ecaldqm::DQWorker::getName(), ievt_, ecaldqm::DQWorker::isInitialized(), ecaldqm::kEcalRawData, EcalDQMonitor::moduleName_, environment_file_cff::runType, schedule_, edm::second(), ecaldqm::DQWorker::setInitialized(), EcalDQMonitor::verbosity_, and workers_.

189 {
190  using namespace std;
191  using namespace ecaldqm;
192 
193  ievt_++;
194 
196  if(!_evt.getByLabel(collectionTags_[kEcalRawData], dcchsHndl))
197  throw cms::Exception("ObjectNotFound") << "EcalRawDataCollection with InputTag " << collectionTags_[kEcalRawData] << " does not exist";
198 
199  // determine event type (called run type in DCCHeader for some reason) for each FED
200  std::vector<short> runType(54, -1);
201  for(EcalRawDataCollection::const_iterator dcchItr = dcchsHndl->begin(); dcchItr != dcchsHndl->end(); ++dcchItr){
202  runType[dcchItr->id() - 1] = dcchItr->getRunType();
203  }
204 
205  bool atLeastOne(false);
206 
207  DQWorkerTask *task(0);
208 
209  // set up task modules
210  for(vector<DQWorkerTask*>::iterator wItr(workers_.begin()); wItr != workers_.end(); ++wItr){
211  task = *wItr;
212 
213  if(task->filterRunType(runType)){
214  enabled_[task] = true;
215 
216  if(!task->isInitialized()){
217  if(verbosity_ > 1) cout << moduleName_ << ": Booking MEs for " << task->getName() << endl;
218  task->bookMEs();
219  task->setInitialized(true);
220  }
221 
222  task->beginEvent(_evt, _es);
223  atLeastOne = true;
224  }else{
225  enabled_[task] = false;
226  }
227  }
228 
229  if(!atLeastOne) return;
230 
231  // run on collections
232  for(unsigned iSch(0); iSch < schedule_.size(); iSch++){
233  Processor processor(schedule_[iSch].first);
234  (this->*processor)(_evt, schedule_[iSch].second);
235  }
236 
237  // close event
238  for(vector<DQWorkerTask *>::iterator wItr(workers_.begin()); wItr != workers_.end(); ++wItr){
239  task = *wItr;
240  if(enabled_[task]) task->endEvent(_evt, _es);
241  }
242 
243 }
std::vector< ecaldqm::DQWorkerTask * > workers_
std::map< ecaldqm::DQWorkerTask *, bool > enabled_
std::string moduleName_
Definition: EcalDQMonitor.h:22
std::vector< T >::const_iterator const_iterator
void(EcalDQMonitorTask::* Processor)(const edm::Event &, ecaldqm::Collections)
U second(std::pair< T, U > const &p)
bool first
Definition: L1TdeRCT.cc:94
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
std::vector< std::pair< Processor, ecaldqm::Collections > > schedule_
tuple cout
Definition: gather_cfg.py:121
const int verbosity_
Definition: EcalDQMonitor.h:24
edm::InputTag collectionTags_[ecaldqm::nCollections]
void EcalDQMonitorTask::beginLuminosityBlock ( const edm::LuminosityBlock _lumi,
const edm::EventSetup _es 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 170 of file EcalDQMonitorTask.cc.

References ecaldqm::DQWorker::beginLuminosityBlock(), ecaldqm::DQWorker::isInitialized(), ecaldqm::kLumiSection, ecaldqm::DQWorkerTask::runsOn(), and workers_.

171 {
172  for(std::vector<DQWorkerTask *>::iterator wItr(workers_.begin()); wItr != workers_.end(); ++wItr){
173  DQWorkerTask* task(*wItr);
174  if(task->isInitialized() && task->runsOn(kLumiSection)) task->beginLuminosityBlock(_lumi, _es);
175  }
176 }
std::vector< ecaldqm::DQWorkerTask * > workers_
void EcalDQMonitorTask::beginRun ( const edm::Run _run,
const edm::EventSetup _es 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 120 of file EcalDQMonitorTask.cc.

References ecaldqm::DQWorker::beginRun(), gather_cfg::cout, edm::EventSetup::get(), ievt_, ecaldqm::kRun, EcalDQMonitor::moduleName_, edm::ESHandle< class >::product(), ecaldqm::DQWorker::reset(), edm::RunBase::run(), ecaldqm::DQWorkerTask::runsOn(), ecaldqm::setElectronicsMap(), ecaldqm::setTrigTowerMap(), taskTimes_, EcalDQMonitor::verbosity_, and workers_.

121 {
122  // set up ecaldqm::electronicsMap in EcalDQMCommonUtils
124  _es.get<EcalMappingRcd>().get(elecMapHandle);
125  setElectronicsMap(elecMapHandle.product());
126 
127  // set up ecaldqm::electronicsMap in EcalDQMCommonUtils
129  _es.get<IdealGeometryRecord>().get(ttMapHandle);
130  setTrigTowerMap(ttMapHandle.product());
131 
132  for(std::vector<DQWorkerTask*>::iterator wItr(workers_.begin()); wItr != workers_.end(); ++wItr){
133  DQWorkerTask* task(*wItr);
134  task->reset();
135  if(task->runsOn(kRun)) task->beginRun(_run, _es);
136  }
137 
138  if(verbosity_ > 0)
139  std::cout << moduleName_ << ": Starting run " << _run.run() << std::endl;
140 
141  ievt_ = 0;
142  taskTimes_.clear();
143 }
std::vector< ecaldqm::DQWorkerTask * > workers_
void setTrigTowerMap(const EcalTrigTowerConstituentsMap *)
RunNumber_t run() const
Definition: RunBase.h:42
std::string moduleName_
Definition: EcalDQMonitor.h:22
void setElectronicsMap(const EcalElectronicsMapping *)
std::map< ecaldqm::DQWorkerTask *, double > taskTimes_
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
tuple cout
Definition: gather_cfg.py:121
const int verbosity_
Definition: EcalDQMonitor.h:24
void EcalDQMonitorTask::endLuminosityBlock ( const edm::LuminosityBlock _lumi,
const edm::EventSetup _es 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 179 of file EcalDQMonitorTask.cc.

References ecaldqm::DQWorker::endLuminosityBlock(), ecaldqm::DQWorker::isInitialized(), ecaldqm::kLumiSection, ecaldqm::DQWorkerTask::runsOn(), and workers_.

180 {
181  for(std::vector<DQWorkerTask *>::iterator wItr(workers_.begin()); wItr != workers_.end(); ++wItr){
182  DQWorkerTask* task(*wItr);
183  if(task->isInitialized() && task->runsOn(kLumiSection)) task->endLuminosityBlock(_lumi, _es);
184  }
185 }
std::vector< ecaldqm::DQWorkerTask * > workers_
void EcalDQMonitorTask::endRun ( const edm::Run _run,
const edm::EventSetup _es 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 146 of file EcalDQMonitorTask.cc.

References ecaldqm::DQWorker::endRun(), evaluateTime_, ecaldqm::DQWorker::getName(), ievt_, ecaldqm::kRun, EcalDQMonitor::moduleName_, ecaldqm::DQWorkerTask::runsOn(), taskTimes_, and workers_.

147 {
148  using namespace std;
149 
150  for(vector<DQWorkerTask *>::iterator wItr(workers_.begin()); wItr != workers_.end(); ++wItr){
151  DQWorkerTask* task(*wItr);
152  if(task->runsOn(kRun)) task->endRun(_run, _es);
153  }
154 
155  if(evaluateTime_){
156  stringstream ss;
157 
158  ss << "************** " << moduleName_ << " **************" << endl;
159  ss << " Mean time consumption of the modules" << endl;
160  ss << "____________________________________" << endl;
161  for(std::vector<DQWorkerTask *>::iterator wItr(workers_.begin()); wItr != workers_.end(); ++wItr){
162  DQWorkerTask* task(*wItr);
163  ss << setw(20) << setfill(' ') << task->getName() << "| " << (taskTimes_[task] / ievt_) << endl;
164  }
165  edm::LogInfo("EcalDQM") << ss.str();
166  }
167 }
std::vector< ecaldqm::DQWorkerTask * > workers_
std::string moduleName_
Definition: EcalDQMonitor.h:22
std::map< ecaldqm::DQWorkerTask *, double > taskTimes_
void EcalDQMonitorTask::fillDescriptions ( edm::ConfigurationDescriptions _descs)
static
void EcalDQMonitorTask::formSchedule_ ( const std::vector< ecaldqm::Collections > &  _usedCollections,
const std::multimap< ecaldqm::Collections, ecaldqm::Collections > &  _dependencies 
)
private

Definition at line 93 of file EcalDQMonitorTask2.cc.

References edm::hlt::Exception, spr::find(), ecaldqm::kBlockSizeErrors, ecaldqm::kChIdErrors, ecaldqm::kEBBasicCluster, ecaldqm::kEBDigi, ecaldqm::kEBRecHit, ecaldqm::kEBSrFlag, ecaldqm::kEBSuperCluster, ecaldqm::kEBUncalibRecHit, ecaldqm::kEcalRawData, ecaldqm::kEEBasicCluster, ecaldqm::kEEDigi, ecaldqm::kEERecHit, ecaldqm::kEESrFlag, ecaldqm::kEESuperCluster, ecaldqm::kEEUncalibRecHit, ecaldqm::kGainErrors, ecaldqm::kGainSwitchErrors, ecaldqm::kMEMBlockSizeErrors, ecaldqm::kMEMChIdErrors, ecaldqm::kMEMGainErrors, ecaldqm::kMEMTowerIdErrors, ecaldqm::kPnDiodeDigi, ecaldqm::kSource, ecaldqm::kTowerIdErrors, ecaldqm::kTrigPrimDigi, and ecaldqm::kTrigPrimEmulDigi.

Referenced by EcalDQMonitorTask().

94 {
95  using namespace std;
96  typedef multimap<Collections, Collections>::const_iterator mmiter;
97 
98  vector<Collections> preSchedule;
99  vector<Collections>::iterator insertPoint, findPoint;
100 
101  for(vector<Collections>::const_iterator colItr(_usedCollections.begin()); colItr != _usedCollections.end(); ++colItr){
102 
103  bool inserted(true);
104  if((insertPoint = find(preSchedule.begin(), preSchedule.end(), *colItr)) == preSchedule.end()) inserted = false;
105 
106  pair<mmiter, mmiter> range(_dependencies.equal_range(*colItr));
107 
108  for(mmiter depItr(range.first); depItr != range.second; ++depItr){
109 
110  if(depItr->second == depItr->first)
111  throw cms::Exception("Fatal") << "Collection " << depItr->second << " depends on itself";
112  if(find(_usedCollections.begin(), _usedCollections.end(), depItr->second) == _usedCollections.end())
113  throw cms::Exception("Fatal") << "Collection " << depItr->first << " depends on Collection " << depItr->second;
114 
115  if((findPoint = find(preSchedule.begin(), preSchedule.end(), depItr->second)) == preSchedule.end())
116  preSchedule.insert(insertPoint, depItr->second);
117  else if(findPoint > insertPoint)
118  throw cms::Exception("InvalidConfiguration") << "Circular dependencies in Collections";
119 
120  }
121 
122  if(!inserted) preSchedule.push_back(*colItr);
123 
124  }
125 
126  for(vector<Collections>::const_iterator colItr(preSchedule.begin()); colItr != preSchedule.end(); ++colItr){
127  std::pair<Processor, Collections> sch;
128 
129  switch(*colItr){
130  case kSource:
131  sch.first = &EcalDQMonitorTask::runOnCollection<FEDRawDataCollection>; break;
132  case kEcalRawData:
133  sch.first = &EcalDQMonitorTask::runOnCollection<EcalRawDataCollection>; break;
134  case kGainErrors:
135  sch.first = &EcalDQMonitorTask::runOnCollection<DetIdCollection>; break;
136  case kChIdErrors:
137  sch.first = &EcalDQMonitorTask::runOnCollection<DetIdCollection>; break;
138  case kGainSwitchErrors:
139  sch.first = &EcalDQMonitorTask::runOnCollection<DetIdCollection>; break;
140  case kTowerIdErrors:
141  sch.first = &EcalDQMonitorTask::runOnCollection<EcalElectronicsIdCollection>; break;
142  case kBlockSizeErrors:
143  sch.first = &EcalDQMonitorTask::runOnCollection<EcalElectronicsIdCollection>; break;
144  case kMEMTowerIdErrors:
145  sch.first = &EcalDQMonitorTask::runOnCollection<EcalElectronicsIdCollection>; break;
146  case kMEMBlockSizeErrors:
147  sch.first = &EcalDQMonitorTask::runOnCollection<EcalElectronicsIdCollection>; break;
148  case kMEMChIdErrors:
149  sch.first = &EcalDQMonitorTask::runOnCollection<EcalElectronicsIdCollection>; break;
150  case kMEMGainErrors:
151  sch.first = &EcalDQMonitorTask::runOnCollection<EcalElectronicsIdCollection>; break;
152  case kEBSrFlag:
153  sch.first = &EcalDQMonitorTask::runOnCollection<EBSrFlagCollection>; break;
154  case kEESrFlag:
155  sch.first = &EcalDQMonitorTask::runOnCollection<EESrFlagCollection>; break;
156  case kEBDigi:
157  sch.first = &EcalDQMonitorTask::runOnCollection<EBDigiCollection>; break;
158  case kEEDigi:
159  sch.first = &EcalDQMonitorTask::runOnCollection<EEDigiCollection>; break;
160  case kPnDiodeDigi:
161  sch.first = &EcalDQMonitorTask::runOnCollection<EcalPnDiodeDigiCollection>; break;
162  case kTrigPrimDigi:
163  sch.first = &EcalDQMonitorTask::runOnCollection<EcalTrigPrimDigiCollection>; break;
164  case kTrigPrimEmulDigi:
165  sch.first = &EcalDQMonitorTask::runOnCollection<EcalTrigPrimDigiCollection>; break;
166  case kEBUncalibRecHit:
167  sch.first = &EcalDQMonitorTask::runOnCollection<EcalUncalibratedRecHitCollection>; break;
168  case kEEUncalibRecHit:
169  sch.first = &EcalDQMonitorTask::runOnCollection<EcalUncalibratedRecHitCollection>; break;
170  case kEBRecHit:
171  sch.first = &EcalDQMonitorTask::runOnCollection<EcalRecHitCollection>; break;
172  case kEERecHit:
173  sch.first = &EcalDQMonitorTask::runOnCollection<EcalRecHitCollection>; break;
174  case kEBBasicCluster:
175  sch.first = &EcalDQMonitorTask::runOnCollection<reco::BasicClusterCollection>; break;
176  case kEEBasicCluster:
177  sch.first = &EcalDQMonitorTask::runOnCollection<reco::BasicClusterCollection>; break;
178  case kEBSuperCluster:
179  sch.first = &EcalDQMonitorTask::runOnCollection<reco::SuperClusterCollection>; break;
180  case kEESuperCluster:
181  sch.first = &EcalDQMonitorTask::runOnCollection<reco::SuperClusterCollection>; break;
182  default:
183  throw cms::Exception("InvalidConfiguration") << "Undefined collection " << *colItr;
184  }
185 
186  sch.second = *colItr;
187 
188  schedule_.push_back(sch);
189  }
190 
191 }
static const char *const kSource
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
std::vector< std::pair< Processor, ecaldqm::Collections > > schedule_
template<class C >
void EcalDQMonitorTask::runOnCollection ( const edm::Event _evt,
ecaldqm::Collections  _colName 
)
private

Definition at line 23 of file EcalDQMonitorTask2.cc.

References ecaldqm::DQWorkerTask::analyze(), begin, edm::hlt::Exception, edm::Event::getByLabel(), and edm::Handle< T >::product().

24 {
25  edm::Handle<C> hndl;
26  if(_evt.getByLabel(collectionTags_[_colName], hndl)){
27 
28  TStopwatch* sw(0);
29  if(evaluateTime_){
30  sw = new TStopwatch;
31  sw->Stop();
32  }
33 
34  DQWorkerTask* task(0);
35 
36  for(std::vector<DQWorkerTask *>::iterator wItr(taskLists_[_colName].begin()); wItr != taskLists_[_colName].end(); ++wItr){
37  task = *wItr;
38  if(evaluateTime_) sw->Start();
39  if(enabled_[task]) task->analyze(hndl.product(), _colName);
40  if(evaluateTime_){
41  sw->Stop();
42  taskTimes_[task] += sw->RealTime();
43  }
44  }
45 
46  delete sw;
47  }
48  else if(!allowMissingCollections_)
49  throw cms::Exception("ObjectNotFound") << "Collection with InputTag " << collectionTags_[_colName] << " does not exist";
50 }
std::map< ecaldqm::DQWorkerTask *, bool > enabled_
std::map< ecaldqm::DQWorkerTask *, double > taskTimes_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
std::vector< ecaldqm::DQWorkerTask * > taskLists_[ecaldqm::nCollections]
T const * product() const
Definition: Handle.h:74
#define begin
Definition: vmac.h:31
edm::InputTag collectionTags_[ecaldqm::nCollections]
template<>
void EcalDQMonitorTask::runOnCollection ( const edm::Event _evt,
Collections  _colName 
)
private

Definition at line 54 of file EcalDQMonitorTask2.cc.

References ecaldqm::DQWorkerTask::analyze(), begin, edm::hlt::Exception, and edm::EDCollection< T >::push_back().

55 {
58  if(_evt.getByLabel(collectionTags_[_colName], ebHndl) && _evt.getByLabel(collectionTags_[_colName], eeHndl)){
59  unsigned nEB(ebHndl->size());
60  unsigned nEE(eeHndl->size());
61 
62  if(nEB == 0 && nEE == 0) return;
63 
64  DetIdCollection ids;
65  for(unsigned iId(0); iId < nEB; iId++) ids.push_back(DetId(ebHndl->at(iId)));
66  for(unsigned iId(0); iId < nEE; iId++) ids.push_back(DetId(eeHndl->at(iId)));
67 
68  TStopwatch* sw(0);
69  if(evaluateTime_){
70  sw = new TStopwatch;
71  sw->Stop();
72  }
73 
74  DQWorkerTask* task(0);
75 
76  for(std::vector<DQWorkerTask *>::iterator wItr(taskLists_[_colName].begin()); wItr != taskLists_[_colName].end(); ++wItr){
77  task = *wItr;
78  if(evaluateTime_) sw->Start();
79  if(enabled_[task]) task->analyze(const_cast<const DetIdCollection*>(&ids), _colName);
80  if(evaluateTime_){
81  sw->Stop();
82  taskTimes_[task] += sw->RealTime();
83  }
84  }
85 
86  delete sw;
87  }
88  else if(!allowMissingCollections_)
89  throw cms::Exception("ObjectNotFound") << "DetIdCollection with InputTag " << collectionTags_[_colName] << " does not exist";
90 }
std::map< ecaldqm::DQWorkerTask *, bool > enabled_
void push_back(T const &t)
Definition: EDCollection.h:68
std::map< ecaldqm::DQWorkerTask *, double > taskTimes_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
Definition: DetId.h:20
std::vector< ecaldqm::DQWorkerTask * > taskLists_[ecaldqm::nCollections]
#define begin
Definition: vmac.h:31
edm::InputTag collectionTags_[ecaldqm::nCollections]

Member Data Documentation

bool EcalDQMonitorTask::allowMissingCollections_
private

Definition at line 61 of file EcalDQMonitorTask.h.

edm::InputTag EcalDQMonitorTask::collectionTags_[ecaldqm::nCollections]
private

Definition at line 50 of file EcalDQMonitorTask.h.

Referenced by analyze(), and EcalDQMonitorTask().

std::map<ecaldqm::DQWorkerTask*, bool> EcalDQMonitorTask::enabled_
private

Definition at line 56 of file EcalDQMonitorTask.h.

Referenced by analyze().

bool EcalDQMonitorTask::evaluateTime_
private

Definition at line 59 of file EcalDQMonitorTask.h.

Referenced by endRun().

int EcalDQMonitorTask::ievt_
private

Definition at line 46 of file EcalDQMonitorTask.h.

Referenced by analyze(), beginRun(), and endRun().

std::vector<std::pair<Processor, ecaldqm::Collections> > EcalDQMonitorTask::schedule_
private
std::vector<ecaldqm::DQWorkerTask*> EcalDQMonitorTask::taskLists_[ecaldqm::nCollections]
private

Definition at line 54 of file EcalDQMonitorTask.h.

Referenced by EcalDQMonitorTask().

std::map<ecaldqm::DQWorkerTask*, double> EcalDQMonitorTask::taskTimes_
private

Definition at line 58 of file EcalDQMonitorTask.h.

Referenced by beginRun(), and endRun().

std::vector<ecaldqm::DQWorkerTask*> EcalDQMonitorTask::workers_
private