Go to the documentation of this file.00001 #ifndef DQM_HCALMONITORTASKS_HCALRAWDATAMONITOR_H
00002 #define DQM_HCALMONITORTASKS_HCALRAWDATAMONITOR_H
00003
00004 #define NUMDCCS 32
00005 #define NUMSPIGS 15
00006 #define HTRCHANMAX 24
00007
00008
00009 #define TWO___FED (1+((2+1)*NUMDCCS) )
00010 #define THREE_FED (1+((3+1)*NUMDCCS) )
00011 #define TWO__SPGT (1+((2+1)*NUMSPIGS) )
00012 #define THREE_SPG (1+((3+1)*NUMSPIGS) )
00013 #define TWO_CHANN (1+((2+1)*HTRCHANMAX))
00014
00015 #define ETABINS 85
00016 #define PHIBINS 72
00017 #define DEPTHBINS 4
00018
00019 #include "DQM/HcalMonitorTasks/interface/HcalBaseDQMonitor.h"
00020 #include "EventFilter/HcalRawToDigi/interface/HcalUnpacker.h"
00021 #include "EventFilter/HcalRawToDigi/interface/HcalHTRData.h"
00022 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
00023 #include "DataFormats/FEDRawData/interface/FEDNumbering.h"
00024 #include "DataFormats/FEDRawData/interface/FEDNumbering.h"
00025 #include "DataFormats/FEDRawData/interface/FEDTrailer.h"
00026 #include <math.h>
00027
00034 class HcalRawDataMonitor: public HcalBaseDQMonitor {
00035 public:
00036 HcalRawDataMonitor(const edm::ParameterSet& ps);
00037
00038 HcalRawDataMonitor(){};
00039 ~HcalRawDataMonitor();
00040 protected:
00041 void analyze(const edm::Event& e, const edm::EventSetup& c);
00042 void beginRun(const edm::Run& run, const edm::EventSetup& c);
00043 void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
00044 const edm::EventSetup& c) ;
00045
00046
00047 void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
00048 const edm::EventSetup& c);
00049
00050 void processEvent(const FEDRawDataCollection& rawraw,
00051 const HcalUnpackerReport& report);
00052
00053 void unpack(const FEDRawData& raw);
00054 void endJob(void);
00055 void endRun(const edm::Run& run, const edm::EventSetup& c);
00056 void setup(void);
00057
00058 edm::InputTag FEDRawDataCollection_;
00059 edm::InputTag digiLabel_;
00060 const HcalElectronicsMap* readoutMap_;
00061
00062 inline int hashup(uint32_t d=0, uint32_t s=0, uint32_t c=1) {
00063 return (int) ( (d*NUMSPIGS*HTRCHANMAX)+(s*HTRCHANMAX)+(c)); }
00064 void stashHDI(int thehash, HcalDetId thehcaldetid);
00065
00066 inline HcalDetId HashToHDI(int thehash) {
00067 return ( ( (thehash<0) || (thehash>(NUMDCCS*NUMSPIGS*HTRCHANMAX)) )
00068 ?(HcalDetId::Undefined)
00069 :(hashedHcalDetId_[thehash]));
00070 };
00071 uint64_t uniqcounter[ETABINS][PHIBINS][DEPTHBINS];
00072 uint64_t problemcount[ETABINS][PHIBINS][DEPTHBINS];
00073 bool problemfound[ETABINS][PHIBINS][DEPTHBINS];
00074 void mapDCCproblem (int dcc);
00075 void mapHTRproblem (int dcc, int spigot);
00076 void mapChannproblem(int dcc, int spigot, int htrchan);
00077 void whosebad(int subdet);
00078
00079 private:
00080 MonitorElement* meCh_DataIntegrityFED00_;
00081 MonitorElement* meCh_DataIntegrityFED01_;
00082 MonitorElement* meCh_DataIntegrityFED02_;
00083 MonitorElement* meCh_DataIntegrityFED03_;
00084 MonitorElement* meCh_DataIntegrityFED04_;
00085 MonitorElement* meCh_DataIntegrityFED05_;
00086 MonitorElement* meCh_DataIntegrityFED06_;
00087 MonitorElement* meCh_DataIntegrityFED07_;
00088 MonitorElement* meCh_DataIntegrityFED08_;
00089 MonitorElement* meCh_DataIntegrityFED09_;
00090 MonitorElement* meCh_DataIntegrityFED10_;
00091 MonitorElement* meCh_DataIntegrityFED11_;
00092 MonitorElement* meCh_DataIntegrityFED12_;
00093 MonitorElement* meCh_DataIntegrityFED13_;
00094 MonitorElement* meCh_DataIntegrityFED14_;
00095 MonitorElement* meCh_DataIntegrityFED15_;
00096 MonitorElement* meCh_DataIntegrityFED16_;
00097 MonitorElement* meCh_DataIntegrityFED17_;
00098 MonitorElement* meCh_DataIntegrityFED18_;
00099 MonitorElement* meCh_DataIntegrityFED19_;
00100 MonitorElement* meCh_DataIntegrityFED20_;
00101 MonitorElement* meCh_DataIntegrityFED21_;
00102 MonitorElement* meCh_DataIntegrityFED22_;
00103 MonitorElement* meCh_DataIntegrityFED23_;
00104 MonitorElement* meCh_DataIntegrityFED24_;
00105 MonitorElement* meCh_DataIntegrityFED25_;
00106 MonitorElement* meCh_DataIntegrityFED26_;
00107 MonitorElement* meCh_DataIntegrityFED27_;
00108 MonitorElement* meCh_DataIntegrityFED28_;
00109 MonitorElement* meCh_DataIntegrityFED29_;
00110 MonitorElement* meCh_DataIntegrityFED30_;
00111 MonitorElement* meCh_DataIntegrityFED31_;
00112
00113 MonitorElement* meChann_DataIntegrityCheck_[NUMDCCS];
00114
00115 uint64_t UScount[NUMDCCS][NUMSPIGS];
00116 float HalfHTRDataCorruptionIndicators_ [THREE_FED][THREE_SPG];
00117 float LRBDataCorruptionIndicators_ [THREE_FED][THREE_SPG];
00118 float ChannSumm_DataIntegrityCheck_ [TWO___FED][TWO__SPGT];
00119 float Chann_DataIntegrityCheck_[NUMDCCS][TWO_CHANN][TWO__SPGT];
00120 float DataFlowInd_ [TWO___FED][THREE_SPG];
00121
00122 MonitorElement* meHalfHTRDataCorruptionIndicators_;
00123 MonitorElement* meLRBDataCorruptionIndicators_;
00124 MonitorElement* meChannSumm_DataIntegrityCheck_;
00125 MonitorElement* meDataFlowInd_;
00126
00127
00128 void label_ySpigots(MonitorElement* me_ptr,int ybins);
00129 void label_xFEDs (MonitorElement* me_ptr,int xbins);
00130 void label_xChanns (MonitorElement* me_ptr,int xbins);
00131
00132 HcalDetId hashedHcalDetId_[NUMDCCS * NUMSPIGS * HTRCHANMAX];
00133
00134
00135 void UpdateMEs (void );
00136
00137
00138 std::map<int, short> CDFversionNumber_list;
00139 std::map<int, short>::iterator CDFvers_it;
00140 std::map<int, short> CDFReservedBits_list;
00141 std::map<int, short>::iterator CDFReservedBits_it;
00142 std::map<int, short> DCCEvtFormat_list;
00143 std::map<int, short>::iterator DCCEvtFormat_it;
00144
00145
00146
00147 MonitorElement* meCDFErrorFound_;
00148 MonitorElement* meDCCEventFormatError_;
00149
00150
00151 MonitorElement* meBCN_;
00152 MonitorElement* medccBCN_;
00153 MonitorElement* meBCNCheck_;
00154 MonitorElement* meBCNSynch_;
00155
00156 MonitorElement* meEvtNCheck_;
00157 MonitorElement* meEvtNumberSynch_;
00158
00159 MonitorElement* meOrNCheck_;
00160 MonitorElement* meOrNSynch_;
00161 MonitorElement* meBCNwhenOrNDiff_;
00162
00163 MonitorElement* mefedEntries_;
00164 MonitorElement* meFEDRawDataSizes_;
00165 MonitorElement* meEvFragSize_;
00166 MonitorElement* meEvFragSize2_;
00167 MonitorElement* meDCCVersion_;
00168
00169 void labelHTRBits(MonitorElement* mePlot,unsigned int axisType);
00170 MonitorElement* HTR_StatusWd_HBHE;
00171 MonitorElement* HTR_StatusWd_HF;
00172 MonitorElement* HTR_StatusWd_HO;
00173 MonitorElement* meStatusWdCrate_;
00174 MonitorElement* meInvHTRData_;
00175 MonitorElement* meFibBCN_;
00176
00177
00178
00179 MonitorElement* meCrate0HTRStatus_ ;
00180 MonitorElement* meCrate1HTRStatus_ ;
00181 MonitorElement* meCrate2HTRStatus_ ;
00182 MonitorElement* meCrate3HTRStatus_ ;
00183 MonitorElement* meCrate4HTRStatus_ ;
00184 MonitorElement* meCrate5HTRStatus_ ;
00185 MonitorElement* meCrate6HTRStatus_ ;
00186 MonitorElement* meCrate7HTRStatus_ ;
00187 MonitorElement* meCrate9HTRStatus_ ;
00188 MonitorElement* meCrate10HTRStatus_;
00189 MonitorElement* meCrate11HTRStatus_;
00190 MonitorElement* meCrate12HTRStatus_;
00191 MonitorElement* meCrate13HTRStatus_;
00192 MonitorElement* meCrate14HTRStatus_;
00193 MonitorElement* meCrate15HTRStatus_;
00194 MonitorElement* meCrate17HTRStatus_;
00195
00196 MonitorElement* meUSFractSpigs_;
00197 MonitorElement* meHTRFWVersion_;
00198 MonitorElement* meFib1OrbMsgBCN_;
00199 MonitorElement* meFib2OrbMsgBCN_;
00200 MonitorElement* meFib3OrbMsgBCN_;
00201 MonitorElement* meFib4OrbMsgBCN_;
00202 MonitorElement* meFib5OrbMsgBCN_;
00203 MonitorElement* meFib6OrbMsgBCN_;
00204 MonitorElement* meFib7OrbMsgBCN_;
00205 MonitorElement* meFib8OrbMsgBCN_;
00206
00207 int NumBadHB, NumBadHE, NumBadHO, NumBadHF, NumBadHFLUMI, NumBadHO0, NumBadHO12;
00208
00209 void HTRPrint(const HcalHTRData& htr,int prtlvl);
00210
00211 bool excludeHORing2_;
00212 };
00213
00214 #endif