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  * $Date: 2010/09/28 13:00:29 $
8  * $Revision: 1.20 $
9  * \author P. Gras
10  * \author E. Di Marco
11  *
12 */
13 
19 
20 class MonitorElement;
21 class DQMStore;
22 
23 static const char endcapDccMap[401] = {
24  " 777777 "
25  " 666777777888 "
26  " 66667777778888 "
27  " 6666667777888888 "
28  " 666666677778888888 "
29  " 566666677778888880 " // Z
30  " 555666667788888000 " // x-----> X
31  "55555566677888000000" // |
32  "555555566 880000000" // |
33  "55555555 00000000"//_ // |
34  "55555554 10000000" // V Y
35  "554444444 111111100"
36  "44444444332211111111"
37  " 444444333222111111 "
38  " 444443333222211111 "
39  " 444433333222221111 "
40  " 4443333322222111 "
41  " 43333332222221 "
42  " 333333222222 "
43  " 333222 "};
44 
46 
47 public:
48 
51 
53 virtual ~EESelectiveReadoutTask();
54 
55 protected:
56 
58 void analyze(const edm::Event& e, const edm::EventSetup& c);
59 
61 void beginJob(void);
62 
64 void endJob(void);
65 
67 void beginRun(const edm::Run& r, const edm::EventSetup& c);
68 
70 void endRun(const edm::Run& r, const edm::EventSetup& c);
71 
73 void reset(void);
74 
76 void setup(void);
77 
79 void cleanup(void);
80 
82 static const int nECALDcc = 54;
83 static const int nEEDcc = 18;
84 static const int nEBDcc = 36;
85 static const int kByte = 1024;
86 
88 static const int nDccChs = 68;
89 
91 static const int nEeRus = 2*(34+32+33+33+32+34+33+34+33);
92 
94 static const int nEndcaps = 2;
95 
97 static const int nEeX = 100;
98 
100 static const int nEeY = 100;
101 
103 static const int scEdge = 5;
104 
106 static const int nTtEta = 56;
107 
109 static const int nTtPhi = 72;
110 
112 static const int bytesPerCrystal = 24;
113 
115 int nCrySC[20][20][2];
116 
119 int nCryTT[108][41];
120 
122 int nEvtFullReadout[20][20][2];
123 
125 int nEvtRUForced[20][20][2];
126 
128 int nEvtZS1Readout[20][20][2];
129 
131 int nEvtZSReadout[20][20][2];
132 
134 int nEvtCompleteReadoutIfZS[20][20][2];
135 
137 int nEvtDroppedReadoutIfFR[20][20][2];
138 
140 int nEvtAnyReadout[20][20][2];
141 
143 int nEvtHighInterest[100][100][2];
144 
146 int nEvtMediumInterest[100][100][2];
147 
149 int nEvtLowInterest[100][100][2];
150 
152 int nEvtAnyInterest[100][100][2];
153 
154 
155 private:
156 
158 enum subdet_t {EB, EE};
159 
163  void anaDigi(const EEDataFrame& frame, const EESrFlagCollection& srFlagColl, uint16_t statusCode);
164 
168 void anaDigiInit();
169 
174 unsigned dccNum(const DetId& xtalId) const;
175 
180 unsigned dccNumOfRU(const EcalScDetId& scId) const;
181 
187 const EcalScDetId readOutUnitOf(const EEDetId& xtalId) const;
188 
192 int iXY2cIndex(int iX) const{
193  return iX-1;
194 }
195 
198 int cIndex2iXY(int iX0) const{
199  return iX0+1;
200 }
201 
206 double getEeEventSize(double nReadXtals) const;
207 
211 double getDccOverhead(subdet_t subdet) const{
212  // return (subdet==EB?34:25)*8;
213  return (subdet==EB?34:52)*8;
214 }
215 
221 double getDccEventSize(int iDcc0, double nReadXtals) const{
222  subdet_t subdet;
223  if(iDcc0<9 || iDcc0>=45){
224  subdet = EE;
225  } else{
226  subdet = EB;
227  }
228  return getDccOverhead(subdet)+nReadXtals*bytesPerCrystal+nRuPerDcc_[iDcc0]*8;
229 }
230 
236 int dccPhiIndexOfRU(int i, int j) const;
237 
243 inline int dccPhiIndex(int i, int j) const {
244  return dccPhiIndexOfRU(i/5, j/5);
245 }
246 
252 int dccIndex(int iDet, int i, int j) const;
253 
259 void configFirWeights(std::vector<double> weightsForZsFIR);
260 
271 static int dccZsFIR(const EcalDataFrame& frame,
272  const std::vector<int>& firWeights,
273  int firstFIRSample,
274  bool* saturated = 0);
275 
276 
281 static std::vector<int> getFIRWeights(const std::vector<double>&
282  normalizedWeights);
283 
284 
290 int getCrystalCount(int iDcc, int iDccCh);
291 
294 int nEe_[2];
295 
298 int nEeLI_[2];
299 
302 int nEeHI_[2];
303 
307 
311 
315 
319 
322 std::vector<int> firWeights_;
323 
328 
329 int ievt_;
330 
332 
333 std::string prefixME_;
334 
336 
338 
345 
346 float xbins[19];
347 float ybins[133];
348 
370 
371 bool init_;
372 
373 };
374 
375 #endif
static const int nEeRus
number of RUs for EE
int nEvtFullReadout[20][20][2]
To store the events with full readout.
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]
subdet_t
distinguishes barral and endcap of ECAL.
MonitorElement * EETowerSize_[2]
void configFirWeights(std::vector< double > weightsForZsFIR)
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
edm::InputTag EcalTrigPrimDigiCollection_
MonitorElement * EEDccEventSizeMap_
bool eeRuActive_[nEndcaps][nEeX/scEdge][nEeY/scEdge]
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.
MonitorElement * EETTFlags_[2]
Definition: DetId.h:20
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.
unsigned dccNumOfRU(const EcalScDetId &scId) const
std::vector< int > firWeights_
edm::InputTag EEUnsuppressedDigiCollection_
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]
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:31
MonitorElement * EEFullReadoutSRFlagMap_[2]