00001 #ifndef DQM_HCALMONITORTASKS_HCALDATAFORMATMONITOR_H
00002 #define DQM_HCALMONITORTASKS_HCALDATAFORMATMONITOR_H
00003
00004 #define IETAMIN -43
00005 #define IETAMAX 43
00006 #define IPHIMIN 0
00007 #define IPHIMAX 71
00008 #define HBHE_LO_DCC 700
00009 #define HBHE_HI_DCC 717
00010 #define HF_LO_DCC 718
00011 #define HF_HI_DCC 724
00012 #define HO_LO_DCC 725
00013 #define HO_HI_DCC 731
00014 #define NUMDCCS 32
00015 #define HTRCHANMAX 24
00016
00017 #define RCDIX 55
00018 #define RCDIY 22
00019 #define HHDIX 97
00020 #define HHDIY 61
00021 #define CSDIX 97
00022
00023 #define CIX 73
00024 #define CIY 46
00025
00026 #include "DQM/HcalMonitorTasks/interface/HcalBaseMonitor.h"
00027 #include "EventFilter/HcalRawToDigi/interface/HcalUnpacker.h"
00028 #include "EventFilter/HcalRawToDigi/interface/HcalHTRData.h"
00029 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
00030 #include "DQMServices/Core/interface/DQMStore.h"
00031 #include "DQMServices/Core/interface/MonitorElement.h"
00032
00039 class HcalDataFormatMonitor: public HcalBaseMonitor {
00040 public:
00041 HcalDataFormatMonitor();
00042 ~HcalDataFormatMonitor();
00043
00044 void setup(const edm::ParameterSet& ps, DQMStore* dbe);
00045
00046 void processEvent(const FEDRawDataCollection& rawraw, const
00047 HcalUnpackerReport& report, const HcalElectronicsMap& emap);
00048 void unpack(const FEDRawData& raw, const HcalElectronicsMap& emap);
00049 void clearME();
00050 void reset();
00051
00052 void HTRPrint(const HcalHTRData& htr,int prtlvl);
00053 void labelHTRBits(MonitorElement* mePlot,unsigned int axisType);
00054 void labelthezoo (MonitorElement* zoo);
00055
00056 public:
00057 void smuggleMaps(std::map<uint32_t, std::vector<HcalDetId> >& givenDCCtoCell,
00058 std::map<pair <int,int> , std::vector<HcalDetId> >& givenHTRtoCell);
00059 std::map<uint32_t, std::vector<HcalDetId> > DCCtoCell;
00060 std::map<uint32_t, std::vector<HcalDetId> > ::iterator thisDCC;
00061 std::map<pair <int,int> , std::vector<HcalDetId> > HTRtoCell;
00062 std::map<pair <int,int> , std::vector<HcalDetId> > ::iterator thisHTR;
00063
00064 private:
00065
00066 static size_t iphirange;
00067 static size_t ietarange;
00068 std::vector<std::vector<bool> > problemhere;
00069 std::vector<std::vector<bool> > problemHB;
00070 std::vector<std::vector<bool> > problemHE;
00071 std::vector<std::vector<bool> > problemHF;
00072 std::vector<std::vector<bool> > problemHO;
00073 void mapHTRproblem (int dcc, int spigot) ;
00074 void mapDCCproblem(int dcc) ;
00075 void fillzoos(int bin, int dccid);
00076 std::vector<std::vector<uint64_t> > phatmap;
00077 std::vector<std::vector<uint64_t> > HBmap;
00078 std::vector<std::vector<uint64_t> > HEmap;
00079 std::vector<std::vector<uint64_t> > HFmap;
00080 std::vector<std::vector<uint64_t> > HOmap;
00081 void UpdateMap();
00082
00083
00084 vector<int> fedUnpackList_;
00085 vector<int> dccCrate_;
00086 vector<HcalSubdetector> dccSubdet_;
00087 int firstFED_;
00088 int ievt_;
00089 int lastEvtN_;
00090 int lastBCN_;
00091
00092
00093
00094 int prtlvl_;
00095 int dfmon_checkNevents;
00096
00097 private:
00098
00099 MonitorElement* meEVT_;
00100 MonitorElement* DATAFORMAT_PROBLEM_MAP;
00101 MonitorElement* DATAFORMAT_PROBLEM_ZOO;
00102 MonitorElement* HB_DATAFORMAT_PROBLEM_MAP;
00103 MonitorElement* HBHE_DATAFORMAT_PROBLEM_ZOO;
00104 MonitorElement* HE_DATAFORMAT_PROBLEM_MAP;
00105 MonitorElement* HF_DATAFORMAT_PROBLEM_MAP;
00106 MonitorElement* HF_DATAFORMAT_PROBLEM_ZOO;
00107 MonitorElement* HO_DATAFORMAT_PROBLEM_MAP;
00108 MonitorElement* HO_DATAFORMAT_PROBLEM_ZOO;
00109
00110
00111 MonitorElement* meSpigotFormatErrors_;
00112 MonitorElement* meBadQualityDigis_;
00113 MonitorElement* meUnmappedDigis_;
00114 MonitorElement* meUnmappedTPDigis_;
00115 MonitorElement* meFEDerrorMap_;
00116
00117 MonitorElement* meFEDRawDataSizes_;
00118 MonitorElement* meUSFractSpigs_;
00119 MonitorElement* meUSEvtSizes2D_;
00120 MonitorElement* meUSEvtSizes1D_;
00121
00122 MonitorElement* me_HBHE_ZS_SlidingSum;
00123 MonitorElement* me_HF_ZS_SlidingSum;
00124 MonitorElement* me_HO_ZS_SlidingSum;
00125 MonitorElement* me_HBHE_ZS_SlidingSum_US;
00126 MonitorElement* me_HF_ZS_SlidingSum_US;
00127 MonitorElement* me_HO_ZS_SlidingSum_US;
00128
00129 MonitorElement* fedEntries_;
00130 MonitorElement* fedFatal_;
00131
00132
00133 MonitorElement* meEvtNumberSynch_;
00134 MonitorElement* meBCNSynch_;
00135 MonitorElement* meBCN_;
00136 MonitorElement* medccBCN_;
00137
00138 MonitorElement* meDCC_DataIntegrityCheck_;
00139 MonitorElement* meHalfHTR_DataIntegrityCheck_;
00140 MonitorElement* meChannSumm_DataIntegrityCheck_;
00141 float DCC_DataIntegrityCheck_ [RCDIX][RCDIY];
00142 float HalfHTR_DataIntegrityCheck_ [HHDIX][HHDIY];
00143 float ChannSumm_DataIntegrityCheck_[CSDIX][HHDIY];
00144 float Chann_DataIntegrityCheck_ [NUMDCCS][CIX][CIY];
00145 void UpdateMEs ();
00146
00147
00148 void label_ySpigots(MonitorElement* me_ptr,int ybins);
00149 void label_xFEDs (MonitorElement* me_ptr,int xbins);
00150 void label_xChanns (MonitorElement* me_ptr,int xbins);
00151
00152 MonitorElement* meInvHTRData_;
00153 MonitorElement* meBCNCheck_;
00154 MonitorElement* meEvtNCheck_;
00155 MonitorElement* meFibBCN_;
00156
00157 MonitorElement* meFWVersion_;
00158 MonitorElement* meEvFragSize_;
00159 MonitorElement* meEvFragSize2_;
00160
00161 MonitorElement* meErrWdCrate_;
00162
00163
00164
00165
00166 MonitorElement* meFEDId_;
00167 MonitorElement* meCDFErrorFound_;
00168 MonitorElement* meDCCEventFormatError_;
00169
00170 MonitorElement* meDCCErrorAndWarnConditions_;
00171 MonitorElement* meDCCStatusFlags_;
00172 MonitorElement* meDCCSummariesOfHTRs_;
00173
00174
00175
00176
00177 MonitorElement* meCrate0HTRErr_;
00178 MonitorElement* meCrate1HTRErr_;
00179 MonitorElement* meCrate2HTRErr_;
00180 MonitorElement* meCrate3HTRErr_;
00181 MonitorElement* meCrate4HTRErr_;
00182 MonitorElement* meCrate5HTRErr_;
00183 MonitorElement* meCrate6HTRErr_;
00184 MonitorElement* meCrate7HTRErr_;
00185 MonitorElement* meCrate8HTRErr_;
00186 MonitorElement* meCrate9HTRErr_;
00187 MonitorElement* meCrate10HTRErr_;
00188 MonitorElement* meCrate11HTRErr_;
00189 MonitorElement* meCrate12HTRErr_;
00190 MonitorElement* meCrate13HTRErr_;
00191 MonitorElement* meCrate14HTRErr_;
00192 MonitorElement* meCrate15HTRErr_;
00193 MonitorElement* meCrate16HTRErr_;
00194 MonitorElement* meCrate17HTRErr_;
00195
00196 MonitorElement* meCh_DataIntegrityFED00_;
00197 MonitorElement* meCh_DataIntegrityFED01_;
00198 MonitorElement* meCh_DataIntegrityFED02_;
00199 MonitorElement* meCh_DataIntegrityFED03_;
00200 MonitorElement* meCh_DataIntegrityFED04_;
00201 MonitorElement* meCh_DataIntegrityFED05_;
00202 MonitorElement* meCh_DataIntegrityFED06_;
00203 MonitorElement* meCh_DataIntegrityFED07_;
00204 MonitorElement* meCh_DataIntegrityFED08_;
00205 MonitorElement* meCh_DataIntegrityFED09_;
00206 MonitorElement* meCh_DataIntegrityFED10_;
00207 MonitorElement* meCh_DataIntegrityFED11_;
00208 MonitorElement* meCh_DataIntegrityFED12_;
00209 MonitorElement* meCh_DataIntegrityFED13_;
00210 MonitorElement* meCh_DataIntegrityFED14_;
00211 MonitorElement* meCh_DataIntegrityFED15_;
00212 MonitorElement* meCh_DataIntegrityFED16_;
00213 MonitorElement* meCh_DataIntegrityFED17_;
00214 MonitorElement* meCh_DataIntegrityFED18_;
00215 MonitorElement* meCh_DataIntegrityFED19_;
00216 MonitorElement* meCh_DataIntegrityFED20_;
00217 MonitorElement* meCh_DataIntegrityFED21_;
00218 MonitorElement* meCh_DataIntegrityFED22_;
00219 MonitorElement* meCh_DataIntegrityFED23_;
00220 MonitorElement* meCh_DataIntegrityFED24_;
00221 MonitorElement* meCh_DataIntegrityFED25_;
00222 MonitorElement* meCh_DataIntegrityFED26_;
00223 MonitorElement* meCh_DataIntegrityFED27_;
00224 MonitorElement* meCh_DataIntegrityFED28_;
00225 MonitorElement* meCh_DataIntegrityFED29_;
00226 MonitorElement* meCh_DataIntegrityFED30_;
00227 MonitorElement* meCh_DataIntegrityFED31_;
00228
00229 MonitorElement* meChann_DataIntegrityCheck_[32];
00230
00231 MonitorElement* meFib1OrbMsgBCN_;
00232 MonitorElement* meFib2OrbMsgBCN_;
00233 MonitorElement* meFib3OrbMsgBCN_;
00234 MonitorElement* meFib4OrbMsgBCN_;
00235 MonitorElement* meFib5OrbMsgBCN_;
00236 MonitorElement* meFib6OrbMsgBCN_;
00237 MonitorElement* meFib7OrbMsgBCN_;
00238 MonitorElement* meFib8OrbMsgBCN_;
00239
00240 MonitorElement* DCC_ErrWd_HBHE;
00241 MonitorElement* DCC_ErrWd_HF;
00242 MonitorElement* DCC_ErrWd_HO;
00243
00244 int currFiberChan;
00245 void LabelChannInteg(MonitorElement* me_ptr);
00246 bool isUnsuppressed (HcalHTRData& payload);
00247 uint64_t UScount[32][15];
00248
00249
00250 std::map<int, short> CDFversionNumber_list;
00251 std::map<int, short>::iterator CDFvers_it;
00252 std::map<int, short> CDFEventType_list;
00253 std::map<int, short>::iterator CDFEvT_it;
00254 std::map<int, short> CDFReservedBits_list;
00255 std::map<int, short>::iterator CDFReservedBits_it;
00256 std::map<int, short> DCCEvtFormat_list;
00257 std::map<int, short>::iterator DCCEvtFormat_it;
00258 std::map<int, short> DCCRsvdBits_list;
00259 std::map<int, short>::iterator DCCRsvdBits_it;
00260
00261
00262 static float DIMbin[32];
00263 };
00264
00265
00266 float HcalDataFormatMonitor::DIMbin[]={ 4, 4.5,
00267 0, 0.5,
00268 1, 1.5,
00269 5, 5.5,
00270 11, 11.5,
00271 15, 15.5,
00272 17, 17.5,
00273 14, 14.5,
00274 10, 10.5,
00275 2, 2.5,
00276 9, 9.5,
00277 12, 12.5,
00278 3, 3.5,
00279 7, 7.5,
00280 6, 6.5,
00281 13, 13.5
00282 };
00283
00284 #endif