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 
37  std::vector<int> uncalibOOTAmps_;
38 
41 
44 
47  };
48 
49  inline bool GpuTask::analyze(void const* collection_data, Collections collection) {
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  }
101 
102 } // namespace ecaldqm
103 
104 #endif
bool runGpuTask_
Definition: GpuTask.h:35
void addDependencies(DependencySet &) override
Definition: GpuTask.cc:24
EBDigiCollection const * EBCpuDigis_
Definition: GpuTask.h:39
bool analyze(void const *, Collections) override
Definition: GpuTask.h:49
void runOnGpuRecHits(EcalRecHitCollection const &, Collections)
Definition: GpuTask.cc:399
bool filterRunType(short const *) override
Definition: GpuTask.cc:92
void runOnCpuUncalibRecHits(EcalUncalibratedRecHitCollection const &, Collections)
Definition: GpuTask.cc:210
EEDigiCollection const * EECpuDigis_
Definition: GpuTask.h:40
EcalRecHitCollection const * EECpuRecHits_
Definition: GpuTask.h:46
void setParams(edm::ParameterSet const &) override
Definition: GpuTask.cc:38
void runOnGpuUncalibRecHits(EcalUncalibratedRecHitCollection const &, Collections)
Definition: GpuTask.cc:262
~GpuTask() override=default
void beginEvent(edm::Event const &, edm::EventSetup const &, bool const &, bool &) override
Definition: GpuTask.cc:103
EcalRecHitCollection const * EBCpuRecHits_
Definition: GpuTask.h:45
std::vector< int > uncalibOOTAmps_
Definition: GpuTask.h:37
void runOnGpuDigis(DigiCollection const &, Collections)
Definition: GpuTask.cc:146
bool gpuOnlyPlots_
Definition: GpuTask.h:36
EcalUncalibratedRecHitCollection const * EECpuUncalibRecHits_
Definition: GpuTask.h:43
EcalUncalibratedRecHitCollection const * EBCpuUncalibRecHits_
Definition: GpuTask.h:42
void runOnCpuRecHits(EcalRecHitCollection const &, Collections)
Definition: GpuTask.cc:371
void runOnCpuDigis(DigiCollection const &, Collections)
Definition: GpuTask.cc:113