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