17 enableUncalib_(
false),
27 EBCpuUncalibRecHits_(nullptr),
28 EECpuUncalibRecHits_(nullptr),
29 EBCpuRecHits_(nullptr),
30 EECpuRecHits_(nullptr) {}
164 template <
typename DigiCollection>
167 MESet& meDigiCpuAmplitude(
MEs_.
at(
"DigiCpuAmplitude"));
173 if constexpr (std::is_same_v<DigiCollection, EBDigiCollection>) {
181 unsigned nCpuDigis(cpuDigis.size());
184 for (
auto const& cpuDigi : cpuDigis) {
189 static_cast<MESetMulti&
>(meDigiCpuAmplitude).use(iSample);
191 int cpuAmp(cpuDataFrame.
sample(iSample).
adc());
197 template <
typename DigiCollection>
200 MESet& meDigiGpuCpuAmplitude(
MEs_.
at(
"DigiGpuCpuAmplitude"));
208 if constexpr (std::is_same_v<DigiCollection, EBDigiCollection>) {
218 <<
"CpuDigis Collection. Aborting runOnGpuDigis\n";
222 unsigned nGpuDigis(gpuDigis.size());
223 unsigned nCpuDigis(cpuDigis->size());
237 for (
auto const& gpuDigi : gpuDigis) {
239 DetId gpuId(gpuDigi.id());
240 typename DigiCollection::const_iterator cpuItr(cpuDigis->find(gpuId));
241 if (cpuItr == cpuDigis->end()) {
242 edm::LogWarning(
"EcalDQM") <<
"GpuTask: Did not find CpuDigi DetId " << gpuId.rawId() <<
" in CPU collection\n";
251 static_cast<MESetMulti&
>(meDigiGpuCpuAmplitude).use(iSample);
253 int gpuAmp(gpuDataFrame.
sample(iSample).
adc());
254 int cpuAmp(cpuDataFrame.
sample(iSample).
adc());
259 MESet& meDigiGpuAmplitude(
MEs_.
at(
"DigiGpuAmplitude"));
260 static_cast<MESetMulti&
>(meDigiGpuAmplitude).use(iSample);
265 MESet& meDigi2DAmplitude(
MEs_.
at(
"Digi2DAmplitude"));
266 static_cast<MESetMulti&
>(meDigi2DAmplitude).use(iSample);
276 MESet& meUncalibCpuAmpError(
MEs_.
at(
"UncalibCpuAmpError"));
277 MESet& meUncalibCpuPedestal(
MEs_.
at(
"UncalibCpuPedestal"));
278 MESet& meUncalibCpuJitter(
MEs_.
at(
"UncalibCpuJitter"));
279 MESet& meUncalibCpuJitterError(
MEs_.
at(
"UncalibCpuJitterError"));
280 MESet& meUncalibCpuChi2(
MEs_.
at(
"UncalibCpuChi2"));
281 MESet& meUncalibCpuOOTAmp(
MEs_.
at(
"UncalibCpuOOTAmp"));
282 MESet& meUncalibCpuFlags(
MEs_.
at(
"UncalibCpuFlags"));
292 unsigned nCpuHits(cpuHits.
size());
295 for (
auto const& cpuHit : cpuHits) {
296 float cpuAmp(cpuHit.amplitude());
297 float cpuAmpError(cpuHit.amplitudeError());
298 float cpuPedestal(cpuHit.pedestal());
299 float cpuJitter(cpuHit.jitter());
300 float cpuJitterError(cpuHit.jitterError());
301 float cpuChi2(cpuHit.chi2());
302 uint32_t cpuFlags(cpuHit.flags());
304 if (cpuJitterError == 10000)
305 cpuJitterError = 0.249999;
316 static_cast<MESetMulti&
>(meUncalibCpuOOTAmp).use(iAmp);
327 MESet& meUncalibGpuCpuAmp(
MEs_.
at(
"UncalibGpuCpuAmp"));
328 MESet& meUncalibGpuCpuAmpError(
MEs_.
at(
"UncalibGpuCpuAmpError"));
329 MESet& meUncalibGpuCpuPedestal(
MEs_.
at(
"UncalibGpuCpuPedestal"));
330 MESet& meUncalibGpuCpuJitter(
MEs_.
at(
"UncalibGpuCpuJitter"));
331 MESet& meUncalibGpuCpuJitterError(
MEs_.
at(
"UncalibGpuCpuJitterError"));
332 MESet& meUncalibGpuCpuChi2(
MEs_.
at(
"UncalibGpuCpuChi2"));
333 MESet& meUncalibGpuCpuOOTAmp(
MEs_.
at(
"UncalibGpuCpuOOTAmp"));
334 MESet& meUncalibGpuCpuFlags(
MEs_.
at(
"UncalibGpuCpuFlags"));
344 <<
"CpuUncalibRecHits Collection. Aborting runOnGpuUncalibRecHits\n";
348 unsigned nGpuHits(gpuHits.
size());
349 unsigned nCpuHits(cpuHits->
size());
363 for (
auto const& gpuHit : gpuHits) {
365 DetId gpuId(gpuHit.id());
367 if (cpuItr == cpuHits->
end()) {
368 edm::LogWarning(
"EcalDQM") <<
"GpuTask: Did not find GpuUncalibRecHit DetId " << gpuId.rawId()
369 <<
" in CPU collection\n";
373 float gpuAmp(gpuHit.amplitude());
374 float gpuAmpError(gpuHit.amplitudeError());
375 float gpuPedestal(gpuHit.pedestal());
376 float gpuJitter(gpuHit.jitter());
377 float gpuJitterError(gpuHit.jitterError());
378 float gpuChi2(gpuHit.chi2());
379 uint32_t gpuFlags(gpuHit.flags());
381 if (gpuJitterError == 10000)
382 gpuJitterError = 0.249999;
384 float cpuAmp(cpuItr->amplitude());
385 float cpuAmpError(cpuItr->amplitudeError());
386 float cpuPedestal(cpuItr->pedestal());
387 float cpuJitter(cpuItr->jitter());
388 float cpuJitterError(cpuItr->jitterError());
389 float cpuChi2(cpuItr->chi2());
390 uint32_t cpuFlags(cpuItr->flags());
392 if (cpuJitterError == 10000)
393 cpuJitterError = 0.249999;
405 MESet& meUncalibGpuAmpError(
MEs_.
at(
"UncalibGpuAmpError"));
406 MESet& meUncalibGpuPedestal(
MEs_.
at(
"UncalibGpuPedestal"));
407 MESet& meUncalibGpuJitter(
MEs_.
at(
"UncalibGpuJitter"));
408 MESet& meUncalibGpuJitterError(
MEs_.
at(
"UncalibGpuJitterError"));
409 MESet& meUncalibGpuChi2(
MEs_.
at(
"UncalibGpuChi2"));
410 MESet& meUncalibGpuFlags(
MEs_.
at(
"UncalibGpuFlags"));
423 MESet& meUncalib2DAmpError(
MEs_.
at(
"Uncalib2DAmpError"));
424 MESet& meUncalib2DPedestal(
MEs_.
at(
"Uncalib2DPedestal"));
425 MESet& meUncalib2DJitter(
MEs_.
at(
"Uncalib2DJitter"));
426 MESet& meUncalib2DJitterError(
MEs_.
at(
"Uncalib2DJitterError"));
428 MESet& meUncalib2DFlags(
MEs_.
at(
"Uncalib2DFlags"));
440 static_cast<MESetMulti&
>(meUncalibGpuCpuOOTAmp).use(iAmp);
449 MESet& meUncalibGpuOOTAmp(
MEs_.
at(
"UncalibGpuOOTAmp"));
450 static_cast<MESetMulti&
>(meUncalibGpuOOTAmp).use(iAmp);
455 MESet& meUncalib2DOOTAmp(
MEs_.
at(
"Uncalib2DOOTAmp"));
456 static_cast<MESetMulti&
>(meUncalib2DOOTAmp).use(iAmp);
465 MESet& meRecHitCpuEnergy(
MEs_.
at(
"RecHitCpuEnergy"));
467 MESet& meRecHitCpuFlags(
MEs_.
at(
"RecHitCpuFlags"));
477 unsigned nCpuHits(cpuHits.
size());
480 for (
auto const& cpuHit : cpuHits) {
481 float cpuEnergy(cpuHit.energy());
482 float cpuTime(cpuHit.time());
483 uint32_t cpuFlags(cpuHit.flagsBits());
493 MESet& meRecHitGpuCpuEnergy(
MEs_.
at(
"RecHitGpuCpuEnergy"));
494 MESet& meRecHitGpuCpuTime(
MEs_.
at(
"RecHitGpuCpuTime"));
495 MESet& meRecHitGpuCpuFlags(
MEs_.
at(
"RecHitGpuCpuFlags"));
504 <<
"CpuRecHits Collection. Aborting runOnGpuRecHits\n";
508 unsigned nGpuHits(gpuHits.
size());
509 unsigned nCpuHits(cpuHits->
size());
522 for (
auto const& gpuHit : gpuHits) {
524 DetId gpuId(gpuHit.detid());
526 if (cpuItr == cpuHits->
end()) {
527 edm::LogWarning(
"EcalDQM") <<
"GpuTask: Did not find GpuRecHit DetId " << gpuId.rawId()
528 <<
" in CPU collection\n";
532 float gpuEnergy(gpuHit.energy());
533 float gpuTime(gpuHit.time());
534 uint32_t gpuFlags(gpuHit.flagsBits());
536 float cpuEnergy(cpuItr->energy());
537 float cpuTime(cpuItr->time());
538 uint32_t cpuFlags(cpuItr->flagsBits());
545 MESet& meRecHitGpuEnergy(
MEs_.
at(
"RecHitGpuEnergy"));
547 MESet& meRecHitGpuFlags(
MEs_.
at(
"RecHitGpuFlags"));
555 MESet& meRecHit2DEnergy(
MEs_.
at(
"RecHit2DEnergy"));
void addDependencies(DependencySet &) override
#define DEFINE_ECALDQM_WORKER(TYPE)
EBDigiCollection const * EBCpuDigis_
void runOnGpuRecHits(EcalRecHitCollection const &, Collections)
bool filterRunType(short const *) override
MESet & at(const std::string &key)
void runOnCpuUncalibRecHits(EcalUncalibratedRecHitCollection const &, Collections)
std::vector< T >::const_iterator const_iterator
EEDigiCollection const * EECpuDigis_
EcalRecHitCollection const * EECpuRecHits_
void fill(EcalDQMSetupObjects const edso, DetId const &_id, double _xyw=1., double _yw=1., double _w=1.) override
void setParams(edm::ParameterSet const &) override
void runOnGpuUncalibRecHits(EcalUncalibratedRecHitCollection const &, Collections)
EcalMGPASample sample(int i) const
virtual void fill(EcalDQMSetupObjects const, DetId const &, double=1., double=1., double=1.)
void beginEvent(edm::Event const &, edm::EventSetup const &, bool const &, bool &) override
EcalRecHitCollection const * EBCpuRecHits_
const_iterator end() const
EcalDQMSetupObjects const getEcalDQMSetupObjects()
std::vector< int > uncalibOOTAmps_
void runOnGpuDigis(DigiCollection const &, Collections)
static constexpr unsigned int sampleSize
iterator find(key_type k)
EcalUncalibratedRecHitCollection const * EECpuUncalibRecHits_
int adc() const
get the ADC sample (12 bits)
EcalUncalibratedRecHitCollection const * EBCpuUncalibRecHits_
Log< level::Warning, false > LogWarning
void erase(const std::string &key)
void runOnCpuRecHits(EcalRecHitCollection const &, Collections)
void runOnCpuDigis(DigiCollection const &, Collections)