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 *dbe)
 
void setupDepthHists1D (MonitorElement *&h, std::vector< MonitorElement * > &hh, std::string Name, std::string Units, int lowbound, int highbound, int Nbins)
 
void setupDepthHists1D (std::vector< MonitorElement * > &hh, std::string Name, std::string Units, int lowbound, int highbound, int Nbins)
 
void setupDepthHists2D (MonitorElement *&h, std::vector< MonitorElement * > &hh, std::string Name, std::string Units)
 
void setupDepthHists2D (std::vector< MonitorElement * > &hh, std::string Name, std::string Units)
 
void setupDepthHists2D (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 (std::vector< MonitorElement * > &hh, std::string Name, std::string Units, int nbinsx, int lowboundx, int highboundx, int nbinsy, int lowboundy, int highboundy)
 
void SetupEtaPhiHists (MonitorElement *&h, EtaPhiHists &hh, std::string Name, std::string Units)
 
void SetupEtaPhiHists (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
 
DQMStorem_dbe
 
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 160 of file HcalBaseMonitor.cc.

References LBprocessed_, levt_, and LumiBlockUpdate().

Referenced by ZDCMonitorModule::beginLuminosityBlock().

161 {
162  // Protect against online mis-ordering of events.
163  // Do we want this enabled here?
164  //if (Online_ && lumisec<lumiblock)
165  // return;
166  LumiBlockUpdate(lumisec);
167  levt_=0;
168  LBprocessed_=false;
169 } // 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::beginRun().

void HcalBaseMonitor::clearME ( )
virtual

Reimplemented in HcalEEUSMonitor.

Definition at line 179 of file HcalBaseMonitor.cc.

References baseFolder_, m_dbe, DQMStore::removeContents(), and DQMStore::setCurrentFolder().

Referenced by ZDCMonitorModule::~ZDCMonitorModule().

179  {
180 
181  if(m_dbe){
183  m_dbe->removeContents();
184  /*
185  m_dbe->setCurrentFolder(baseFolder_+"/HB");
186  m_dbe->removeContents();
187 
188  m_dbe->setCurrentFolder(baseFolder_+"/HE");
189  m_dbe->removeContents();
190 
191  m_dbe->setCurrentFolder(baseFolder_+"/HO");
192  m_dbe->removeContents();
193 
194  m_dbe->setCurrentFolder(baseFolder_+"/HF");
195  m_dbe->removeContents();
196  */
197  }
198  return;
199 } // void HcalBaseMonitor::clearME();
void removeContents(void)
erase all monitoring elements in current directory (not including subfolders);
Definition: DQMStore.cc:3085
std::string baseFolder_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
void HcalBaseMonitor::done ( )
virtual

Definition at line 177 of file HcalBaseMonitor.cc.

Referenced by ZDCMonitorModule::endJob().

177 {}
void HcalBaseMonitor::endLuminosityBlock ( void  )

Definition at line 171 of file HcalBaseMonitor.cc.

References LBprocessed_.

172 {
173  LBprocessed_=true;
174  return;
175 } // 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 221 of file HcalBaseMonitor.cc.

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

222 {
223  /* This prevents known bad cells from being displayed in overall problem maps and
224  depth histograms. Is this what we want? Or do we want some problems to be
225  displayed in the depth plots but not the overall map? (Or vice versa?)
226  */
227 
228  for (unsigned int i=0;i<badCells_.size();++i)
229  {
230  unsigned int badc = atoi(badCells_[i].c_str());
231  HcalDetId id(badc);
232  int etabin=CalcEtaBin(id.subdet(),id.ieta(),id.depth());
233  if (ProblemCells!=0) ProblemCells->setBinContent(etabin+1,id.iphi(),0);
234  if (ProblemCellsByDepth.depth[id.depth()-1]!=0)
235  ProblemCellsByDepth.depth[id.depth()-1]->setBinContent(etabin+1,id.iphi(),0);
236  } // for (unsigned int i=0;...)
237  return;
238 } // 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 120 of file HcalBaseMonitor.cc.

References lumiblock, and Nlumiblocks_.

Referenced by beginLuminosityBlock().

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

Definition at line 639 of file HcalBaseMonitor.cc.

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

640 {
641  // when called, reset all counters, and all histograms
642  if (ProblemCells!=0) ProblemCells->Reset();
643  for (unsigned int i=0;i<ProblemCellsByDepth.depth.size();++i)
644  {
645  if (ProblemCellsByDepth.depth[i]!=0)
646  ProblemCellsByDepth.depth[i]->Reset();
647  }
648  return;
649 }
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 105 of file HcalBaseMonitor.cc.

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

106 {
107  // increment event counters
108  ++ievt_;
109  ++levt_;
110  ++tevt_;
111  // Fill MonitorElements
112  if (m_dbe)
113  {
114  if (meEVT_) meEVT_->Fill(ievt_);
116  }
117  return;
118 }
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 628 of file HcalBaseMonitor.cc.

References timingPdfMaker::histo, and i.

629 {
630  for (unsigned int i=0; i<hh.size();++i)
631  {
632  TH1F* histo=hh[i]->getTH1F();
633  histo->SetMinimum(min);
634  histo->SetMaximum(max);
635  }
636  return;
637 }
int i
Definition: DBlmapReader.cc:9
const T & max(const T &a, const T &b)
void HcalBaseMonitor::setMinMaxHists2D ( std::vector< MonitorElement * > &  hh,
double  min,
double  max 
)

Definition at line 617 of file HcalBaseMonitor.cc.

References timingPdfMaker::histo, and i.

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

Definition at line 523 of file HcalBaseMonitor.cc.

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

524 {
525  // Makes an overall 1D Monitor Element (for summing over depths) for h, and creates individual depth Monitor Elements for hh
526  if (showTiming)
527  {
529  }
530 
531  std::stringstream name;
532  name<<Name;
533 
534  std::stringstream unitname;
535  std::stringstream unittitle;
536  if (Units.empty())
537  {
538  unitname<<Units;
539  unittitle<<"No Units";
540  }
541  else
542  {
543  unitname<<" "<<Units;
544  unittitle<<Units;
545  }
546 
547  // Create overall 1D Monitor Element
548  h=m_dbe->book1D(("All "+name.str()+unitname.str()).c_str(),
549  (name.str() + " for all HCAL ("+unittitle.str().c_str()+")"),
550  Nbins,lowbound,highbound);
551  h->setAxisTitle(unitname.str().c_str(),1);
552 
553  // Create vector of Monitor Elements for individual depths
554  setupDepthHists1D(hh, Name, Units, lowbound, highbound, Nbins);
555 
556  if (showTiming)
557  {
558  cpu_timer.stop(); std::cout <<"TIMER:: HcalBaseMonitor SETUPDEPTHHISTS1D_OVERALL "<<name.str().c_str()<<" -> "<<cpu_timer.cpuTime()<<std::endl;
559  }
560  return;
561 
562 } //void HcalBaseMonitor::setupDepthHists1D(MonitorElement* &h, std::vector<MonitorElement*> &hh, std::string Name, std::string Units)
void setupDepthHists1D(MonitorElement *&h, std::vector< MonitorElement * > &hh, std::string Name, std::string Units, int lowbound, int highbound, int Nbins)
void start()
Definition: CPUTimer.cc:74
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:942
void reset()
Definition: CPUTimer.cc:107
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 setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void HcalBaseMonitor::setupDepthHists1D ( std::vector< MonitorElement * > &  hh,
std::string  Name,
std::string  Units,
int  lowbound,
int  highbound,
int  Nbins 
)

Definition at line 566 of file HcalBaseMonitor.cc.

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

567 {
568  // Makes histograms just for the vector of Monitor Elements
569  if (showTiming)
570  {
572  }
573 
574  std::stringstream name;
575  name<<Name;
576  std::stringstream unitname;
577  std::stringstream unittitle;
578  if (Units.empty())
579  {
580  unitname<<Units;
581  unittitle<<"No Units";
582  }
583  else
584  {
585  unitname<<" "<<Units;
586  unittitle<<Units;
587  }
588 
589  // Push back depth plots
590  hh.push_back(m_dbe->book1D(("HB "+name.str()+unitname.str()).c_str(),
591  (name.str()+" HB ("+unittitle.str().c_str()+")"),
592  Nbins,lowbound,highbound));
593  hh.push_back( m_dbe->book1D(("HE "+name.str()+unitname.str()).c_str(),
594  (name.str()+" HE ("+unittitle.str().c_str()+")"),
595  Nbins,lowbound,highbound));
596  hh.push_back( m_dbe->book1D(("HO "+name.str()+unitname.str()).c_str(),
597  (name.str()+" HO ("+unittitle.str().c_str()+")"),
598  Nbins,lowbound,highbound));
599  hh.push_back( m_dbe->book1D(("HF "+name.str()+unitname.str()).c_str(),
600  (name.str()+" HF ("+unittitle.str().c_str()+")"),
601  Nbins,lowbound,highbound));
602 
603  for (unsigned int i=0;i<hh.size();++i)
604  {
605  hh[i]->setAxisTitle(unitname.str().c_str(),1);
606  }
607 
608  if (showTiming)
609  {
610  cpu_timer.stop(); std::cout <<"TIMER:: HcalBaseMonitor SETUPDEPTHHISTS1D "<<name.str().c_str()<<" -> "<<cpu_timer.cpuTime()<<std::endl;
611  }
612 
613  return;
614 } // 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
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:942
void reset()
Definition: CPUTimer.cc:107
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 ( MonitorElement *&  h,
std::vector< MonitorElement * > &  hh,
std::string  Name,
std::string  Units 
)

Definition at line 283 of file HcalBaseMonitor.cc.

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

Referenced by setupDepthHists2D().

284 {
285  /* Code makes overall 2D MonitorElement histogram,
286  and the vector of 2D MonitorElements for each individual depth.
287  Eta, Phi bins are set automatically from the etaMax_, etaMin_, etc.
288  values in HcalBaseMonitor.h
289  */
290 
291  /*
292  if (showTiming)
293  {
294  cpu_timer.reset(); cpu_timer.start();
295  }
296  */
297  std::stringstream name;
298  name<<Name;
299  std::stringstream unitname;
300  std::stringstream unittitle;
301  if (Units.empty())
302  {
303  unitname<<Units;
304  unittitle<<"No Units";
305  }
306  else
307  {
308  unitname<<" "<<Units;
309  unittitle<<Units;
310  }
311 
312  h=m_dbe->book2D(("All "+name.str()+unitname.str()).c_str(),
313  (name.str() + " for all HCAL ("+unittitle.str().c_str()+")"),
316  h->setAxisTitle("i#eta",1);
317  h->setAxisTitle("i#phi",2);
318 
319  setupDepthHists2D(hh, Name, Units);
320  /*
321  if (showTiming)
322  {
323  cpu_timer.stop(); std::cout <<"TIMER:: HcalBaseMonitor SETUPDEPTHHISTS2D_OVERALL "<<name.str().c_str()<<" -> "<<cpu_timer.cpuTime()<<std::endl;
324  }
325  */
326  return;
327 } // void HcalBaseMonitor::setupDepthHists2D(MonitorElement* &h, std::vector<MonitorElement*> &hh, std::string Name, std::string Units)
void setupDepthHists2D(MonitorElement *&h, std::vector< MonitorElement * > &hh, std::string Name, std::string Units)
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1070
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void HcalBaseMonitor::setupDepthHists2D ( std::vector< MonitorElement * > &  hh,
std::string  Name,
std::string  Units 
)

Definition at line 332 of file HcalBaseMonitor.cc.

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

333 {
334  /* Code makes vector of 2D MonitorElements for all 6 depths
335  (4 depths, + 2 for separate HE histograms).
336  Bins are automatically set for eta/phi indices
337  DEPRECATE THIS ONCE ALL OLD-STYLE 2D HISTOGRAMS HAVE BEEN REMOVED!
338  */
339 
340  /*
341  if (showTiming)
342  {
343  cpu_timer.reset(); cpu_timer.start();
344  }
345  */
346  std::stringstream name;
347  name<<Name;
348 
349  std::stringstream unitname;
350  std::stringstream unittitle;
351  if (Units.empty())
352  {
353  unitname<<Units;
354  unittitle<<"No Units";
355  }
356  else
357  {
358  unitname<<" "<<Units;
359  unittitle<<Units;
360  }
361 
362  // Push back depth plots -- remove ZDC names at some point?
363  hh.push_back(m_dbe->book2D(("HB HF Depth 1 "+name.str()+unitname.str()).c_str(),
364  (name.str()+" Depth 1 -- HB & HF only ("+unittitle.str().c_str()+")"),
367  hh.push_back( m_dbe->book2D(("HB HF Depth 2 "+name.str()+unitname.str()).c_str(),
368  (name.str()+" Depth 2 -- HB & HF only ("+unittitle.str().c_str()+")"),
371  hh.push_back( m_dbe->book2D(("HE Depth 3 "+name.str()+unitname.str()).c_str(),
372  (name.str()+" Depth 3 -- HE ("+unittitle.str().c_str()+")"),
375  hh.push_back( m_dbe->book2D(("HO ZDC "+name.str()+unitname.str()).c_str(),
376  (name.str()+" -- HO & ZDC ("+unittitle.str().c_str()+")"),
379  hh.push_back(m_dbe->book2D(("HE Depth 1 "+name.str()+unitname.str()).c_str(),
380  (name.str()+" Depth 1 -- HE only ("+unittitle.str().c_str()+")"),
383  hh.push_back(m_dbe->book2D(("HE Depth 2 "+name.str()+unitname.str()).c_str(),
384  (name.str()+" Depth 2 -- HE only ("+unittitle.str().c_str()+")"),
387  for (unsigned int i=0;i<hh.size();++i)
388  {
389  hh[i]->setAxisTitle("i#eta",1);
390  hh[i]->setAxisTitle("i#phi",2);
391  }
392  /*
393  if (showTiming)
394  {
395  cpu_timer.stop(); std::cout <<"TIMER:: HcalBaseMonitor SETUPDEPTHHISTS2D "<<name.str().c_str()<<" -> "<<cpu_timer.cpuTime()<<std::endl;
396  }
397  */
398  return;
399 } // void HcalBaseMonitor::setupDepthHists2D(std::vector<MonitorElement*> &hh, std::string Name, std::string Units)
int i
Definition: DBlmapReader.cc:9
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1070
void HcalBaseMonitor::setupDepthHists2D ( 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 404 of file HcalBaseMonitor.cc.

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

407 {
408  /* Code makes overall 2D MonitorElement histogram,
409  and the vector of 2D MonitorElements for each individual depth.
410  Bin ranges, sizes are specified by user
411  DEPRECATE THIS ONCE ALL OLD-STYLE 2D HISTOGRAMS HAVE BEEN REMOVED!
412  */
413 
414  if (showTiming)
415  {
417  }
418 
419  std::stringstream name;
420  name<<Name;
421  std::stringstream unitname;
422  std::stringstream unittitle;
423  if (Units.empty())
424  {
425  unitname<<Units;
426  unittitle<<"No Units";
427  }
428  else
429  {
430  unitname<<" "<<Units;
431  unittitle<<Units;
432  }
433 
434  h=m_dbe->book2D(("All "+name.str()+unitname.str()).c_str(),
435  (name.str() + " for all HCAL ("+unittitle.str().c_str()+")"),
436  nbinsx, lowboundx, highboundx,
437  nbinsy, lowboundy, highboundy);
438 
439  setupDepthHists2D(hh, Name, Units,
440  nbinsx, lowboundx, highboundx,
441  nbinsy, lowboundy, highboundy);
442 
443 
444  if (showTiming)
445  {
446  cpu_timer.stop(); std::cout <<"TIMER:: HcalBaseMonitor SETUPDEPTHHISTS2D_OVERALL "<<name.str().c_str()<<" -> "<<cpu_timer.cpuTime()<<std::endl;
447  }
448  return;
449 } // void HcalBaseMonitor::setupDepthHists2D(MonitorElement* &h, std::vector<MonitorElement*> &hh, std::string Name, std::string Units, int nbinsx...)
void start()
Definition: CPUTimer.cc:74
void reset()
Definition: CPUTimer.cc:107
edm::CPUTimer cpu_timer
void setupDepthHists2D(MonitorElement *&h, std::vector< MonitorElement * > &hh, std::string Name, std::string Units)
Times stop()
Definition: CPUTimer.cc:94
double cpuTime() const
Definition: CPUTimer.cc:158
tuple cout
Definition: gather_cfg.py:121
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1070
void HcalBaseMonitor::setupDepthHists2D ( 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 454 of file HcalBaseMonitor.cc.

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

457 {
458  /* Code makes vector of 2D MonitorElements for all 6 depths
459  (4 depths, + 2 for separate HE histograms).
460  Bins are automatically set for eta/phi indices
461  DEPRECATE THIS ONCE ALL OLD-STYLE 2D HISTOGRAMS HAVE BEEN REMOVED!
462 
463 
464  */
465 
466  if (showTiming)
467  {
469  }
470 
471  std::stringstream name;
472  name<<Name;
473 
474  std::stringstream unitname;
475  std::stringstream unittitle;
476  if (Units.empty())
477  {
478  unitname<<Units;
479  unittitle<<"No Units";
480  }
481  else
482  {
483  unitname<<" "<<Units;
484  unittitle<<Units;
485  }
486 
487  // Push back depth plots
488  hh.push_back(m_dbe->book2D(("HB HF Depth 1 "+name.str()+unitname.str()).c_str(),
489  (name.str()+" Depth 1 -- HB & HF only ("+unittitle.str().c_str()+")"),
490  nbinsx, lowboundx, highboundx,
491  nbinsy, lowboundy, highboundy));
492  hh.push_back( m_dbe->book2D(("HB HF Depth 2 "+name.str()+unitname.str()).c_str(),
493  (name.str()+" Depth 2 -- HB & HF only ("+unittitle.str().c_str()+")"),
494  nbinsx, lowboundx, highboundx,
495  nbinsy, lowboundy, highboundy));
496  hh.push_back( m_dbe->book2D(("HE Depth 3 "+name.str()+unitname.str()).c_str(),
497  (name.str()+" Depth 3 -- HE ("+unittitle.str().c_str()+")"),
498  nbinsx, lowboundx, highboundx,
499  nbinsy, lowboundy, highboundy));
500  hh.push_back( m_dbe->book2D(("HO ZDC "+name.str()+unitname.str()).c_str(),
501  (name.str()+" -- HO & ZDC ("+unittitle.str().c_str()+")"),
502  nbinsx, lowboundx, highboundx,
503  nbinsy, lowboundy, highboundy));
504  hh.push_back(m_dbe->book2D(("HE Depth 1 "+name.str()+unitname.str()).c_str(),
505  (name.str()+" Depth 1 -- HE only ("+unittitle.str().c_str()+")"),
506  nbinsx, lowboundx, highboundx,
507  nbinsy, lowboundy, highboundy));
508  hh.push_back(m_dbe->book2D(("HE Depth 2 "+name.str()+unitname.str()).c_str(),
509  (name.str()+" Depth 2 -- HE only ("+unittitle.str().c_str()+")"),
510  nbinsx, lowboundx, highboundx,
511  nbinsy, lowboundy, highboundy));
512 
513  if (showTiming)
514  {
515  cpu_timer.stop(); std::cout <<"TIMER:: HcalBaseMonitor SETUPDEPTHHISTS2D "<<name.str().c_str()<<" -> "<<cpu_timer.cpuTime()<<std::endl;
516  }
517 
518  return;
519 } // 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
tuple cout
Definition: gather_cfg.py:121
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1070
void HcalBaseMonitor::SetupEtaPhiHists ( MonitorElement *&  h,
EtaPhiHists hh,
std::string  Name,
std::string  Units 
)

Definition at line 248 of file HcalBaseMonitor.cc.

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

249 {
250  std::stringstream name;
251  name<<Name;
252  std::stringstream unitname;
253  std::stringstream unittitle;
254  if (Units.empty())
255  {
256  unitname<<Units;
257  unittitle<<"No Units";
258  }
259  else
260  {
261  unitname<<" "<<Units;
262  unittitle<<Units;
263  }
264 
265  h=m_dbe->book2D(("All "+name.str()+unitname.str()).c_str(),
266  (name.str() + " for all HCAL ("+unittitle.str().c_str()+")"),
267  85,-42.5,42.5,
268  72,0.5,72.5);
269 
270  h->setAxisTitle("i#eta",1);
271  h->setAxisTitle("i#phi",2);
272 
273  SetupEtaPhiHists(hh, Name, Units);
274  return;
275 }
void SetupEtaPhiHists(MonitorElement *&h, EtaPhiHists &hh, std::string Name, std::string Units)
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1070
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void HcalBaseMonitor::SetupEtaPhiHists ( EtaPhiHists hh,
std::string  Name,
std::string  Units 
)

Definition at line 277 of file HcalBaseMonitor.cc.

References m_dbe, and EtaPhiHists::setup().

278 {
279  hh.setup(m_dbe, Name, Units);
280  return;
281 }
void setup(DQMStore *&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 204 of file HcalBaseMonitor.cc.

References badCells_, and i.

205 {
206  /*
207  Function identifies whether cell with HcalDetId 'id' should be vetoed,
208  based on elements stored in badCells_ array.
209  */
210 
211  if(badCells_.size()==0) return false;
212  for(unsigned int i = 0; i< badCells_.size(); ++i)
213  {
214 
215  unsigned int badc = atoi(badCells_[i].c_str());
216  if(id.rawId() == badc) return true;
217  }
218  return false;
219 } // 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 118 of file HcalBaseMonitor.h.

Referenced by setup().

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

Definition at line 114 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 123 of file HcalBaseMonitor.h.

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

bool HcalBaseMonitor::LBprocessed_
protected

Definition at line 126 of file HcalBaseMonitor.h.

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

int HcalBaseMonitor::levt_
protected

Definition at line 124 of file HcalBaseMonitor.h.

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

int HcalBaseMonitor::lumiblock
protected

Definition at line 129 of file HcalBaseMonitor.h.

Referenced by LumiBlockUpdate(), and setup().

DQMStore* HcalBaseMonitor::m_dbe
protected
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 127 of file HcalBaseMonitor.h.

Referenced by processEvent(), and setup().

MonitorElement* HcalBaseMonitor::meTOTALEVT_
protected

Definition at line 128 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 131 of file HcalBaseMonitor.h.

Referenced by setup().

int HcalBaseMonitor::NumBadHE
protected

Definition at line 131 of file HcalBaseMonitor.h.

Referenced by setup().

int HcalBaseMonitor::NumBadHF
protected

Definition at line 131 of file HcalBaseMonitor.h.

Referenced by setup().

int HcalBaseMonitor::NumBadHO
protected

Definition at line 131 of file HcalBaseMonitor.h.

Referenced by setup().

int HcalBaseMonitor::oldlumiblock
protected

Definition at line 130 of file HcalBaseMonitor.h.

Referenced by setup().

bool HcalBaseMonitor::Online_
protected

Definition at line 113 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 120 of file HcalBaseMonitor.h.

Referenced by hideKnownBadCells(), and periodicReset().

EtaPhiHists HcalBaseMonitor::ProblemCellsByDepth
protected

Definition at line 121 of file HcalBaseMonitor.h.

Referenced by hideKnownBadCells(), and periodicReset().

MonitorElement* HcalBaseMonitor::ProblemsVsLB
protected

Definition at line 132 of file HcalBaseMonitor.h.

Referenced by setup().

MonitorElement* HcalBaseMonitor::ProblemsVsLB_HB
protected

Definition at line 133 of file HcalBaseMonitor.h.

Referenced by setup().

MonitorElement * HcalBaseMonitor::ProblemsVsLB_HBHEHF
protected

Definition at line 133 of file HcalBaseMonitor.h.

Referenced by setup().

MonitorElement * HcalBaseMonitor::ProblemsVsLB_HE
protected

Definition at line 133 of file HcalBaseMonitor.h.

Referenced by setup().

MonitorElement * HcalBaseMonitor::ProblemsVsLB_HF
protected

Definition at line 133 of file HcalBaseMonitor.h.

Referenced by setup().

MonitorElement * HcalBaseMonitor::ProblemsVsLB_HO
protected

Definition at line 133 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 125 of file HcalBaseMonitor.h.

Referenced by processEvent(), and setup().