CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalRawDataMonitor.h
Go to the documentation of this file.
1 #ifndef DQM_HCALMONITORTASKS_HCALRAWDATAMONITOR_H
2 #define DQM_HCALMONITORTASKS_HCALRAWDATAMONITOR_H
3 
4 #define NUMDCCS 32
5 #define NUMSPIGS 15
6 #define HTRCHANMAX 24
7 //Dimensions of 'LED' plots, grouping bits by hardware space
8 // NUMBER_HDWARE = 1 + ((NUMBER +1)*(NUM_HRDWARE_PIECES))
9 #define TWO___FED (1+((2+1)*NUMDCCS) )
10 #define THREE_FED (1+((3+1)*NUMDCCS) )
11 #define TWO__SPGT (1+((2+1)*NUMSPIGS) )
12 #define THREE_SPG (1+((3+1)*NUMSPIGS) )
13 #define TWO_CHANN (1+((2+1)*HTRCHANMAX))
14 
15 #define ETABINS 85
16 #define PHIBINS 72
17 #define DEPTHBINS 4
18 
26 #include <math.h>
27 
33  public:
35  //Constructor with no arguments
38  protected:
39  void analyze(const edm::Event& e, const edm::EventSetup& c);
41  void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
42  const edm::EventSetup& c) ;
43  // End LumiBlock
44  // Dump the backstage arrays into MEs, for normalization by the Client
45  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
46  const edm::EventSetup& c);
47  // Within Analyze(), processEvent
48  void processEvent(const FEDRawDataCollection& rawraw,
49  const HcalUnpackerReport& report);
50  // Within processEvent, unpack(fed)
51  void unpack(const FEDRawData& raw);
52  void endJob(void);
53  void endRun(const edm::Run& run, const edm::EventSetup& c);
54  void setup(DQMStore::IBooker &);
55  void reset(void);
56 
59 
62 
64  //Electronics map -> geographic channel map
65  inline int hashup(uint32_t d=0, uint32_t s=0, uint32_t c=1) {
66  return (int) ( (d*NUMSPIGS*HTRCHANMAX)+(s*HTRCHANMAX)+(c)); }
67  void stashHDI(int thehash, HcalDetId thehcaldetid);
68  //Protect against indexing past array.
69  inline HcalDetId HashToHDI(int thehash) {
70  return ( ( (thehash<0) || (thehash>(NUMDCCS*NUMSPIGS*HTRCHANMAX)) )
72  :(hashedHcalDetId_[thehash]));
73  };
74  uint64_t uniqcounter[ETABINS][PHIBINS][DEPTHBINS]; // HFd1,2 at 'depths' 3,4 to avoid collision with HE
75  uint64_t problemcount[ETABINS][PHIBINS][DEPTHBINS]; // HFd1,2 at 'depths' 3,4 to avoid collision with HE
76  bool problemfound[ETABINS][PHIBINS][DEPTHBINS]; // HFd1,2 at 'depths' 3,4 to avoid collision with HE
77  void mapDCCproblem (int dcc); // Set problemfound[][][] = true for the hardware's ieta/iphi/depth's
78  void mapHTRproblem (int dcc, int spigot); // Set problemfound[][][] = true for the hardware's ieta/iphi/depth's
79  void mapChannproblem(int dcc, int spigot, int htrchan); // Set problemfound[][][] = true for the hardware's ieta/iphi/depth
80  void whosebad(int subdet); //Increment the NumBad counter for this LS, for this Hcal subdet
81 
82  private:
83  MonitorElement* meCh_DataIntegrityFED00_; //DataIntegrity for channels in FED 00
84  MonitorElement* meCh_DataIntegrityFED01_; //DataIntegrity for channels in FED 01
85  MonitorElement* meCh_DataIntegrityFED02_; //DataIntegrity for channels in FED 02
86  MonitorElement* meCh_DataIntegrityFED03_; //DataIntegrity for channels in FED 03
87  MonitorElement* meCh_DataIntegrityFED04_; //DataIntegrity for channels in FED 04
88  MonitorElement* meCh_DataIntegrityFED05_; //DataIntegrity for channels in FED 05
89  MonitorElement* meCh_DataIntegrityFED06_; //DataIntegrity for channels in FED 06
90  MonitorElement* meCh_DataIntegrityFED07_; //DataIntegrity for channels in FED 07
91  MonitorElement* meCh_DataIntegrityFED08_; //DataIntegrity for channels in FED 08
92  MonitorElement* meCh_DataIntegrityFED09_; //DataIntegrity for channels in FED 09
93  MonitorElement* meCh_DataIntegrityFED10_; //DataIntegrity for channels in FED 10
94  MonitorElement* meCh_DataIntegrityFED11_; //DataIntegrity for channels in FED 11
95  MonitorElement* meCh_DataIntegrityFED12_; //DataIntegrity for channels in FED 12
96  MonitorElement* meCh_DataIntegrityFED13_; //DataIntegrity for channels in FED 13
97  MonitorElement* meCh_DataIntegrityFED14_; //DataIntegrity for channels in FED 14
98  MonitorElement* meCh_DataIntegrityFED15_; //DataIntegrity for channels in FED 15
99  MonitorElement* meCh_DataIntegrityFED16_; //DataIntegrity for channels in FED 16
100  MonitorElement* meCh_DataIntegrityFED17_; //DataIntegrity for channels in FED 17
101  MonitorElement* meCh_DataIntegrityFED18_; //DataIntegrity for channels in FED 18
102  MonitorElement* meCh_DataIntegrityFED19_; //DataIntegrity for channels in FED 19
103  MonitorElement* meCh_DataIntegrityFED20_; //DataIntegrity for channels in FED 20
104  MonitorElement* meCh_DataIntegrityFED21_; //DataIntegrity for channels in FED 21
105  MonitorElement* meCh_DataIntegrityFED22_; //DataIntegrity for channels in FED 22
106  MonitorElement* meCh_DataIntegrityFED23_; //DataIntegrity for channels in FED 23
107  MonitorElement* meCh_DataIntegrityFED24_; //DataIntegrity for channels in FED 24
108  MonitorElement* meCh_DataIntegrityFED25_; //DataIntegrity for channels in FED 25
109  MonitorElement* meCh_DataIntegrityFED26_; //DataIntegrity for channels in FED 26
110  MonitorElement* meCh_DataIntegrityFED27_; //DataIntegrity for channels in FED 27
111  MonitorElement* meCh_DataIntegrityFED28_; //DataIntegrity for channels in FED 28
112  MonitorElement* meCh_DataIntegrityFED29_; //DataIntegrity for channels in FED 29
113  MonitorElement* meCh_DataIntegrityFED30_; //DataIntegrity for channels in FED 30
114  MonitorElement* meCh_DataIntegrityFED31_; //DataIntegrity for channels in FED 31
115  // handy array of pointers to pointers...
117 
124 
129 
130  //Histogram labelling functions
131  void label_ySpigots(MonitorElement* me_ptr,int ybins);
132  void label_xFEDs (MonitorElement* me_ptr,int xbins);
133  void label_xChanns (MonitorElement* me_ptr,int xbins);
134 
136 
137  // Transfer internal problem counts to ME's, & reset internal counters.
138  void UpdateMEs (void );
139 
140  //Member variables for reference values to be used in consistency checks.
141  std::map<int, short> CDFversionNumber_list;
142  std::map<int, short>::iterator CDFvers_it;
143  std::map<int, short> CDFReservedBits_list;
144  std::map<int, short>::iterator CDFReservedBits_it;
145  std::map<int, short> DCCEvtFormat_list;
146  std::map<int, short>::iterator DCCEvtFormat_it;
147 
148  // The following MEs map specific conditons from the EventFragment headers as specified in
149  // http://cmsdoc.cern.ch/cms/HCAL/document/CountingHouse/DCC/DCC_1Jul06.pdf
150  MonitorElement* meCDFErrorFound_; //Summary histo of Common Data Format violations by FED ID
151  MonitorElement* meDCCEventFormatError_; //Summary histo of DCC Event Format violations by FED ID
152 
153  //Check that evt numbers are synchronized across all half-HTRs and their DCC
154  MonitorElement* meBCN_; // Bunch count number distributions
155  MonitorElement* medccBCN_; // Bunch count number distributions
156  MonitorElement* meBCNCheck_; // HTR BCN compared to DCC BCN
157  MonitorElement* meBCNSynch_; // htr-htr disagreement location
158 
159  MonitorElement* meEvtNCheck_; // HTR Evt # compared to DCC Evt #
160  MonitorElement* meEvtNumberSynch_; // htr-htr disagreement location
161 
162  MonitorElement* meOrNCheck_; // htr OrN compared to dcc OrN
163  MonitorElement* meOrNSynch_; // htr-htr disagreement location
164  MonitorElement* meBCNwhenOrNDiff_; // BCN distribution (subset)
165 
171 
172  void labelHTRBits(MonitorElement* mePlot,unsigned int axisType);
176  MonitorElement* meStatusWdCrate_; //HTR status bits by crate
179 
180  // The following MEs map specific conditons from the HTR/DCC headers as specified in
181  // http://cmsdoc.cern.ch/cms/HCAL/document/CountingHouse/HTR/design/Rev4MainFPGA.pdf
182  MonitorElement* meCrate0HTRStatus_ ; //Map of HTR status bits into Crate 0
183  MonitorElement* meCrate1HTRStatus_ ; //Map of HTR status bits into Crate 1
184  MonitorElement* meCrate2HTRStatus_ ; //Map of HTR status bits into Crate 2
185  MonitorElement* meCrate3HTRStatus_ ; //Map of HTR status bits into Crate 3
186  MonitorElement* meCrate4HTRStatus_ ; //Map of HTR status bits into Crate 4
187  MonitorElement* meCrate5HTRStatus_ ; //Map of HTR status bits into Crate 5
188  MonitorElement* meCrate6HTRStatus_ ; //Map of HTR status bits into Crate 6
189  MonitorElement* meCrate7HTRStatus_ ; //Map of HTR status bits into Crate 7
190  MonitorElement* meCrate9HTRStatus_ ; //Map of HTR status bits into Crate 9
191  MonitorElement* meCrate10HTRStatus_; //Map of HTR status bits into Crate 10
192  MonitorElement* meCrate11HTRStatus_; //Map of HTR status bits into Crate 11
193  MonitorElement* meCrate12HTRStatus_; //Map of HTR status bits into Crate 12
194  MonitorElement* meCrate13HTRStatus_; //Map of HTR status bits into Crate 13
195  MonitorElement* meCrate14HTRStatus_; //Map of HTR status bits into Crate 14
196  MonitorElement* meCrate15HTRStatus_; //Map of HTR status bits into Crate 15
197  MonitorElement* meCrate17HTRStatus_; //Map of HTR status bits into Crate 17
198 
201  MonitorElement* meFib1OrbMsgBCN_; //BCN of Fiber 1 Orb Msg
202  MonitorElement* meFib2OrbMsgBCN_; //BCN of Fiber 2 Orb Msg
203  MonitorElement* meFib3OrbMsgBCN_; //BCN of Fiber 3 Orb Msg
204  MonitorElement* meFib4OrbMsgBCN_; //BCN of Fiber 4 Orb Msg
205  MonitorElement* meFib5OrbMsgBCN_; //BCN of Fiber 5 Orb Msg
206  MonitorElement* meFib6OrbMsgBCN_; //BCN of Fiber 6 Orb Msg
207  MonitorElement* meFib7OrbMsgBCN_; //BCN of Fiber 7 Orb Msg
208  MonitorElement* meFib8OrbMsgBCN_; //BCN of Fiber 8 Orb Msg
209 
211 
212  void HTRPrint(const HcalHTRData& htr,int prtlvl);
213 
215 };
216 
217 #endif
MonitorElement * meCh_DataIntegrityFED04_
void setup(DQMStore::IBooker &)
MonitorElement * meCh_DataIntegrityFED27_
static const HcalDetId Undefined
Definition: HcalDetId.h:67
MonitorElement * meUSFractSpigs_
MonitorElement * meCh_DataIntegrityFED23_
MonitorElement * meBCN_
MonitorElement * meCDFErrorFound_
MonitorElement * meCrate7HTRStatus_
void label_xFEDs(MonitorElement *me_ptr, int xbins)
MonitorElement * meCrate4HTRStatus_
float HalfHTRDataCorruptionIndicators_[(1+((3+1)*32))][(1+((3+1)*15))]
#define NUMDCCS
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
MonitorElement * meCh_DataIntegrityFED25_
MonitorElement * meCh_DataIntegrityFED13_
int ib
Definition: cuy.py:660
void whosebad(int subdet)
bool problemfound[85][72][4]
const double xbins[]
MonitorElement * meEvtNumberSynch_
#define TWO_CHANN
MonitorElement * meCrate3HTRStatus_
MonitorElement * meCh_DataIntegrityFED02_
MonitorElement * meCh_DataIntegrityFED05_
MonitorElement * meFib5OrbMsgBCN_
float ChannSumm_DataIntegrityCheck_[(1+((2+1)*32))][(1+((2+1)*15))]
#define THREE_FED
MonitorElement * meCh_DataIntegrityFED09_
MonitorElement * meBCNCheck_
MonitorElement * meCrate17HTRStatus_
MonitorElement * meChannSumm_DataIntegrityCheck_
void stashHDI(int thehash, HcalDetId thehcaldetid)
void processEvent(const FEDRawDataCollection &rawraw, const HcalUnpackerReport &report)
MonitorElement * meCrate13HTRStatus_
std::map< int, short > CDFversionNumber_list
MonitorElement * meOrNCheck_
MonitorElement * meCrate2HTRStatus_
std::map< int, short > CDFReservedBits_list
#define NUMSPIGS
void label_xChanns(MonitorElement *me_ptr, int xbins)
MonitorElement * meBCNSynch_
MonitorElement * meCrate14HTRStatus_
MonitorElement * meCh_DataIntegrityFED03_
void analyze(const edm::Event &e, const edm::EventSetup &c)
void labelHTRBits(MonitorElement *mePlot, unsigned int axisType)
MonitorElement * meCrate15HTRStatus_
uint64_t problemcount[85][72][4]
MonitorElement * meDataFlowInd_
MonitorElement * meCh_DataIntegrityFED14_
std::map< int, short >::iterator CDFReservedBits_it
tuple report
Definition: zeeHLT_cff.py:9
tuple d
Definition: ztail.py:151
#define TWO__SPGT
MonitorElement * meCrate6HTRStatus_
edm::InputTag FEDRawDataCollection_
MonitorElement * meCh_DataIntegrityFED24_
std::map< int, short >::iterator DCCEvtFormat_it
#define HTRCHANMAX
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
MonitorElement * meCh_DataIntegrityFED06_
HcalDetId hashedHcalDetId_[32 *15 *24]
const HcalElectronicsMap * readoutMap_
MonitorElement * HTR_StatusWd_HO
MonitorElement * meCrate5HTRStatus_
void unpack(const FEDRawData &raw)
MonitorElement * meCrate0HTRStatus_
MonitorElement * meOrNSynch_
void endRun(const edm::Run &run, const edm::EventSetup &c)
void label_ySpigots(MonitorElement *me_ptr, int ybins)
MonitorElement * meCh_DataIntegrityFED11_
MonitorElement * meCrate12HTRStatus_
uint64_t uniqcounter[85][72][4]
std::map< int, short >::iterator CDFvers_it
MonitorElement * meCh_DataIntegrityFED17_
MonitorElement * meFibBCN_
uint64_t UScount[32][15]
MonitorElement * meDCCEventFormatError_
MonitorElement * meCh_DataIntegrityFED30_
MonitorElement * medccBCN_
MonitorElement * meCh_DataIntegrityFED12_
float Chann_DataIntegrityCheck_[32][(1+((2+1)*24))][(1+((2+1)*15))]
#define TWO___FED
MonitorElement * HTR_StatusWd_HBHE
MonitorElement * meCh_DataIntegrityFED10_
MonitorElement * meFib4OrbMsgBCN_
MonitorElement * meInvHTRData_
MonitorElement * meCh_DataIntegrityFED19_
void mapHTRproblem(int dcc, int spigot)
MonitorElement * meEvtNCheck_
MonitorElement * meBCNwhenOrNDiff_
MonitorElement * meFib1OrbMsgBCN_
void HTRPrint(const HcalHTRData &htr, int prtlvl)
unsigned long long uint64_t
Definition: Time.h:15
MonitorElement * meCrate11HTRStatus_
MonitorElement * meFib8OrbMsgBCN_
MonitorElement * meLRBDataCorruptionIndicators_
MonitorElement * meCh_DataIntegrityFED08_
edm::EDGetTokenT< HcalUnpackerReport > tok_unpack_
#define DEPTHBINS
MonitorElement * meCh_DataIntegrityFED29_
MonitorElement * meCh_DataIntegrityFED00_
#define ETABINS
MonitorElement * meCh_DataIntegrityFED26_
MonitorElement * meCrate1HTRStatus_
MonitorElement * meStatusWdCrate_
MonitorElement * meFib7OrbMsgBCN_
float LRBDataCorruptionIndicators_[(1+((3+1)*32))][(1+((3+1)*15))]
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
void mapChannproblem(int dcc, int spigot, int htrchan)
MonitorElement * meCh_DataIntegrityFED16_
#define THREE_SPG
MonitorElement * meCh_DataIntegrityFED07_
MonitorElement * meEvFragSize_
MonitorElement * HTR_StatusWd_HF
MonitorElement * meCh_DataIntegrityFED28_
MonitorElement * meFib2OrbMsgBCN_
#define PHIBINS
MonitorElement * meEvFragSize2_
float DataFlowInd_[(1+((2+1)*32))][(1+((3+1)*15))]
MonitorElement * meDCCVersion_
MonitorElement * meCh_DataIntegrityFED20_
std::map< int, short > DCCEvtFormat_list
MonitorElement * meCrate10HTRStatus_
MonitorElement * meHTRFWVersion_
MonitorElement * meFEDRawDataSizes_
MonitorElement * meCh_DataIntegrityFED01_
MonitorElement * mefedEntries_
MonitorElement * meCh_DataIntegrityFED15_
MonitorElement * meCh_DataIntegrityFED31_
HcalDetId HashToHDI(int thehash)
MonitorElement * meHalfHTRDataCorruptionIndicators_
edm::InputTag digiLabel_
int hashup(uint32_t d=0, uint32_t s=0, uint32_t c=1)
MonitorElement * meFib3OrbMsgBCN_
MonitorElement * meChann_DataIntegrityCheck_[32]
MonitorElement * meCh_DataIntegrityFED21_
MonitorElement * meFib6OrbMsgBCN_
Definition: Run.h:41
MonitorElement * meCh_DataIntegrityFED18_
void bookHistograms(DQMStore::IBooker &ib, const edm::Run &run, const edm::EventSetup &c)
MonitorElement * meCrate9HTRStatus_
MonitorElement * meCh_DataIntegrityFED22_