CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GpuTask.cc
Go to the documentation of this file.
2 
5 
8 
11 
12 namespace ecaldqm {
14  : DQWorkerTask(),
15  runGpuTask_(false),
16  gpuOnlyPlots_(false),
17  EBCpuDigis_(nullptr),
18  EECpuDigis_(nullptr),
19  EBCpuUncalibRecHits_(nullptr),
20  EECpuUncalibRecHits_(nullptr),
21  EBCpuRecHits_(nullptr),
22  EECpuRecHits_(nullptr) {}
23 
25  // Ensure we run on CPU objects before GPU objects
26  if (runGpuTask_) {
27  dependencies.push_back(Dependency(kEBGpuDigi, kEBCpuDigi));
28  dependencies.push_back(Dependency(kEEGpuDigi, kEECpuDigi));
29 
32 
35  }
36  }
37 
39  runGpuTask_ = params.getUntrackedParameter<bool>("runGpuTask");
40  // Only makes sense to run GPU-only plots if we're running at all...
41  gpuOnlyPlots_ = runGpuTask_ && params.getUntrackedParameter<bool>("gpuOnlyPlots");
42  uncalibOOTAmps_ = params.getUntrackedParameter<std::vector<int> >("uncalibOOTAmps");
43 
44  if (!runGpuTask_) {
45  MEs_.erase(std::string("DigiCpuAmplitude"));
46  MEs_.erase(std::string("DigiGpuCpuAmplitude"));
47  MEs_.erase(std::string("UncalibCpu"));
48  MEs_.erase(std::string("UncalibCpuAmp"));
49  MEs_.erase(std::string("UncalibCpuAmpError"));
50  MEs_.erase(std::string("UncalibCpuPedestal"));
51  MEs_.erase(std::string("UncalibCpuJitter"));
52  MEs_.erase(std::string("UncalibCpuJitterError"));
53  MEs_.erase(std::string("UncalibCpuChi2"));
54  MEs_.erase(std::string("UncalibCpuOOTAmp"));
55  MEs_.erase(std::string("UncalibCpuFlags"));
56  MEs_.erase(std::string("UncalibGpuCpu"));
57  MEs_.erase(std::string("UncalibGpuCpuAmp"));
58  MEs_.erase(std::string("UncalibGpuCpuAmpError"));
59  MEs_.erase(std::string("UncalibGpuCpuPedestal"));
60  MEs_.erase(std::string("UncalibGpuCpuJitter"));
61  MEs_.erase(std::string("UncalibGpuCpuJitterError"));
62  MEs_.erase(std::string("UncalibGpuCpuChi2"));
63  MEs_.erase(std::string("UncalibGpuCpuOOTAmp"));
64  MEs_.erase(std::string("UncalibGpuCpuFlags"));
65  MEs_.erase(std::string("RecHitCpu"));
66  MEs_.erase(std::string("RecHitCpuEnergy"));
67  MEs_.erase(std::string("RecHitCpuTime"));
68  MEs_.erase(std::string("RecHitCpuFlags"));
69  MEs_.erase(std::string("RecHitGpuCpu"));
70  MEs_.erase(std::string("RecHitGpuCpuEnergy"));
71  MEs_.erase(std::string("RecHitGpuCpuTime"));
72  MEs_.erase(std::string("RecHitGpuCpuFlags"));
73  }
74  if (!gpuOnlyPlots_) {
75  MEs_.erase(std::string("DigiGpuAmplitude"));
76  MEs_.erase(std::string("RecHitGpu"));
77  MEs_.erase(std::string("RecHitGpuEnergy"));
78  MEs_.erase(std::string("RecHitGpuTime"));
79  MEs_.erase(std::string("RecHitGpuFlags"));
80  MEs_.erase(std::string("UncalibGpu"));
81  MEs_.erase(std::string("UncalibGpuAmp"));
82  MEs_.erase(std::string("UncalibGpuAmpError"));
83  MEs_.erase(std::string("UncalibGpuPedestal"));
84  MEs_.erase(std::string("UncalibGpuJitter"));
85  MEs_.erase(std::string("UncalibGpuJitterError"));
86  MEs_.erase(std::string("UncalibGpuChi2"));
87  MEs_.erase(std::string("UncalibGpuOOTAmp"));
88  MEs_.erase(std::string("UncalibGpuFlags"));
89  }
90  }
91 
92  bool GpuTask::filterRunType(short const* runType) {
93  for (unsigned iFED(0); iFED != ecaldqm::nDCC; iFED++) {
94  if (runType[iFED] == EcalDCCHeaderBlock::COSMIC || runType[iFED] == EcalDCCHeaderBlock::MTCC ||
95  runType[iFED] == EcalDCCHeaderBlock::COSMICS_GLOBAL || runType[iFED] == EcalDCCHeaderBlock::PHYSICS_GLOBAL ||
96  runType[iFED] == EcalDCCHeaderBlock::COSMICS_LOCAL || runType[iFED] == EcalDCCHeaderBlock::PHYSICS_LOCAL)
97  return true;
98  }
99 
100  return false;
101  }
102 
103  void GpuTask::beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) {
104  EBCpuDigis_ = nullptr;
105  EECpuDigis_ = nullptr;
106  EBCpuUncalibRecHits_ = nullptr;
107  EECpuUncalibRecHits_ = nullptr;
108  EBCpuRecHits_ = nullptr;
109  EECpuRecHits_ = nullptr;
110  }
111 
112  template <typename DigiCollection>
113  void GpuTask::runOnCpuDigis(DigiCollection const& cpuDigis, Collections collection) {
114  MESet& meDigiCpu(MEs_.at("DigiCpu"));
115  MESet& meDigiCpuAmplitude(MEs_.at("DigiCpuAmplitude"));
116 
117  int iSubdet(collection == kEBCpuDigi ? EcalBarrel : EcalEndcap);
118 
119  // Save CpuDigis for comparison with GpuDigis
120  // "if constexpr" ensures cpuDigis is the correct type at compile time
121  if constexpr (std::is_same_v<DigiCollection, EBDigiCollection>) {
122  assert(iSubdet == EcalBarrel);
123  EBCpuDigis_ = &cpuDigis;
124  } else {
125  assert(iSubdet == EcalEndcap);
126  EECpuDigis_ = &cpuDigis;
127  }
128 
129  unsigned nCpuDigis(cpuDigis.size());
130  meDigiCpu.fill(getEcalDQMSetupObjects(), iSubdet, nCpuDigis);
131 
132  for (auto const& cpuDigi : cpuDigis) {
133  // EcalDataFrame is not a derived class of edm::DataFrame, but can take edm::DataFrame (digis) in the constructor
134  EcalDataFrame cpuDataFrame(cpuDigi);
135 
136  for (unsigned iSample = 0; iSample < ecalPh1::sampleSize; iSample++) {
137  static_cast<MESetMulti&>(meDigiCpuAmplitude).use(iSample);
138 
139  int cpuAmp(cpuDataFrame.sample(iSample).adc());
140  meDigiCpuAmplitude.fill(getEcalDQMSetupObjects(), iSubdet, cpuAmp);
141  }
142  }
143  }
144 
145  template <typename DigiCollection>
146  void GpuTask::runOnGpuDigis(DigiCollection const& gpuDigis, Collections collection) {
147  MESet& meDigiGpuCpu(MEs_.at("DigiGpuCpu"));
148  MESet& meDigiGpuCpuAmplitude(MEs_.at("DigiGpuCpuAmplitude"));
149 
150  int iSubdet(collection == kEBGpuDigi ? EcalBarrel : EcalEndcap);
151 
152  // Get CpuDigis saved from GpuTask::runOnCpuDigis() for this event
153  // "if constexpr" ensures cpuDigis is the correct type at compile time
154  // Note: gpuDigis is a collection and cpuDigis is a pointer to a collection (for historical reasons)
155  DigiCollection const* cpuDigis;
156  if constexpr (std::is_same_v<DigiCollection, EBDigiCollection>) {
157  assert(iSubdet == EcalBarrel);
158  cpuDigis = EBCpuDigis_;
159  } else {
160  assert(iSubdet == EcalEndcap);
161  cpuDigis = EECpuDigis_;
162  }
163 
164  if (!cpuDigis) {
165  edm::LogWarning("EcalDQM") << "GpuTask: Did not find " << ((iSubdet == EcalBarrel) ? "EB" : "EE")
166  << "CpuDigis Collection. Aborting runOnGpuDigis\n";
167  return;
168  }
169 
170  unsigned nGpuDigis(gpuDigis.size());
171  unsigned nCpuDigis(cpuDigis->size());
172 
173  meDigiGpuCpu.fill(getEcalDQMSetupObjects(), iSubdet, nGpuDigis - nCpuDigis);
174 
175  if (gpuOnlyPlots_) {
176  MESet& meDigiGpu(MEs_.at("DigiGpu"));
177  meDigiGpu.fill(getEcalDQMSetupObjects(), iSubdet, nGpuDigis);
178  }
179 
180  for (auto const& gpuDigi : gpuDigis) {
181  // Find CpuDigi with matching DetId
182  DetId gpuId(gpuDigi.id());
183  typename DigiCollection::const_iterator cpuItr(cpuDigis->find(gpuId));
184  if (cpuItr == cpuDigis->end()) {
185  edm::LogWarning("EcalDQM") << "GpuTask: Did not find CpuDigi DetId " << gpuId.rawId() << " in CPU collection\n";
186  continue;
187  }
188 
189  // EcalDataFrame is not a derived class of edm::DataFrame, but can take edm::DataFrame (digis) in the constructor
190  EcalDataFrame gpuDataFrame(gpuDigi);
191  EcalDataFrame cpuDataFrame(*cpuItr);
192 
193  for (unsigned iSample = 0; iSample < ecalPh1::sampleSize; iSample++) {
194  static_cast<MESetMulti&>(meDigiGpuCpuAmplitude).use(iSample);
195 
196  int gpuAmp(gpuDataFrame.sample(iSample).adc());
197  int cpuAmp(cpuDataFrame.sample(iSample).adc());
198 
199  meDigiGpuCpuAmplitude.fill(getEcalDQMSetupObjects(), iSubdet, gpuAmp - cpuAmp);
200 
201  if (gpuOnlyPlots_) {
202  MESet& meDigiGpuAmplitude(MEs_.at("DigiGpuAmplitude"));
203  static_cast<MESetMulti&>(meDigiGpuAmplitude).use(iSample);
204  meDigiGpuAmplitude.fill(getEcalDQMSetupObjects(), iSubdet, gpuAmp);
205  }
206  }
207  }
208  }
209 
211  MESet& meUncalibCpu(MEs_.at("UncalibCpu"));
212  MESet& meUncalibCpuAmp(MEs_.at("UncalibCpuAmp"));
213  MESet& meUncalibCpuAmpError(MEs_.at("UncalibCpuAmpError"));
214  MESet& meUncalibCpuPedestal(MEs_.at("UncalibCpuPedestal"));
215  MESet& meUncalibCpuJitter(MEs_.at("UncalibCpuJitter"));
216  MESet& meUncalibCpuJitterError(MEs_.at("UncalibCpuJitterError"));
217  MESet& meUncalibCpuChi2(MEs_.at("UncalibCpuChi2"));
218  MESet& meUncalibCpuOOTAmp(MEs_.at("UncalibCpuOOTAmp"));
219  MESet& meUncalibCpuFlags(MEs_.at("UncalibCpuFlags"));
220 
221  int iSubdet(collection == kEBCpuUncalibRecHit ? EcalBarrel : EcalEndcap);
222 
223  // Save CpuUncalibRecHits for comparison with GpuUncalibRecHits
224  if (iSubdet == EcalBarrel)
225  EBCpuUncalibRecHits_ = &cpuHits;
226  else
227  EECpuUncalibRecHits_ = &cpuHits;
228 
229  unsigned nCpuHits(cpuHits.size());
230  meUncalibCpu.fill(getEcalDQMSetupObjects(), iSubdet, nCpuHits);
231 
232  for (auto const& cpuHit : cpuHits) {
233  float cpuAmp(cpuHit.amplitude());
234  float cpuAmpError(cpuHit.amplitudeError());
235  float cpuPedestal(cpuHit.pedestal());
236  float cpuJitter(cpuHit.jitter());
237  float cpuJitterError(cpuHit.jitterError());
238  float cpuChi2(cpuHit.chi2());
239  uint32_t cpuFlags(cpuHit.flags());
240 
241  if (cpuJitterError == 10000) // Set this so 10000 (special value) shows up in last bin
242  cpuJitterError = 0.249999;
243 
244  meUncalibCpuAmp.fill(getEcalDQMSetupObjects(), iSubdet, cpuAmp);
245  meUncalibCpuAmpError.fill(getEcalDQMSetupObjects(), iSubdet, cpuAmpError);
246  meUncalibCpuPedestal.fill(getEcalDQMSetupObjects(), iSubdet, cpuPedestal);
247  meUncalibCpuJitter.fill(getEcalDQMSetupObjects(), iSubdet, cpuJitter);
248  meUncalibCpuJitterError.fill(getEcalDQMSetupObjects(), iSubdet, cpuJitterError);
249  meUncalibCpuChi2.fill(getEcalDQMSetupObjects(), iSubdet, cpuChi2);
250  meUncalibCpuFlags.fill(getEcalDQMSetupObjects(), iSubdet, cpuFlags);
251 
252  for (unsigned iAmp = 0; iAmp < uncalibOOTAmps_.size(); iAmp++) {
253  static_cast<MESetMulti&>(meUncalibCpuOOTAmp).use(iAmp);
254 
255  // Get corresponding OOT Amplitude
256  int cpuOOTAmp(cpuHit.outOfTimeAmplitude(uncalibOOTAmps_[iAmp]));
257  meUncalibCpuOOTAmp.fill(getEcalDQMSetupObjects(), iSubdet, cpuOOTAmp);
258  }
259  }
260  }
261 
263  MESet& meUncalibGpuCpu(MEs_.at("UncalibGpuCpu"));
264  MESet& meUncalibGpuCpuAmp(MEs_.at("UncalibGpuCpuAmp"));
265  MESet& meUncalibGpuCpuAmpError(MEs_.at("UncalibGpuCpuAmpError"));
266  MESet& meUncalibGpuCpuPedestal(MEs_.at("UncalibGpuCpuPedestal"));
267  MESet& meUncalibGpuCpuJitter(MEs_.at("UncalibGpuCpuJitter"));
268  MESet& meUncalibGpuCpuJitterError(MEs_.at("UncalibGpuCpuJitterError"));
269  MESet& meUncalibGpuCpuChi2(MEs_.at("UncalibGpuCpuChi2"));
270  MESet& meUncalibGpuCpuOOTAmp(MEs_.at("UncalibGpuCpuOOTAmp"));
271  MESet& meUncalibGpuCpuFlags(MEs_.at("UncalibGpuCpuFlags"));
272 
273  int iSubdet(collection == kEBGpuUncalibRecHit ? EcalBarrel : EcalEndcap);
274 
275  // Get CpuUncalibRecHits saved from GpuTask::runOnCpuUncalibRecHits() for this event
276  // Note: _gpuHits is a collection and cpuHits is a pointer to a collection (for historical reasons)
277  EcalUncalibratedRecHitCollection const* cpuHits =
279  if (!cpuHits) {
280  edm::LogWarning("EcalDQM") << "GpuTask: Did not find " << ((iSubdet == EcalBarrel) ? "EB" : "EE")
281  << "CpuUncalibRecHits Collection. Aborting runOnGpuUncalibRecHits\n";
282  return;
283  }
284 
285  unsigned nGpuHits(gpuHits.size());
286  unsigned nCpuHits(cpuHits->size());
287 
288  meUncalibGpuCpu.fill(getEcalDQMSetupObjects(), iSubdet, nGpuHits - nCpuHits);
289 
290  if (gpuOnlyPlots_) {
291  MESet& meUncalibGpu(MEs_.at("UncalibGpu"));
292  meUncalibGpu.fill(getEcalDQMSetupObjects(), iSubdet, nGpuHits);
293  }
294 
295  for (auto const& gpuHit : gpuHits) {
296  // Find CpuUncalibRecHit with matching DetId
297  DetId gpuId(gpuHit.id());
299  if (cpuItr == cpuHits->end()) {
300  edm::LogWarning("EcalDQM") << "GpuTask: Did not find GpuUncalibRecHit DetId " << gpuId.rawId()
301  << " in CPU collection\n";
302  continue;
303  }
304 
305  float gpuAmp(gpuHit.amplitude());
306  float gpuAmpError(gpuHit.amplitudeError());
307  float gpuPedestal(gpuHit.pedestal());
308  float gpuJitter(gpuHit.jitter());
309  float gpuJitterError(gpuHit.jitterError());
310  float gpuChi2(gpuHit.chi2());
311  uint32_t gpuFlags(gpuHit.flags());
312 
313  if (gpuJitterError == 10000) // Set this so 10000 (special value) shows up in last bin
314  gpuJitterError = 0.249999;
315 
316  float cpuAmp(cpuItr->amplitude());
317  float cpuAmpError(cpuItr->amplitudeError());
318  float cpuPedestal(cpuItr->pedestal());
319  float cpuJitter(cpuItr->jitter());
320  float cpuJitterError(cpuItr->jitterError());
321  float cpuChi2(cpuItr->chi2());
322  uint32_t cpuFlags(cpuItr->flags());
323 
324  if (cpuJitterError == 10000) // Set this so 10000 (special value) shows up in last bin
325  cpuJitterError = 0.249999;
326 
327  meUncalibGpuCpuAmp.fill(getEcalDQMSetupObjects(), iSubdet, gpuAmp - cpuAmp);
328  meUncalibGpuCpuAmpError.fill(getEcalDQMSetupObjects(), iSubdet, gpuAmpError - cpuAmpError);
329  meUncalibGpuCpuPedestal.fill(getEcalDQMSetupObjects(), iSubdet, gpuPedestal - cpuPedestal);
330  meUncalibGpuCpuJitter.fill(getEcalDQMSetupObjects(), iSubdet, gpuJitter - cpuJitter);
331  meUncalibGpuCpuJitterError.fill(getEcalDQMSetupObjects(), iSubdet, gpuJitterError - cpuJitterError);
332  meUncalibGpuCpuChi2.fill(getEcalDQMSetupObjects(), iSubdet, gpuChi2 - cpuChi2);
333  meUncalibGpuCpuFlags.fill(getEcalDQMSetupObjects(), iSubdet, gpuFlags - cpuFlags);
334 
335  if (gpuOnlyPlots_) {
336  MESet& meUncalibGpuAmp(MEs_.at("UncalibGpuAmp"));
337  MESet& meUncalibGpuAmpError(MEs_.at("UncalibGpuAmpError"));
338  MESet& meUncalibGpuPedestal(MEs_.at("UncalibGpuPedestal"));
339  MESet& meUncalibGpuJitter(MEs_.at("UncalibGpuJitter"));
340  MESet& meUncalibGpuJitterError(MEs_.at("UncalibGpuJitterError"));
341  MESet& meUncalibGpuChi2(MEs_.at("UncalibGpuChi2"));
342  MESet& meUncalibGpuFlags(MEs_.at("UncalibGpuFlags"));
343 
344  meUncalibGpuAmp.fill(getEcalDQMSetupObjects(), iSubdet, gpuAmp);
345  meUncalibGpuAmpError.fill(getEcalDQMSetupObjects(), iSubdet, gpuAmpError);
346  meUncalibGpuPedestal.fill(getEcalDQMSetupObjects(), iSubdet, gpuPedestal);
347  meUncalibGpuJitter.fill(getEcalDQMSetupObjects(), iSubdet, gpuJitter);
348  meUncalibGpuJitterError.fill(getEcalDQMSetupObjects(), iSubdet, gpuJitterError);
349  meUncalibGpuChi2.fill(getEcalDQMSetupObjects(), iSubdet, gpuChi2);
350  meUncalibGpuFlags.fill(getEcalDQMSetupObjects(), iSubdet, gpuFlags);
351  }
352 
353  for (unsigned iAmp = 0; iAmp < uncalibOOTAmps_.size(); iAmp++) {
354  static_cast<MESetMulti&>(meUncalibGpuCpuOOTAmp).use(iAmp);
355 
356  // Get corresponding OOT Amplitude
357  int gpuOOTAmp(gpuHit.outOfTimeAmplitude(uncalibOOTAmps_[iAmp]));
358  int cpuOOTAmp(cpuItr->outOfTimeAmplitude(uncalibOOTAmps_[iAmp]));
359 
360  meUncalibGpuCpuOOTAmp.fill(getEcalDQMSetupObjects(), iSubdet, gpuOOTAmp - cpuOOTAmp);
361 
362  if (gpuOnlyPlots_) {
363  MESet& meUncalibGpuOOTAmp(MEs_.at("UncalibGpuOOTAmp"));
364  static_cast<MESetMulti&>(meUncalibGpuOOTAmp).use(iAmp);
365  meUncalibGpuOOTAmp.fill(getEcalDQMSetupObjects(), iSubdet, gpuOOTAmp);
366  }
367  }
368  }
369  }
370 
372  MESet& meRecHitCpu(MEs_.at("RecHitCpu"));
373  MESet& meRecHitCpuEnergy(MEs_.at("RecHitCpuEnergy"));
374  MESet& meRecHitCpuTime(MEs_.at("RecHitCpuTime"));
375  MESet& meRecHitCpuFlags(MEs_.at("RecHitCpuFlags"));
376 
377  int iSubdet(collection == kEBCpuRecHit ? EcalBarrel : EcalEndcap);
378 
379  // Save CpuRecHits for comparison with GpuRecHits
380  if (iSubdet == EcalBarrel)
381  EBCpuRecHits_ = &cpuHits;
382  else
383  EECpuRecHits_ = &cpuHits;
384 
385  unsigned nCpuHits(cpuHits.size());
386  meRecHitCpu.fill(getEcalDQMSetupObjects(), iSubdet, nCpuHits);
387 
388  for (auto const& cpuHit : cpuHits) {
389  float cpuEnergy(cpuHit.energy());
390  float cpuTime(cpuHit.time());
391  uint32_t cpuFlags(cpuHit.flagsBits());
392 
393  meRecHitCpuEnergy.fill(getEcalDQMSetupObjects(), iSubdet, cpuEnergy);
394  meRecHitCpuTime.fill(getEcalDQMSetupObjects(), iSubdet, cpuTime);
395  meRecHitCpuFlags.fill(getEcalDQMSetupObjects(), iSubdet, cpuFlags);
396  }
397  }
398 
400  MESet& meRecHitGpuCpu(MEs_.at("RecHitGpuCpu"));
401  MESet& meRecHitGpuCpuEnergy(MEs_.at("RecHitGpuCpuEnergy"));
402  MESet& meRecHitGpuCpuTime(MEs_.at("RecHitGpuCpuTime"));
403  MESet& meRecHitGpuCpuFlags(MEs_.at("RecHitGpuCpuFlags"));
404 
405  int iSubdet(collection == kEBGpuRecHit ? EcalBarrel : EcalEndcap);
406 
407  // Get CpuRecHits saved from GpuTask::runOnCpuRecHits() for this event
408  // Note: _gpuHits is a collection and cpuHits is a pointer to a collection (for historical reasons)
409  EcalRecHitCollection const* cpuHits = (iSubdet == EcalBarrel) ? EBCpuRecHits_ : EECpuRecHits_;
410  if (!cpuHits) {
411  edm::LogWarning("EcalDQM") << "GpuTask: Did not find " << ((iSubdet == EcalBarrel) ? "EB" : "EE")
412  << "CpuRecHits Collection. Aborting runOnGpuRecHits\n";
413  return;
414  }
415 
416  unsigned nGpuHits(gpuHits.size());
417  unsigned nCpuHits(cpuHits->size());
418 
419  meRecHitGpuCpu.fill(getEcalDQMSetupObjects(), iSubdet, nGpuHits - nCpuHits);
420 
421  if (gpuOnlyPlots_) {
422  MESet& meRecHitGpu(MEs_.at("RecHitGpu"));
423  meRecHitGpu.fill(getEcalDQMSetupObjects(), iSubdet, nGpuHits);
424  }
425 
426  for (auto const& gpuHit : gpuHits) {
427  // Find CpuRecHit with matching DetId
428  DetId gpuId(gpuHit.detid());
429  EcalRecHitCollection::const_iterator cpuItr(cpuHits->find(gpuId));
430  if (cpuItr == cpuHits->end()) {
431  edm::LogWarning("EcalDQM") << "GpuTask: Did not find GpuRecHit DetId " << gpuId.rawId()
432  << " in CPU collection\n";
433  continue;
434  }
435 
436  float gpuEnergy(gpuHit.energy());
437  float gpuTime(gpuHit.time());
438  uint32_t gpuFlags(gpuHit.flagsBits());
439 
440  float cpuEnergy(cpuItr->energy());
441  float cpuTime(cpuItr->time());
442  uint32_t cpuFlags(cpuItr->flagsBits());
443 
444  meRecHitGpuCpuEnergy.fill(getEcalDQMSetupObjects(), iSubdet, gpuEnergy - cpuEnergy);
445  meRecHitGpuCpuTime.fill(getEcalDQMSetupObjects(), iSubdet, gpuTime - cpuTime);
446  meRecHitGpuCpuFlags.fill(getEcalDQMSetupObjects(), iSubdet, gpuFlags - cpuFlags);
447 
448  if (gpuOnlyPlots_) {
449  MESet& meRecHitGpuEnergy(MEs_.at("RecHitGpuEnergy"));
450  MESet& meRecHitGpuTime(MEs_.at("RecHitGpuTime"));
451  MESet& meRecHitGpuFlags(MEs_.at("RecHitGpuFlags"));
452 
453  meRecHitGpuEnergy.fill(getEcalDQMSetupObjects(), iSubdet, gpuEnergy);
454  meRecHitGpuTime.fill(getEcalDQMSetupObjects(), iSubdet, gpuTime);
455  meRecHitGpuFlags.fill(getEcalDQMSetupObjects(), iSubdet, gpuFlags);
456  }
457  }
458  }
459 
461 } // namespace ecaldqm
bool runGpuTask_
Definition: GpuTask.h:35
T getUntrackedParameter(std::string const &, T const &) const
void addDependencies(DependencySet &) override
Definition: GpuTask.cc:24
#define DEFINE_ECALDQM_WORKER(TYPE)
Definition: DQWorker.h:162
EBDigiCollection const * EBCpuDigis_
Definition: GpuTask.h:39
void runOnGpuRecHits(EcalRecHitCollection const &, Collections)
Definition: GpuTask.cc:399
bool filterRunType(short const *) override
Definition: GpuTask.cc:92
MESet & at(const std::string &key)
Definition: MESet.h:399
tuple dependencies
Definition: symbols.py:21
void runOnCpuUncalibRecHits(EcalUncalibratedRecHitCollection const &, Collections)
Definition: GpuTask.cc:210
std::vector< T >::const_iterator const_iterator
EcalMGPASample sample(int i) const
Definition: EcalDataFrame.h:29
tuple runType
Definition: runPedHist.py:37
EEDigiCollection const * EECpuDigis_
Definition: GpuTask.h:40
assert(be >=bs)
EcalRecHitCollection const * EECpuRecHits_
Definition: GpuTask.h:46
void fill(EcalDQMSetupObjects const edso, DetId const &_id, double _xyw=1., double _yw=1., double _w=1.) override
Definition: MESetMulti.h:29
void setParams(edm::ParameterSet const &) override
Definition: GpuTask.cc:38
void runOnGpuUncalibRecHits(EcalUncalibratedRecHitCollection const &, Collections)
Definition: GpuTask.cc:262
virtual void fill(EcalDQMSetupObjects const, DetId const &, double=1., double=1., double=1.)
Definition: MESet.h:74
void beginEvent(edm::Event const &, edm::EventSetup const &, bool const &, bool &) override
Definition: GpuTask.cc:103
EcalRecHitCollection const * EBCpuRecHits_
Definition: GpuTask.h:45
const_iterator end() const
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:142
Definition: DetId.h:17
std::vector< int > uncalibOOTAmps_
Definition: GpuTask.h:37
MESetCollection MEs_
Definition: DQWorker.h:125
void runOnGpuDigis(DigiCollection const &, Collections)
Definition: GpuTask.cc:146
static constexpr unsigned int sampleSize
Definition: EcalConstants.h:30
iterator find(key_type k)
size_type size() const
bool gpuOnlyPlots_
Definition: GpuTask.h:36
EcalUncalibratedRecHitCollection const * EECpuUncalibRecHits_
Definition: GpuTask.h:43
EcalUncalibratedRecHitCollection const * EBCpuUncalibRecHits_
Definition: GpuTask.h:42
Log< level::Warning, false > LogWarning
void push_back(Dependency const &_d)
Definition: DQWorkerTask.h:46
void erase(const std::string &key)
Definition: MESet.h:390
void runOnCpuRecHits(EcalRecHitCollection const &, Collections)
Definition: GpuTask.cc:371
void runOnCpuDigis(DigiCollection const &, Collections)
Definition: GpuTask.cc:113
int adc() const
get the ADC sample (12 bits)