CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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"
14 
15 #include <memory>
16 
18 public:
23  EcalSelectiveReadoutSuppressor(const edm::ParameterSet & params, const EcalSRSettings* settings);
24 
25  enum {BARREL, ENDCAP};
26 
30  static int getFIRTapCount(){ return nFIRTaps;}
31 
36 
41 
42 
45  void setGeometry(const CaloGeometry * caloGeometry);
46 
54  void run(const edm::EventSetup& eventSetup,
55  const EcalTrigPrimDigiCollection & trigPrims,
56  EBDigiCollection & barrelDigis,
57  EEDigiCollection & endcapDigis);
58 
73  void run(const edm::EventSetup& eventSetup,
74  const EcalTrigPrimDigiCollection & trigPrims,
75  const EBDigiCollection & barrelDigis,
76  const EEDigiCollection & endcapDigis,
77  EBDigiCollection* selectedBarrelDigis,
78  EEDigiCollection* selectedEndcapDigis,
79  EBSrFlagCollection* ebSrFlags,
80  EESrFlagCollection* eeSrFlags);
81 
85  return ecalSelectiveReadout.get();
86  }
87 
94  void printTTFlags(std::ostream& os, int iEvent = -1,
95  bool withHeader=true) const;
96 
97  private:
98 
105  bool accept(const edm::DataFrame& frame, int thr);
106 
108 
110  void initCellThresholds(double barrelLowInterest, double endcapLowInterest,
111  double barrelHighInterest, double endcapHighInterest);
119  int internalThreshold(double thresholdInGeV, int iSubDet) const;
120 
138  std::vector<int> getFIRWeigths();
139 
145  int iEta2cIndex(int iEta) const{
146  return (iEta<0)?iEta+85:iEta+84;
147  }
148 
154  int iPhi2cIndex(int iPhi) const{
155  return iPhi-1;
156  }
157 
163  int iTTEta2cIndex(int iEta) const{
164  return (iEta<0)?iEta+28:iEta+27;
165  }
166 
172  int iTTPhi2cIndex(int iPhi) const{
173  return iPhi-1;
174  }
175 
181  void setTtFlags(const edm::EventSetup& eventSetup,
182  const EBDigiCollection& ebDigis,
183  const EEDigiCollection& eeDigis);
184 
188  void setTtFlags(const EcalTrigPrimDigiCollection & trigPrims);
189 
190  template<class T>
191  double frame2Energy(const T& frame, int timeOffset = 0) const;
192 
193 
194 // /** Help function to get SR flag from ZS threshold using min/max convention
195 // * for SUPPRESS and FULL_READOUT: see zsThreshold.
196 // * @param thr ZS threshold in thrUnit
197 // * @param flag for Zero suppression: EcalSrFlag::SRF_ZS1 or
198 // * EcalSrFlag::SRF_ZS2
199 // * @return the SR flag
200 // */
201 // int thr2Srf(int thr, int zsFlag) const;
202 
205  const static size_t nEndcaps = 2;
206 
209  const static size_t nEndcapTriggerTowersInEta = 11;
210 
213  const static size_t nBarrelTriggerTowersInEta = 34;
214 
217  const static size_t nTriggerTowersInEta
219 
222  const static size_t nTriggerTowersInPhi = 72;
223 
224 
227  std::auto_ptr<EcalSelectiveReadout> ecalSelectiveReadout;
228 
230 
234 
239 
242  std::vector<int> firWeights;
243 
247  static const int nFIRTaps;
248 
251  std::vector<float> weights;
252 
256 
263  int zsThreshold[2][4];
264 
269  double thrUnit[2];
270 
274 
281 
285  std::vector<int> actions_;
286 
292 
297 
302 
307 
308 
315  int srFlags[2][8];
316 
320 
323  int ievt_;
324 };
325 #endif
void setGeometry(const CaloGeometry *caloGeometry)
EcalSelectiveReadoutSuppressor(const edm::ParameterSet &params, const EcalSRSettings *settings)
void initCellThresholds(double barrelLowInterest, double endcapLowInterest, double barrelHighInterest, double endcapHighInterest)
helpers for constructors
EcalSelectiveReadout * getEcalSelectiveReadout()
void printTTFlags(std::ostream &os, int iEvent=-1, bool withHeader=true) const
std::auto_ptr< EcalSelectiveReadout > ecalSelectiveReadout
double frame2Energy(const T &frame, int timeOffset=0) const
void setTriggerMap(const EcalTrigTowerConstituentsMap *map)
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:243
EcalSelectiveReadout::ttFlag_t defaultTtf_
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
long double T