CMS 3D CMS Logo

GpuTask.h
Go to the documentation of this file.
1 #ifndef DQM_EcalMonitorTasks_GpuTask_H
2 #define DQM_EcalMonitorTasks_GpuTask_H
3 
4 #include "DQWorkerTask.h"
5 
8 
9 namespace ecaldqm {
10 
11  class GpuTask : public DQWorkerTask {
12  public:
13  GpuTask();
14  ~GpuTask() override = default;
15 
16  void addDependencies(DependencySet&) override;
17 
18  bool filterRunType(short const*) override;
19 
20  void beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) override;
21  bool analyze(void const*, Collections) override;
22 
23  template <typename DigiCollection>
25  template <typename DigiCollection>
31 
32  private:
33  void setParams(edm::ParameterSet const&) override;
34 
39 
40  bool digi1D_;
41  bool digi2D_;
42  bool uncalib1D_;
43  bool uncalib2D_;
44  bool rechit1D_;
45  bool rechit2D_;
46 
47  std::vector<int> uncalibOOTAmps_;
48 
51 
54 
57  };
58 
59  inline bool GpuTask::analyze(void const* collection_data, Collections collection) {
60  switch (collection) {
61  case kEBCpuDigi:
62  if (collection_data && runGpuTask_ && enableDigi_)
63  runOnCpuDigis(*static_cast<EBDigiCollection const*>(collection_data), collection);
64  return runGpuTask_;
65  break;
66  case kEECpuDigi:
67  if (collection_data && runGpuTask_ && enableDigi_)
68  runOnCpuDigis(*static_cast<EEDigiCollection const*>(collection_data), collection);
69  return runGpuTask_;
70  break;
71  case kEBGpuDigi:
72  if (collection_data && runGpuTask_ && enableDigi_)
73  runOnGpuDigis(*static_cast<EBDigiCollection const*>(collection_data), collection);
74  return runGpuTask_;
75  break;
76  case kEEGpuDigi:
77  if (collection_data && runGpuTask_ && enableDigi_)
78  runOnGpuDigis(*static_cast<EEDigiCollection const*>(collection_data), collection);
79  return runGpuTask_;
80  break;
83  if (collection_data && runGpuTask_ && enableUncalib_)
84  runOnCpuUncalibRecHits(*static_cast<EcalUncalibratedRecHitCollection const*>(collection_data), collection);
85  return runGpuTask_;
86  break;
89  if (collection_data && runGpuTask_ && enableUncalib_)
90  runOnGpuUncalibRecHits(*static_cast<EcalUncalibratedRecHitCollection const*>(collection_data), collection);
91  return runGpuTask_;
92  break;
93  case kEBCpuRecHit:
94  case kEECpuRecHit:
95  if (collection_data && runGpuTask_ && enableRecHit_)
96  runOnCpuRecHits(*static_cast<EcalRecHitCollection const*>(collection_data), collection);
97  return runGpuTask_;
98  break;
99  case kEBGpuRecHit:
100  case kEEGpuRecHit:
101  if (collection_data && runGpuTask_ && enableRecHit_)
102  runOnGpuRecHits(*static_cast<EcalRecHitCollection const*>(collection_data), collection);
103  return runGpuTask_;
104  break;
105  default:
106  break;
107  }
108 
109  return false;
110  }
111 
112 } // namespace ecaldqm
113 
114 #endif
bool uncalib2D_
Definition: GpuTask.h:43
bool runGpuTask_
Definition: GpuTask.h:35
void addDependencies(DependencySet &) override
Definition: GpuTask.cc:32
EBDigiCollection const * EBCpuDigis_
Definition: GpuTask.h:49
bool analyze(void const *, Collections) override
Definition: GpuTask.h:59
void runOnGpuRecHits(EcalRecHitCollection const &, Collections)
Definition: GpuTask.cc:491
bool filterRunType(short const *) override
Definition: GpuTask.cc:144
void runOnCpuUncalibRecHits(EcalUncalibratedRecHitCollection const &, Collections)
Definition: GpuTask.cc:273
bool rechit2D_
Definition: GpuTask.h:45
EEDigiCollection const * EECpuDigis_
Definition: GpuTask.h:50
EcalRecHitCollection const * EECpuRecHits_
Definition: GpuTask.h:56
bool enableDigi_
Definition: GpuTask.h:36
void setParams(edm::ParameterSet const &) override
Definition: GpuTask.cc:46
bool rechit1D_
Definition: GpuTask.h:44
void runOnGpuUncalibRecHits(EcalUncalibratedRecHitCollection const &, Collections)
Definition: GpuTask.cc:325
bool enableUncalib_
Definition: GpuTask.h:37
~GpuTask() override=default
void beginEvent(edm::Event const &, edm::EventSetup const &, bool const &, bool &) override
Definition: GpuTask.cc:155
EcalRecHitCollection const * EBCpuRecHits_
Definition: GpuTask.h:55
std::vector< int > uncalibOOTAmps_
Definition: GpuTask.h:47
void runOnGpuDigis(DigiCollection const &, Collections)
Definition: GpuTask.cc:198
EcalUncalibratedRecHitCollection const * EECpuUncalibRecHits_
Definition: GpuTask.h:53
EcalUncalibratedRecHitCollection const * EBCpuUncalibRecHits_
Definition: GpuTask.h:52
bool uncalib1D_
Definition: GpuTask.h:42
bool enableRecHit_
Definition: GpuTask.h:38
void runOnCpuRecHits(EcalRecHitCollection const &, Collections)
Definition: GpuTask.cc:463
void runOnCpuDigis(DigiCollection const &, Collections)
Definition: GpuTask.cc:165