CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EESelectiveReadoutTask.h
Go to the documentation of this file.
1 #ifndef EESelectiveReadoutTask_H
2 #define EESelectiveReadoutTask_H
3 
4 /*
5  * \file EESelectiveReadoutTask.h
6  *
7  * \author P. Gras
8  * \author E. Di Marco
9  *
10 */
11 
17 
21 
22 class MonitorElement;
23 class DQMStore;
24 class EcalSRSettings;
25 
26 static const char endcapDccMap[401] = {
27  " 777777 "
28  " 666777777888 "
29  " 66667777778888 "
30  " 6666667777888888 "
31  " 666666677778888888 "
32  " 566666677778888880 " // Z
33  " 555666667788888000 " // x-----> X
34  "55555566677888000000" // |
35  "555555566 880000000" // |
36  "55555555 00000000"//_ // |
37  "55555554 10000000" // V Y
38  "554444444 111111100"
39  "44444444332211111111"
40  " 444444333222111111 "
41  " 444443333222211111 "
42  " 444433333222221111 "
43  " 4443333322222111 "
44  " 43333332222221 "
45  " 333333222222 "
46  " 333222 "};
47 
49 
50 public:
51 
54 
56 virtual ~EESelectiveReadoutTask();
57 
58 protected:
59 
61 void analyze(const edm::Event& e, const edm::EventSetup& c);
62 
64 void beginJob(void);
65 
67 void endJob(void);
68 
70 void beginRun(const edm::Run& r, const edm::EventSetup& c);
71 
73 void endRun(const edm::Run& r, const edm::EventSetup& c);
74 
76 void reset(void);
77 
79 void setup(void);
80 
82 void cleanup(void);
83 
85 static const int nECALDcc = 54;
86 static const int nEEDcc = 18;
87 static const int nEBDcc = 36;
88 static const int kByte = 1024;
89 
91 static const int nDccChs = 68;
92 
94 static const int nEeRus = 2*(34+32+33+33+32+34+33+34+33);
95 
97 static const int nEndcaps = 2;
98 
100 static const int nEeX = 100;
101 
103 static const int nEeY = 100;
104 
106 static const int scEdge = 5;
107 
109 static const int nTtEta = 56;
110 
112 static const int nTtPhi = 72;
113 
115 static const int bytesPerCrystal = 24;
116 
118 int nCrySC[20][20][2];
119 
122 int nCryTT[108][41];
123 
125 int nEvtFullReadout[20][20][2];
126 
128 int nEvtRUForced[20][20][2];
129 
131 int nEvtZS1Readout[20][20][2];
132 
134 int nEvtZSReadout[20][20][2];
135 
137 int nEvtCompleteReadoutIfZS[20][20][2];
138 
140 int nEvtDroppedReadoutIfFR[20][20][2];
141 
143 int nEvtAnyReadout[20][20][2];
144 
146 int nEvtHighInterest[100][100][2];
147 
149 int nEvtMediumInterest[100][100][2];
150 
152 int nEvtLowInterest[100][100][2];
153 
155 int nEvtAnyInterest[100][100][2];
156 
157 
158 private:
159 
161 enum subdet_t {EB, EE};
162 
166  void anaDigi(const EEDataFrame& frame, const EESrFlagCollection& srFlagColl, uint16_t statusCode);
167 
171 void anaDigiInit();
172 
177 unsigned dccNum(const DetId& xtalId) const;
178 
183 unsigned dccNumOfRU(const EcalScDetId& scId) const;
184 
190 const EcalScDetId readOutUnitOf(const EEDetId& xtalId) const;
191 
195 int iXY2cIndex(int iX) const{
196  return iX-1;
197 }
198 
201 int cIndex2iXY(int iX0) const{
202  return iX0+1;
203 }
204 
209 double getEeEventSize(double nReadXtals) const;
210 
214 double getDccOverhead(subdet_t subdet) const{
215  // return (subdet==EB?34:25)*8;
216  return (subdet==EB?34:52)*8;
217 }
218 
224 double getDccEventSize(int iDcc0, double nReadXtals) const{
225  subdet_t subdet;
226  if(iDcc0<9 || iDcc0>=45){
227  subdet = EE;
228  } else{
229  subdet = EB;
230  }
231  return getDccOverhead(subdet)+nReadXtals*bytesPerCrystal+nRuPerDcc_[iDcc0]*8;
232 }
233 
239 int dccPhiIndexOfRU(int i, int j) const;
240 
246 inline int dccPhiIndex(int i, int j) const {
247  return dccPhiIndexOfRU(i/5, j/5);
248 }
249 
255 int dccIndex(int iDet, int i, int j) const;
256 
262 void configFirWeights(const std::vector<double>& weightsForZsFIR);
263 
274 static int dccZsFIR(const EcalDataFrame& frame,
275  const std::vector<int>& firWeights,
276  int firstFIRSample,
277  bool* saturated = 0);
278 
279 
284 static std::vector<int> getFIRWeights(const std::vector<double>&
285  normalizedWeights);
286 
287 
293 int getCrystalCount(int iDcc, int iDccCh);
294 
297 int nEe_[2];
298 
301 int nEeLI_[2];
302 
305 int nEeHI_[2];
306 
310 
314 
318 
322 
325 std::vector<int> firWeights_;
326 
331 
332 int ievt_;
333 
335 
337 
339 
341 
347 
348 float xbins[19];
349 float ybins[133];
350 
372 
373 bool init_;
374 
377 
378 };
379 
380 #endif
static const int nEeRus
number of RUs for EE
int nEvtFullReadout[20][20][2]
To store the events with full readout.
edm::EDGetTokenT< EcalRecHitCollection > EcalRecHitCollection_
int i
Definition: DBlmapReader.cc:9
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
static const int nEndcaps
number of endcaps
MonitorElement * EEFullReadoutSRFlagCount_[2]
EESelectiveReadoutTask(const edm::ParameterSet &ps)
Constructor.
MonitorElement * EEReadoutUnitForcedBitMap_[2]
double getDccOverhead(subdet_t subdet) const
MonitorElement * EELowInterestZsFIR_[2]
MonitorElement * EEDroppedFRCount_[2]
void configFirWeights(const std::vector< double > &weightsForZsFIR)
subdet_t
distinguishes barral and endcap of ECAL.
MonitorElement * EETowerSize_[2]
edm::EDGetTokenT< EESrFlagCollection > EESRFlagCollection_
static const int nECALDcc
Constants.
int nEvtZSReadout[20][20][2]
To store the events with ZS1 or ZS2 readout.
int getCrystalCount(int iDcc, int iDccCh)
static const int nTtPhi
Number of Trigger Towers along Phi.
MonitorElement * EEZeroSuppression1SRFlagMap_[2]
MonitorElement * EEHighInterestZsFIR_[2]
int nEvtAnyInterest[100][100][2]
To store the events with any interest.
int nEvtDroppedReadoutIfFR[20][20][2]
To store the events with 0 channels readout when FR is requested.
static const int nDccChs
maximum number of RUs read by a DCC
virtual ~EESelectiveReadoutTask()
Destructor.
MonitorElement * EECompleteZSMap_[2]
int nEvtCompleteReadoutIfZS[20][20][2]
To store the events with complete readout when ZS is requested.
static const char endcapDccMap[401]
MonitorElement * EETTFMismatch_[2]
int nPerRu_[nECALDcc][nDccChs]
MonitorElement * EEEventSize_[2]
int nEvtLowInterest[100][100][2]
To store the events with low interest TT.
int dccIndex(int iDet, int i, int j) const
static const int nTtEta
Number of Trigger Towers along Eta.
MonitorElement * EEHighInterestPayload_[2]
MonitorElement * EEHighInterestTriggerTowerFlagMap_[2]
double getEeEventSize(double nReadXtals) const
double getDccEventSize(int iDcc0, double nReadXtals) const
int j
Definition: DBlmapReader.cc:9
MonitorElement * EEDccEventSizeMap_
bool eeRuActive_[nEndcaps][nEeX/scEdge][nEeY/scEdge]
edm::EDGetTokenT< EcalTrigPrimDigiCollection > EcalTrigPrimDigiCollection_
void anaDigi(const EEDataFrame &frame, const EESrFlagCollection &srFlagColl, uint16_t statusCode)
static const int nEeX
EE crystal grid size along X.
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
int nEvtRUForced[20][20][2]
To store the events with RU forced.
edm::EDGetTokenT< FEDRawDataCollection > FEDRawDataCollection_
MonitorElement * EETTFlags_[2]
Definition: DetId.h:18
int dccPhiIndexOfRU(int i, int j) const
unsigned dccNum(const DetId &xtalId) const
int nEvtMediumInterest[100][100][2]
To store the events with medium interest TT.
void beginJob(void)
BeginJob.
int nEvtZS1Readout[20][20][2]
To store the events with ZS1 readout.
int nEvtHighInterest[100][100][2]
To store the events with high interest TT.
int nCrySC[20][20][2]
To store the readout crystals / SC.
const EcalSRSettings * settings_
unsigned dccNumOfRU(const EcalScDetId &scId) const
std::vector< int > firWeights_
MonitorElement * EECompleteZSCount_[2]
MonitorElement * EEDroppedFRMap_[2]
static std::vector< int > getFIRWeights(const std::vector< double > &normalizedWeights)
int nEvtAnyReadout[20][20][2]
To store the events with any readout.
MonitorElement * EELowInterestPayload_[2]
edm::EDGetTokenT< EEDigiCollection > EEDigiCollection_
const EcalScDetId readOutUnitOf(const EEDetId &xtalId) const
int cIndex2iXY(int iX0) const
MonitorElement * EELowInterestTriggerTowerFlagMap_[2]
static const int scEdge
Number of crystals along a supercrystal edge.
int dccPhiIndex(int i, int j) const
static const int bytesPerCrystal
Number of bytes per crystal.
MonitorElement * EEMediumInterestTriggerTowerFlagMap_[2]
static int dccZsFIR(const EcalDataFrame &frame, const std::vector< int > &firWeights, int firstFIRSample, bool *saturated=0)
static const int nEeY
EE crystal grid size along Y.
Definition: Run.h:41
MonitorElement * EEFullReadoutSRFlagMap_[2]