CMS 3D CMS Logo

SelectiveReadoutTask.h
Go to the documentation of this file.
1 #ifndef SelectiveReadoutTask_H
2 #define SelectiveReadoutTask_H
3 
4 #include "DQWorkerTask.h"
5 
7 
15 
17 
18 namespace ecaldqm {
19 
21  public:
23  ~SelectiveReadoutTask() override {}
24 
25  void addDependencies(DependencySet&) override;
26 
27  void beginRun(edm::Run const&, edm::EventSetup const&) override;
28  void beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) override;
29 
30  bool analyze(void const*, Collections) override;
31 
32  void runOnSource(FEDRawDataCollection const&);
34  template <typename SRFlagCollection>
35  void runOnSrFlags(SRFlagCollection const&, Collections);
36  template <typename DigiCollection>
38  void setTokens(edm::ConsumesCollector&) override;
39 
40  enum Constants {
41  nFIRTaps = 6,
44  };
45 
46  private:
47  void setParams(edm::ParameterSet const&) override;
48 
49  void setFIRWeights_(std::vector<double> const&);
50 
51  bool useCondDb_;
53  std::vector<int> ZSFIRWeights_;
54 
55  std::set<std::pair<int, int> > suppressed_;
56  std::vector<short> flags_;
58  };
59 
60  inline bool SelectiveReadoutTask::analyze(void const* _p, Collections _collection) {
61  switch (_collection) {
62  case kSource:
63  if (_p)
64  runOnSource(*static_cast<FEDRawDataCollection const*>(_p));
65  return true;
66  break;
67  case kEcalRawData:
68  if (_p)
69  runOnRawData(*static_cast<EcalRawDataCollection const*>(_p));
70  return true;
71  break;
72  case kEBSrFlag:
73  if (_p)
74  runOnSrFlags(*static_cast<EBSrFlagCollection const*>(_p), _collection);
75  return true;
76  break;
77  case kEESrFlag:
78  if (_p)
79  runOnSrFlags(*static_cast<EESrFlagCollection const*>(_p), _collection);
80  return true;
81  break;
82  case kEBDigi:
83  if (_p)
84  runOnDigis(*static_cast<EBDigiCollection const*>(_p), _collection);
85  return true;
86  break;
87  case kEEDigi:
88  if (_p)
89  runOnDigis(*static_cast<EEDigiCollection const*>(_p), _collection);
90  return true;
91  break;
92  default:
93  break;
94  }
95  return false;
96  }
97 
98 } // namespace ecaldqm
99 
100 #endif
static constexpr int kEBTotalTowers
void runOnDigis(DigiCollection const &, Collections)
void setFIRWeights_(std::vector< double > const &)
bool analyze(void const *, Collections) override
void runOnRawData(EcalRawDataCollection const &)
void setParams(edm::ParameterSet const &) override
void addDependencies(DependencySet &) override
void beginRun(edm::Run const &, edm::EventSetup const &) override
void runOnSrFlags(SRFlagCollection const &, Collections)
edm::ESGetToken< EcalSRSettings, EcalSRSettingsRcd > hSr
void beginEvent(edm::Event const &, edm::EventSetup const &, bool const &, bool &) override
void runOnSource(FEDRawDataCollection const &)
void setTokens(edm::ConsumesCollector &) override
std::set< std::pair< int, int > > suppressed_
Definition: Run.h:45