CMS 3D CMS Logo

List of all members | Protected Member Functions | Private Member Functions | Private Attributes
ElectronDqmAnalyzerBase Class Reference

#include <ElectronDqmAnalyzerBase.h>

Inheritance diagram for ElectronDqmAnalyzerBase:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... > ElectronAnalyzer ElectronGeneralAnalyzer ElectronMcFakeValidator ElectronMcSignalValidator ElectronMcSignalValidatorMiniAOD ElectronTagProbeAnalyzer

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
MonitorElementbookH1 (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
 
MonitorElementbookH1withSumw2 (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
 
MonitorElementbookH2 (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="COLZ")
 
MonitorElementbookH2withSumw2 (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="COLZ")
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
MonitorElementbookP1 (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="E1 P")
 
MonitorElementcloneH1 (DQMStore::IBooker &iBooker, const std::string &name, MonitorElement *original, const std::string &title="")
 
MonitorElementcloneH1 (DQMStore::IBooker &iBooker, const std::string &name, const std::string &original, const std::string &title="")
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &) override
 
 ElectronDqmAnalyzerBase (const edm::ParameterSet &conf)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
bool finalStepDone ()
 
void setBookEfficiencyFlag (const bool &)
 
void setBookIndex (short)
 
void setBookPrefix (const std::string &)
 
void setBookStatOverflowFlag (const bool &)
 
int verbosity ()
 
 ~ElectronDqmAnalyzerBase () override
 

Private Member Functions

std::string newName (const std::string &name)
 

Private Attributes

bool bookEfficiencyFlag_ = false
 
short bookIndex_
 
std::string bookPrefix_
 
bool bookStatOverflowFlag_ = false
 
bool finalDone_
 
std::string finalStep_
 
std::vector< std::string > histoNames_
 
bool histoNamesReady
 
std::string inputFile_
 
std::string inputInternalPath_
 
std::string outputFile_
 
std::string outputInternalPath_
 
int verbosity_
 

Additional Inherited Members

- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Detailed Description

Definition at line 19 of file ElectronDqmAnalyzerBase.h.

Constructor & Destructor Documentation

ElectronDqmAnalyzerBase::ElectronDqmAnalyzerBase ( const edm::ParameterSet conf)
explicitprotected

Definition at line 19 of file ElectronDqmAnalyzerBase.cc.

References finalStep_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), inputFile_, inputInternalPath_, outputFile_, outputInternalPath_, AlCaHLTBitMon_QueryRunRegistry::string, and verbosity_.

20  : bookPrefix_("ele"), bookIndex_(0), histoNamesReady(false), finalDone_(false)
21  {
22  verbosity_ = conf.getUntrackedParameter<int>("Verbosity") ;
23  finalStep_ = conf.getParameter<std::string>("FinalStep") ;
24  inputFile_ = conf.getParameter<std::string>("InputFile") ;
25  outputFile_ = conf.getParameter<std::string>("OutputFile") ;
26  inputInternalPath_ = conf.getParameter<std::string>("InputFolderName") ;
27  outputInternalPath_ = conf.getParameter<std::string>("OutputFolderName") ;
28 
29  }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
ElectronDqmAnalyzerBase::~ElectronDqmAnalyzerBase ( )
overrideprotected

Definition at line 31 of file ElectronDqmAnalyzerBase.cc.

32  {}

Member Function Documentation

void ElectronDqmAnalyzerBase::analyze ( const edm::Event e,
const edm::EventSetup c 
)
inlineoverrideprotected

Definition at line 34 of file ElectronDqmAnalyzerBase.h.

34 {}
MonitorElement * ElectronDqmAnalyzerBase::bookH1 ( DQMStore::IBooker iBooker,
const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
const std::string &  titleX = "",
const std::string &  titleY = "Events",
Option_t *  option = "E1 P" 
)
protected

Definition at line 95 of file ElectronDqmAnalyzerBase.cc.

References DQMStore::IBooker::book1D(), bookH1withSumw2(), bookStatOverflowFlag_, MonitorElement::getTH1(), MonitorElement::getTH1F(), newName(), outputInternalPath_, and DQMStore::IBooker::setCurrentFolder().

Referenced by ElectronMcSignalValidatorMiniAOD::bookHistograms(), ElectronMcSignalValidator::bookHistograms(), ElectronGeneralAnalyzer::bookHistograms(), ElectronTagProbeAnalyzer::bookHistograms(), bookHistograms(), ElectronMcFakeValidator::bookHistograms(), ElectronAnalyzer::bookHistograms(), and verbosity().

99  {
101  MonitorElement * me = iBooker.book1D(newName(name),title,nchX,lowX,highX) ;
102  if (titleX!="") { me->getTH1F()->GetXaxis()->SetTitle(titleX.c_str()) ; }
103  if (titleY!="") { me->getTH1F()->GetYaxis()->SetTitle(titleY.c_str()) ; }
104  if (TString(option)!="") { me->getTH1F()->SetOption(option) ; }
105  if (bookStatOverflowFlag_) {me->getTH1()->StatOverflows(kTRUE) ; }
106  return me ;
107  }
TH1F * getTH1F() const
TH1 * getTH1() const
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
std::string newName(const std::string &name)
MonitorElement * ElectronDqmAnalyzerBase::bookH1withSumw2 ( DQMStore::IBooker iBooker,
const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
const std::string &  titleX = "",
const std::string &  titleY = "Events",
Option_t *  option = "E1 P" 
)
protected

Definition at line 110 of file ElectronDqmAnalyzerBase.cc.

References DQMStore::IBooker::book1D(), bookH2(), bookStatOverflowFlag_, MonitorElement::getTH1(), MonitorElement::getTH1F(), newName(), outputInternalPath_, and DQMStore::IBooker::setCurrentFolder().

Referenced by bookH1(), ElectronMcSignalValidatorMiniAOD::bookHistograms(), ElectronMcSignalValidator::bookHistograms(), ElectronTagProbeAnalyzer::bookHistograms(), ElectronMcFakeValidator::bookHistograms(), ElectronAnalyzer::bookHistograms(), and verbosity().

114  {
116  MonitorElement * me = iBooker.book1D(newName(name),title,nchX,lowX,highX) ;
117  if (me->getTH1F()->GetSumw2N() == 0) me->getTH1F()->Sumw2() ;
118  if (titleX!="") { me->getTH1F()->GetXaxis()->SetTitle(titleX.c_str()) ; }
119  if (titleY!="") { me->getTH1F()->GetYaxis()->SetTitle(titleY.c_str()) ; }
120  if (TString(option)!="") { me->getTH1F()->SetOption(option) ; }
121  if (bookStatOverflowFlag_) {me->getTH1()->StatOverflows(kTRUE) ; }
122  return me ;
123  }
TH1F * getTH1F() const
TH1 * getTH1() const
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
std::string newName(const std::string &name)
MonitorElement * ElectronDqmAnalyzerBase::bookH2 ( DQMStore::IBooker iBooker,
const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY,
const std::string &  titleX = "",
const std::string &  titleY = "",
Option_t *  option = "COLZ" 
)
protected

Definition at line 126 of file ElectronDqmAnalyzerBase.cc.

References DQMStore::IBooker::book2D(), bookH2withSumw2(), bookStatOverflowFlag_, MonitorElement::getTH1(), MonitorElement::getTH2F(), newName(), outputInternalPath_, and DQMStore::IBooker::setCurrentFolder().

Referenced by bookH1withSumw2(), ElectronMcSignalValidatorMiniAOD::bookHistograms(), ElectronMcSignalValidator::bookHistograms(), ElectronGeneralAnalyzer::bookHistograms(), ElectronTagProbeAnalyzer::bookHistograms(), ElectronMcFakeValidator::bookHistograms(), ElectronAnalyzer::bookHistograms(), and verbosity().

131  {
133  MonitorElement * me = iBooker.book2D(newName(name),title,nchX,lowX,highX,nchY,lowY,highY) ;
134  if (titleX!="") { me->getTH2F()->GetXaxis()->SetTitle(titleX.c_str()) ; }
135  if (titleY!="") { me->getTH2F()->GetYaxis()->SetTitle(titleY.c_str()) ; }
136  if (TString(option)!="") { me->getTH2F()->SetOption(option) ; }
137  if (bookStatOverflowFlag_) {me->getTH1()->StatOverflows(kTRUE) ; }
138  return me ;
139  }
TH1 * getTH1() const
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
TH2F * getTH2F() const
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
std::string newName(const std::string &name)
MonitorElement * ElectronDqmAnalyzerBase::bookH2withSumw2 ( DQMStore::IBooker iBooker,
const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY,
const std::string &  titleX = "",
const std::string &  titleY = "",
Option_t *  option = "COLZ" 
)
protected

Definition at line 142 of file ElectronDqmAnalyzerBase.cc.

References DQMStore::IBooker::book2D(), bookP1(), bookStatOverflowFlag_, MonitorElement::getTH1(), MonitorElement::getTH2F(), newName(), outputInternalPath_, and DQMStore::IBooker::setCurrentFolder().

Referenced by bookH2(), ElectronMcSignalValidatorMiniAOD::bookHistograms(), ElectronMcSignalValidator::bookHistograms(), and verbosity().

147  {
149  MonitorElement * me = iBooker.book2D(newName(name),title,nchX,lowX,highX,nchY,lowY,highY) ;
150  if (me->getTH2F()->GetSumw2N() == 0) me->getTH2F()->Sumw2() ;
151  if (titleX!="") { me->getTH2F()->GetXaxis()->SetTitle(titleX.c_str()) ; }
152  if (titleY!="") { me->getTH2F()->GetYaxis()->SetTitle(titleY.c_str()) ; }
153  if (TString(option)!="") { me->getTH2F()->SetOption(option) ; }
154  if (bookStatOverflowFlag_) {me->getTH1()->StatOverflows(kTRUE) ; }
155  return me ;
156  }
TH1 * getTH1() const
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
TH2F * getTH2F() const
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
std::string newName(const std::string &name)
void ElectronDqmAnalyzerBase::bookHistograms ( DQMStore::IBooker ibooker_,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotected

Definition at line 88 of file ElectronDqmAnalyzerBase.cc.

References bookH1().

89 {
90  edm::LogInfo("DQMAnalyzeBase::bookHistograms") << std::endl;
91 
92 }
MonitorElement * ElectronDqmAnalyzerBase::bookP1 ( DQMStore::IBooker iBooker,
const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
double  lowY,
double  highY,
const std::string &  titleX = "",
const std::string &  titleY = "",
Option_t *  option = "E1 P" 
)
protected

Definition at line 159 of file ElectronDqmAnalyzerBase.cc.

References DQMStore::IBooker::bookProfile(), bookStatOverflowFlag_, MonitorElement::getTH1(), MonitorElement::getTProfile(), newName(), outputInternalPath_, and DQMStore::IBooker::setCurrentFolder().

Referenced by bookH2withSumw2(), ElectronMcSignalValidator::bookHistograms(), ElectronGeneralAnalyzer::bookHistograms(), ElectronMcFakeValidator::bookHistograms(), ElectronAnalyzer::bookHistograms(), and verbosity().

164  {
166  MonitorElement * me = iBooker.bookProfile(newName(name),title,nchX,lowX,highX,lowY,highY," ") ;
167  if (titleX!="") { me->getTProfile()->GetXaxis()->SetTitle(titleX.c_str()) ; }
168  if (titleY!="") { me->getTProfile()->GetYaxis()->SetTitle(titleY.c_str()) ; }
169  if (TString(option)!="") { me->getTProfile()->SetOption(option) ; }
170  if (bookStatOverflowFlag_) {me->getTH1()->StatOverflows(kTRUE) ; }
171  return me ;
172  }
TProfile * getTProfile() const
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:113
TH1 * getTH1() const
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
std::string newName(const std::string &name)
MonitorElement* ElectronDqmAnalyzerBase::cloneH1 ( DQMStore::IBooker iBooker,
const std::string &  name,
MonitorElement original,
const std::string &  title = "" 
)
protected

Referenced by verbosity().

MonitorElement* ElectronDqmAnalyzerBase::cloneH1 ( DQMStore::IBooker iBooker,
const std::string &  name,
const std::string &  original,
const std::string &  title = "" 
)
protected
void ElectronDqmAnalyzerBase::dqmBeginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotected

Definition at line 58 of file ElectronDqmAnalyzerBase.cc.

59  {
60  }
void ElectronDqmAnalyzerBase::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overrideprotected

Definition at line 78 of file ElectronDqmAnalyzerBase.cc.

References finalDone_, finalStep_, and funct::true.

79  {
80  if (finalStep_=="AtLumiEnd")
81  {
82  if (finalDone_)
83  { edm::LogWarning("ElectronDqmAnalyzerBase::endLuminosityBlock")<<"finalize() already called" ; }
84  finalDone_ = true ;
85  }
86  }
void ElectronDqmAnalyzerBase::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotected

Definition at line 62 of file ElectronDqmAnalyzerBase.cc.

References finalDone_, finalStep_, outputFile_, and funct::true.

63  {
64  if (finalStep_=="AtRunEnd")
65  {
66  if (finalDone_)
67  { edm::LogWarning("ElectronDqmAnalyzerBase::endRun")<<"finalize() already called" ; }
68  finalDone_ = true ;
69 
70  // --- transfert from endJob()
71  if (outputFile_!="")
72  {
73 // edm::LogWarning("ElectronDqmAnalyzerBase::endRun")<<"finalize() already called" ;
74  }
75  }
76  }
bool ElectronDqmAnalyzerBase::finalStepDone ( )
inlineprotected

Definition at line 37 of file ElectronDqmAnalyzerBase.h.

References finalDone_.

std::string ElectronDqmAnalyzerBase::newName ( const std::string &  name)
private

Definition at line 46 of file ElectronDqmAnalyzerBase.cc.

References bookIndex_, bookPrefix_, and dataset::name.

Referenced by bookH1(), bookH1withSumw2(), bookH2(), bookH2withSumw2(), and bookP1().

47  {
48  if (bookPrefix_.empty())
49  { return name ; }
50  std::ostringstream oss ;
51  oss<<bookPrefix_ ;
52  if (bookIndex_>=0)
53  { oss<<bookIndex_++ ; }
54  oss<<"_"<<name ;
55  return oss.str() ;
56  }
void ElectronDqmAnalyzerBase::setBookEfficiencyFlag ( const bool &  eff_flag)
protected
void ElectronDqmAnalyzerBase::setBookIndex ( short  index)
protected
void ElectronDqmAnalyzerBase::setBookPrefix ( const std::string &  prefix)
protected
void ElectronDqmAnalyzerBase::setBookStatOverflowFlag ( const bool &  statOverflow_flag)
protected
int ElectronDqmAnalyzerBase::verbosity ( )
inlineprotected

Member Data Documentation

bool ElectronDqmAnalyzerBase::bookEfficiencyFlag_ = false
private

Definition at line 91 of file ElectronDqmAnalyzerBase.h.

Referenced by setBookEfficiencyFlag().

short ElectronDqmAnalyzerBase::bookIndex_
private

Definition at line 90 of file ElectronDqmAnalyzerBase.h.

Referenced by newName(), and setBookIndex().

std::string ElectronDqmAnalyzerBase::bookPrefix_
private

Definition at line 89 of file ElectronDqmAnalyzerBase.h.

Referenced by newName(), and setBookPrefix().

bool ElectronDqmAnalyzerBase::bookStatOverflowFlag_ = false
private
bool ElectronDqmAnalyzerBase::finalDone_
private

Definition at line 100 of file ElectronDqmAnalyzerBase.h.

Referenced by endLuminosityBlock(), endRun(), and finalStepDone().

std::string ElectronDqmAnalyzerBase::finalStep_
private

Definition at line 95 of file ElectronDqmAnalyzerBase.h.

Referenced by ElectronDqmAnalyzerBase(), endLuminosityBlock(), and endRun().

std::vector<std::string> ElectronDqmAnalyzerBase::histoNames_
private

Definition at line 94 of file ElectronDqmAnalyzerBase.h.

bool ElectronDqmAnalyzerBase::histoNamesReady
private

Definition at line 93 of file ElectronDqmAnalyzerBase.h.

std::string ElectronDqmAnalyzerBase::inputFile_
private

Definition at line 96 of file ElectronDqmAnalyzerBase.h.

Referenced by ElectronDqmAnalyzerBase().

std::string ElectronDqmAnalyzerBase::inputInternalPath_
private

Definition at line 98 of file ElectronDqmAnalyzerBase.h.

Referenced by ElectronDqmAnalyzerBase().

std::string ElectronDqmAnalyzerBase::outputFile_
private

Definition at line 97 of file ElectronDqmAnalyzerBase.h.

Referenced by ElectronDqmAnalyzerBase(), and endRun().

std::string ElectronDqmAnalyzerBase::outputInternalPath_
private
int ElectronDqmAnalyzerBase::verbosity_
private

Definition at line 88 of file ElectronDqmAnalyzerBase.h.

Referenced by ElectronDqmAnalyzerBase(), and verbosity().