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 | Protected Attributes
HcalBaseMonitor Class Reference

#include <HcalBaseMonitor.h>

Inheritance diagram for HcalBaseMonitor:
HcalCaloTowerMonitor HcalEEUSMonitor HcalZDCMonitor

Public Member Functions

void beginLuminosityBlock (int lb)
 
virtual void beginRun ()
 
virtual void clearME ()
 
virtual void done ()
 
void endLuminosityBlock ()
 
bool getDiagnostics () const
 
int getVerbosity () const
 
 HcalBaseMonitor ()
 
void hideKnownBadCells ()
 
virtual void periodicReset ()
 
void processEvent ()
 
void setDiagnostics (bool myval)
 
void setMinMaxHists1D (std::vector< MonitorElement * > &hh, double min, double max)
 
void setMinMaxHists2D (std::vector< MonitorElement * > &hh, double min, double max)
 
virtual void setup (const edm::ParameterSet &ps, DQMStore::IBooker &ib)
 
void setupDepthHists1D (DQMStore::IBooker &ib, MonitorElement *&h, std::vector< MonitorElement * > &hh, std::string Name, std::string Units, int lowbound, int highbound, int Nbins)
 
void setupDepthHists1D (DQMStore::IBooker &ib, std::vector< MonitorElement * > &hh, std::string Name, std::string Units, int lowbound, int highbound, int Nbins)
 
void setupDepthHists2D (DQMStore::IBooker &ib, MonitorElement *&h, std::vector< MonitorElement * > &hh, std::string Name, std::string Units)
 
void setupDepthHists2D (DQMStore::IBooker &ib, std::vector< MonitorElement * > &hh, std::string Name, std::string Units)
 
void setupDepthHists2D (DQMStore::IBooker &ib, MonitorElement *&h, std::vector< MonitorElement * > &hh, std::string Name, std::string Units, int nbinsx, int lowboundx, int highboundx, int nbinsy, int lowboundy, int highboundy)
 
void setupDepthHists2D (DQMStore::IBooker &ib, std::vector< MonitorElement * > &hh, std::string Name, std::string Units, int nbinsx, int lowboundx, int highboundx, int nbinsy, int lowboundy, int highboundy)
 
void SetupEtaPhiHists (DQMStore::IBooker &ib, MonitorElement *&h, EtaPhiHists &hh, std::string Name, std::string Units)
 
void SetupEtaPhiHists (DQMStore::IBooker &ib, EtaPhiHists &hh, std::string Name, std::string Units)
 
void setVerbosity (int verb)
 
bool vetoCell (HcalDetId &id)
 
virtual ~HcalBaseMonitor ()
 

Protected Member Functions

void LumiBlockUpdate (int lb)
 

Protected Attributes

std::vector< int > AllowedCalibTypes_
 
std::vector< std::string > badCells_
 
std::string baseFolder_
 
bool checkHB_
 
bool checkHE_
 
bool checkHF_
 
bool checkHO_
 
int checkNevents_
 
edm::CPUTimer cpu_timer
 
bool dump2database
 
int etaBins_
 
double etaMax_
 
double etaMin_
 
int fVerbosity
 
int ievt_
 
bool LBprocessed_
 
int levt_
 
int lumiblock
 
bool makeDiagnostics
 
MonitorElementmeEVT_
 
MonitorElementmeTOTALEVT_
 
double minErrorFlag_
 
int Nlumiblocks_
 
int NumBadHB
 
int NumBadHE
 
int NumBadHF
 
int NumBadHO
 
int oldlumiblock
 
bool Online_
 
int phiBins_
 
double phiMax_
 
double phiMin_
 
MonitorElementProblemCells
 
EtaPhiHists ProblemCellsByDepth
 
MonitorElementProblemsVsLB
 
MonitorElementProblemsVsLB_HB
 
MonitorElementProblemsVsLB_HBHEHF
 
MonitorElementProblemsVsLB_HE
 
MonitorElementProblemsVsLB_HF
 
MonitorElementProblemsVsLB_HO
 
int resetNevents_
 
std::string rootFolder_
 
bool showTiming
 
int tevt_
 

Detailed Description

Author
W. Fisher - FNAL

Definition at line 43 of file HcalBaseMonitor.h.

Constructor & Destructor Documentation

HcalBaseMonitor::HcalBaseMonitor ( )

Definition at line 10 of file HcalBaseMonitor.cc.

References badCells_, baseFolder_, fVerbosity, and rootFolder_.

10  {
11  fVerbosity = 0;
12  badCells_.clear();
13  rootFolder_ = "Hcal";
14  baseFolder_ = "BaseMonitor";
15 }
std::string rootFolder_
std::string baseFolder_
std::vector< std::string > badCells_
HcalBaseMonitor::~HcalBaseMonitor ( )
virtual

Definition at line 17 of file HcalBaseMonitor.cc.

17 {}

Member Function Documentation

void HcalBaseMonitor::beginLuminosityBlock ( int  lb)

Definition at line 155 of file HcalBaseMonitor.cc.

References LBprocessed_, levt_, and LumiBlockUpdate().

Referenced by ZDCMonitorModule::beginLuminosityBlock().

156 {
157  // Protect against online mis-ordering of events.
158  // Do we want this enabled here?
159  //if (Online_ && lumisec<lumiblock)
160  // return;
161  LumiBlockUpdate(lumisec);
162  levt_=0;
163  LBprocessed_=false;
164 } // beginLuminosityBlock
void LumiBlockUpdate(int lb)
void HcalBaseMonitor::beginRun ( void  )
virtual

Definition at line 19 of file HcalBaseMonitor.cc.

References ievt_, LBprocessed_, and levt_.

Referenced by ZDCMonitorModule::bookHistograms().

void HcalBaseMonitor::clearME ( )
virtual

Reimplemented in HcalEEUSMonitor.

Definition at line 174 of file HcalBaseMonitor.cc.

174  {
175 
176 /* if(m_dbe){
177  m_dbe->setCurrentFolder(baseFolder_);
178  m_dbe->removeContents();
179 // m_dbe->setCurrentFolder(baseFolder_+"/HB");
180 // m_dbe->removeContents();
181 //
182 // m_dbe->setCurrentFolder(baseFolder_+"/HE");
183 // m_dbe->removeContents();
184 //
185 // m_dbe->setCurrentFolder(baseFolder_+"/HO");
186 // m_dbe->removeContents();
187 //
188 // m_dbe->setCurrentFolder(baseFolder_+"/HF");
189 // m_dbe->removeContents();
190  }*/
191  return;
192 } // void HcalBaseMonitor::clearME();
void HcalBaseMonitor::done ( )
virtual

Definition at line 172 of file HcalBaseMonitor.cc.

172 {}
void HcalBaseMonitor::endLuminosityBlock ( void  )

Definition at line 166 of file HcalBaseMonitor.cc.

References LBprocessed_.

167 {
168  LBprocessed_=true;
169  return;
170 } // endLuminosityBlock;
bool HcalBaseMonitor::getDiagnostics ( ) const
inline

Definition at line 59 of file HcalBaseMonitor.h.

References makeDiagnostics.

59 { return makeDiagnostics;}
int HcalBaseMonitor::getVerbosity ( ) const
inline

Definition at line 56 of file HcalBaseMonitor.h.

References fVerbosity.

56 { return fVerbosity; }
void HcalBaseMonitor::hideKnownBadCells ( )

Definition at line 214 of file HcalBaseMonitor.cc.

References badCells_, CalcEtaBin(), EtaPhiHists::depth, i, ProblemCells, ProblemCellsByDepth, and MonitorElement::setBinContent().

215 {
216  /* This prevents known bad cells from being displayed in overall problem maps and
217  depth histograms. Is this what we want? Or do we want some problems to be
218  displayed in the depth plots but not the overall map? (Or vice versa?)
219  */
220 
221  for (unsigned int i=0;i<badCells_.size();++i)
222  {
223  unsigned int badc = atoi(badCells_[i].c_str());
224  HcalDetId id(badc);
225  int etabin=CalcEtaBin(id.subdet(),id.ieta(),id.depth());
226  if (ProblemCells!=0) ProblemCells->setBinContent(etabin+1,id.iphi(),0);
227  if (ProblemCellsByDepth.depth[id.depth()-1]!=0)
228  ProblemCellsByDepth.depth[id.depth()-1]->setBinContent(etabin+1,id.iphi(),0);
229  } // for (unsigned int i=0;...)
230  return;
231 } // void HcalBaseMonitor::hideKnownBadCells()
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
EtaPhiHists ProblemCellsByDepth
std::vector< MonitorElement * > depth
MonitorElement * ProblemCells
std::vector< std::string > badCells_
int CalcEtaBin(int subdet, int ieta, int depth)
void HcalBaseMonitor::LumiBlockUpdate ( int  lb)
protected

Definition at line 115 of file HcalBaseMonitor.cc.

References lumiblock, and Nlumiblocks_.

Referenced by beginLuminosityBlock().

116 {
117 
118  //if (Online_ && lb<=lumiblock) // protect against mis-ordered LBs. Handle differently in the future?
119  // return;
120 
121  lumiblock=lb;
122  if (lumiblock==0) // initial lumiblock call; don't fill histograms, because nothing has been determined yet
123  return;
124 
125  if (lb>Nlumiblocks_) // don't fill plots if lumiblock is beyond range
126  return;
127 
128  // The following function would let us 'fill in' missing lumiblock sections.
129  // I think we only want this for Online running, since offline should fill each lumi block
130  // independently.
131  // Should probably just do this in the individual tasks?
132  /*
133  if (Online_ && lumiblock<lb)
134  {
135  for (int i=lumiblock+1;i<lb;++i)
136  {
137  if (ProblemsVsLB)
138  ProblemsVsLB->Fill(i,NumBadHB+NumBadHE+NumBadHO+NumBadHF);
139  if (ProblemsVsLB_HB)
140  ProblemsVsLB_HB->Fill(i,NumBadHB);
141  if (ProblemsVsLB_HE)
142  ProblemsVsLB_HE->Fill(i,NumBadHE);
143  if (ProblemsVsLB_HO)
144  ProblemsVsLB_HO->Fill(i,NumBadHO);
145  if (ProblemsVsLB_HF)
146  ProblemsVsLB_HF->Fill(i,NumBadHF);
147  if (ProblemsVsLB_HBHEHF)
148  ProblemsVsLB_HBHEHF->Fill(i,NumBadHB+NumBadHE+NumBadHF);
149  }
150  }
151  */
152  return;
153 }
void HcalBaseMonitor::periodicReset ( )
virtual

Definition at line 632 of file HcalBaseMonitor.cc.

References EtaPhiHists::depth, i, ProblemCells, ProblemCellsByDepth, and MonitorElement::Reset().

633 {
634  // when called, reset all counters, and all histograms
635  if (ProblemCells!=0) ProblemCells->Reset();
636  for (unsigned int i=0;i<ProblemCellsByDepth.depth.size();++i)
637  {
638  if (ProblemCellsByDepth.depth[i]!=0)
639  ProblemCellsByDepth.depth[i]->Reset();
640  }
641  return;
642 }
int i
Definition: DBlmapReader.cc:9
EtaPhiHists ProblemCellsByDepth
std::vector< MonitorElement * > depth
MonitorElement * ProblemCells
void Reset(void)
reset ME (ie. contents, errors, etc)
void HcalBaseMonitor::processEvent ( )

Definition at line 103 of file HcalBaseMonitor.cc.

References MonitorElement::Fill(), ievt_, levt_, meEVT_, meTOTALEVT_, and tevt_.

104 {
105  // increment event counters
106  ++ievt_;
107  ++levt_;
108  ++tevt_;
109  // Fill MonitorElements
110  if (meEVT_) meEVT_->Fill(ievt_);
112  return;
113 }
MonitorElement * meTOTALEVT_
void Fill(long long x)
MonitorElement * meEVT_
void HcalBaseMonitor::setDiagnostics ( bool  myval)
inline

Definition at line 58 of file HcalBaseMonitor.h.

References makeDiagnostics.

58 { makeDiagnostics=myval;}
void HcalBaseMonitor::setMinMaxHists1D ( std::vector< MonitorElement * > &  hh,
double  min,
double  max 
)

Definition at line 621 of file HcalBaseMonitor.cc.

References timingPdfMaker::histo, and i.

622 {
623  for (unsigned int i=0; i<hh.size();++i)
624  {
625  TH1F* histo=hh[i]->getTH1F();
626  histo->SetMinimum(min);
627  histo->SetMaximum(max);
628  }
629  return;
630 }
int i
Definition: DBlmapReader.cc:9
T min(T a, T b)
Definition: MathUtil.h:58
void HcalBaseMonitor::setMinMaxHists2D ( std::vector< MonitorElement * > &  hh,
double  min,
double  max 
)

Definition at line 610 of file HcalBaseMonitor.cc.

References timingPdfMaker::histo, and i.

611 {
612  for (unsigned int i=0; i<hh.size();++i)
613  {
614  TH2F* histo=hh[i]->getTH2F();
615  histo->SetMinimum(min);
616  histo->SetMaximum(max);
617  }
618  return;
619 }
int i
Definition: DBlmapReader.cc:9
T min(T a, T b)
Definition: MathUtil.h:58
void HcalBaseMonitor::setup ( const edm::ParameterSet ps,
DQMStore::IBooker ib 
)
virtual

Reimplemented in HcalEEUSMonitor, HcalCaloTowerMonitor, and HcalZDCMonitor.

Definition at line 21 of file HcalBaseMonitor.cc.

References AllowedCalibTypes_, badCells_, checkHB_, checkHE_, checkHF_, checkHO_, checkNevents_, gather_cfg::cout, dump2database, etaBins_, ETAMAX, etaMax_, ETAMIN, etaMin_, fVerbosity, edm::ParameterSet::getUntrackedParameter(), ievt_, levt_, lumiblock, makeDiagnostics, meEVT_, meTOTALEVT_, minErrorFlag_, Nlumiblocks_, NumBadHB, NumBadHE, NumBadHF, NumBadHO, oldlumiblock, Online_, phiBins_, PHIMAX, phiMax_, PHIMIN, phiMin_, ProblemsVsLB, ProblemsVsLB_HB, ProblemsVsLB_HBHEHF, ProblemsVsLB_HE, ProblemsVsLB_HF, ProblemsVsLB_HO, resetNevents_, rootFolder_, showTiming, AlCaHLTBitMon_QueryRunRegistry::string, and tevt_.

Referenced by HcalCaloTowerMonitor::setup(), HcalZDCMonitor::setup(), and HcalEEUSMonitor::setup().

21  {
22 
23  std::vector<std::string> dummy;
24  dummy.clear();
25  Online_ = ps.getUntrackedParameter<bool>("Online",false);
26  badCells_ = ps.getUntrackedParameter<std::vector<std::string> >( "BadCells" , dummy);
27  AllowedCalibTypes_ = ps.getUntrackedParameter<std::vector<int> > ("AllowedCalibTypes");
28 
29 
30  // Base folder for the contents of this job
31  std::string subsystemname = ps.getUntrackedParameter<std::string>("subSystemFolder", "Hcal") ;
32  rootFolder_ = subsystemname + "/";
33 
34  // Global cfgs
35 
36  fVerbosity = ps.getUntrackedParameter<int>("debug",0);
37  makeDiagnostics = ps.getUntrackedParameter<bool>("makeDiagnosticPlots",false);
38  showTiming = ps.getUntrackedParameter<bool>("showTiming",false);
39  dump2database = ps.getUntrackedParameter<bool>("dump2database",false); // dumps output to database file
40 
41  checkHB_ = ps.getUntrackedParameter<bool>("checkHB",true);
42  checkHE_ = ps.getUntrackedParameter<bool>("checkHE",true);
43  checkHO_ = ps.getUntrackedParameter<bool>("checkHO",true);
44  checkHF_ = ps.getUntrackedParameter<bool>("checkHF",true);
45 
46  checkNevents_ = ps.getUntrackedParameter<int>("checkNevents",1000); // specify how often to run checks
47  Nlumiblocks_ = ps.getUntrackedParameter<int>("Nlumiblocks",1000); // number of luminosity blocks to include in time plots
48  if (Nlumiblocks_<=0) Nlumiblocks_=1000;
49  resetNevents_ = ps.getUntrackedParameter<int>("resetNevents",-1); // how often to reset histograms
50 
51  // Minimum error rate that will caused the problem histogram to be filled
52  minErrorFlag_ = ps.getUntrackedParameter<double>("minErrorFlag",0.05);
53 
54  // Set eta, phi boundaries
55  // We can remove these variables once we move completely to EtaPhiHists from the old 2D SJ6hists
56  etaMax_ = ps.getUntrackedParameter<double>("MaxEta", ETAMAX);
57  etaMin_ = ps.getUntrackedParameter<double>("MinEta", ETAMIN);
58 
59  if (etaMax_ > 44.5)
60  {
61  std::cout <<"<HcalBaseMonitor> WARNING: etaMax_ value of "<<etaMax_<<" exceeds maximum allowed value of 44.5"<<std::endl;
62  std::cout <<" Value being set back to 44.5."<<std::endl;
63  std::cout <<" Additional code changes are necessary to allow value of "<<etaMax_<<std::endl;
64  etaMax_ = 44.5;
65  }
66 
67  if (etaMin_ < ETAMIN)
68  {
69  std::cout <<"<HcalBaseMonitor> WARNING: etaMin_ value of "<<etaMin_<<" exceeds minimum allowed value of 44.5"<<std::endl;
70  std::cout <<" Value being set back to -44.5."<<std::endl;
71  std::cout <<" Additional code changes are necessary to allow value of "<<etaMin_<<std::endl;
72  etaMin_ = -44.5;
73  }
74 
75  etaBins_ = (int)(etaMax_ - etaMin_);
76 
77  phiMax_ = ps.getUntrackedParameter<double>("MaxPhi", PHIMAX);
78  phiMin_ = ps.getUntrackedParameter<double>("MinPhi", PHIMIN);
79  phiBins_ = (int)(phiMax_ - phiMin_);
80 
81  ProblemsVsLB=0;
87 
88  meEVT_=0;
89  meTOTALEVT_=0;
90  ievt_=0;
91  levt_=0;
92  tevt_=0;
93  lumiblock=0;
94  oldlumiblock=0;
95  NumBadHB=0;
96  NumBadHE=0;
97  NumBadHO=0;
98  NumBadHF=0;
99 
100  return;
101 } //void HcalBaseMonitor::setup()
T getUntrackedParameter(std::string const &, T const &) const
#define PHIMAX
MonitorElement * ProblemsVsLB_HE
std::vector< int > AllowedCalibTypes_
MonitorElement * ProblemsVsLB_HO
MonitorElement * ProblemsVsLB_HBHEHF
MonitorElement * meTOTALEVT_
MonitorElement * ProblemsVsLB_HF
#define ETAMAX
#define ETAMIN
MonitorElement * ProblemsVsLB
std::string rootFolder_
MonitorElement * ProblemsVsLB_HB
#define PHIMIN
std::vector< std::string > badCells_
tuple cout
Definition: gather_cfg.py:121
MonitorElement * meEVT_
void HcalBaseMonitor::setupDepthHists1D ( DQMStore::IBooker ib,
MonitorElement *&  h,
std::vector< MonitorElement * > &  hh,
std::string  Name,
std::string  Units,
int  lowbound,
int  highbound,
int  Nbins 
)

Definition at line 516 of file HcalBaseMonitor.cc.

References DQMStore::IBooker::book1D(), gather_cfg::cout, cpu_timer, edm::CPUTimer::cpuTime(), mergeVDriftHistosByStation::name, edm::CPUTimer::reset(), MonitorElement::setAxisTitle(), showTiming, edm::CPUTimer::start(), and edm::CPUTimer::stop().

517 {
518  // Makes an overall 1D Monitor Element (for summing over depths) for h, and creates individual depth Monitor Elements for hh
519  if (showTiming)
520  {
522  }
523 
524  std::stringstream name;
525  name<<Name;
526 
527  std::stringstream unitname;
528  std::stringstream unittitle;
529  if (Units.empty())
530  {
531  unitname<<Units;
532  unittitle<<"No Units";
533  }
534  else
535  {
536  unitname<<" "<<Units;
537  unittitle<<Units;
538  }
539 
540  // Create overall 1D Monitor Element
541  h=ib.book1D(("All "+name.str()+unitname.str()).c_str(),
542  (name.str() + " for all HCAL ("+unittitle.str().c_str()+")"),
543  Nbins,lowbound,highbound);
544  h->setAxisTitle(unitname.str().c_str(),1);
545 
546  // Create vector of Monitor Elements for individual depths
547  setupDepthHists1D(ib, hh, Name, Units, lowbound, highbound, Nbins);
548 
549  if (showTiming)
550  {
551  cpu_timer.stop(); std::cout <<"TIMER:: HcalBaseMonitor SETUPDEPTHHISTS1D_OVERALL "<<name.str().c_str()<<" -> "<<cpu_timer.cpuTime()<<std::endl;
552  }
553  return;
554 
555 } //void HcalBaseMonitor::setupDepthHists1D(MonitorElement* &h, std::vector<MonitorElement*> &hh, std::string Name, std::string Units)
void start()
Definition: CPUTimer.cc:74
void reset()
Definition: CPUTimer.cc:107
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
edm::CPUTimer cpu_timer
Times stop()
Definition: CPUTimer.cc:94
void setupDepthHists1D(DQMStore::IBooker &ib, MonitorElement *&h, std::vector< MonitorElement * > &hh, std::string Name, std::string Units, int lowbound, int highbound, int Nbins)
double cpuTime() const
Definition: CPUTimer.cc:158
tuple cout
Definition: gather_cfg.py:121
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void HcalBaseMonitor::setupDepthHists1D ( DQMStore::IBooker ib,
std::vector< MonitorElement * > &  hh,
std::string  Name,
std::string  Units,
int  lowbound,
int  highbound,
int  Nbins 
)

Definition at line 559 of file HcalBaseMonitor.cc.

References DQMStore::IBooker::book1D(), gather_cfg::cout, cpu_timer, edm::CPUTimer::cpuTime(), i, mergeVDriftHistosByStation::name, edm::CPUTimer::reset(), showTiming, edm::CPUTimer::start(), and edm::CPUTimer::stop().

560 {
561  // Makes histograms just for the vector of Monitor Elements
562  if (showTiming)
563  {
565  }
566 
567  std::stringstream name;
568  name<<Name;
569  std::stringstream unitname;
570  std::stringstream unittitle;
571  if (Units.empty())
572  {
573  unitname<<Units;
574  unittitle<<"No Units";
575  }
576  else
577  {
578  unitname<<" "<<Units;
579  unittitle<<Units;
580  }
581 
582  // Push back depth plots
583  hh.push_back(ib.book1D(("HB "+name.str()+unitname.str()).c_str(),
584  (name.str()+" HB ("+unittitle.str().c_str()+")"),
585  Nbins,lowbound,highbound));
586  hh.push_back( ib.book1D(("HE "+name.str()+unitname.str()).c_str(),
587  (name.str()+" HE ("+unittitle.str().c_str()+")"),
588  Nbins,lowbound,highbound));
589  hh.push_back( ib.book1D(("HO "+name.str()+unitname.str()).c_str(),
590  (name.str()+" HO ("+unittitle.str().c_str()+")"),
591  Nbins,lowbound,highbound));
592  hh.push_back( ib.book1D(("HF "+name.str()+unitname.str()).c_str(),
593  (name.str()+" HF ("+unittitle.str().c_str()+")"),
594  Nbins,lowbound,highbound));
595 
596  for (unsigned int i=0;i<hh.size();++i)
597  {
598  hh[i]->setAxisTitle(unitname.str().c_str(),1);
599  }
600 
601  if (showTiming)
602  {
603  cpu_timer.stop(); std::cout <<"TIMER:: HcalBaseMonitor SETUPDEPTHHISTS1D "<<name.str().c_str()<<" -> "<<cpu_timer.cpuTime()<<std::endl;
604  }
605 
606  return;
607 } // void HcalBaseMonitor::setupDepthHists1D(std::vector<MonitorElement*> &hh, std::string Name, std::string Units, int lowbound, int highbound, int Nbins)
int i
Definition: DBlmapReader.cc:9
void start()
Definition: CPUTimer.cc:74
void reset()
Definition: CPUTimer.cc:107
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
edm::CPUTimer cpu_timer
Times stop()
Definition: CPUTimer.cc:94
double cpuTime() const
Definition: CPUTimer.cc:158
tuple cout
Definition: gather_cfg.py:121
void HcalBaseMonitor::setupDepthHists2D ( DQMStore::IBooker ib,
MonitorElement *&  h,
std::vector< MonitorElement * > &  hh,
std::string  Name,
std::string  Units 
)

Definition at line 276 of file HcalBaseMonitor.cc.

References DQMStore::IBooker::book2D(), etaBins_, etaMax_, etaMin_, mergeVDriftHistosByStation::name, phiBins_, phiMax_, phiMin_, and MonitorElement::setAxisTitle().

Referenced by setupDepthHists2D().

277 {
278  /* Code makes overall 2D MonitorElement histogram,
279  and the vector of 2D MonitorElements for each individual depth.
280  Eta, Phi bins are set automatically from the etaMax_, etaMin_, etc.
281  values in HcalBaseMonitor.h
282  */
283 
284  /*
285  if (showTiming)
286  {
287  cpu_timer.reset(); cpu_timer.start();
288  }
289  */
290  std::stringstream name;
291  name<<Name;
292  std::stringstream unitname;
293  std::stringstream unittitle;
294  if (Units.empty())
295  {
296  unitname<<Units;
297  unittitle<<"No Units";
298  }
299  else
300  {
301  unitname<<" "<<Units;
302  unittitle<<Units;
303  }
304 
305  h=ib.book2D(("All "+name.str()+unitname.str()).c_str(),
306  (name.str() + " for all HCAL ("+unittitle.str().c_str()+")"),
309  h->setAxisTitle("i#eta",1);
310  h->setAxisTitle("i#phi",2);
311 
312  setupDepthHists2D(ib, hh, Name, Units);
313  /*
314  if (showTiming)
315  {
316  cpu_timer.stop(); std::cout <<"TIMER:: HcalBaseMonitor SETUPDEPTHHISTS2D_OVERALL "<<name.str().c_str()<<" -> "<<cpu_timer.cpuTime()<<std::endl;
317  }
318  */
319  return;
320 } // void HcalBaseMonitor::setupDepthHists2D(MonitorElement* &h, std::vector<MonitorElement*> &hh, std::string Name, std::string Units)
void setupDepthHists2D(DQMStore::IBooker &ib, MonitorElement *&h, std::vector< MonitorElement * > &hh, std::string Name, std::string Units)
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void HcalBaseMonitor::setupDepthHists2D ( DQMStore::IBooker ib,
std::vector< MonitorElement * > &  hh,
std::string  Name,
std::string  Units 
)

Definition at line 325 of file HcalBaseMonitor.cc.

References DQMStore::IBooker::book2D(), etaBins_, etaMax_, etaMin_, i, mergeVDriftHistosByStation::name, phiBins_, phiMax_, and phiMin_.

326 {
327  /* Code makes vector of 2D MonitorElements for all 6 depths
328  (4 depths, + 2 for separate HE histograms).
329  Bins are automatically set for eta/phi indices
330  DEPRECATE THIS ONCE ALL OLD-STYLE 2D HISTOGRAMS HAVE BEEN REMOVED!
331  */
332 
333  /*
334  if (showTiming)
335  {
336  cpu_timer.reset(); cpu_timer.start();
337  }
338  */
339  std::stringstream name;
340  name<<Name;
341 
342  std::stringstream unitname;
343  std::stringstream unittitle;
344  if (Units.empty())
345  {
346  unitname<<Units;
347  unittitle<<"No Units";
348  }
349  else
350  {
351  unitname<<" "<<Units;
352  unittitle<<Units;
353  }
354 
355  // Push back depth plots -- remove ZDC names at some point?
356  hh.push_back(ib.book2D(("HB HF Depth 1 "+name.str()+unitname.str()).c_str(),
357  (name.str()+" Depth 1 -- HB & HF only ("+unittitle.str().c_str()+")"),
360  hh.push_back( ib.book2D(("HB HF Depth 2 "+name.str()+unitname.str()).c_str(),
361  (name.str()+" Depth 2 -- HB & HF only ("+unittitle.str().c_str()+")"),
364  hh.push_back( ib.book2D(("HE Depth 3 "+name.str()+unitname.str()).c_str(),
365  (name.str()+" Depth 3 -- HE ("+unittitle.str().c_str()+")"),
368  hh.push_back( ib.book2D(("HO ZDC "+name.str()+unitname.str()).c_str(),
369  (name.str()+" -- HO & ZDC ("+unittitle.str().c_str()+")"),
372  hh.push_back(ib.book2D(("HE Depth 1 "+name.str()+unitname.str()).c_str(),
373  (name.str()+" Depth 1 -- HE only ("+unittitle.str().c_str()+")"),
376  hh.push_back(ib.book2D(("HE Depth 2 "+name.str()+unitname.str()).c_str(),
377  (name.str()+" Depth 2 -- HE only ("+unittitle.str().c_str()+")"),
380  for (unsigned int i=0;i<hh.size();++i)
381  {
382  hh[i]->setAxisTitle("i#eta",1);
383  hh[i]->setAxisTitle("i#phi",2);
384  }
385  /*
386  if (showTiming)
387  {
388  cpu_timer.stop(); std::cout <<"TIMER:: HcalBaseMonitor SETUPDEPTHHISTS2D "<<name.str().c_str()<<" -> "<<cpu_timer.cpuTime()<<std::endl;
389  }
390  */
391  return;
392 } // void HcalBaseMonitor::setupDepthHists2D(std::vector<MonitorElement*> &hh, std::string Name, std::string Units)
int i
Definition: DBlmapReader.cc:9
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
void HcalBaseMonitor::setupDepthHists2D ( DQMStore::IBooker ib,
MonitorElement *&  h,
std::vector< MonitorElement * > &  hh,
std::string  Name,
std::string  Units,
int  nbinsx,
int  lowboundx,
int  highboundx,
int  nbinsy,
int  lowboundy,
int  highboundy 
)

Definition at line 397 of file HcalBaseMonitor.cc.

References DQMStore::IBooker::book2D(), gather_cfg::cout, cpu_timer, edm::CPUTimer::cpuTime(), mergeVDriftHistosByStation::name, edm::CPUTimer::reset(), setupDepthHists2D(), showTiming, edm::CPUTimer::start(), and edm::CPUTimer::stop().

400 {
401  /* Code makes overall 2D MonitorElement histogram,
402  and the vector of 2D MonitorElements for each individual depth.
403  Bin ranges, sizes are specified by user
404  DEPRECATE THIS ONCE ALL OLD-STYLE 2D HISTOGRAMS HAVE BEEN REMOVED!
405  */
406 
407  if (showTiming)
408  {
410  }
411 
412  std::stringstream name;
413  name<<Name;
414  std::stringstream unitname;
415  std::stringstream unittitle;
416  if (Units.empty())
417  {
418  unitname<<Units;
419  unittitle<<"No Units";
420  }
421  else
422  {
423  unitname<<" "<<Units;
424  unittitle<<Units;
425  }
426 
427  h=ib.book2D(("All "+name.str()+unitname.str()).c_str(),
428  (name.str() + " for all HCAL ("+unittitle.str().c_str()+")"),
429  nbinsx, lowboundx, highboundx,
430  nbinsy, lowboundy, highboundy);
431 
432  setupDepthHists2D(ib, hh, Name, Units,
433  nbinsx, lowboundx, highboundx,
434  nbinsy, lowboundy, highboundy);
435 
436 
437  if (showTiming)
438  {
439  cpu_timer.stop(); std::cout <<"TIMER:: HcalBaseMonitor SETUPDEPTHHISTS2D_OVERALL "<<name.str().c_str()<<" -> "<<cpu_timer.cpuTime()<<std::endl;
440  }
441  return;
442 } // void HcalBaseMonitor::setupDepthHists2D(MonitorElement* &h, std::vector<MonitorElement*> &hh, std::string Name, std::string Units, int nbinsx...)
void start()
Definition: CPUTimer.cc:74
void setupDepthHists2D(DQMStore::IBooker &ib, MonitorElement *&h, std::vector< MonitorElement * > &hh, std::string Name, std::string Units)
void reset()
Definition: CPUTimer.cc:107
edm::CPUTimer cpu_timer
Times stop()
Definition: CPUTimer.cc:94
double cpuTime() const
Definition: CPUTimer.cc:158
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
tuple cout
Definition: gather_cfg.py:121
void HcalBaseMonitor::setupDepthHists2D ( DQMStore::IBooker ib,
std::vector< MonitorElement * > &  hh,
std::string  Name,
std::string  Units,
int  nbinsx,
int  lowboundx,
int  highboundx,
int  nbinsy,
int  lowboundy,
int  highboundy 
)

Definition at line 447 of file HcalBaseMonitor.cc.

References DQMStore::IBooker::book2D(), gather_cfg::cout, cpu_timer, edm::CPUTimer::cpuTime(), mergeVDriftHistosByStation::name, edm::CPUTimer::reset(), showTiming, edm::CPUTimer::start(), and edm::CPUTimer::stop().

450 {
451  /* Code makes vector of 2D MonitorElements for all 6 depths
452  (4 depths, + 2 for separate HE histograms).
453  Bins are automatically set for eta/phi indices
454  DEPRECATE THIS ONCE ALL OLD-STYLE 2D HISTOGRAMS HAVE BEEN REMOVED!
455 
456 
457  */
458 
459  if (showTiming)
460  {
462  }
463 
464  std::stringstream name;
465  name<<Name;
466 
467  std::stringstream unitname;
468  std::stringstream unittitle;
469  if (Units.empty())
470  {
471  unitname<<Units;
472  unittitle<<"No Units";
473  }
474  else
475  {
476  unitname<<" "<<Units;
477  unittitle<<Units;
478  }
479 
480  // Push back depth plots
481  hh.push_back(ib.book2D(("HB HF Depth 1 "+name.str()+unitname.str()).c_str(),
482  (name.str()+" Depth 1 -- HB & HF only ("+unittitle.str().c_str()+")"),
483  nbinsx, lowboundx, highboundx,
484  nbinsy, lowboundy, highboundy));
485  hh.push_back( ib.book2D(("HB HF Depth 2 "+name.str()+unitname.str()).c_str(),
486  (name.str()+" Depth 2 -- HB & HF only ("+unittitle.str().c_str()+")"),
487  nbinsx, lowboundx, highboundx,
488  nbinsy, lowboundy, highboundy));
489  hh.push_back( ib.book2D(("HE Depth 3 "+name.str()+unitname.str()).c_str(),
490  (name.str()+" Depth 3 -- HE ("+unittitle.str().c_str()+")"),
491  nbinsx, lowboundx, highboundx,
492  nbinsy, lowboundy, highboundy));
493  hh.push_back( ib.book2D(("HO ZDC "+name.str()+unitname.str()).c_str(),
494  (name.str()+" -- HO & ZDC ("+unittitle.str().c_str()+")"),
495  nbinsx, lowboundx, highboundx,
496  nbinsy, lowboundy, highboundy));
497  hh.push_back(ib.book2D(("HE Depth 1 "+name.str()+unitname.str()).c_str(),
498  (name.str()+" Depth 1 -- HE only ("+unittitle.str().c_str()+")"),
499  nbinsx, lowboundx, highboundx,
500  nbinsy, lowboundy, highboundy));
501  hh.push_back(ib.book2D(("HE Depth 2 "+name.str()+unitname.str()).c_str(),
502  (name.str()+" Depth 2 -- HE only ("+unittitle.str().c_str()+")"),
503  nbinsx, lowboundx, highboundx,
504  nbinsy, lowboundy, highboundy));
505 
506  if (showTiming)
507  {
508  cpu_timer.stop(); std::cout <<"TIMER:: HcalBaseMonitor SETUPDEPTHHISTS2D "<<name.str().c_str()<<" -> "<<cpu_timer.cpuTime()<<std::endl;
509  }
510 
511  return;
512 } // void HcalBaseMonitor::setupDepthHists2D(std::vector<MonitorElement*> &hh, std::string Name, std::string Units)
void start()
Definition: CPUTimer.cc:74
void reset()
Definition: CPUTimer.cc:107
edm::CPUTimer cpu_timer
Times stop()
Definition: CPUTimer.cc:94
double cpuTime() const
Definition: CPUTimer.cc:158
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
tuple cout
Definition: gather_cfg.py:121
void HcalBaseMonitor::SetupEtaPhiHists ( DQMStore::IBooker ib,
MonitorElement *&  h,
EtaPhiHists hh,
std::string  Name,
std::string  Units 
)

Definition at line 241 of file HcalBaseMonitor.cc.

References DQMStore::IBooker::book2D(), mergeVDriftHistosByStation::name, and MonitorElement::setAxisTitle().

242 {
243  std::stringstream name;
244  name<<Name;
245  std::stringstream unitname;
246  std::stringstream unittitle;
247  if (Units.empty())
248  {
249  unitname<<Units;
250  unittitle<<"No Units";
251  }
252  else
253  {
254  unitname<<" "<<Units;
255  unittitle<<Units;
256  }
257 
258  h=ib.book2D(("All "+name.str()+unitname.str()).c_str(),
259  (name.str() + " for all HCAL ("+unittitle.str().c_str()+")"),
260  85,-42.5,42.5,
261  72,0.5,72.5);
262 
263  h->setAxisTitle("i#eta",1);
264  h->setAxisTitle("i#phi",2);
265 
266  SetupEtaPhiHists(ib, hh, Name, Units);
267  return;
268 }
void SetupEtaPhiHists(DQMStore::IBooker &ib, MonitorElement *&h, EtaPhiHists &hh, std::string Name, std::string Units)
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void HcalBaseMonitor::SetupEtaPhiHists ( DQMStore::IBooker ib,
EtaPhiHists hh,
std::string  Name,
std::string  Units 
)

Definition at line 270 of file HcalBaseMonitor.cc.

References EtaPhiHists::setup().

271 {
272  hh.setup(ib, Name, Units);
273  return;
274 }
void setup(DQMStore::IBooker &m_dbe, std::string Name, std::string Units="")
void HcalBaseMonitor::setVerbosity ( int  verb)
inline

Definition at line 55 of file HcalBaseMonitor.h.

References fVerbosity.

55 { fVerbosity = verb; }
bool HcalBaseMonitor::vetoCell ( HcalDetId id)

Definition at line 197 of file HcalBaseMonitor.cc.

References badCells_, and i.

198 {
199  /*
200  Function identifies whether cell with HcalDetId 'id' should be vetoed,
201  based on elements stored in badCells_ array.
202  */
203 
204  if(badCells_.size()==0) return false;
205  for(unsigned int i = 0; i< badCells_.size(); ++i)
206  {
207 
208  unsigned int badc = atoi(badCells_[i].c_str());
209  if(id.rawId() == badc) return true;
210  }
211  return false;
212 } // bool HcalBaseMonitor::vetoCell(HcalDetId id)
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > badCells_

Member Data Documentation

std::vector<int> HcalBaseMonitor::AllowedCalibTypes_
protected

Definition at line 117 of file HcalBaseMonitor.h.

Referenced by setup().

std::vector<std::string> HcalBaseMonitor::badCells_
protected

Definition at line 113 of file HcalBaseMonitor.h.

Referenced by HcalBaseMonitor(), hideKnownBadCells(), setup(), and vetoCell().

std::string HcalBaseMonitor::baseFolder_
protected
bool HcalBaseMonitor::checkHB_
protected

Definition at line 104 of file HcalBaseMonitor.h.

Referenced by setup().

bool HcalBaseMonitor::checkHE_
protected

Definition at line 104 of file HcalBaseMonitor.h.

Referenced by setup().

bool HcalBaseMonitor::checkHF_
protected

Definition at line 104 of file HcalBaseMonitor.h.

Referenced by setup().

bool HcalBaseMonitor::checkHO_
protected

Definition at line 104 of file HcalBaseMonitor.h.

Referenced by setup().

int HcalBaseMonitor::checkNevents_
protected

Definition at line 97 of file HcalBaseMonitor.h.

Referenced by setup().

edm::CPUTimer HcalBaseMonitor::cpu_timer
protected
bool HcalBaseMonitor::dump2database
protected

Definition at line 96 of file HcalBaseMonitor.h.

Referenced by setup().

int HcalBaseMonitor::etaBins_
protected

Definition at line 101 of file HcalBaseMonitor.h.

Referenced by setup(), and setupDepthHists2D().

double HcalBaseMonitor::etaMax_
protected

Definition at line 99 of file HcalBaseMonitor.h.

Referenced by setup(), and setupDepthHists2D().

double HcalBaseMonitor::etaMin_
protected

Definition at line 99 of file HcalBaseMonitor.h.

Referenced by setup(), and setupDepthHists2D().

int HcalBaseMonitor::fVerbosity
protected
int HcalBaseMonitor::ievt_
protected

Definition at line 122 of file HcalBaseMonitor.h.

Referenced by beginRun(), processEvent(), and setup().

bool HcalBaseMonitor::LBprocessed_
protected

Definition at line 125 of file HcalBaseMonitor.h.

Referenced by beginLuminosityBlock(), beginRun(), and endLuminosityBlock().

int HcalBaseMonitor::levt_
protected

Definition at line 123 of file HcalBaseMonitor.h.

Referenced by beginLuminosityBlock(), beginRun(), processEvent(), and setup().

int HcalBaseMonitor::lumiblock
protected

Definition at line 128 of file HcalBaseMonitor.h.

Referenced by LumiBlockUpdate(), and setup().

bool HcalBaseMonitor::makeDiagnostics
protected

Definition at line 110 of file HcalBaseMonitor.h.

Referenced by getDiagnostics(), setDiagnostics(), and setup().

MonitorElement* HcalBaseMonitor::meEVT_
protected

Definition at line 126 of file HcalBaseMonitor.h.

Referenced by processEvent(), and setup().

MonitorElement* HcalBaseMonitor::meTOTALEVT_
protected

Definition at line 127 of file HcalBaseMonitor.h.

Referenced by processEvent(), and setup().

double HcalBaseMonitor::minErrorFlag_
protected

Definition at line 102 of file HcalBaseMonitor.h.

Referenced by setup().

int HcalBaseMonitor::Nlumiblocks_
protected

Definition at line 106 of file HcalBaseMonitor.h.

Referenced by LumiBlockUpdate(), and setup().

int HcalBaseMonitor::NumBadHB
protected

Definition at line 130 of file HcalBaseMonitor.h.

Referenced by setup().

int HcalBaseMonitor::NumBadHE
protected

Definition at line 130 of file HcalBaseMonitor.h.

Referenced by setup().

int HcalBaseMonitor::NumBadHF
protected

Definition at line 130 of file HcalBaseMonitor.h.

Referenced by setup().

int HcalBaseMonitor::NumBadHO
protected

Definition at line 130 of file HcalBaseMonitor.h.

Referenced by setup().

int HcalBaseMonitor::oldlumiblock
protected

Definition at line 129 of file HcalBaseMonitor.h.

Referenced by setup().

bool HcalBaseMonitor::Online_
protected

Definition at line 112 of file HcalBaseMonitor.h.

Referenced by setup().

int HcalBaseMonitor::phiBins_
protected

Definition at line 101 of file HcalBaseMonitor.h.

Referenced by setup(), and setupDepthHists2D().

double HcalBaseMonitor::phiMax_
protected

Definition at line 100 of file HcalBaseMonitor.h.

Referenced by setup(), and setupDepthHists2D().

double HcalBaseMonitor::phiMin_
protected

Definition at line 100 of file HcalBaseMonitor.h.

Referenced by setup(), and setupDepthHists2D().

MonitorElement* HcalBaseMonitor::ProblemCells
protected

Definition at line 119 of file HcalBaseMonitor.h.

Referenced by hideKnownBadCells(), and periodicReset().

EtaPhiHists HcalBaseMonitor::ProblemCellsByDepth
protected

Definition at line 120 of file HcalBaseMonitor.h.

Referenced by hideKnownBadCells(), and periodicReset().

MonitorElement* HcalBaseMonitor::ProblemsVsLB
protected

Definition at line 131 of file HcalBaseMonitor.h.

Referenced by setup().

MonitorElement* HcalBaseMonitor::ProblemsVsLB_HB
protected

Definition at line 132 of file HcalBaseMonitor.h.

Referenced by setup().

MonitorElement * HcalBaseMonitor::ProblemsVsLB_HBHEHF
protected

Definition at line 132 of file HcalBaseMonitor.h.

Referenced by setup().

MonitorElement * HcalBaseMonitor::ProblemsVsLB_HE
protected

Definition at line 132 of file HcalBaseMonitor.h.

Referenced by setup().

MonitorElement * HcalBaseMonitor::ProblemsVsLB_HF
protected

Definition at line 132 of file HcalBaseMonitor.h.

Referenced by setup().

MonitorElement * HcalBaseMonitor::ProblemsVsLB_HO
protected

Definition at line 132 of file HcalBaseMonitor.h.

Referenced by setup().

int HcalBaseMonitor::resetNevents_
protected

Definition at line 105 of file HcalBaseMonitor.h.

Referenced by setup().

std::string HcalBaseMonitor::rootFolder_
protected
bool HcalBaseMonitor::showTiming
protected
int HcalBaseMonitor::tevt_
protected

Definition at line 124 of file HcalBaseMonitor.h.

Referenced by processEvent(), and setup().