CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EBSelectiveReadoutTask.h
Go to the documentation of this file.
1 #ifndef EBSelectiveReadoutTask_H
2 #define EBSelectiveReadoutTask_H
3 
4 /*
5  * \file EBSelectiveReadoutTask.h
6  *
7  * $Date: 2011/03/03 22:05:50 $
8  * $Revision: 1.19 $
9  * \author P. Gras
10  * \author E. Di Marco
11  *
12 */
13 
17 
18 
19 class MonitorElement;
20 class DQMStore;
21 class EcalSRSettings;
22 
24 
25 public:
26 
29 
31 virtual ~EBSelectiveReadoutTask();
32 
33 protected:
34 
36 void analyze(const edm::Event& e, const edm::EventSetup& c);
37 
39 void beginJob(void);
40 
42 void endJob(void);
43 
45 void beginRun(const edm::Run& r, const edm::EventSetup& c);
46 
48 void endRun(const edm::Run& r, const edm::EventSetup& c);
49 
51 void reset(void);
52 
54 void setup(void);
55 
57 void cleanup(void);
58 
60 static const int nTTEta = 34;
61 static const int nTTPhi = 72;
62 static const int nECALDcc = 54;
63 static const int nEBDcc = 36;
64 static const int kByte = 1024;
65 
67 static const int nDccChs = 68;
68 
70 static const int nEbRus = 36*68;
71 
73 static const int nEbEta = 170;
74 
76 static const int nEbPhi = 360;
77 
79 static const int ebTtEdge = 5;
80 
82 static const int scEdge = 5;
83 
85 static const int nTtEta = 56;
86 
88 static const int nTtPhi = 72;
89 
91 static const int bytesPerCrystal = 24;
92 
94 int nCryTower[72][34];
95 
97 int nEvtFullReadout[72][34];
98 
100 int nEvtRUForced[72][34];
101 
103 int nEvtAnyReadout[72][34];
104 
106 int nEvtZS1Readout[72][34];
107 
109 int nEvtZSReadout[72][34];
110 
113 
116 
118 int nEvtHighInterest[72][34];
119 
121 int nEvtMediumInterest[72][34];
122 
124 int nEvtLowInterest[72][34];
125 
127 int nEvtAnyInterest[72][34];
128 
129 private:
130 
132 enum subdet_t {EB, EE};
133 
137 void anaDigi(const EBDataFrame& frame, const EBSrFlagCollection& srFlagColl, uint16_t statusCode);
138 
142 void anaDigiInit();
143 
148 unsigned dccNum(const DetId& xtalId) const;
149 
153 int iEta2cIndex(int iEta) const{
154  return (iEta<0)?iEta+85:iEta+84;
155 }
156 
160 int iPhi2cIndex(int iPhi) const{
161  return iPhi-1;
162 }
163 
169 EcalTrigTowerDetId readOutUnitOf(const EBDetId& xtalId) const;
170 
174 int iXY2cIndex(int iX) const{
175  return iX-1;
176 }
177 
180 int cIndex2iXY(int iX0) const{
181  return iX0+1;
182 }
183 
186 int cIndex2iEta(int i) const{
187  return (i<85)?i-85:i-84;
188 }
189 
192 int cIndex2iPhi(int i) const {
193  return i+1;
194 }
195 
200 double getEbEventSize(double nReadXtals) const;
201 
205 double getDccOverhead(subdet_t subdet) const{
206  // return (subdet==EB?34:25)*8;
207  return (subdet==EB?34:52)*8;
208 }
209 
215 double getDccEventSize(int iDcc0, double nReadXtals) const{
216  subdet_t subdet;
217  if(iDcc0<9 || iDcc0>=45){
218  subdet = EE;
219  } else{
220  subdet = EB;
221  }
222  return getDccOverhead(subdet)+nReadXtals*bytesPerCrystal+nRuPerDcc_[iDcc0]*8;
223 }
224 
230 int dccPhiIndexOfRU(int i, int j) const;
231 
237 int dccPhiIndex(int i, int j) const {
238  return dccPhiIndexOfRU(i/5, j/5);
239 }
240 
246 int dccIndex(int i, int j) const;
247 
253 void configFirWeights(std::vector<double> weightsForZsFIR);
254 
265 static int dccZsFIR(const EcalDataFrame& frame,
266  const std::vector<int>& firWeights,
267  int firstFIRSample,
268  bool* saturated = 0);
269 
270 
275 static std::vector<int> getFIRWeights(const std::vector<double>&
276  normalizedWeights);
277 
283 int getCrystalCount() { return 25; }
284 
285 
288 int nEb_;
289 
292 int nEbLI_;
293 
296 int nEbHI_;
297 
301 
305 
309 
313 
316 std::vector<int> firWeights_;
317 
322 
323 int ievt_;
324 
326 
327 std::string prefixME_;
328 
330 
332 
339 
340 float xbins[37];
341 float ybins[89];
342 
364 
365 bool init_;
366 
369 
370 };
371 
372 #endif
int nEvtLowInterest[72][34]
To store the events with low interest TT.
int i
Definition: DBlmapReader.cc:9
int nCryTower[72][34]
To store the readout crystals / tower.
MonitorElement * EBMediumInterestTriggerTowerFlagMap_
static const int bytesPerCrystal
Number of bytes per crystal.
static std::vector< int > getFIRWeights(const std::vector< double > &normalizedWeights)
MonitorElement * EBDccEventSizeMap_
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
static const int nEbPhi
number of crystals along Phi in EB
MonitorElement * EBLowInterestZsFIR_
static const int nEbRus
number of RUs for EB
static const int ebTtEdge
Number of crystals along an EB TT.
MonitorElement * EBFullReadoutSRFlagCount_
double getDccOverhead(subdet_t subdet) const
int nEvtHighInterest[72][34]
To store the events with high interest TT.
int cIndex2iXY(int iX0) const
subdet_t
distinguishes barral and endcap of ECAL.
static const int scEdge
Number of crystals along a supercrystal edge.
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
EcalTrigTowerDetId readOutUnitOf(const EBDetId &xtalId) const
int nEvtZSReadout[72][34]
To store the events with ZS1 or ZS2 readout.
edm::InputTag EcalTrigPrimDigiCollection_
int iPhi2cIndex(int iPhi) const
MonitorElement * EBFullReadoutSRFlagMap_
int nEvtAnyInterest[72][34]
To store the events with any interest.
MonitorElement * EBLowInterestPayload_
virtual ~EBSelectiveReadoutTask()
Destructor.
int nEvtFullReadout[72][34]
To store the events with full readout.
static int dccZsFIR(const EcalDataFrame &frame, const std::vector< int > &firWeights, int firstFIRSample, bool *saturated=0)
int nEvtZS1Readout[72][34]
To store the events with ZS1 readout.
edm::InputTag EBUnsuppressedDigiCollection_
int nEvtDroppedReadoutIfFR[72][34]
To store the events with 0 channels readout when FR is requested.
MonitorElement * EBCompleteZSCount_
static const int nTtPhi
Number of Trigger Towers along Phi.
MonitorElement * EBHighInterestPayload_
std::vector< int > firWeights_
int j
Definition: DBlmapReader.cc:9
static const int nEbEta
number of crystals along Eta in EB
const EcalSRSettings * settings_
void beginJob(void)
BeginJob.
double getEbEventSize(double nReadXtals) const
int dccPhiIndexOfRU(int i, int j) const
int nEvtCompleteReadoutIfZS[72][34]
To store the events with complete readout when ZS is requested.
void configFirWeights(std::vector< double > weightsForZsFIR)
MonitorElement * EBHighInterestTriggerTowerFlagMap_
Definition: DetId.h:20
EBSelectiveReadoutTask(const edm::ParameterSet &ps)
Constructor.
int nEvtRUForced[72][34]
To store the events with RU forced.
int nEvtMediumInterest[72][34]
To store the events with medium interest TT.
int dccIndex(int i, int j) const
static const int nDccChs
maximum number of RUs read by a DCC
bool ebRuActive_[nEbEta/ebTtEdge][nEbPhi/ebTtEdge]
int nPerRu_[nECALDcc][nDccChs]
MonitorElement * EBLowInterestTriggerTowerFlagMap_
MonitorElement * EBHighInterestZsFIR_
unsigned dccNum(const DetId &xtalId) const
int dccPhiIndex(int i, int j) const
MonitorElement * EBZeroSuppression1SRFlagMap_
MonitorElement * EBDroppedFRCount_
int nEvtAnyReadout[72][34]
To store the events with any readout.
MonitorElement * EBReadoutUnitForcedBitMap_
static const int nTtEta
Number of Trigger Towers along Eta.
int iEta2cIndex(int iEta) const
static const int nTTEta
Constants.
void anaDigi(const EBDataFrame &frame, const EBSrFlagCollection &srFlagColl, uint16_t statusCode)
Definition: Run.h:33
double getDccEventSize(int iDcc0, double nReadXtals) const