CMS 3D CMS Logo

EcalSelectiveReadoutSuppressor.h
Go to the documentation of this file.
1 #ifndef EcalSelectiveReadoutSuppressor_h
2 #define EcalSelectiveReadoutSuppressor_h
3 
4 #include <vector>
5 #include "boost/multi_array.hpp"
15 
16 #include <memory>
17 
18 class CaloGeometryRecord;
19 
21 public:
27 
28  void setSettings(const EcalSRSettings* settings);
29 
30  enum { BARREL, ENDCAP };
31 
35  static int getFIRTapCount() { return nFIRTaps; }
36 
41 
46 
49  void setGeometry(const CaloGeometry* caloGeometry);
50 
58  void run(const edm::EventSetup& eventSetup,
59  const EcalTrigPrimDigiCollection& trigPrims,
62 
77  void run(const edm::EventSetup& eventSetup,
78  const EcalTrigPrimDigiCollection& trigPrims,
81  EBDigiCollection* selectedBarrelDigis,
82  EEDigiCollection* selectedEndcapDigis,
83  EBSrFlagCollection* ebSrFlags,
84  EESrFlagCollection* eeSrFlags);
85 
89 
96  void printTTFlags(std::ostream& os, int iEvent = -1, bool withHeader = true) const;
97 
98 private:
105  bool accept(const edm::DataFrame& frame, int thr);
106 
108 
110  void initCellThresholds(double barrelLowInterest,
111  double endcapLowInterest,
112  double barrelHighInterest,
113  double endcapHighInterest);
121  int internalThreshold(double thresholdInGeV, int iSubDet) const;
122 
140  std::vector<int> getFIRWeigths();
141 
147  int iEta2cIndex(int iEta) const { return (iEta < 0) ? iEta + 85 : iEta + 84; }
148 
154  int iPhi2cIndex(int iPhi) const { return iPhi - 1; }
155 
161  int iTTEta2cIndex(int iEta) const { return (iEta < 0) ? iEta + 28 : iEta + 27; }
162 
168  int iTTPhi2cIndex(int iPhi) const { return iPhi - 1; }
169 
175  void setTtFlags(const edm::EventSetup& eventSetup, const EBDigiCollection& ebDigis, const EEDigiCollection& eeDigis);
176 
180  void setTtFlags(const EcalTrigPrimDigiCollection& trigPrims);
181 
182  template <class T>
183  double frame2Energy(const T& frame, int timeOffset = 0) const;
184 
185  // /** Help function to get SR flag from ZS threshold using min/max convention
186  // * for SUPPRESS and FULL_READOUT: see zsThreshold.
187  // * @param thr ZS threshold in thrUnit
188  // * @param flag for Zero suppression: EcalSrFlag::SRF_ZS1 or
189  // * EcalSrFlag::SRF_ZS2
190  // * @return the SR flag
191  // */
192  // int thr2Srf(int thr, int zsFlag) const;
193 
196  const static size_t nEndcaps = 2;
197 
200  const static size_t nEndcapTriggerTowersInEta = 11;
201 
204  const static size_t nBarrelTriggerTowersInEta = 34;
205 
209 
212  const static size_t nTriggerTowersInPhi = 72;
213 
216  std::unique_ptr<EcalSelectiveReadout> ecalSelectiveReadout;
217 
219 
223 
228 
231  std::vector<int> firWeights;
232 
236  static const int nFIRTaps;
237 
240  std::vector<float> weights;
241 
245 
252  int zsThreshold[2][8];
253 
258  double thrUnit[2];
259 
263 
270 
274  std::vector<int> actions_;
275 
281 
286 
291 
296 
303  int srFlags[2][8];
304 
308 
311  int ievt_;
312 
314 };
315 #endif
void setGeometry(const CaloGeometry *caloGeometry)
void setSettings(const EcalSRSettings *settings)
EcalSelectiveReadoutSuppressor(const edm::ParameterSet &params, edm::ConsumesCollector iC)
void initCellThresholds(double barrelLowInterest, double endcapLowInterest, double barrelHighInterest, double endcapHighInterest)
helpers for constructors
EcalSelectiveReadout * getEcalSelectiveReadout()
void setTriggerMap(const EcalTrigTowerConstituentsMap *map)
std::unique_ptr< EcalSelectiveReadout > ecalSelectiveReadout
EcalSelectiveReadout::ttFlag_t ttFlags[nTriggerTowersInEta][nTriggerTowersInPhi]
void run(const edm::EventSetup &eventSetup, const EcalTrigPrimDigiCollection &trigPrims, EBDigiCollection &barrelDigis, EEDigiCollection &endcapDigis)
int internalThreshold(double thresholdInGeV, int iSubDet) const
int iEvent
Definition: GenABIO.cc:224
EcalSelectiveReadout::ttFlag_t defaultTtf_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geoToken_
double frame2Energy(const T &frame, int timeOffset=0) const
bool accept(const edm::DataFrame &frame, int thr)
void setTtFlags(const edm::EventSetup &eventSetup, const EBDigiCollection &ebDigis, const EEDigiCollection &eeDigis)
void setElecMap(const EcalElectronicsMapping *map)
const EcalTrigTowerConstituentsMap * theTriggerMap
void printTTFlags(std::ostream &os, int iEvent=-1, bool withHeader=true) const
long double T