CMS 3D CMS Logo

EcalDQMonitorTask2.cc
Go to the documentation of this file.
2 
4 
18 
19 template <typename CollectionClass>
22  std::set<ecaldqm::DQWorker*> const& _enabledTasks) {
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 }
45 
46 void EcalDQMonitorTask::formSchedule(std::vector<ecaldqm::Collections> const& _preSchedule,
47  edm::ParameterSet const& _tagPSet) {
48  for (std::vector<ecaldqm::Collections>::const_iterator colItr(_preSchedule.begin()); colItr != _preSchedule.end();
49  ++colItr) {
50  std::pair<Processor, ecaldqm::Collections> sch;
51 
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 }
ecaldqm::kEBTestPulseUncalibRecHit
Definition: Collections.h:34
Handle.h
EcalDQMonitorTask.h
MessageLogger.h
ecaldqm::EcalDQMonitor::moduleName_
const std::string moduleName_
Definition: EcalDQMonitor.h:41
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
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:45
ecaldqm::kEEReducedRecHit
Definition: Collections.h:39
ecaldqm::kEEDigi
Definition: Collections.h:26
ecaldqm::EcalDQMonitor::verbosity_
const int verbosity_
Definition: EcalDQMonitor.h:42
ecaldqm::kMEMChIdErrors
Definition: Collections.h:21
EcalDetIdCollections.h
edm::LogInfo
Definition: MessageLogger.h:254
ecaldqm::kEBGainErrors
Definition: Collections.h:11
ecaldqm::kEESrFlag
Definition: Collections.h:24
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
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
ecaldqm::EcalDQMonitor::executeOnWorkers_
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1)
Definition: EcalDQMonitor.h:46
ecaldqm::kEBChIdErrors
Definition: Collections.h:13
EcalRecHitCollections.h
ecaldqm::kEEGainErrors
Definition: Collections.h:12
ecaldqm::DQWorker
Definition: DQWorker.h:28
ecaldqm::kEETestPulseUncalibRecHit
Definition: Collections.h:35
EcalRawDataCollections.h
ecaldqm::kTowerIdErrors
Definition: Collections.h:17
ecaldqm::kEBUncalibRecHit
Definition: Collections.h:30
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
EcalDigiCollections.h
ecaldqm::kEBRecHit
Definition: Collections.h:36
ecaldqm::kEEChIdErrors
Definition: Collections.h:14
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
edm::LogWarning
Definition: MessageLogger.h:141
edm::View
Definition: CaloClusterFwd.h:14
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
ecaldqm::kEBSrFlag
Definition: Collections.h:23
EcalDQMonitorTask::runOnCollection
void runOnCollection(edm::Event const &, ecaldqm::Collections, std::set< ecaldqm::DQWorker * > const &)
Definition: EcalDQMonitorTask2.cc:20
universalConfigTemplate.collection
collection
Definition: universalConfigTemplate.py:81
FEDRawDataCollection.h
ecaldqm::Collections
Collections
Definition: Collections.h:8
ecaldqm::kPnDiodeDigi
Definition: Collections.h:27
ecaldqm::kEBLaserLedUncalibRecHit
Definition: Collections.h:32
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
ecaldqm::kEBSuperCluster
Definition: Collections.h:42
SuperClusterFwd.h
ecaldqm::kEBDigi
Definition: Collections.h:25
EcalDQMonitorTask::schedule_
std::vector< std::pair< Processor, ecaldqm::Collections > > schedule_
Definition: EcalDQMonitorTask.h:46
DQWorkerTask.h
Exception
Definition: hltDiff.cc:246
ecaldqm::kMEMGainErrors
Definition: Collections.h:22
ecaldqm::kEEUncalibRecHit
Definition: Collections.h:31
ecaldqm::kMEMTowerIdErrors
Definition: Collections.h:19
ecaldqm::kEBReducedRecHit
Definition: Collections.h:38
Exception.h
EcalDQMonitorTask::allowMissingCollections_
bool allowMissingCollections_
Definition: EcalDQMonitorTask.h:47
View.h
ParameterSet.h
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:126
ecaldqm::kEEBasicCluster
Definition: Collections.h:41
edm::Event
Definition: Event.h:73
ecaldqm::kBlockSizeErrors
Definition: Collections.h:18
ecaldqm::kEBGainSwitchErrors
Definition: Collections.h:15
edm::InputTag
Definition: InputTag.h:15
CaloCluster.h