#include <DQM/HcalMonitorTasks/interface/HcalDataIntegrityTask.h>
Public Member Functions | |
void | clearME () |
HcalDataIntegrityTask () | |
void | processEvent (const FEDRawDataCollection &rawraw, const HcalUnpackerReport &report, const HcalElectronicsMap &emap) |
void | reset () |
void | setup (const edm::ParameterSet &ps, DQMStore *dbe) |
void | unpack (const FEDRawData &raw, const HcalElectronicsMap &emap) |
~HcalDataIntegrityTask () | |
Public Attributes | |
std::map< uint32_t, std::vector< HcalDetId > > | DCCtoCell |
std::map< pair< int, int >, std::vector< HcalDetId > > | HTRtoCell |
std::map< uint32_t, std::vector< HcalDetId > >::iterator | thisDCC |
std::map< pair< int, int >, std::vector< HcalDetId > >::iterator | thisHTR |
Private Member Functions | |
void | fillzoos (int bin, int dccid) |
void | mapDCCproblem (int dcc) |
void | mapHTRproblem (int dcc, int spigot) |
void | UpdateMap () |
Private Attributes | |
std::map< int, short > | CDFEventType_list |
std::map< int, short >::iterator | CDFEvT_it |
std::map< int, short >::iterator | CDFReservedBits_it |
std::map< int, short > | CDFReservedBits_list |
std::map< int, short >::iterator | CDFvers_it |
std::map< int, short > | CDFversionNumber_list |
vector< int > | dccCrate_ |
std::map< int, short >::iterator | DCCEvtFormat_it |
std::map< int, short > | DCCEvtFormat_list |
std::map< int, short >::iterator | DCCRsvdBits_it |
std::map< int, short > | DCCRsvdBits_list |
vector< HcalSubdetector > | dccSubdet_ |
MonitorElement * | fedEntries_ |
MonitorElement * | fedFatal_ |
MonitorElement * | fedNonFatal_ |
vector< int > | fedUnpackList_ |
int | firstFED_ |
std::vector< std::vector < uint64_t > > | HBmap |
std::vector< std::vector < uint64_t > > | HEmap |
std::vector< std::vector < uint64_t > > | HFmap |
std::vector< std::vector < uint64_t > > | HOmap |
int | ievt_ |
int | lastBCN_ |
int | lastEvtN_ |
std::vector< std::vector < uint64_t > > | phatmap |
std::vector< std::vector< bool > > | problemHB |
std::vector< std::vector< bool > > | problemHE |
std::vector< std::vector< bool > > | problemhere |
std::vector< std::vector< bool > > | problemHF |
std::vector< std::vector< bool > > | problemHO |
int | prtlvl_ |
Static Private Attributes | |
static float | DIMbin [32] |
static size_t | ietarange |
static size_t | iphirange |
Definition at line 30 of file HcalDataIntegrityTask.h.
HcalDataIntegrityTask::HcalDataIntegrityTask | ( | ) |
Definition at line 7 of file HcalDataIntegrityTask.cc.
References HBmap, HEmap, HFmap, HOmap, IETAMAX, IETAMIN, ietarange, IPHIMAX, IPHIMIN, iphirange, phatmap, problemHB, problemHE, problemhere, problemHF, and problemHO.
00008 { 00009 //Initialize phatmap to a vector of vectors of uint64_t 0 00010 static size_t iphirange = IPHIMAX - IPHIMIN; 00011 static size_t ietarange = IETAMAX - IETAMIN; 00012 00013 std::vector<uint64_t> phatv (iphirange + 1, 0); 00014 // ... nothing goes at ieta=0, so an extra bin goes there. 00015 phatmap = vector< vector < uint64_t> > ( ietarange + 1, phatv); 00016 HBmap = vector< vector < uint64_t> > ( ietarange + 1, phatv); 00017 HEmap = vector< vector < uint64_t> > ( ietarange + 1, phatv); 00018 HFmap = vector< vector < uint64_t> > ( ietarange + 1, phatv); 00019 HOmap = vector< vector < uint64_t> > ( ietarange + 1, phatv); 00020 std::vector<bool> probvect (iphirange + 1, 0); 00021 // ... nothing goes at ieta=0, so an extra bin goes there. 00022 problemhere = vector< vector <bool> > ( ietarange + 1, probvect); 00023 problemHB = vector< vector <bool> > ( ietarange + 1, probvect); 00024 problemHE = vector< vector <bool> > ( ietarange + 1, probvect); 00025 problemHF = vector< vector <bool> > ( ietarange + 1, probvect); 00026 problemHO = vector< vector <bool> > ( ietarange + 1, probvect); 00027 00028 } // HcalDataIntegrityTask::HcalDataIntegrityTask()
HcalDataIntegrityTask::~HcalDataIntegrityTask | ( | ) |
void HcalDataIntegrityTask::clearME | ( | ) | [virtual] |
Reimplemented from HcalBaseMonitor.
Definition at line 34 of file HcalDataIntegrityTask.cc.
References HcalBaseMonitor::baseFolder_, HcalBaseMonitor::m_dbe, DQMStore::removeContents(), and DQMStore::setCurrentFolder().
Referenced by HcalMonitorModule::~HcalMonitorModule().
00035 { 00036 if(m_dbe){ 00037 m_dbe->setCurrentFolder(baseFolder_); 00038 m_dbe->removeContents(); 00039 } 00040 }
void HcalDataIntegrityTask::processEvent | ( | const FEDRawDataCollection & | rawraw, | |
const HcalUnpackerReport & | report, | |||
const HcalElectronicsMap & | emap | |||
) |
Definition at line 84 of file HcalDataIntegrityTask.cc.
References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), FEDRawDataCollection::FEDData(), fedUnpackList_, i, ievt_, HcalBaseMonitor::m_dbe, FEDRawData::size(), and unpack().
Referenced by HcalMonitorModule::analyze().
00086 { 00087 00088 if(!m_dbe) 00089 { 00090 cout<<"HcalDataIntegrityTask::processEvent DQMStore not instantiated!!!"<<endl; 00091 return; 00092 } 00093 00094 ievt_++; 00095 00096 // Loop over all FEDs reporting the event, unpacking if good. 00097 for (vector<int>::const_iterator i=fedUnpackList_.begin();i!=fedUnpackList_.end(); i++) 00098 { 00099 const FEDRawData& fed = rawraw.FEDData(*i); 00100 if (fed.size()<12) continue; // Was 16. How do such tiny events even get here? 00101 unpack(fed,emap); 00102 } 00103 00104 return; 00105 } //void HcalDataIntegrityTask::processEvent()
void HcalDataIntegrityTask::setup | ( | const edm::ParameterSet & | ps, | |
DQMStore * | dbe | |||
) | [virtual] |
Reimplemented from HcalBaseMonitor.
Definition at line 43 of file HcalDataIntegrityTask.cc.
References HcalBaseMonitor::baseFolder_, DQMStore::book1D(), GenMuonPlsPt100GeV_cfg::cout, lat::endl(), fedEntries_, fedFatal_, fedNonFatal_, fedUnpackList_, first, firstFED_, HcalBaseMonitor::fVerbosity, FEDNumbering::getHcalFEDIds(), edm::ParameterSet::getUntrackedParameter(), i, ievt_, HcalBaseMonitor::m_dbe, prtlvl_, HcalBaseMonitor::rootFolder_, DQMStore::setCurrentFolder(), and HcalBaseMonitor::setup().
Referenced by HcalMonitorModule::HcalMonitorModule().
00045 { 00046 HcalBaseMonitor::setup(ps,dbe); 00047 00048 ievt_=0; 00049 baseFolder_ = rootFolder_+"HcalDataIntegrityTask"; 00050 00051 if(fVerbosity) 00052 cout << "About to pushback fedUnpackList_" << endl; 00053 00054 firstFED_ = FEDNumbering::getHcalFEDIds().first; 00055 for (int i=FEDNumbering::getHcalFEDIds().first; 00056 i<=FEDNumbering::getHcalFEDIds().second; 00057 ++i) 00058 { 00059 if(fVerbosity) cout << "[DFMon:]Pushback for fedUnpackList_: " << i <<endl; 00060 fedUnpackList_.push_back(i); 00061 } 00062 00063 prtlvl_ = ps.getUntrackedParameter<int>("dfPrtLvl"); 00064 00065 if ( m_dbe ) 00066 { 00067 char* type; 00068 00069 if (fVerbosity) 00070 cout <<"SET TO HCAL/FEDIntegrity"<<endl; 00071 m_dbe->setCurrentFolder("Hcal/FEDIntegrity/"); 00072 type="FEDEntries"; 00073 fedEntries_ = m_dbe->book1D(type,"# entries per HCAL FED",32,700,732); 00074 type="FEDFatal"; 00075 fedFatal_ = m_dbe->book1D(type,"# fatal errors HCAL FED",32,700,732); 00076 type="FEDNonFatal"; 00077 fedNonFatal_ = m_dbe->book1D(type,"# non-fatal errors HCAL FED",32,700,732); 00078 } // if (m_dbe) 00079 00080 00081 return; 00082 }
void HcalDataIntegrityTask::unpack | ( | const FEDRawData & | raw, | |
const HcalElectronicsMap & | emap | |||
) |
Definition at line 109 of file HcalDataIntegrityTask.cc.
References HcalDCCHeader::BOEshouldBe5Always(), HcalDCCHeader::BOEshouldBeZeroAlways(), CDFEventType_list, CDFEvT_it, CDFReservedBits_it, CDFReservedBits_list, CDFvers_it, CDFversionNumber_list, FEDTrailer::check(), FEDRawData::data(), fedEntries_, fedFatal_, MonitorElement::Fill(), HcalDCCHeader::getCDFEventType(), HcalDCCHeader::getCDFversionNumber(), HcalDCCHeader::getSlink64ReservedBits(), HcalDCCHeader::getSourceId(), FEDTrailer::lenght(), FEDTrailer::moreTrailers(), FEDRawData::size(), HcalDCCHeader::thereIsASecondCDFHeaderWord(), and HcalDCCHeader::thereIsAThirdCDFHeaderWord().
Referenced by processEvent().
00110 { 00111 // get the DCC header 00112 const HcalDCCHeader* dccHeader=(const HcalDCCHeader*)(raw.data()); 00113 if(!dccHeader) return; 00114 00115 // get the DCC trailer 00116 unsigned char* trailer_ptr = (unsigned char*) (raw.data()+raw.size()-sizeof(uint64_t)); 00117 FEDTrailer trailer = FEDTrailer(trailer_ptr); 00118 00119 int dccid=dccHeader->getSourceId(); 00120 00122 bool CDFProbThisDCC = false; 00123 /* 1 */ //There should always be a second CDF header word indicated. 00124 if (!dccHeader->thereIsASecondCDFHeaderWord()) 00125 { 00126 CDFProbThisDCC = true; 00127 } 00128 00129 /* 2 */ //Make sure a reference CDF Version value has been recorded for this dccid 00130 CDFvers_it = CDFversionNumber_list.find(dccid); 00131 if (CDFvers_it == CDFversionNumber_list.end()) 00132 { 00133 CDFversionNumber_list.insert(pair<int,short> 00134 (dccid,dccHeader->getCDFversionNumber() ) ); 00135 CDFvers_it = CDFversionNumber_list.find(dccid); 00136 } // then check against it. 00137 00138 if (dccHeader->getCDFversionNumber()!= CDFvers_it->second) 00139 { 00140 CDFProbThisDCC = true; 00141 } 00142 00143 /* 3 */ //Make sure a reference CDF EventType value has been recorded for this dccid 00144 CDFEvT_it = CDFEventType_list.find(dccid); 00145 if (CDFEvT_it == CDFEventType_list.end()) 00146 { 00147 CDFEventType_list.insert(pair<int,short> 00148 (dccid,dccHeader->getCDFEventType() ) ); 00149 CDFEvT_it = CDFEventType_list.find(dccid); 00150 } // then check against it. 00151 00152 if (dccHeader->getCDFEventType()!= CDFEvT_it->second) 00153 { 00154 CDFProbThisDCC = true; 00155 } 00156 00157 /* 4 */ //There should always be a '5' in CDF Header word 0, bits [63:60] 00158 if (dccHeader->BOEshouldBe5Always()!=5) 00159 { 00160 CDFProbThisDCC = true; 00161 } 00162 00163 /* 5 */ //There should never be a third CDF Header word indicated. 00164 if (dccHeader->thereIsAThirdCDFHeaderWord()) 00165 { 00166 CDFProbThisDCC = true; 00167 } 00168 00169 /* 6 */ //Make sure a reference value of Reserved Bits has been recorded for this dccid 00170 00171 CDFReservedBits_it = CDFReservedBits_list.find(dccid); 00172 if (CDFReservedBits_it == CDFReservedBits_list.end()) { 00173 CDFReservedBits_list.insert(pair<int,short> 00174 (dccid,dccHeader->getSlink64ReservedBits() ) ); 00175 CDFReservedBits_it = CDFReservedBits_list.find(dccid); 00176 } // then check against it. 00177 00178 if ((int) dccHeader->getSlink64ReservedBits()!= CDFReservedBits_it->second) 00179 { 00180 CDFProbThisDCC = true; 00181 } 00182 00183 /* 7 */ //There should always be 0x0 in CDF Header word 1, bits [63:60] 00184 if (dccHeader->BOEshouldBeZeroAlways() !=0) 00185 { 00186 CDFProbThisDCC = true; 00187 } 00188 00189 /* 8 */ //There should only be one trailer 00190 if (trailer.moreTrailers()) 00191 { 00192 CDFProbThisDCC = true; 00193 } 00194 // if trailer. 00195 00196 /* 9 */ //CDF Trailer [55:30] should be the # 64-bit words in the EvFragment 00197 if ((uint64_t) raw.size() != ( (uint64_t) trailer.lenght()*sizeof(uint64_t)) ) //The function name is a typo! Awesome. 00198 { 00199 CDFProbThisDCC = true; 00200 } 00201 /*10 */ //There is a rudimentary sanity check built into the FEDTrailer class 00202 if (!trailer.check()) 00203 { 00204 CDFProbThisDCC = true; 00205 } 00206 00207 if (CDFProbThisDCC) 00208 fedFatal_->Fill(dccid); 00209 fedEntries_->Fill(dccid); 00210 00211 return; 00212 } // void HcalDataIntegrityTask::unpack(
void HcalDataIntegrityTask::UpdateMap | ( | ) | [private] |
std::map<int, short> HcalDataIntegrityTask::CDFEventType_list [private] |
std::map<int, short>::iterator HcalDataIntegrityTask::CDFEvT_it [private] |
std::map<int, short>::iterator HcalDataIntegrityTask::CDFReservedBits_it [private] |
std::map<int, short> HcalDataIntegrityTask::CDFReservedBits_list [private] |
std::map<int, short>::iterator HcalDataIntegrityTask::CDFvers_it [private] |
std::map<int, short> HcalDataIntegrityTask::CDFversionNumber_list [private] |
vector<int> HcalDataIntegrityTask::dccCrate_ [private] |
Definition at line 70 of file HcalDataIntegrityTask.h.
std::map<int, short>::iterator HcalDataIntegrityTask::DCCEvtFormat_it [private] |
Definition at line 96 of file HcalDataIntegrityTask.h.
std::map<int, short> HcalDataIntegrityTask::DCCEvtFormat_list [private] |
Definition at line 95 of file HcalDataIntegrityTask.h.
std::map<int, short>::iterator HcalDataIntegrityTask::DCCRsvdBits_it [private] |
Definition at line 98 of file HcalDataIntegrityTask.h.
std::map<int, short> HcalDataIntegrityTask::DCCRsvdBits_list [private] |
Definition at line 97 of file HcalDataIntegrityTask.h.
vector<HcalSubdetector> HcalDataIntegrityTask::dccSubdet_ [private] |
Definition at line 71 of file HcalDataIntegrityTask.h.
std::map<uint32_t, std::vector<HcalDetId> > HcalDataIntegrityTask::DCCtoCell |
Definition at line 44 of file HcalDataIntegrityTask.h.
float HcalDataIntegrityTask::DIMbin [static, private] |
Initial value:
{ 4, 4.5, 0, 0.5, 1, 1.5, 5, 5.5, 11, 11.5, 15, 15.5, 17, 17.5, 14, 14.5, 10, 10.5, 2, 2.5, 9, 9.5, 12, 12.5, 3, 3.5, 7, 7.5, 6, 6.5, 13, 13.5 }
Definition at line 101 of file HcalDataIntegrityTask.h.
MonitorElement* HcalDataIntegrityTask::fedEntries_ [private] |
MonitorElement* HcalDataIntegrityTask::fedFatal_ [private] |
vector<int> HcalDataIntegrityTask::fedUnpackList_ [private] |
int HcalDataIntegrityTask::firstFED_ [private] |
std::vector<std::vector<uint64_t> > HcalDataIntegrityTask::HBmap [private] |
std::vector<std::vector<uint64_t> > HcalDataIntegrityTask::HEmap [private] |
std::vector<std::vector<uint64_t> > HcalDataIntegrityTask::HFmap [private] |
std::vector<std::vector<uint64_t> > HcalDataIntegrityTask::HOmap [private] |
std::map<pair <int,int> , std::vector<HcalDetId> > HcalDataIntegrityTask::HTRtoCell |
Definition at line 46 of file HcalDataIntegrityTask.h.
size_t HcalDataIntegrityTask::ietarange [static, private] |
int HcalDataIntegrityTask::ievt_ [private] |
size_t HcalDataIntegrityTask::iphirange [static, private] |
int HcalDataIntegrityTask::lastBCN_ [private] |
Definition at line 75 of file HcalDataIntegrityTask.h.
int HcalDataIntegrityTask::lastEvtN_ [private] |
Definition at line 74 of file HcalDataIntegrityTask.h.
std::vector<std::vector<uint64_t> > HcalDataIntegrityTask::phatmap [private] |
std::vector<std::vector<bool> > HcalDataIntegrityTask::problemHB [private] |
std::vector<std::vector<bool> > HcalDataIntegrityTask::problemHE [private] |
std::vector<std::vector<bool> > HcalDataIntegrityTask::problemhere [private] |
std::vector<std::vector<bool> > HcalDataIntegrityTask::problemHF [private] |
std::vector<std::vector<bool> > HcalDataIntegrityTask::problemHO [private] |
int HcalDataIntegrityTask::prtlvl_ [private] |
std::map<uint32_t, std::vector<HcalDetId> >::iterator HcalDataIntegrityTask::thisDCC |
Definition at line 45 of file HcalDataIntegrityTask.h.
std::map<pair <int,int> , std::vector<HcalDetId> >::iterator HcalDataIntegrityTask::thisHTR |
Definition at line 47 of file HcalDataIntegrityTask.h.