CMS 3D CMS Logo

OccupancyTask.h
Go to the documentation of this file.
1 #ifndef OccupancyTask_H
2 #define OccupancyTask_H
3 
4 #include "DQWorkerTask.h"
5 
15 
16 namespace ecaldqm {
17  class OccupancyTask : public DQWorkerTask {
18  public:
19  OccupancyTask();
20  ~OccupancyTask() override {}
21 
22  bool filterRunType(short const*) override;
23 
24  void beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) override;
25  void beginRun(edm::Run const&, edm::EventSetup const&) override;
26  bool analyze(void const*, Collections) override;
27 
29  template <typename DigiCollection>
33  void setTokens(edm::ConsumesCollector&) override;
34  void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
35 
36  private:
37  void setParams(edm::ParameterSet const&) override;
39  bool FillLaser = false;
41  float tpThreshold_;
45  double scal_pu;
46  bool FindPUinLS = false;
47  int nEv;
48  bool lumiCheck_;
49  };
50 
51  inline bool OccupancyTask::analyze(void const* _p, Collections _collection) {
52  switch (_collection) {
53  case kEcalRawData:
54  if (_p)
55  runOnRawData(*static_cast<EcalRawDataCollection const*>(_p));
56  return true;
57  case kEBDigi:
58  if (_p)
59  runOnDigis(*static_cast<EBDigiCollection const*>(_p), _collection);
60  return true;
61  break;
62  case kEEDigi:
63  if (_p)
64  runOnDigis(*static_cast<EEDigiCollection const*>(_p), _collection);
65  return true;
66  break;
67  case kTrigPrimDigi:
68  if (_p)
69  runOnTPDigis(*static_cast<EcalTrigPrimDigiCollection const*>(_p));
70  return true;
71  break;
72  case kEBRecHit:
73  case kEERecHit:
74  if (_p)
75  runOnRecHits(*static_cast<EcalRecHitCollection const*>(_p), _collection);
76  return true;
77  break;
78  default:
79  break;
80  }
81 
82  return false;
83  }
84 } // namespace ecaldqm
85 
86 #endif
void runOnRecHits(EcalRecHitCollection const &, Collections)
edm::InputTag metadataTag
Definition: OccupancyTask.h:43
void runOnRawData(EcalRawDataCollection const &)
void runOnDigis(DigiCollection const &, Collections)
void beginRun(edm::Run const &, edm::EventSetup const &) override
edm::TimeValue_t m_iTime
Definition: OccupancyTask.h:42
bool analyze(void const *, Collections) override
Definition: OccupancyTask.h:51
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
void runOnTPDigis(EcalTrigPrimDigiCollection const &)
void setTokens(edm::ConsumesCollector &) override
unsigned long long TimeValue_t
Definition: Timestamp.h:21
void setParams(edm::ParameterSet const &) override
void beginEvent(edm::Event const &, edm::EventSetup const &, bool const &, bool &) override
bool filterRunType(short const *) override
edm::ESGetToken< EcalLaserDbService, EcalLaserDbRecord > lasertoken_
Definition: OccupancyTask.h:38
edm::EDGetTokenT< OnlineLuminosityRecord > metaDataToken_
Definition: OccupancyTask.h:44
Definition: Run.h:45