CMS 3D CMS Logo

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

#include <HcalMonitorModule.h>

Inheritance diagram for HcalMonitorModule:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 HcalMonitorModule (const edm::ParameterSet &ps)
 
 ~HcalMonitorModule ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 
void beginJob ()
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 
void beginRun (const edm::Run &run, const edm::EventSetup &c)
 
void CheckSubdetectorStatus (const edm::Handle< FEDRawDataCollection > &rawraw, HcalSubdetector subdet, const HcalElectronicsMap &emap)
 
void cleanup (void)
 
void endJob (void)
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 
void endRun (const edm::Run &run, const edm::EventSetup &c)
 
void reset (void)
 
void setup (void)
 
- 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)
 

Private Attributes

EtaPhiHists ChannelStatus
 
DQMStoredbe_
 
int debug_
 
const HcalElectronicsMapeMap_
 
bool enableCleanup_
 
int evtNumber_
 
edm::InputTag FEDRawDataCollection_
 
bool fedsListed_
 
int HBpresent_
 
int HEpresent_
 
int HFpresent_
 
int HOpresent_
 
int ievt_
 
bool init_
 
edm::InputTag inputLabelReport_
 
MonitorElementmeCalibType_
 
MonitorElementmeCurrentCalibType_
 
MonitorElementmeEvt_
 
MonitorElementmeEvtsVsLS_
 
MonitorElementmeFEDS_
 
MonitorElementmeHB_
 
MonitorElementmeHE_
 
MonitorElementmeHF_
 
MonitorElementmeHO_
 
MonitorElementmeIevt_
 
MonitorElementmeIevtHist_
 
MonitorElementmeOnline_
 
MonitorElementmeProcessedEndLumi_
 
bool mergeRuns_
 
MonitorElementmeRun_
 
MonitorElementmeStatus_
 
int NLumiBlocks_
 
bool Online_
 
std::string prefixME_
 
int runNumber_
 
edm::EDGetTokenT
< FEDRawDataCollection
tok_raw_
 
edm::EDGetTokenT
< HcalUnpackerReport
tok_report_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 29 of file HcalMonitorModule.h.

Constructor & Destructor Documentation

HcalMonitorModule::HcalMonitorModule ( const edm::ParameterSet ps)

Definition at line 55 of file HcalMonitorModule.cc.

References debug_, enableCleanup_, FEDRawDataCollection_, edm::ParameterSet::getUntrackedParameter(), init_, inputLabelReport_, mergeRuns_, NLumiBlocks_, Online_, prefixME_, AlCaHLTBitMon_QueryRunRegistry::string, tok_raw_, and tok_report_.

56 { // Set initial values
57  init_=false; // first event sets up Monitor Elements and sets init_ to true
58 
59  // get ps objects
60  Online_ = ps.getUntrackedParameter<bool>("online",false);
61  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns",false);
62  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup",false);
63  debug_ = ps.getUntrackedParameter<int>("debug",0);
64 
65  FEDRawDataCollection_ = ps.getUntrackedParameter<edm::InputTag>("FEDRawDataCollection");
66  tok_raw_ = consumes<FEDRawDataCollection>(FEDRawDataCollection_);
67 
69  tok_report_ = consumes<HcalUnpackerReport>(inputLabelReport_);
70 
71  prefixME_ = ps.getUntrackedParameter<std::string>("subSystemFolder","Hcal/");
72  if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!="/")
73  prefixME_.append("/");
74 
75  NLumiBlocks_ = ps.getUntrackedParameter<int>("NLumiBlocks",4000);
76 
77 } // HcalMonitorModule::HcalMonitorModule
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag inputLabelReport_
edm::InputTag FEDRawDataCollection_
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
edm::EDGetTokenT< HcalUnpackerReport > tok_report_
HcalMonitorModule::~HcalMonitorModule ( )

Definition at line 81 of file HcalMonitorModule.cc.

82 {
83 
84 } //HcalMonitorModule::~HcalMonitorModule()

Member Function Documentation

void HcalMonitorModule::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

Implements edm::EDAnalyzer.

Definition at line 313 of file HcalMonitorModule.cc.

References diJetCalib::calibType, CheckSubdetectorStatus(), gather_cfg::cout, FEDRawData::data(), debug_, eMap_, edm::EventID::event(), evtNumber_, f, FEDRawDataCollection_, fedsListed_, MonitorElement::Fill(), edm::Event::getByToken(), HBpresent_, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HEpresent_, HFpresent_, HOpresent_, i, edm::EventBase::id(), ievt_, init_, inputLabelReport_, LogDebug, edm::EventBase::luminosityBlock(), FEDNumbering::MAXHCALFEDID, meCalibType_, meCurrentCalibType_, meEvt_, meEvtsVsLS_, meFEDS_, meIevt_, meIevtHist_, meRun_, meStatus_, FEDNumbering::MINHCALFEDID, zeeHLT_cff::report, edm::EventID::run(), runNumber_, setup(), FEDRawData::size(), tok_raw_, tok_report_, and relativeConstraints::value.

314 {
315  if (!init_) this->setup();
316 
317  LogDebug("HcalMonitorModule")<<"processing event "<<ievt_;
318 
319  // Fill Monitor Elements with run, evt, processed event info
320  ++ievt_;
321  runNumber_=e.id().run();
322  evtNumber_=e.id().event();
323  if (meRun_) meRun_->Fill(runNumber_);
324  if (meEvt_) meEvt_->Fill(evtNumber_);
325  if (meIevt_) meIevt_->Fill(ievt_);
326  if (meIevtHist_) meIevtHist_->Fill(1);
328  if (ievt_==1)
329  {
330  LogDebug("HcalMonitorModule") << "processing run " << runNumber_;
331  // begin-of-run
332  if ( meStatus_ ) meStatus_->Fill(0);
333  }
334  else
335  {
336  // running
337  if ( meStatus_ ) meStatus_->Fill(1);
338  }
339 
340  // Try to get raw data
342  if (!(e.getByToken(tok_raw_,rawraw)))
343  {
344  edm::LogWarning("HcalMonitorModule")<<" raw data with label "<<FEDRawDataCollection_ <<" not available";
345  return;
346  }
347 
348  // Get Event Calibration Type -- copy of Bryan Dahmes' filter
349  int calibType=-1;
350  int numEmptyFEDs = 0 ;
351  std::vector<int> calibTypeCounter(8,0) ;
353  {
354  const FEDRawData& fedData = rawraw->FEDData(i) ;
355 
356  if ( fedData.size() < 24 ) numEmptyFEDs++ ;
357  if ( fedData.size() < 24 ) continue;
358 
359  int value = (int)((const HcalDCCHeader*)(fedData.data()))->getCalibType() ;
360  if(value>7)
361  {
362  edm::LogWarning("HcalMonitorModule::CalibTypeFilter") << "Unexpected Calibration type: "<< value << " in FED: "<<i<<" (should be 0-7). I am bailing out...";
363  return;
364  }
365 
366  calibTypeCounter.at(value)++ ; // increment the counter for this calib type
367  } // for (int i = FEDNumbering::MINHCALFEDID; ...)
368 
369  int maxCount = 0;
370  int numberOfFEDIds = FEDNumbering::MAXHCALFEDID - FEDNumbering::MINHCALFEDID + 1 ;
371  for (unsigned int i=0; i<calibTypeCounter.size(); i++) {
372  if ( calibTypeCounter.at(i) > maxCount )
373  { calibType = i ; maxCount = calibTypeCounter.at(i) ; }
374  if ( maxCount == numberOfFEDIds ) break ;
375  }
376 
377  if ( maxCount != (numberOfFEDIds-numEmptyFEDs) )
378  edm::LogWarning("HcalMonitorModule::CalibTypeFilter") << "Conflicting calibration types found. Assigning type "
379  << calibType ;
380  LogDebug("HcalMonitorModule::CalibTypeFilter") << "Calibration type is: " << calibType ;
381  // Fill histogram of calibration types, as well as integer to keep track of current value
382  if (meCalibType_) meCalibType_->Fill(calibType);
385 
386  if (debug_>2) std::cout <<"\t<HcalMonitorModule> ievt = "<<ievt_<<" calibration type = "<<calibType<<std::endl;
387 
388  // Check to see which subdetectors are present.
389  // May only need to do this on first event? Subdets don't appear during a run?
390  if (HBpresent_==0)
392  if (HEpresent_==0)
394  if (HOpresent_==0)
396  if (HFpresent_==0)
398 
399  // Here, we do need this information each event
401  if (!(e.getByToken(tok_report_,report)))
402  {
403  edm::LogWarning("HcalMonitorModule")<<" Unpacker Report "<<inputLabelReport_<<" not available";
404  return;
405  }
406 
407  if (!fedsListed_)
408  {
409  const std::vector<int> feds = (*report).getFedsUnpacked();
410  for(unsigned int f=0; f<feds.size(); ++f)
411  meFEDS_->Fill(feds[f]);
412  fedsListed_ = true;
413  } // if (!fedsListed_)
414 
415 } // void HcalMonitorModule::analyze(...)
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:42
EventNumber_t event() const
Definition: EventID.h:44
int i
Definition: DBlmapReader.cc:9
MonitorElement * meStatus_
edm::InputTag inputLabelReport_
edm::InputTag FEDRawDataCollection_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
tuple calibType
Definition: diJetCalib.py:20
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
MonitorElement * meEvt_
void CheckSubdetectorStatus(const edm::Handle< FEDRawDataCollection > &rawraw, HcalSubdetector subdet, const HcalElectronicsMap &emap)
MonitorElement * meCurrentCalibType_
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
const HcalElectronicsMap * eMap_
void Fill(long long x)
MonitorElement * meCalibType_
tuple report
Definition: zeeHLT_cff.py:9
MonitorElement * meFEDS_
double f[11][100]
MonitorElement * meIevt_
MonitorElement * meRun_
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
edm::EventID id() const
Definition: EventBase.h:56
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
MonitorElement * meIevtHist_
tuple cout
Definition: gather_cfg.py:121
edm::EDGetTokenT< HcalUnpackerReport > tok_report_
MonitorElement * meEvtsVsLS_
void HcalMonitorModule::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 88 of file HcalMonitorModule.cc.

References gather_cfg::cout, dbe_, debug_, eMap_, fedsListed_, HBpresent_, HEpresent_, HFpresent_, HOpresent_, ievt_, meCalibType_, meEvtsVsLS_, meFEDS_, meHB_, meHE_, meHF_, meHO_, meIevt_, meIevtHist_, meProcessedEndLumi_, and cppFunctionSkipper::operator.

89 {
90  if (debug_>0) std::cout <<"HcalMonitorModule::beginJob()"<<std::endl;
91  // Get DQM service
93  // set default values
94  ievt_=0;
95  fedsListed_=false;
96  HBpresent_=0;
97  HEpresent_=0;
98  HOpresent_=0;
99  HFpresent_=0;
100  // Set pointers to null
101  meCalibType_=0;
102  meFEDS_=0;
103  meIevt_=0;
104  meIevtHist_=0;
105  meEvtsVsLS_=0;
107  meHB_=0;
108  meHE_=0;
109  meHO_=0;
110  meHF_=0;
111  eMap_=0;
112 }
MonitorElement * meHB_
MonitorElement * meHO_
MonitorElement * meProcessedEndLumi_
const HcalElectronicsMap * eMap_
MonitorElement * meCalibType_
MonitorElement * meFEDS_
MonitorElement * meHE_
MonitorElement * meIevt_
MonitorElement * meIevtHist_
tuple cout
Definition: gather_cfg.py:121
MonitorElement * meHF_
MonitorElement * meEvtsVsLS_
void HcalMonitorModule::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 278 of file HcalMonitorModule.cc.

References gather_cfg::cout, and debug_.

280 {
281  if (debug_>0) std::cout <<"HcalMonitorModule::beginLuminosityBlock"<<std::endl;
282 }// void HcalMonitorModule::beginLuminosityBlock(...)
tuple cout
Definition: gather_cfg.py:121
void HcalMonitorModule::beginRun ( const edm::Run run,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 114 of file HcalMonitorModule.cc.

References gather_cfg::cout, debug_, eMap_, edm::EventSetup::get(), mergeRuns_, reset(), and setup().

115 {
116  if ( debug_>0 ) std::cout << "HcalMonitorModule: beginRun" << std::endl;
117  // reset histograms & counters on a new run, unless merging allowed
118 
119  if (eMap_==0) //eMap_ not created yet
120  {
121  if (debug_>1) std::cout <<"\t<HcalMonitorModule::beginRun> Getting Emap!"<<std::endl;
123  c.get<HcalDbRecord>().get( pSetup );
124  eMap_=pSetup->getHcalMapping();
125  }
126  if (mergeRuns_) return;
127  this->setup();
128  this->reset();
129 
130 } //HcalMonitorModule::beginRun(....)
const HcalElectronicsMap * eMap_
const T & get() const
Definition: EventSetup.h:55
tuple cout
Definition: gather_cfg.py:121
void HcalMonitorModule::CheckSubdetectorStatus ( const edm::Handle< FEDRawDataCollection > &  rawraw,
HcalSubdetector  subdet,
const HcalElectronicsMap emap 
)
protected

Definition at line 419 of file HcalMonitorModule.cc.

References HcalHTRData::check(), gather_cfg::cout, FEDRawData::data(), debug_, MonitorElement::Fill(), HcalDCCHeader::getSourceId(), HcalDCCHeader::getSpigotData(), HcalDCCHeader::getSpigotPresent(), HBpresent_, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HEpresent_, HFpresent_, HOpresent_, HcalHTRData::htrSlot(), HcalHTRData::htrTopBottom(), i, HcalHTRData::isHistogramEvent(), HcalElectronicsMap::lookup(), FEDNumbering::MAXHCALFEDID, meHB_, meHE_, meHF_, meHO_, FEDNumbering::MINHCALFEDID, DetId::null(), HcalHTRData::readoutVMECrateId(), HcalElectronicsId::setHTR(), FEDRawData::size(), HcalDCCHeader::SPIGOT_COUNT, and DetId::subdetId().

Referenced by analyze().

422 {
423 
424  std::vector<int> fedUnpackList;
425  for (int i=FEDNumbering::MINHCALFEDID;
427  i++)
428  fedUnpackList.push_back(i);
429 
430  if (debug_>1) std::cout <<"<HcalMonitorModule::CheckSubdetectorStatus> Checking subdetector "<<subdet<<std::endl;
431  for (std::vector<int>::const_iterator i=fedUnpackList.begin();
432  i!=fedUnpackList.end();
433  ++i)
434  {
435  if (debug_>2) std::cout <<"\t<HcalMonitorModule::CheckSubdetectorStatus> FED = "<<*i<<std::endl;
436  const FEDRawData& fed =(*rawraw).FEDData(*i);
437  if (fed.size()<12) continue; // Was 16. How do such tiny events even get here?
438 
439  // get the DCC header
440  const HcalDCCHeader* dccHeader=(const HcalDCCHeader*)(fed.data());
441  if (!dccHeader) return;
442  int dccid=dccHeader->getSourceId();
443  // check for HF
444  if (subdet == HcalForward && dccid>717 && dccid<724)
445  {
446  HFpresent_=1;
448  return;
449  }
450  else if (subdet==HcalOuter && dccid>723)
451  {
452  HOpresent_=1;
454  return;
455  }
456  else if (dccid<718 && (subdet==HcalBarrel || subdet==HcalEndcap))
457  {
458  HcalHTRData htr;
459  for (int spigot=0; spigot<HcalDCCHeader::SPIGOT_COUNT; spigot++)
460  {
461  if (!dccHeader->getSpigotPresent(spigot)) continue;
462 
463  // Load the given decoder with the pointer and length from this spigot.
464  dccHeader->getSpigotData(spigot,htr, fed.size());
465 
466  // check min length, correct wordcount, empty event, or total length if histo event.
467  if (!htr.check()) continue;
468  if (htr.isHistogramEvent()) continue;
469 
470  int firstFED = FEDNumbering::MINHCALFEDID;
471 
472  // Tease out HB and HE, which share HTRs in HBHE
473  for(int fchan=0; fchan<3; ++fchan) //0,1,2 are valid
474  {
475  for(int fib=1; fib<9; ++fib) //1...8 are valid
476  {
477  HcalElectronicsId eid(fchan,fib,spigot,dccid-firstFED);
478  eid.setHTR(htr.readoutVMECrateId(),
479  htr.htrSlot(),htr.htrTopBottom());
480 
481  DetId did=emap.lookup(eid);
482  if (!did.null())
483  {
484 
485  if ((HcalSubdetector)did.subdetId()==subdet)
486  {
487  if (subdet==HcalBarrel)
488  {
489  HBpresent_=1;
491  return;
492  }
493  else if (subdet==HcalEndcap)
494  {
495  HEpresent_=1;
497  return;
498  }
499  } // if ((HcalSubdetector)did.subdetId()==subdet)
500  } // if (!did.null())
501  } // for (int fib=1;fib<9;...)
502  } // for (int fchan=0; fchan<3;...)
503  } // for (int spigot=0;spigot<HcalDCCHeader::SPIGOT_COUNT; spigot++)
504  } //else if (dcc<718 && (subdet...))
505  } // loop over fedUnpackList
506 
507 
508 } // void HcalMonitorModule::CheckSubdetectorStatus(...)
int i
Definition: DBlmapReader.cc:9
MonitorElement * meHB_
bool check() const
Check for a good event Requires a minimum length, matching wordcount and length, not an empty event...
Definition: HcalHTRData.cc:62
unsigned int htrTopBottom() const
HcalElectronicsId-style HTR top/bottom (1=top/0=bottom)
Definition: HcalHTRData.cc:342
MonitorElement * meHO_
int getSpigotData(int nspigot, HcalHTRData &decodeTool, int validSize) const
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
void Fill(long long x)
unsigned int htrSlot() const
HcalElectronicsId-style HTR slot.
Definition: HcalHTRData.cc:338
HcalSubdetector
Definition: HcalAssistant.h:31
bool getSpigotPresent(unsigned int nspigot) const
Read the &quot;PRESENT&quot; bit for this spigot.
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
MonitorElement * meHE_
int getSourceId() const
Definition: HcalDCCHeader.h:32
Definition: DetId.h:18
bool null() const
is this a null id ?
Definition: DetId.h:45
unsigned int readoutVMECrateId() const
HcalElectronicsId-style VME crate number.
Definition: HcalHTRData.cc:346
static const int SPIGOT_COUNT
Definition: HcalDCCHeader.h:19
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
tuple cout
Definition: gather_cfg.py:121
MonitorElement * meHF_
Readout chain identification for Hcal [31:26] Unused (so far) [25] Trigger-chain id flag [24:20] Read...
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
bool isHistogramEvent() const
Is this event a histogram event? (do not call standard unpack in this case!!!!!)
Definition: HcalHTRData.cc:385
void HcalMonitorModule::cleanup ( void  )
protected

Definition at line 218 of file HcalMonitorModule.cc.

References gather_cfg::cout, dbe_, debug_, enableCleanup_, fedsListed_, MonitorElement::getName(), HBpresent_, HEpresent_, HFpresent_, HOpresent_, init_, meCalibType_, meCurrentCalibType_, meEvt_, meFEDS_, meHB_, meHE_, meHF_, meHO_, meIevt_, meIevtHist_, meProcessedEndLumi_, meRun_, meStatus_, prefixME_, DQMStore::removeElement(), and DQMStore::setCurrentFolder().

Referenced by endJob().

219 {
220  if (debug_>0) std::cout <<"HcalMonitorModule::cleanup"<<std::endl;
221  if (!enableCleanup_) return;
222  if (dbe_)
223  {
224  dbe_->setCurrentFolder(prefixME_+"HcalInfo");
225  if ( meStatus_ )
227  meStatus_ = 0;
228  if ( meRun_ )
230  meRun_ = 0;
231  if ( meEvt_ )
233  meEvt_ = 0;
234  if (meIevt_)
236  meIevt_=0;
237  if (meIevtHist_)
239  meIevtHist_=0;
240  if (meFEDS_)
242  meFEDS_ = 0;
243  if (meCalibType_)
245  meCalibType_ = 0;
246  if (meCurrentCalibType_)
249  if (meProcessedEndLumi_)
252  if (meHB_)
254  meHB_=0;
255 
256  if (meHE_)
258  meHE_=0;
259  if (meHO_)
261  meHO_=0;
262  if (meHF_)
264  meHF_=0;
265  } // if (dbe_)
266 
267  fedsListed_=false;
268  HBpresent_=0;
269  HEpresent_=0;
270  HOpresent_=0;
271  HFpresent_=0;
272  init_=false;
273 
274 } // void HcalMonitorModule::cleanup(void)
const std::string & getName(void) const
get name of ME
MonitorElement * meStatus_
MonitorElement * meHB_
MonitorElement * meHO_
MonitorElement * meEvt_
MonitorElement * meProcessedEndLumi_
MonitorElement * meCurrentCalibType_
MonitorElement * meCalibType_
MonitorElement * meFEDS_
void removeElement(const std::string &name)
Definition: DQMStore.cc:2772
MonitorElement * meHE_
MonitorElement * meIevt_
MonitorElement * meRun_
MonitorElement * meIevtHist_
tuple cout
Definition: gather_cfg.py:121
MonitorElement * meHF_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
void HcalMonitorModule::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 296 of file HcalMonitorModule.cc.

References cleanup(), gather_cfg::cout, dbe_, debug_, evtNumber_, MonitorElement::Fill(), DQMStore::get(), init_, meEvt_, meRun_, meStatus_, prefixME_, and runNumber_.

297 {
298  if (debug_>0) std::cout <<"HcalMonitorModule::endJob()"<<std::endl;
299  if (dbe_)
300  {
301  meStatus_ = dbe_->get(prefixME_ + "/EventInfo/STATUS");
302  meRun_ = dbe_->get(prefixME_ + "/EventInfo/RUN");
303  meEvt_ = dbe_->get(prefixME_ + "/EventInfo/EVT");
304  }
305  if (meStatus_) meStatus_->Fill(2);
306  if (meRun_) meRun_->Fill(runNumber_);
307  if (meEvt_) meEvt_->Fill(evtNumber_);
308  if (init_) this->cleanup();
309 } // void HcalMonitorModule::endJob(void)
MonitorElement * meStatus_
MonitorElement * meEvt_
void Fill(long long x)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1623
MonitorElement * meRun_
tuple cout
Definition: gather_cfg.py:121
void HcalMonitorModule::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 287 of file HcalMonitorModule.cc.

References gather_cfg::cout, debug_, MonitorElement::Fill(), edm::LuminosityBlockBase::luminosityBlock(), and meProcessedEndLumi_.

289 {
290  if (debug_>0) std::cout <<"HcalMonitorModule::endLuminosityBlock"<<std::endl;
292 }// void HcalMonitorModule::endLuminosityBlock(...)
MonitorElement * meProcessedEndLumi_
void Fill(long long x)
LuminosityBlockNumber_t luminosityBlock() const
tuple cout
Definition: gather_cfg.py:121
void HcalMonitorModule::endRun ( const edm::Run run,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 133 of file HcalMonitorModule.cc.

References gather_cfg::cout, debug_, evtNumber_, MonitorElement::Fill(), meEvt_, meRun_, meStatus_, and runNumber_.

133  {
134 
135  if ( debug_>0 ) std::cout << "HcalMonitorModule: endRun" << std::endl;
136 
137  // end-of-run
138  if ( meStatus_ ) meStatus_->Fill(2);
139 
140  if ( meRun_ ) meRun_->Fill(runNumber_);
141  if ( meEvt_ ) meEvt_->Fill(evtNumber_);
142 }
MonitorElement * meStatus_
MonitorElement * meEvt_
void Fill(long long x)
MonitorElement * meRun_
tuple cout
Definition: gather_cfg.py:121
void HcalMonitorModule::reset ( void  )
protected

Definition at line 144 of file HcalMonitorModule.cc.

References gather_cfg::cout, debug_, fedsListed_, MonitorElement::Fill(), HBpresent_, HEpresent_, HFpresent_, HOpresent_, ievt_, meCalibType_, meEvtsVsLS_, meFEDS_, meHB_, meHE_, meHF_, meHO_, meIevt_, meIevtHist_, meProcessedEndLumi_, and MonitorElement::Reset().

Referenced by beginRun().

145 {
146  if (debug_>0) std::cout <<"HcalMonitorModule::reset"<<std::endl;
147  // Call Reset() on all MonitorElement histograms
149  if (meFEDS_) meFEDS_->Reset();
150  if (meIevt_) meIevt_->Fill(0);
151  if (meIevtHist_) meIevtHist_->Reset();
152  if (meEvtsVsLS_) meEvtsVsLS_->Reset();
153  ievt_=0;
155  if (meHB_) meHB_->Fill(-1);
156  if (meHE_) meHE_->Fill(-1);
157  if (meHO_) meHO_->Fill(-1);
158  if (meHF_) meHF_->Fill(-1);
159  HBpresent_=0;
160  HEpresent_=0;
161  HOpresent_=0;
162  HFpresent_=0;
163  fedsListed_=false;
164 } // void HcalMonitorModule::reset(void)
MonitorElement * meHB_
MonitorElement * meHO_
MonitorElement * meProcessedEndLumi_
void Fill(long long x)
MonitorElement * meCalibType_
MonitorElement * meFEDS_
MonitorElement * meHE_
MonitorElement * meIevt_
MonitorElement * meIevtHist_
tuple cout
Definition: gather_cfg.py:121
MonitorElement * meHF_
void Reset(void)
reset ME (ie. contents, errors, etc)
MonitorElement * meEvtsVsLS_
void HcalMonitorModule::setup ( void  )
protected

Definition at line 166 of file HcalMonitorModule.cc.

References DQMStore::book1D(), DQMStore::bookInt(), gather_cfg::cout, dbe_, debug_, MonitorElement::Fill(), init_, FEDNumbering::MAXHCALFEDID, meCalibType_, meCurrentCalibType_, meEvt_, meEvtsVsLS_, meFEDS_, meHB_, meHE_, meHF_, meHO_, meIevt_, meIevtHist_, meOnline_, meProcessedEndLumi_, meRun_, meStatus_, FEDNumbering::MINHCALFEDID, NLumiBlocks_, Online_, prefixME_, MonitorElement::setBinLabel(), and DQMStore::setCurrentFolder().

Referenced by analyze(), and beginRun().

167 {
168  // Run this on first event in run; set up all necessary monitor elements
169  if (debug_>0) std::cout <<"HcalMonitorModule::setup"<<std::endl;
170  init_=true;
171  if (dbe_)
172  {
173  dbe_->setCurrentFolder(prefixME_+"HcalInfo");
174  meStatus_ = dbe_->bookInt("STATUS");
175  if (meStatus_) meStatus_->Fill(-1);
176  meRun_ = dbe_->bookInt("RUN");
177  if (meRun_) meRun_->Fill(-1);
178  meEvt_ = dbe_->bookInt("EVT");
179  if (meEvt_) meEvt_->Fill(-1);
180  meIevt_ = dbe_->bookInt("EventsProcessed");
181  if (meIevt_) meIevt_->Fill(-1);
182  meIevtHist_ = dbe_->book1D("EventsInHcalMonitorModule","Events Seen by HcalMonitorModule",1,0.5,1.5);
183  meIevtHist_->setBinLabel(1,"Nevents",1);
184  meEvtsVsLS_ = dbe_->book1D("EventsVsLS","Events vs. Luminosity Section;LS;# events",NLumiBlocks_,0.5,NLumiBlocks_+0.5);
185  meOnline_ = dbe_->bookInt("Online");
186  meOnline_->Fill((int)Online_);
187  meProcessedEndLumi_ = dbe_->bookInt("EndLumiBlock_MonitorModule");
189  meCurrentCalibType_= dbe_->bookInt("CURRENT_EVENT_TYPE");
191 
192  meHB_ = dbe_->bookInt("HBpresent");
193  meHE_ = dbe_->bookInt("HEpresent");
194  meHO_ = dbe_->bookInt("HOpresent");
195  meHF_ = dbe_->bookInt("HFpresent");
196  if (meHB_) meHB_->Fill(-1);
197  if (meHE_) meHE_->Fill(-1);
198  if (meHO_) meHO_->Fill(-1);
199  if (meHF_) meHF_->Fill(-1);
200 
201  meFEDS_ = dbe_->book1D("FEDs Unpacked","FEDs Unpacked; Hcal FEDs 700-731",1+(FEDNumbering::MAXHCALFEDID-FEDNumbering::MINHCALFEDID),FEDNumbering::MINHCALFEDID-0.5,FEDNumbering::MAXHCALFEDID+0.5);
202 
203  meCalibType_ = dbe_->book1D("CalibrationType","Calibration Type",9,-0.5,8.5);
204  meCalibType_->setBinLabel(1,"Normal",1);
205  meCalibType_->setBinLabel(2,"Ped",1);
206  meCalibType_->setBinLabel(3,"RADDAM",1);
207  meCalibType_->setBinLabel(4,"HBHEHPD",1);
208  meCalibType_->setBinLabel(5,"HOHPD",1);
209  meCalibType_->setBinLabel(6,"HFPMT",1);
210  meCalibType_->setBinLabel(7,"ZDC",1);
211  meCalibType_->setBinLabel(8,"CASTOR",1);
212 
213  } // if (dbe_)
214  return;
215 } // void HcalMonitorModule::setup(void)
MonitorElement * meStatus_
MonitorElement * meHB_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * meHO_
MonitorElement * meEvt_
MonitorElement * meProcessedEndLumi_
MonitorElement * meCurrentCalibType_
void Fill(long long x)
MonitorElement * meCalibType_
MonitorElement * meFEDS_
MonitorElement * meHE_
MonitorElement * meIevt_
MonitorElement * meRun_
MonitorElement * meIevtHist_
tuple cout
Definition: gather_cfg.py:121
MonitorElement * meHF_
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:779
MonitorElement * meOnline_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
MonitorElement * meEvtsVsLS_

Member Data Documentation

EtaPhiHists HcalMonitorModule::ChannelStatus
private

Definition at line 120 of file HcalMonitorModule.h.

DQMStore* HcalMonitorModule::dbe_
private

Definition at line 117 of file HcalMonitorModule.h.

Referenced by beginJob(), cleanup(), endJob(), and setup().

int HcalMonitorModule::debug_
private
const HcalElectronicsMap* HcalMonitorModule::eMap_
private

Definition at line 119 of file HcalMonitorModule.h.

Referenced by analyze(), beginJob(), and beginRun().

bool HcalMonitorModule::enableCleanup_
private

Definition at line 105 of file HcalMonitorModule.h.

Referenced by cleanup(), and HcalMonitorModule().

int HcalMonitorModule::evtNumber_
private

Definition at line 83 of file HcalMonitorModule.h.

Referenced by analyze(), endJob(), and endRun().

edm::InputTag HcalMonitorModule::FEDRawDataCollection_
private

Definition at line 108 of file HcalMonitorModule.h.

Referenced by analyze(), and HcalMonitorModule().

bool HcalMonitorModule::fedsListed_
private

Definition at line 101 of file HcalMonitorModule.h.

Referenced by analyze(), beginJob(), cleanup(), and reset().

int HcalMonitorModule::HBpresent_
private

Definition at line 116 of file HcalMonitorModule.h.

Referenced by analyze(), beginJob(), CheckSubdetectorStatus(), cleanup(), and reset().

int HcalMonitorModule::HEpresent_
private

Definition at line 116 of file HcalMonitorModule.h.

Referenced by analyze(), beginJob(), CheckSubdetectorStatus(), cleanup(), and reset().

int HcalMonitorModule::HFpresent_
private

Definition at line 116 of file HcalMonitorModule.h.

Referenced by analyze(), beginJob(), CheckSubdetectorStatus(), cleanup(), and reset().

int HcalMonitorModule::HOpresent_
private

Definition at line 116 of file HcalMonitorModule.h.

Referenced by analyze(), beginJob(), CheckSubdetectorStatus(), cleanup(), and reset().

int HcalMonitorModule::ievt_
private

Definition at line 81 of file HcalMonitorModule.h.

Referenced by analyze(), beginJob(), and reset().

bool HcalMonitorModule::init_
private

Definition at line 107 of file HcalMonitorModule.h.

Referenced by analyze(), cleanup(), endJob(), HcalMonitorModule(), and setup().

edm::InputTag HcalMonitorModule::inputLabelReport_
private

Definition at line 109 of file HcalMonitorModule.h.

Referenced by analyze(), and HcalMonitorModule().

MonitorElement* HcalMonitorModule::meCalibType_
private

Definition at line 89 of file HcalMonitorModule.h.

Referenced by analyze(), beginJob(), cleanup(), reset(), and setup().

MonitorElement* HcalMonitorModule::meCurrentCalibType_
private

Definition at line 90 of file HcalMonitorModule.h.

Referenced by analyze(), cleanup(), and setup().

MonitorElement* HcalMonitorModule::meEvt_
private

Definition at line 87 of file HcalMonitorModule.h.

Referenced by analyze(), cleanup(), endJob(), endRun(), and setup().

MonitorElement* HcalMonitorModule::meEvtsVsLS_
private

Definition at line 97 of file HcalMonitorModule.h.

Referenced by analyze(), beginJob(), reset(), and setup().

MonitorElement* HcalMonitorModule::meFEDS_
private

Definition at line 88 of file HcalMonitorModule.h.

Referenced by analyze(), beginJob(), cleanup(), reset(), and setup().

MonitorElement* HcalMonitorModule::meHB_
private

Definition at line 91 of file HcalMonitorModule.h.

Referenced by beginJob(), CheckSubdetectorStatus(), cleanup(), reset(), and setup().

MonitorElement* HcalMonitorModule::meHE_
private

Definition at line 92 of file HcalMonitorModule.h.

Referenced by beginJob(), CheckSubdetectorStatus(), cleanup(), reset(), and setup().

MonitorElement* HcalMonitorModule::meHF_
private

Definition at line 94 of file HcalMonitorModule.h.

Referenced by beginJob(), CheckSubdetectorStatus(), cleanup(), reset(), and setup().

MonitorElement* HcalMonitorModule::meHO_
private

Definition at line 93 of file HcalMonitorModule.h.

Referenced by beginJob(), CheckSubdetectorStatus(), cleanup(), reset(), and setup().

MonitorElement* HcalMonitorModule::meIevt_
private

Definition at line 95 of file HcalMonitorModule.h.

Referenced by analyze(), beginJob(), cleanup(), reset(), and setup().

MonitorElement* HcalMonitorModule::meIevtHist_
private

Definition at line 96 of file HcalMonitorModule.h.

Referenced by analyze(), beginJob(), cleanup(), reset(), and setup().

MonitorElement* HcalMonitorModule::meOnline_
private

Definition at line 99 of file HcalMonitorModule.h.

Referenced by setup().

MonitorElement* HcalMonitorModule::meProcessedEndLumi_
private

Definition at line 98 of file HcalMonitorModule.h.

Referenced by beginJob(), cleanup(), endLuminosityBlock(), reset(), and setup().

bool HcalMonitorModule::mergeRuns_
private

Definition at line 104 of file HcalMonitorModule.h.

Referenced by beginRun(), and HcalMonitorModule().

MonitorElement* HcalMonitorModule::meRun_
private

Definition at line 86 of file HcalMonitorModule.h.

Referenced by analyze(), cleanup(), endJob(), endRun(), and setup().

MonitorElement* HcalMonitorModule::meStatus_
private

Definition at line 85 of file HcalMonitorModule.h.

Referenced by analyze(), cleanup(), endJob(), endRun(), and setup().

int HcalMonitorModule::NLumiBlocks_
private

Definition at line 111 of file HcalMonitorModule.h.

Referenced by HcalMonitorModule(), and setup().

bool HcalMonitorModule::Online_
private

Definition at line 103 of file HcalMonitorModule.h.

Referenced by HcalMonitorModule(), and setup().

std::string HcalMonitorModule::prefixME_
private

Definition at line 110 of file HcalMonitorModule.h.

Referenced by cleanup(), endJob(), HcalMonitorModule(), and setup().

int HcalMonitorModule::runNumber_
private

Definition at line 82 of file HcalMonitorModule.h.

Referenced by analyze(), endJob(), and endRun().

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

Definition at line 113 of file HcalMonitorModule.h.

Referenced by analyze(), and HcalMonitorModule().

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

Definition at line 114 of file HcalMonitorModule.h.

Referenced by analyze(), and HcalMonitorModule().