CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ecaldqm::GpuTask Class Reference

#include <GpuTask.h>

Inheritance diagram for ecaldqm::GpuTask:
ecaldqm::DQWorkerTask ecaldqm::DQWorker

Public Member Functions

void addDependencies (DependencySet &) override
 
bool analyze (void const *, Collections) override
 
void beginEvent (edm::Event const &, edm::EventSetup const &, bool const &, bool &) override
 
bool filterRunType (short const *) override
 
 GpuTask ()
 
template<typename DigiCollection >
void runOnCpuDigis (DigiCollection const &, Collections)
 
void runOnCpuRecHits (EcalRecHitCollection const &, Collections)
 
void runOnCpuUncalibRecHits (EcalUncalibratedRecHitCollection const &, Collections)
 
template<typename DigiCollection >
void runOnGpuDigis (DigiCollection const &, Collections)
 
void runOnGpuRecHits (EcalRecHitCollection const &, Collections)
 
void runOnGpuUncalibRecHits (EcalUncalibratedRecHitCollection const &, Collections)
 
 ~GpuTask () override=default
 
- Public Member Functions inherited from ecaldqm::DQWorkerTask
 DQWorkerTask ()
 
virtual void endEvent (edm::Event const &, edm::EventSetup const &)
 
virtual bool filterTrigger (edm::TriggerResultsByName const &)
 
virtual void setTokens (edm::ConsumesCollector &)
 
 ~DQWorkerTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorker
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void bookMEs (DQMStore::IBooker &)
 
 DQWorker ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
EcalDQMSetupObjects const getEcalDQMSetupObjects ()
 
EcalElectronicsMapping const * GetElectronicsMap ()
 
CaloGeometry const * GetGeometry ()
 
std::string const & getName () const
 
CaloTopology const * GetTopology ()
 
EcalTrigTowerConstituentsMap const * GetTrigTowerMap ()
 
bool onlineMode () const
 
virtual void releaseMEs ()
 
void setEventNumber (edm::EventNumber_t _e)
 
void setLumiNumber (edm::LuminosityBlockNumber_t _l)
 
void setRunNumber (edm::RunNumber_t _r)
 
void setSetupObjects (edm::EventSetup const &)
 
void setSetupObjectsEndLumi (edm::EventSetup const &)
 
void setTime (time_t _t)
 
void setTokens (edm::ConsumesCollector &)
 
virtual ~DQWorker () noexcept(false)
 

Private Member Functions

void setParams (edm::ParameterSet const &) override
 

Private Attributes

EBDigiCollection const * EBCpuDigis_
 
EcalRecHitCollection const * EBCpuRecHits_
 
EcalUncalibratedRecHitCollection const * EBCpuUncalibRecHits_
 
EEDigiCollection const * EECpuDigis_
 
EcalRecHitCollection const * EECpuRecHits_
 
EcalUncalibratedRecHitCollection const * EECpuUncalibRecHits_
 
bool gpuOnlyPlots_
 
bool runGpuTask_
 
std::vector< int > uncalibOOTAmps_
 

Additional Inherited Members

- Public Types inherited from ecaldqm::DQWorkerTask
typedef EcalDCCHeaderBlock::EcalDCCEventSettings EventSettings
 
- Static Public Member Functions inherited from ecaldqm::DQWorkerTask
static void fillDescriptions (edm::ParameterSetDescription &)
 
- Static Public Member Functions inherited from ecaldqm::DQWorker
static void fillDescriptions (edm::ParameterSetDescription &_desc)
 
- Public Attributes inherited from ecaldqm::DQWorker
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcdelecMapHandle
 
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcdelecMapHandleEndLumi
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeomHandle
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeomHandleEndLumi
 
edm::ESGetToken< CaloTopology, CaloTopologyRecordtopoHandle
 
edm::ESGetToken< CaloTopology, CaloTopologyRecordtopoHandleEndLumi
 
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecordttMapHandle
 
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecordttMapHandleEndLumi
 
- Protected Types inherited from ecaldqm::DQWorker
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from ecaldqm::DQWorkerTask
void setME (edm::ParameterSet const &) final
 
- Protected Member Functions inherited from ecaldqm::DQWorker
void initialize (std::string const &_name, edm::ParameterSet const &)
 
void print_ (std::string const &, int=0) const
 
virtual void setSource (edm::ParameterSet const &)
 
void setVerbosity (int _verbosity)
 
- Protected Attributes inherited from ecaldqm::DQWorker
bool booked_
 
MESetCollection MEs_
 
std::string name_
 
bool onlineMode_
 
Timestamp timestamp_
 
int verbosity_
 
bool willConvertToEDM_
 

Detailed Description

Definition at line 11 of file GpuTask.h.

Constructor & Destructor Documentation

◆ GpuTask()

ecaldqm::GpuTask::GpuTask ( )

Definition at line 13 of file GpuTask.cc.

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) {}
bool runGpuTask_
Definition: GpuTask.h:35
EBDigiCollection const * EBCpuDigis_
Definition: GpuTask.h:39
EEDigiCollection const * EECpuDigis_
Definition: GpuTask.h:40
EcalRecHitCollection const * EECpuRecHits_
Definition: GpuTask.h:46
EcalRecHitCollection const * EBCpuRecHits_
Definition: GpuTask.h:45
bool gpuOnlyPlots_
Definition: GpuTask.h:36
EcalUncalibratedRecHitCollection const * EECpuUncalibRecHits_
Definition: GpuTask.h:43
EcalUncalibratedRecHitCollection const * EBCpuUncalibRecHits_
Definition: GpuTask.h:42

◆ ~GpuTask()

ecaldqm::GpuTask::~GpuTask ( )
overridedefault

Member Function Documentation

◆ addDependencies()

void ecaldqm::GpuTask::addDependencies ( DependencySet dependencies)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 24 of file GpuTask.cc.

References ecaldqm::kEBCpuDigi, ecaldqm::kEBCpuRecHit, ecaldqm::kEBCpuUncalibRecHit, ecaldqm::kEBGpuDigi, ecaldqm::kEBGpuRecHit, ecaldqm::kEBGpuUncalibRecHit, ecaldqm::kEECpuDigi, ecaldqm::kEECpuRecHit, ecaldqm::kEECpuUncalibRecHit, ecaldqm::kEEGpuDigi, ecaldqm::kEEGpuRecHit, ecaldqm::kEEGpuUncalibRecHit, and runGpuTask_.

◆ analyze()

bool ecaldqm::GpuTask::analyze ( void const *  collection_data,
Collections  collection 
)
inlineoverridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 49 of file GpuTask.h.

References universalConfigTemplate::collection, ecaldqm::kEBCpuDigi, ecaldqm::kEBCpuRecHit, ecaldqm::kEBCpuUncalibRecHit, ecaldqm::kEBGpuDigi, ecaldqm::kEBGpuRecHit, ecaldqm::kEBGpuUncalibRecHit, ecaldqm::kEECpuDigi, ecaldqm::kEECpuRecHit, ecaldqm::kEECpuUncalibRecHit, ecaldqm::kEEGpuDigi, ecaldqm::kEEGpuRecHit, ecaldqm::kEEGpuUncalibRecHit, runGpuTask_, runOnCpuDigis(), runOnCpuRecHits(), runOnCpuUncalibRecHits(), runOnGpuDigis(), runOnGpuRecHits(), and runOnGpuUncalibRecHits().

49  {
50  switch (collection) {
51  case kEBCpuDigi:
52  if (collection_data && runGpuTask_)
53  runOnCpuDigis(*static_cast<EBDigiCollection const*>(collection_data), collection);
54  return runGpuTask_;
55  break;
56  case kEECpuDigi:
57  if (collection_data && runGpuTask_)
58  runOnCpuDigis(*static_cast<EEDigiCollection const*>(collection_data), collection);
59  return runGpuTask_;
60  break;
61  case kEBGpuDigi:
62  if (collection_data && runGpuTask_)
63  runOnGpuDigis(*static_cast<EBDigiCollection const*>(collection_data), collection);
64  return runGpuTask_;
65  break;
66  case kEEGpuDigi:
67  if (collection_data && runGpuTask_)
68  runOnGpuDigis(*static_cast<EEDigiCollection const*>(collection_data), collection);
69  return runGpuTask_;
70  break;
73  if (collection_data && runGpuTask_)
74  runOnCpuUncalibRecHits(*static_cast<EcalUncalibratedRecHitCollection const*>(collection_data), collection);
75  return runGpuTask_;
76  break;
79  if (collection_data && runGpuTask_)
80  runOnGpuUncalibRecHits(*static_cast<EcalUncalibratedRecHitCollection const*>(collection_data), collection);
81  return runGpuTask_;
82  break;
83  case kEBCpuRecHit:
84  case kEECpuRecHit:
85  if (collection_data && runGpuTask_)
86  runOnCpuRecHits(*static_cast<EcalRecHitCollection const*>(collection_data), collection);
87  return runGpuTask_;
88  break;
89  case kEBGpuRecHit:
90  case kEEGpuRecHit:
91  if (collection_data && runGpuTask_)
92  runOnGpuRecHits(*static_cast<EcalRecHitCollection const*>(collection_data), collection);
93  return runGpuTask_;
94  break;
95  default:
96  break;
97  }
98 
99  return false;
100  }
bool runGpuTask_
Definition: GpuTask.h:35
void runOnGpuRecHits(EcalRecHitCollection const &, Collections)
Definition: GpuTask.cc:399
void runOnCpuUncalibRecHits(EcalUncalibratedRecHitCollection const &, Collections)
Definition: GpuTask.cc:210
void runOnGpuUncalibRecHits(EcalUncalibratedRecHitCollection const &, Collections)
Definition: GpuTask.cc:262
void runOnGpuDigis(DigiCollection const &, Collections)
Definition: GpuTask.cc:146
void runOnCpuRecHits(EcalRecHitCollection const &, Collections)
Definition: GpuTask.cc:371
void runOnCpuDigis(DigiCollection const &, Collections)
Definition: GpuTask.cc:113

◆ beginEvent()

void ecaldqm::GpuTask::beginEvent ( edm::Event const &  ,
edm::EventSetup const &  ,
bool const &  ,
bool &   
)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 103 of file GpuTask.cc.

References EBCpuDigis_, EBCpuRecHits_, EBCpuUncalibRecHits_, EECpuDigis_, EECpuRecHits_, and EECpuUncalibRecHits_.

103  {
104  EBCpuDigis_ = nullptr;
105  EECpuDigis_ = nullptr;
106  EBCpuUncalibRecHits_ = nullptr;
107  EECpuUncalibRecHits_ = nullptr;
108  EBCpuRecHits_ = nullptr;
109  EECpuRecHits_ = nullptr;
110  }
EBDigiCollection const * EBCpuDigis_
Definition: GpuTask.h:39
EEDigiCollection const * EECpuDigis_
Definition: GpuTask.h:40
EcalRecHitCollection const * EECpuRecHits_
Definition: GpuTask.h:46
EcalRecHitCollection const * EBCpuRecHits_
Definition: GpuTask.h:45
EcalUncalibratedRecHitCollection const * EECpuUncalibRecHits_
Definition: GpuTask.h:43
EcalUncalibratedRecHitCollection const * EBCpuUncalibRecHits_
Definition: GpuTask.h:42

◆ filterRunType()

bool ecaldqm::GpuTask::filterRunType ( short const *  runType)
overridevirtual

◆ runOnCpuDigis()

template<typename DigiCollection >
void ecaldqm::GpuTask::runOnCpuDigis ( DigiCollection const &  cpuDigis,
Collections  collection 
)

Definition at line 113 of file GpuTask.cc.

References EcalMGPASample::adc(), cms::cuda::assert(), ecaldqm::MESetCollection::at(), universalConfigTemplate::collection, EBCpuDigis_, EcalBarrel, EcalEndcap, EECpuDigis_, ecaldqm::MESetMulti::fill(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::kEBCpuDigi, ecaldqm::DQWorker::MEs_, EcalDataFrame::sample(), and ecalPh1::sampleSize.

Referenced by analyze().

113  {
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  }
EBDigiCollection const * EBCpuDigis_
Definition: GpuTask.h:39
MESet & at(const std::string &key)
Definition: MESet.h:399
EEDigiCollection const * EECpuDigis_
Definition: GpuTask.h:40
assert(be >=bs)
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:142
MESetCollection MEs_
Definition: DQWorker.h:125
static constexpr unsigned int sampleSize
Definition: EcalConstants.h:44

◆ runOnCpuRecHits()

void ecaldqm::GpuTask::runOnCpuRecHits ( EcalRecHitCollection const &  cpuHits,
Collections  collection 
)

Definition at line 371 of file GpuTask.cc.

References ecaldqm::MESetCollection::at(), universalConfigTemplate::collection, EBCpuRecHits_, EcalBarrel, EcalEndcap, EECpuRecHits_, ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::kEBCpuRecHit, ecaldqm::DQWorker::MEs_, and edm::SortedCollection< T, SORT >::size().

Referenced by analyze().

371  {
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  }
MESet & at(const std::string &key)
Definition: MESet.h:399
EcalRecHitCollection const * EECpuRecHits_
Definition: GpuTask.h:46
EcalRecHitCollection const * EBCpuRecHits_
Definition: GpuTask.h:45
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:142
MESetCollection MEs_
Definition: DQWorker.h:125

◆ runOnCpuUncalibRecHits()

void ecaldqm::GpuTask::runOnCpuUncalibRecHits ( EcalUncalibratedRecHitCollection const &  cpuHits,
Collections  collection 
)

Definition at line 210 of file GpuTask.cc.

References ecaldqm::MESetCollection::at(), universalConfigTemplate::collection, EBCpuUncalibRecHits_, EcalBarrel, EcalEndcap, EECpuUncalibRecHits_, ecaldqm::MESetMulti::fill(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::kEBCpuUncalibRecHit, ecaldqm::DQWorker::MEs_, edm::SortedCollection< T, SORT >::size(), and uncalibOOTAmps_.

Referenced by analyze().

210  {
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 
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  }
MESet & at(const std::string &key)
Definition: MESet.h:399
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:142
std::vector< int > uncalibOOTAmps_
Definition: GpuTask.h:37
MESetCollection MEs_
Definition: DQWorker.h:125
EcalUncalibratedRecHitCollection const * EECpuUncalibRecHits_
Definition: GpuTask.h:43
EcalUncalibratedRecHitCollection const * EBCpuUncalibRecHits_
Definition: GpuTask.h:42

◆ runOnGpuDigis()

template<typename DigiCollection >
void ecaldqm::GpuTask::runOnGpuDigis ( DigiCollection const &  gpuDigis,
Collections  collection 
)

Definition at line 146 of file GpuTask.cc.

References EcalMGPASample::adc(), cms::cuda::assert(), ecaldqm::MESetCollection::at(), universalConfigTemplate::collection, siStripShotFilter_cfi::DigiCollection, EBCpuDigis_, EcalBarrel, EcalEndcap, EECpuDigis_, ecaldqm::MESetMulti::fill(), ecaldqm::MESet::fill(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), gpuOnlyPlots_, ecaldqm::kEBGpuDigi, ecaldqm::DQWorker::MEs_, EcalDataFrame::sample(), and ecalPh1::sampleSize.

Referenced by analyze().

146  {
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  }
EBDigiCollection const * EBCpuDigis_
Definition: GpuTask.h:39
MESet & at(const std::string &key)
Definition: MESet.h:399
EEDigiCollection const * EECpuDigis_
Definition: GpuTask.h:40
assert(be >=bs)
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:142
Definition: DetId.h:17
MESetCollection MEs_
Definition: DQWorker.h:125
static constexpr unsigned int sampleSize
Definition: EcalConstants.h:44
bool gpuOnlyPlots_
Definition: GpuTask.h:36
Log< level::Warning, false > LogWarning

◆ runOnGpuRecHits()

void ecaldqm::GpuTask::runOnGpuRecHits ( EcalRecHitCollection const &  gpuHits,
Collections  collection 
)

Definition at line 399 of file GpuTask.cc.

References ecaldqm::MESetCollection::at(), universalConfigTemplate::collection, EBCpuRecHits_, EcalBarrel, EcalEndcap, EECpuRecHits_, edm::SortedCollection< T, SORT >::end(), ecaldqm::MESet::fill(), edm::SortedCollection< T, SORT >::find(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), gpuOnlyPlots_, ecaldqm::kEBGpuRecHit, ecaldqm::DQWorker::MEs_, and edm::SortedCollection< T, SORT >::size().

Referenced by analyze().

399  {
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  }
MESet & at(const std::string &key)
Definition: MESet.h:399
size_type size() const
std::vector< EcalRecHit >::const_iterator const_iterator
EcalRecHitCollection const * EECpuRecHits_
Definition: GpuTask.h:46
EcalRecHitCollection const * EBCpuRecHits_
Definition: GpuTask.h:45
const_iterator end() const
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:142
Definition: DetId.h:17
MESetCollection MEs_
Definition: DQWorker.h:125
iterator find(key_type k)
bool gpuOnlyPlots_
Definition: GpuTask.h:36
Log< level::Warning, false > LogWarning

◆ runOnGpuUncalibRecHits()

void ecaldqm::GpuTask::runOnGpuUncalibRecHits ( EcalUncalibratedRecHitCollection const &  gpuHits,
Collections  collection 
)

Definition at line 262 of file GpuTask.cc.

References ecaldqm::MESetCollection::at(), universalConfigTemplate::collection, EBCpuUncalibRecHits_, EcalBarrel, EcalEndcap, EECpuUncalibRecHits_, edm::SortedCollection< T, SORT >::end(), ecaldqm::MESetMulti::fill(), ecaldqm::MESet::fill(), edm::SortedCollection< T, SORT >::find(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), gpuOnlyPlots_, ecaldqm::kEBGpuUncalibRecHit, ecaldqm::DQWorker::MEs_, edm::SortedCollection< T, SORT >::size(), and uncalibOOTAmps_.

Referenced by analyze().

262  {
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 
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  }
MESet & at(const std::string &key)
Definition: MESet.h:399
size_type size() const
std::vector< T >::const_iterator const_iterator
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
iterator find(key_type k)
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

◆ setParams()

void ecaldqm::GpuTask::setParams ( edm::ParameterSet const &  params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 38 of file GpuTask.cc.

References ecaldqm::MESetCollection::erase(), gpuOnlyPlots_, ecaldqm::DQWorker::MEs_, submitPVValidationJobs::params, runGpuTask_, AlCaHLTBitMon_QueryRunRegistry::string, and uncalibOOTAmps_.

38  {
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  }
bool runGpuTask_
Definition: GpuTask.h:35
std::vector< int > uncalibOOTAmps_
Definition: GpuTask.h:37
MESetCollection MEs_
Definition: DQWorker.h:125
bool gpuOnlyPlots_
Definition: GpuTask.h:36
void erase(const std::string &key)
Definition: MESet.h:390

Member Data Documentation

◆ EBCpuDigis_

EBDigiCollection const* ecaldqm::GpuTask::EBCpuDigis_
private

Definition at line 39 of file GpuTask.h.

Referenced by beginEvent(), runOnCpuDigis(), and runOnGpuDigis().

◆ EBCpuRecHits_

EcalRecHitCollection const* ecaldqm::GpuTask::EBCpuRecHits_
private

Definition at line 45 of file GpuTask.h.

Referenced by beginEvent(), runOnCpuRecHits(), and runOnGpuRecHits().

◆ EBCpuUncalibRecHits_

EcalUncalibratedRecHitCollection const* ecaldqm::GpuTask::EBCpuUncalibRecHits_
private

Definition at line 42 of file GpuTask.h.

Referenced by beginEvent(), runOnCpuUncalibRecHits(), and runOnGpuUncalibRecHits().

◆ EECpuDigis_

EEDigiCollection const* ecaldqm::GpuTask::EECpuDigis_
private

Definition at line 40 of file GpuTask.h.

Referenced by beginEvent(), runOnCpuDigis(), and runOnGpuDigis().

◆ EECpuRecHits_

EcalRecHitCollection const* ecaldqm::GpuTask::EECpuRecHits_
private

Definition at line 46 of file GpuTask.h.

Referenced by beginEvent(), runOnCpuRecHits(), and runOnGpuRecHits().

◆ EECpuUncalibRecHits_

EcalUncalibratedRecHitCollection const* ecaldqm::GpuTask::EECpuUncalibRecHits_
private

Definition at line 43 of file GpuTask.h.

Referenced by beginEvent(), runOnCpuUncalibRecHits(), and runOnGpuUncalibRecHits().

◆ gpuOnlyPlots_

bool ecaldqm::GpuTask::gpuOnlyPlots_
private

Definition at line 36 of file GpuTask.h.

Referenced by runOnGpuDigis(), runOnGpuRecHits(), runOnGpuUncalibRecHits(), and setParams().

◆ runGpuTask_

bool ecaldqm::GpuTask::runGpuTask_
private

Definition at line 35 of file GpuTask.h.

Referenced by addDependencies(), analyze(), and setParams().

◆ uncalibOOTAmps_

std::vector<int> ecaldqm::GpuTask::uncalibOOTAmps_
private

Definition at line 37 of file GpuTask.h.

Referenced by runOnCpuUncalibRecHits(), runOnGpuUncalibRecHits(), and setParams().