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  * \author P. Gras
8  * \author E. Di Marco
9  *
10 */
11 
15 
20 
21 class MonitorElement;
22 class DQMStore;
23 class EcalSRSettings;
24 
26 
27 public:
28 
31 
33 virtual ~EBSelectiveReadoutTask();
34 
35 protected:
36 
38 void analyze(const edm::Event& e, const edm::EventSetup& c);
39 
41 void beginJob(void);
42 
44 void endJob(void);
45 
47 void beginRun(const edm::Run& r, const edm::EventSetup& c);
48 
50 void endRun(const edm::Run& r, const edm::EventSetup& c);
51 
53 void reset(void);
54 
56 void setup(void);
57 
59 void cleanup(void);
60 
62 static const int nTTEta = 34;
63 static const int nTTPhi = 72;
64 static const int nECALDcc = 54;
65 static const int nEBDcc = 36;
66 static const int kByte = 1024;
67 
69 static const int nDccChs = 68;
70 
72 static const int nEbRus = 36*68;
73 
75 static const int nEbEta = 170;
76 
78 static const int nEbPhi = 360;
79 
81 static const int ebTtEdge = 5;
82 
84 static const int scEdge = 5;
85 
87 static const int nTtEta = 56;
88 
90 static const int nTtPhi = 72;
91 
93 static const int bytesPerCrystal = 24;
94 
96 int nCryTower[72][34];
97 
99 int nEvtFullReadout[72][34];
100 
102 int nEvtRUForced[72][34];
103 
105 int nEvtAnyReadout[72][34];
106 
108 int nEvtZS1Readout[72][34];
109 
111 int nEvtZSReadout[72][34];
112 
115 
118 
120 int nEvtHighInterest[72][34];
121 
123 int nEvtMediumInterest[72][34];
124 
126 int nEvtLowInterest[72][34];
127 
129 int nEvtAnyInterest[72][34];
130 
131 private:
132 
134 enum subdet_t {EB, EE};
135 
139 void anaDigi(const EBDataFrame& frame, const EBSrFlagCollection& srFlagColl, uint16_t statusCode);
140 
144 void anaDigiInit();
145 
150 unsigned dccNum(const DetId& xtalId) const;
151 
155 int iEta2cIndex(int iEta) const{
156  return (iEta<0)?iEta+85:iEta+84;
157 }
158 
162 int iPhi2cIndex(int iPhi) const{
163  return iPhi-1;
164 }
165 
171 EcalTrigTowerDetId readOutUnitOf(const EBDetId& xtalId) const;
172 
176 int iXY2cIndex(int iX) const{
177  return iX-1;
178 }
179 
182 int cIndex2iXY(int iX0) const{
183  return iX0+1;
184 }
185 
188 int cIndex2iEta(int i) const{
189  return (i<85)?i-85:i-84;
190 }
191 
194 int cIndex2iPhi(int i) const {
195  return i+1;
196 }
197 
202 double getEbEventSize(double nReadXtals) const;
203 
207 double getDccOverhead(subdet_t subdet) const{
208  // return (subdet==EB?34:25)*8;
209  return (subdet==EB?34:52)*8;
210 }
211 
217 double getDccEventSize(int iDcc0, double nReadXtals) const{
218  subdet_t subdet;
219  if(iDcc0<9 || iDcc0>=45){
220  subdet = EE;
221  } else{
222  subdet = EB;
223  }
224  return getDccOverhead(subdet)+nReadXtals*bytesPerCrystal+nRuPerDcc_[iDcc0]*8;
225 }
226 
232 int dccPhiIndexOfRU(int i, int j) const;
233 
239 int dccPhiIndex(int i, int j) const {
240  return dccPhiIndexOfRU(i/5, j/5);
241 }
242 
248 int dccIndex(int i, int j) const;
249 
255 void configFirWeights(const std::vector<double>& weightsForZsFIR);
256 
267 static int dccZsFIR(const EcalDataFrame& frame,
268  const std::vector<int>& firWeights,
269  int firstFIRSample,
270  bool* saturated = 0);
271 
272 
277 static std::vector<int> getFIRWeights(const std::vector<double>&
278  normalizedWeights);
279 
285 int getCrystalCount() { return 25; }
286 
287 
290 int nEb_;
291 
294 int nEbLI_;
295 
298 int nEbHI_;
299 
303 
307 
311 
315 
318 std::vector<int> firWeights_;
319 
324 
325 int ievt_;
326 
328 
330 
332 
334 
340 
341 float xbins[37];
342 float ybins[89];
343 
365 
366 bool init_;
367 
370 
371 };
372 
373 #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.
edm::EDGetTokenT< EcalTrigPrimDigiCollection > EcalTrigPrimDigiCollection_
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
edm::EDGetTokenT< EcalRecHitCollection > EcalRecHitCollection_
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.
void configFirWeights(const std::vector< double > &weightsForZsFIR)
EcalTrigTowerDetId readOutUnitOf(const EBDetId &xtalId) const
int nEvtZSReadout[72][34]
To store the events with ZS1 or ZS2 readout.
int iPhi2cIndex(int iPhi) const
MonitorElement * EBFullReadoutSRFlagMap_
int nEvtAnyInterest[72][34]
To store the events with any interest.
edm::EDGetTokenT< EBDigiCollection > EBDigiCollection_
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.
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.
edm::EDGetTokenT< EBSrFlagCollection > EBSRFlagCollection_
MonitorElement * EBHighInterestTriggerTowerFlagMap_
Definition: DetId.h:18
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.
edm::EDGetTokenT< FEDRawDataCollection > FEDRawDataCollection_
void anaDigi(const EBDataFrame &frame, const EBSrFlagCollection &srFlagColl, uint16_t statusCode)
Definition: Run.h:41
double getDccEventSize(int iDcc0, double nReadXtals) const