CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes
HcalDataIntegrityTask Class Reference

#include <HcalDataIntegrityTask.h>

Inheritance diagram for HcalDataIntegrityTask:
HcalBaseDQMonitor DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 
void bookHistograms (DQMStore::IBooker &ib, const edm::Run &run, const edm::EventSetup &c)
 
 HcalDataIntegrityTask (const edm::ParameterSet &ps)
 
void processEvent (const FEDRawDataCollection &rawraw, const HcalUnpackerReport &report, const HcalElectronicsMap &emap)
 
void reset ()
 
void setup (DQMStore::IBooker &)
 
void unpack (const FEDRawData &raw, const HcalElectronicsMap &emap)
 
 ~HcalDataIntegrityTask ()
 
- Public Member Functions inherited from HcalBaseDQMonitor
 HcalBaseDQMonitor (const edm::ParameterSet &ps)
 
 HcalBaseDQMonitor ()
 
virtual ~HcalBaseDQMonitor ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Public Attributes

std::map< uint32_t,
std::vector< HcalDetId > > 
DCCtoCell
 
std::map< uint32_t,
std::vector< HcalDetId >
>::iterator 
thisDCC
 

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
 
std::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
 
std::vector< HcalSubdetectordccSubdet_
 
MonitorElementfedEntries_
 
MonitorElementfedFatal_
 
MonitorElementfedNonFatal_
 
std::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
 
edm::InputTag inputLabelRawData_
 
edm::InputTag inputLabelReport_
 
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_
 
const HcalElectronicsMapreadoutMap_
 
edm::EDGetTokenT
< FEDRawDataCollection
tok_raw_
 
edm::EDGetTokenT
< HcalUnpackerReport
tok_report_
 

Static Private Attributes

static float DIMbin [32]
 
static size_t ietarange
 
static size_t iphirange
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from HcalBaseDQMonitor
virtual void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 
virtual void cleanup (void)
 
virtual void dqmBeginRun (const edm::Run &run, const edm::EventSetup &c)
 
virtual void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 
virtual void endRun (const edm::Run &run, const edm::EventSetup &c)
 
void getLogicalMap (const edm::EventSetup &c)
 
bool IsAllowedCalibType ()
 
bool LumiInOrder (int lumisec)
 
void SetupEtaPhiHists (DQMStore::IBooker &ib, EtaPhiHists &hh, std::string Name, std::string Units)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from HcalBaseDQMonitor
std::vector< int > AllowedCalibTypes_
 
int badChannelStatusMask_
 
int currentLS
 
int currenttype_
 
int debug_
 
bool enableCleanup_
 
bool eventAllowed_
 
bool HBpresent_
 
bool HEpresent_
 
bool HFpresent_
 
bool HOpresent_
 
int ievt_
 
std::map< unsigned int, int > KnownBadCells_
 
int levt_
 
HcalLogicalMaplogicalMap_
 
bool makeDiagnostics_
 
MonitorElementmeIevt_
 
MonitorElementmeLevt_
 
bool mergeRuns_
 
MonitorElementmeTevt_
 
MonitorElementmeTevtHist_
 
bool needLogicalMap_
 
int NLumiBlocks_
 
bool Online_
 
std::string prefixME_
 
MonitorElementProblemsCurrentLB
 
MonitorElementProblemsVsLB
 
MonitorElementProblemsVsLB_HB
 
MonitorElementProblemsVsLB_HBHEHF
 
MonitorElementProblemsVsLB_HE
 
MonitorElementProblemsVsLB_HF
 
MonitorElementProblemsVsLB_HO
 
bool skipOutOfOrderLS_
 
std::string subdir_
 
int tevt_
 

Detailed Description

Author
J. Temple – University of Maryland copied from W. Fisher/J. St. John's DataFormat code

Definition at line 29 of file HcalDataIntegrityTask.h.

Constructor & Destructor Documentation

HcalDataIntegrityTask::HcalDataIntegrityTask ( const edm::ParameterSet ps)

Definition at line 8 of file HcalDataIntegrityTask.cc.

References HcalBaseDQMonitor::AllowedCalibTypes_, HcalBaseDQMonitor::debug_, HcalBaseDQMonitor::enableCleanup_, edm::ParameterSet::getUntrackedParameter(), inputLabelRawData_, inputLabelReport_, HLT_25ns10e33_v2_cff::InputTag, HcalBaseDQMonitor::makeDiagnostics_, HcalBaseDQMonitor::mergeRuns_, HcalBaseDQMonitor::NLumiBlocks_, HcalBaseDQMonitor::Online_, HcalBaseDQMonitor::prefixME_, HcalBaseDQMonitor::skipOutOfOrderLS_, AlCaHLTBitMon_QueryRunRegistry::string, HcalBaseDQMonitor::subdir_, tok_raw_, and tok_report_.

9 {
10 
11  Online_ = ps.getUntrackedParameter<bool>("online",false);
12  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns",false);
13  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup",false);
14  debug_ = ps.getUntrackedParameter<int>("debug",0);
15  prefixME_ = ps.getUntrackedParameter<std::string>("subSystemFolder","Hcal");
16  if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!="/")
17  prefixME_.append("/");
18  subdir_ = ps.getUntrackedParameter<std::string>("TaskFolder","HcalDataIntegrityTask");
19  if (subdir_.size()>0 && subdir_.substr(subdir_.size()-1,subdir_.size())!="/")
20  subdir_.append("/");
21  subdir_=prefixME_+subdir_;
22  AllowedCalibTypes_ = ps.getUntrackedParameter<std::vector<int> > ("AllowedCalibTypes");
23  skipOutOfOrderLS_ = ps.getUntrackedParameter<bool>("skipOutOfOrderLS",false);
24  NLumiBlocks_ = ps.getUntrackedParameter<int>("NLumiBlocks",4000);
25  makeDiagnostics_ = ps.getUntrackedParameter<bool>("makeDiagnostics",false);
26 
27  // Specific Data Integrity Task parameters
29  inputLabelReport_ = ps.getUntrackedParameter<edm::InputTag>("UnpackerReportLabel",edm::InputTag("hcalDigis"));
30 
31 
32  // register for data access
33  tok_raw_ = consumes<FEDRawDataCollection>(inputLabelRawData_);
34  tok_report_ = consumes<HcalUnpackerReport>(inputLabelReport_);
35 
36 } // HcalDataIntegrityTask::HcalDataIntegrityTask()
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
std::vector< int > AllowedCalibTypes_
edm::EDGetTokenT< HcalUnpackerReport > tok_report_
HcalDataIntegrityTask::~HcalDataIntegrityTask ( )

Definition at line 38 of file HcalDataIntegrityTask.cc.

38 {}

Member Function Documentation

void HcalDataIntegrityTask::analyze ( const edm::Event e,
const edm::EventSetup s 
)
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 139 of file HcalDataIntegrityTask.cc.

References HcalBaseDQMonitor::analyze(), HcalBaseDQMonitor::debug_, edm::Event::getByToken(), inputLabelRawData_, inputLabelReport_, HcalBaseDQMonitor::IsAllowedCalibType(), HcalBaseDQMonitor::LumiInOrder(), edm::EventBase::luminosityBlock(), processEvent(), readoutMap_, zeeHLT_cff::report, tok_raw_, and tok_report_.

140 {
141  if (!IsAllowedCalibType()) return;
142  if (LumiInOrder(e.luminosityBlock())==false) return;
143 
144  // Now get the collections we need
145 
147 
148  if (!(e.getByToken(tok_raw_,rawraw)))
149  {
150  if (debug_>0) edm::LogWarning("HcalDataIntegrityTask")<<" raw data with label "<<inputLabelRawData_<<" not available";
151  return;
152  }
153 
155  if (!(e.getByToken(tok_report_,report)))
156  {
157  if (debug_>0) edm::LogWarning("HcalDataIntegrityTask")<<" UnpackerReport with label "<<inputLabelReport_<<" \not available";
158  return;
159  }
160 
161  // Collections were found; increment counters
163 
164  processEvent(*rawraw, *report, *readoutMap_);
165 }
bool LumiInOrder(int lumisec)
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:62
tuple report
Definition: zeeHLT_cff.py:9
const HcalElectronicsMap * readoutMap_
void processEvent(const FEDRawDataCollection &rawraw, const HcalUnpackerReport &report, const HcalElectronicsMap &emap)
edm::EDGetTokenT< HcalUnpackerReport > tok_report_
void HcalDataIntegrityTask::bookHistograms ( DQMStore::IBooker ib,
const edm::Run run,
const edm::EventSetup c 
)
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 51 of file HcalDataIntegrityTask.cc.

References HcalBaseDQMonitor::bookHistograms(), gather_cfg::cout, HcalBaseDQMonitor::debug_, edm::EventSetup::get(), HcalBaseDQMonitor::mergeRuns_, readoutMap_, reset(), setup(), HcalBaseDQMonitor::subdir_, and HcalBaseDQMonitor::tevt_.

52 {
53 
54  if (debug_>0) std::cout <<"HcalDataIntegrityTask::bookHistograms(): task = '"<<subdir_<<"'"<<std::endl;
55 
57  if (mergeRuns_ && tevt_>0) return;
58 
59  if (debug_>1) std::cout<<"\t<HcalDataIntegrityTask::getting eMap..."<<std::endl;
61  c.get<HcalDbRecord>().get( pSetup );
62  readoutMap_=pSetup->getHcalMapping();
63 
64  if (tevt_==0) // create histograms, if they haven't been created already
65  this->setup(ib);
66  // Clear histograms at the start of each run if not merging runs
67  if (mergeRuns_==false)
68  this->reset();
69 
70 } // bookHistograms(const edm::Run& run, const edm::EventSetup& c)
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
const HcalElectronicsMap * readoutMap_
const T & get() const
Definition: EventSetup.h:56
void setup(DQMStore::IBooker &)
tuple cout
Definition: gather_cfg.py:145
void HcalDataIntegrityTask::fillzoos ( int  bin,
int  dccid 
)
private
void HcalDataIntegrityTask::mapDCCproblem ( int  dcc)
private
void HcalDataIntegrityTask::mapHTRproblem ( int  dcc,
int  spigot 
)
private
void HcalDataIntegrityTask::processEvent ( const FEDRawDataCollection rawraw,
const HcalUnpackerReport report,
const HcalElectronicsMap emap 
)

Definition at line 169 of file HcalDataIntegrityTask.cc.

References FEDRawDataCollection::FEDData(), fedUnpackList_, i, FEDRawData::size(), and unpack().

Referenced by analyze().

171  {
172 
173  // Loop over all FEDs reporting the event, unpacking if good.
174  for (std::vector<int>::const_iterator i=fedUnpackList_.begin();i!=fedUnpackList_.end(); i++)
175  {
176  const FEDRawData& fed = rawraw.FEDData(*i);
177  if (fed.size()<12) continue; // Was 16. How do such tiny events even get here?
178  unpack(fed,emap);
179  }
180 
181  return;
182 } //void HcalDataIntegrityTask::processEvent()
int i
Definition: DBlmapReader.cc:9
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
std::vector< int > fedUnpackList_
void unpack(const FEDRawData &raw, const HcalElectronicsMap &emap)
void HcalDataIntegrityTask::reset ( void  )
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 40 of file HcalDataIntegrityTask.cc.

References gather_cfg::cout, HcalBaseDQMonitor::debug_, fedEntries_, fedFatal_, fedNonFatal_, HcalBaseDQMonitor::reset(), and MonitorElement::Reset().

Referenced by bookHistograms(), and setup().

41 {
42  if (debug_>0) std::cout <<"HcalDataIntegrityTask::reset()"<<std::endl;
44  fedEntries_->Reset();
45  fedFatal_->Reset();
47 
48 }
MonitorElement * fedEntries_
virtual void reset(void)
MonitorElement * fedNonFatal_
tuple cout
Definition: gather_cfg.py:145
void Reset(void)
reset ME (ie. contents, errors, etc)
void HcalDataIntegrityTask::setup ( DQMStore::IBooker ib)
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 73 of file HcalDataIntegrityTask.cc.

References DQMStore::IBooker::book1D(), gather_cfg::cout, HcalBaseDQMonitor::debug_, fedEntries_, fedFatal_, fedNonFatal_, fedUnpackList_, firstFED_, HBmap, HEmap, HFmap, HOmap, i, IETAMAX, IETAMIN, ietarange, IPHIMAX, IPHIMIN, iphirange, FEDNumbering::MAXHCALFEDID, FEDNumbering::MINHCALFEDID, phatmap, problemHB, problemHE, problemhere, problemHF, problemHO, reset(), DQMStore::IBooker::setCurrentFolder(), HcalBaseDQMonitor::setup(), and HcalBaseDQMonitor::subdir_.

Referenced by bookHistograms().

74 {
75  // Setup Creates all necessary histograms
77 
78  //Initialize phatmap to a vector of vectors of uint64_t 0
79  const static size_t iphirange = IPHIMAX - IPHIMIN;
80  const static size_t ietarange = IETAMAX - IETAMIN;
81 
82  std::vector<uint64_t> phatv (iphirange + 1, 0);
83 
84  if (debug_>0) std::cout <<"<HcalDataIntegrityTask::setup> Clearing old vectors"<<std::endl;
85  // Clear any old vectors
86  phatmap.clear();
87  HBmap.clear();
88  HEmap.clear();
89  HFmap.clear();
90  HOmap.clear();
91  problemhere.clear();
92  problemHB.clear();
93  problemHE.clear();
94  problemHF.clear();
95  problemHO.clear();
96 
97  // ... nothing goes at ieta=0, so an extra bin goes there.
98  phatmap = std::vector< std::vector < uint64_t> > ( ietarange + 1, phatv);
99  HBmap = std::vector< std::vector < uint64_t> > ( ietarange + 1, phatv);
100  HEmap = std::vector< std::vector < uint64_t> > ( ietarange + 1, phatv);
101  HFmap = std::vector< std::vector < uint64_t> > ( ietarange + 1, phatv);
102  HOmap = std::vector< std::vector < uint64_t> > ( ietarange + 1, phatv);
103  std::vector<bool> probvect (iphirange + 1, 0);
104  // ... nothing goes at ieta=0, so an extra bin goes there.
105  problemhere = std::vector< std::vector <bool> > ( ietarange + 1, probvect);
106  problemHB = std::vector< std::vector <bool> > ( ietarange + 1, probvect);
107  problemHE = std::vector< std::vector <bool> > ( ietarange + 1, probvect);
108  problemHF = std::vector< std::vector <bool> > ( ietarange + 1, probvect);
109  problemHO = std::vector< std::vector <bool> > ( ietarange + 1, probvect);
110 
111 
112 
113  if(debug_>1)
114  std::cout << "About to pushback fedUnpackList_" << std::endl;
115 
116  // Use this in CMSSW_3_0_X and above:
118  for (int i=FEDNumbering::MINHCALFEDID;
120  ++i)
121  {
122  if(debug_>1) std::cout << "[DFMon:]Pushback for fedUnpackList_: " << i <<std::endl;
123  fedUnpackList_.push_back(i);
124  }
125 
126  if (debug_>1)
127  std::cout <<"\t<HcalDataIntegrityTask> Setting folder to "<<subdir_<<std::endl;
128 
130 
131  fedEntries_ = ib.book1D("FEDEntries","# entries per HCAL FED",32,700,732);
132  fedFatal_ = ib.book1D("FEDFatal","# fatal errors HCAL FED",32,700,732);
133  fedNonFatal_ = ib.book1D("FEDNonFatal","# non-fatal errors HCAL FED",32,700,732);
134 
135  this->reset(); // clear all histograms at start
136  return;
137 }
int i
Definition: DBlmapReader.cc:9
#define IPHIMIN
std::vector< std::vector< bool > > problemHE
std::vector< std::vector< uint64_t > > HFmap
std::vector< std::vector< uint64_t > > phatmap
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
std::vector< std::vector< uint64_t > > HEmap
std::vector< int > fedUnpackList_
MonitorElement * fedEntries_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
std::vector< std::vector< bool > > problemHF
std::vector< std::vector< uint64_t > > HOmap
std::vector< std::vector< bool > > problemHB
#define IPHIMAX
std::vector< std::vector< uint64_t > > HBmap
MonitorElement * fedNonFatal_
std::vector< std::vector< bool > > problemHO
#define IETAMAX
#define IETAMIN
tuple cout
Definition: gather_cfg.py:145
std::vector< std::vector< bool > > problemhere
virtual void setup(DQMStore::IBooker &)
void HcalDataIntegrityTask::unpack ( const FEDRawData raw,
const HcalElectronicsMap emap 
)

Definition at line 186 of file HcalDataIntegrityTask.cc.

References HcalDCCHeader::BOEshouldBe5Always(), HcalDCCHeader::BOEshouldBeZeroAlways(), CDFEventType_list, CDFEvT_it, CDFReservedBits_it, CDFReservedBits_list, CDFvers_it, CDFversionNumber_list, FEDTrailer::check(), compareJSON::const, 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().

187  {
188  // get the DCC header
189  const HcalDCCHeader* dccHeader=reinterpret_cast<const HcalDCCHeader*>(raw.data());
190  if(!dccHeader) return;
191 
192  // get the DCC trailer
193  unsigned char const* trailer_ptr = reinterpret_cast<unsigned char const*>(raw.data()+raw.size()-sizeof(uint64_t));
194  FEDTrailer trailer = FEDTrailer(trailer_ptr);
195 
196  int dccid=dccHeader->getSourceId();
197 
199  bool CDFProbThisDCC = false;
200  /* 1 */ //There should always be a second CDF header word indicated.
201  if (!dccHeader->thereIsASecondCDFHeaderWord())
202  {
203  CDFProbThisDCC = true;
204  }
205 
206  /* 2 */ //Make sure a reference CDF Version value has been recorded for this dccid
207  CDFvers_it = CDFversionNumber_list.find(dccid);
208  if (CDFvers_it == CDFversionNumber_list.end())
209  {
210  CDFversionNumber_list.insert(std::pair<int,short>
211  (dccid,dccHeader->getCDFversionNumber() ) );
212  CDFvers_it = CDFversionNumber_list.find(dccid);
213  } // then check against it.
214 
215  if (dccHeader->getCDFversionNumber()!= CDFvers_it->second)
216  {
217  CDFProbThisDCC = true;
218  }
219 
220  /* 3 */ //Make sure a reference CDF EventType value has been recorded for this dccid
221  CDFEvT_it = CDFEventType_list.find(dccid);
222  if (CDFEvT_it == CDFEventType_list.end())
223  {
224  CDFEventType_list.insert(std::pair<int,short>
225  (dccid,dccHeader->getCDFEventType() ) );
226  CDFEvT_it = CDFEventType_list.find(dccid);
227  } // then check against it.
228 
229  if (dccHeader->getCDFEventType()!= CDFEvT_it->second)
230  {
231  // On probation until safe against Orbit Gap Calibration Triggers...
232  // CDFProbThisDCC = true;
233  }
234 
235  /* 4 */ //There should always be a '5' in CDF Header word 0, bits [63:60]
236  if (dccHeader->BOEshouldBe5Always()!=5)
237  {
238  CDFProbThisDCC = true;
239  }
240 
241  /* 5 */ //There should never be a third CDF Header word indicated.
242  if (dccHeader->thereIsAThirdCDFHeaderWord())
243  {
244  CDFProbThisDCC = true;
245  }
246 
247  /* 6 */ //Make sure a reference value of Reserved Bits has been recorded for this dccid
248 
251  CDFReservedBits_list.insert(std::pair<int,short>
252  (dccid,dccHeader->getSlink64ReservedBits() ) );
254  } // then check against it.
255 
256  if ((int) dccHeader->getSlink64ReservedBits()!= CDFReservedBits_it->second)
257  {
258  // On probation until safe against Orbit Gap Calibration Triggers...
259  // CDFProbThisDCC = true;
260  }
261 
262  /* 7 */ //There should always be 0x0 in CDF Header word 1, bits [63:60]
263  if (dccHeader->BOEshouldBeZeroAlways() !=0)
264  {
265  CDFProbThisDCC = true;
266  }
267 
268  /* 8 */ //There should only be one trailer
269  if (trailer.moreTrailers())
270  {
271  CDFProbThisDCC = true;
272  }
273  // if trailer.
274 
275  /* 9 */ //CDF Trailer [55:30] should be the # 64-bit words in the EvFragment
276  if ((uint64_t) raw.size() != ( (uint64_t) trailer.lenght()*sizeof(uint64_t)) ) //The function name is a typo! Awesome.
277  {
278  CDFProbThisDCC = true;
279  }
280  /*10 */ //There is a rudimentary sanity check built into the FEDTrailer class
281  if (!trailer.check())
282  {
283  CDFProbThisDCC = true;
284  }
285 
286  if (CDFProbThisDCC)
287  fedFatal_->Fill(dccid);
288  fedEntries_->Fill(dccid);
289 
290  return;
291 } // void HcalDataIntegrityTask::unpack()
bool check()
Definition: FEDTrailer.cc:64
unsigned int getSlink64ReservedBits() const
Definition: HcalDCCHeader.h:48
bool moreTrailers()
Definition: FEDTrailer.cc:37
std::map< int, short > CDFversionNumber_list
bool thereIsAThirdCDFHeaderWord() const
Definition: HcalDCCHeader.h:44
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
void Fill(long long x)
std::map< int, short >::iterator CDFvers_it
std::map< int, short >::iterator CDFReservedBits_it
unsigned short getCDFEventType() const
Definition: HcalDCCHeader.h:38
int getSourceId() const
Definition: HcalDCCHeader.h:32
MonitorElement * fedEntries_
unsigned long long uint64_t
Definition: Time.h:15
std::map< int, short >::iterator CDFEvT_it
int lenght()
The length of the event fragment counted in 64-bit words including header and trailer.
Definition: FEDTrailer.cc:17
string const
Definition: compareJSON.py:14
short BOEshouldBeZeroAlways() const
Definition: HcalDCCHeader.h:50
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
std::map< int, short > CDFReservedBits_list
std::map< int, short > CDFEventType_list
short getCDFversionNumber() const
Definition: HcalDCCHeader.h:30
unsigned short BOEshouldBe5Always() const
Definition: HcalDCCHeader.h:40
bool thereIsASecondCDFHeaderWord() const
Definition: HcalDCCHeader.h:28
void HcalDataIntegrityTask::UpdateMap ( )
private

Member Data Documentation

std::map<int, short> HcalDataIntegrityTask::CDFEventType_list
private

Definition at line 88 of file HcalDataIntegrityTask.h.

Referenced by unpack().

std::map<int, short>::iterator HcalDataIntegrityTask::CDFEvT_it
private

Definition at line 89 of file HcalDataIntegrityTask.h.

Referenced by unpack().

std::map<int, short>::iterator HcalDataIntegrityTask::CDFReservedBits_it
private

Definition at line 91 of file HcalDataIntegrityTask.h.

Referenced by unpack().

std::map<int, short> HcalDataIntegrityTask::CDFReservedBits_list
private

Definition at line 90 of file HcalDataIntegrityTask.h.

Referenced by unpack().

std::map<int, short>::iterator HcalDataIntegrityTask::CDFvers_it
private

Definition at line 87 of file HcalDataIntegrityTask.h.

Referenced by unpack().

std::map<int, short> HcalDataIntegrityTask::CDFversionNumber_list
private

Definition at line 86 of file HcalDataIntegrityTask.h.

Referenced by unpack().

std::vector<int> HcalDataIntegrityTask::dccCrate_
private

Definition at line 69 of file HcalDataIntegrityTask.h.

std::map<int, short>::iterator HcalDataIntegrityTask::DCCEvtFormat_it
private

Definition at line 93 of file HcalDataIntegrityTask.h.

std::map<int, short> HcalDataIntegrityTask::DCCEvtFormat_list
private

Definition at line 92 of file HcalDataIntegrityTask.h.

std::map<int, short>::iterator HcalDataIntegrityTask::DCCRsvdBits_it
private

Definition at line 95 of file HcalDataIntegrityTask.h.

std::map<int, short> HcalDataIntegrityTask::DCCRsvdBits_list
private

Definition at line 94 of file HcalDataIntegrityTask.h.

std::vector<HcalSubdetector> HcalDataIntegrityTask::dccSubdet_
private

Definition at line 70 of file HcalDataIntegrityTask.h.

std::map<uint32_t, std::vector<HcalDetId> > HcalDataIntegrityTask::DCCtoCell

Definition at line 45 of file HcalDataIntegrityTask.h.

float HcalDataIntegrityTask::DIMbin
staticprivate
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 98 of file HcalDataIntegrityTask.h.

MonitorElement* HcalDataIntegrityTask::fedEntries_
private

Definition at line 81 of file HcalDataIntegrityTask.h.

Referenced by reset(), setup(), and unpack().

MonitorElement* HcalDataIntegrityTask::fedFatal_
private

Definition at line 82 of file HcalDataIntegrityTask.h.

Referenced by reset(), setup(), and unpack().

MonitorElement* HcalDataIntegrityTask::fedNonFatal_
private

Definition at line 83 of file HcalDataIntegrityTask.h.

Referenced by reset(), and setup().

std::vector<int> HcalDataIntegrityTask::fedUnpackList_
private

Definition at line 68 of file HcalDataIntegrityTask.h.

Referenced by processEvent(), and setup().

int HcalDataIntegrityTask::firstFED_
private

Definition at line 71 of file HcalDataIntegrityTask.h.

Referenced by setup().

std::vector<std::vector<uint64_t> > HcalDataIntegrityTask::HBmap
private

Definition at line 61 of file HcalDataIntegrityTask.h.

Referenced by setup().

std::vector<std::vector<uint64_t> > HcalDataIntegrityTask::HEmap
private

Definition at line 62 of file HcalDataIntegrityTask.h.

Referenced by setup().

std::vector<std::vector<uint64_t> > HcalDataIntegrityTask::HFmap
private

Definition at line 63 of file HcalDataIntegrityTask.h.

Referenced by setup().

std::vector<std::vector<uint64_t> > HcalDataIntegrityTask::HOmap
private

Definition at line 64 of file HcalDataIntegrityTask.h.

Referenced by setup().

size_t HcalDataIntegrityTask::ietarange
staticprivate

Definition at line 51 of file HcalDataIntegrityTask.h.

Referenced by setup().

edm::InputTag HcalDataIntegrityTask::inputLabelRawData_
private

Definition at line 101 of file HcalDataIntegrityTask.h.

Referenced by analyze(), and HcalDataIntegrityTask().

edm::InputTag HcalDataIntegrityTask::inputLabelReport_
private

Definition at line 102 of file HcalDataIntegrityTask.h.

Referenced by analyze(), and HcalDataIntegrityTask().

size_t HcalDataIntegrityTask::iphirange
staticprivate

Definition at line 50 of file HcalDataIntegrityTask.h.

Referenced by setup().

int HcalDataIntegrityTask::lastBCN_
private

Definition at line 73 of file HcalDataIntegrityTask.h.

int HcalDataIntegrityTask::lastEvtN_
private

Definition at line 72 of file HcalDataIntegrityTask.h.

std::vector<std::vector<uint64_t> > HcalDataIntegrityTask::phatmap
private

Definition at line 60 of file HcalDataIntegrityTask.h.

Referenced by setup().

std::vector<std::vector<bool> > HcalDataIntegrityTask::problemHB
private

Definition at line 53 of file HcalDataIntegrityTask.h.

Referenced by setup().

std::vector<std::vector<bool> > HcalDataIntegrityTask::problemHE
private

Definition at line 54 of file HcalDataIntegrityTask.h.

Referenced by setup().

std::vector<std::vector<bool> > HcalDataIntegrityTask::problemhere
private

Definition at line 52 of file HcalDataIntegrityTask.h.

Referenced by setup().

std::vector<std::vector<bool> > HcalDataIntegrityTask::problemHF
private

Definition at line 55 of file HcalDataIntegrityTask.h.

Referenced by setup().

std::vector<std::vector<bool> > HcalDataIntegrityTask::problemHO
private

Definition at line 56 of file HcalDataIntegrityTask.h.

Referenced by setup().

int HcalDataIntegrityTask::prtlvl_
private

Definition at line 77 of file HcalDataIntegrityTask.h.

const HcalElectronicsMap* HcalDataIntegrityTask::readoutMap_
private

Definition at line 100 of file HcalDataIntegrityTask.h.

Referenced by analyze(), and bookHistograms().

std::map<uint32_t, std::vector<HcalDetId> >::iterator HcalDataIntegrityTask::thisDCC

Definition at line 46 of file HcalDataIntegrityTask.h.

edm::EDGetTokenT<FEDRawDataCollection> HcalDataIntegrityTask::tok_raw_
private

Definition at line 104 of file HcalDataIntegrityTask.h.

Referenced by analyze(), and HcalDataIntegrityTask().

edm::EDGetTokenT<HcalUnpackerReport> HcalDataIntegrityTask::tok_report_
private

Definition at line 105 of file HcalDataIntegrityTask.h.

Referenced by analyze(), and HcalDataIntegrityTask().