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/11/10 10:43:29 $
8  * $Revision: 1.21 $
9  * \author P. Gras
10  * \author E. Di Marco
11  *
12 */
13 
19 
20 class MonitorElement;
21 class DQMStore;
22 class EcalSRSettings;
23 
24 static const char endcapDccMap[401] = {
25  " 777777 "
26  " 666777777888 "
27  " 66667777778888 "
28  " 6666667777888888 "
29  " 666666677778888888 "
30  " 566666677778888880 " // Z
31  " 555666667788888000 " // x-----> X
32  "55555566677888000000" // |
33  "555555566 880000000" // |
34  "55555555 00000000"//_ // |
35  "55555554 10000000" // V Y
36  "554444444 111111100"
37  "44444444332211111111"
38  " 444444333222111111 "
39  " 444443333222211111 "
40  " 444433333222221111 "
41  " 4443333322222111 "
42  " 43333332222221 "
43  " 333333222222 "
44  " 333222 "};
45 
47 
48 public:
49 
52 
54 virtual ~EESelectiveReadoutTask();
55 
56 protected:
57 
59 void analyze(const edm::Event& e, const edm::EventSetup& c);
60 
62 void beginJob(void);
63 
65 void endJob(void);
66 
68 void beginRun(const edm::Run& r, const edm::EventSetup& c);
69 
71 void endRun(const edm::Run& r, const edm::EventSetup& c);
72 
74 void reset(void);
75 
77 void setup(void);
78 
80 void cleanup(void);
81 
83 static const int nECALDcc = 54;
84 static const int nEEDcc = 18;
85 static const int nEBDcc = 36;
86 static const int kByte = 1024;
87 
89 static const int nDccChs = 68;
90 
92 static const int nEeRus = 2*(34+32+33+33+32+34+33+34+33);
93 
95 static const int nEndcaps = 2;
96 
98 static const int nEeX = 100;
99 
101 static const int nEeY = 100;
102 
104 static const int scEdge = 5;
105 
107 static const int nTtEta = 56;
108 
110 static const int nTtPhi = 72;
111 
113 static const int bytesPerCrystal = 24;
114 
116 int nCrySC[20][20][2];
117 
120 int nCryTT[108][41];
121 
123 int nEvtFullReadout[20][20][2];
124 
126 int nEvtRUForced[20][20][2];
127 
129 int nEvtZS1Readout[20][20][2];
130 
132 int nEvtZSReadout[20][20][2];
133 
135 int nEvtCompleteReadoutIfZS[20][20][2];
136 
138 int nEvtDroppedReadoutIfFR[20][20][2];
139 
141 int nEvtAnyReadout[20][20][2];
142 
144 int nEvtHighInterest[100][100][2];
145 
147 int nEvtMediumInterest[100][100][2];
148 
150 int nEvtLowInterest[100][100][2];
151 
153 int nEvtAnyInterest[100][100][2];
154 
155 
156 private:
157 
159 enum subdet_t {EB, EE};
160 
164  void anaDigi(const EEDataFrame& frame, const EESrFlagCollection& srFlagColl, uint16_t statusCode);
165 
169 void anaDigiInit();
170 
175 unsigned dccNum(const DetId& xtalId) const;
176 
181 unsigned dccNumOfRU(const EcalScDetId& scId) const;
182 
188 const EcalScDetId readOutUnitOf(const EEDetId& xtalId) const;
189 
193 int iXY2cIndex(int iX) const{
194  return iX-1;
195 }
196 
199 int cIndex2iXY(int iX0) const{
200  return iX0+1;
201 }
202 
207 double getEeEventSize(double nReadXtals) const;
208 
212 double getDccOverhead(subdet_t subdet) const{
213  // return (subdet==EB?34:25)*8;
214  return (subdet==EB?34:52)*8;
215 }
216 
222 double getDccEventSize(int iDcc0, double nReadXtals) const{
223  subdet_t subdet;
224  if(iDcc0<9 || iDcc0>=45){
225  subdet = EE;
226  } else{
227  subdet = EB;
228  }
229  return getDccOverhead(subdet)+nReadXtals*bytesPerCrystal+nRuPerDcc_[iDcc0]*8;
230 }
231 
237 int dccPhiIndexOfRU(int i, int j) const;
238 
244 inline int dccPhiIndex(int i, int j) const {
245  return dccPhiIndexOfRU(i/5, j/5);
246 }
247 
253 int dccIndex(int iDet, int i, int j) const;
254 
260 void configFirWeights(std::vector<double> weightsForZsFIR);
261 
272 static int dccZsFIR(const EcalDataFrame& frame,
273  const std::vector<int>& firWeights,
274  int firstFIRSample,
275  bool* saturated = 0);
276 
277 
282 static std::vector<int> getFIRWeights(const std::vector<double>&
283  normalizedWeights);
284 
285 
291 int getCrystalCount(int iDcc, int iDccCh);
292 
295 int nEe_[2];
296 
299 int nEeLI_[2];
300 
303 int nEeHI_[2];
304 
308 
312 
316 
320 
323 std::vector<int> firWeights_;
324 
329 
330 int ievt_;
331 
333 
334 std::string prefixME_;
335 
337 
339 
346 
347 float xbins[19];
348 float ybins[133];
349 
371 
372 bool init_;
373 
376 
377 };
378 
379 #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.
const EcalSRSettings * settings_
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:32
MonitorElement * EEFullReadoutSRFlagMap_[2]