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="")
 
 ElectronDqmAnalyzerBase (const edm::ParameterSet &conf)
 
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
 
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 22 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)
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 66 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(), bookHistograms(), ElectronTagProbeAnalyzer::bookHistograms(), ElectronMcFakeValidator::bookHistograms(), and ElectronAnalyzer::bookHistograms().

70  {
72  MonitorElement * me = iBooker.book1D(newName(name),title,nchX,lowX,highX) ;
73  if (!titleX.empty()) { me->getTH1F()->GetXaxis()->SetTitle(titleX.c_str()) ; }
74  if (!titleY.empty()) { me->getTH1F()->GetYaxis()->SetTitle(titleY.c_str()) ; }
75  if (TString(option)!="") { me->getTH1F()->SetOption(option) ; }
76  if (bookStatOverflowFlag_) {me->getTH1()->StatOverflows(kTRUE) ; }
77  return me ;
78  }
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 81 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(), and ElectronAnalyzer::bookHistograms().

85  {
87  MonitorElement * me = iBooker.book1D(newName(name),title,nchX,lowX,highX) ;
88  if (me->getTH1F()->GetSumw2N() == 0) me->getTH1F()->Sumw2() ;
89  if (!titleX.empty()) { me->getTH1F()->GetXaxis()->SetTitle(titleX.c_str()) ; }
90  if (!titleY.empty()) { me->getTH1F()->GetYaxis()->SetTitle(titleY.c_str()) ; }
91  if (TString(option)!="") { me->getTH1F()->SetOption(option) ; }
92  if (bookStatOverflowFlag_) {me->getTH1()->StatOverflows(kTRUE) ; }
93  return me ;
94  }
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 97 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(), and ElectronAnalyzer::bookHistograms().

102  {
104  MonitorElement * me = iBooker.book2D(newName(name),title,nchX,lowX,highX,nchY,lowY,highY) ;
105  if (!titleX.empty()) { me->getTH2F()->GetXaxis()->SetTitle(titleX.c_str()) ; }
106  if (!titleY.empty()) { me->getTH2F()->GetYaxis()->SetTitle(titleY.c_str()) ; }
107  if (TString(option)!="") { me->getTH2F()->SetOption(option) ; }
108  if (bookStatOverflowFlag_) {me->getTH1()->StatOverflows(kTRUE) ; }
109  return me ;
110  }
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 113 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(), and ElectronMcSignalValidator::bookHistograms().

118  {
120  MonitorElement * me = iBooker.book2D(newName(name),title,nchX,lowX,highX,nchY,lowY,highY) ;
121  if (me->getTH2F()->GetSumw2N() == 0) me->getTH2F()->Sumw2() ;
122  if (!titleX.empty()) { me->getTH2F()->GetXaxis()->SetTitle(titleX.c_str()) ; }
123  if (!titleY.empty()) { me->getTH2F()->GetYaxis()->SetTitle(titleY.c_str()) ; }
124  if (TString(option)!="") { me->getTH2F()->SetOption(option) ; }
125  if (bookStatOverflowFlag_) {me->getTH1()->StatOverflows(kTRUE) ; }
126  return me ;
127  }
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 59 of file ElectronDqmAnalyzerBase.cc.

References bookH1().

60 {
61  edm::LogInfo("DQMAnalyzeBase::bookHistograms") << std::endl;
62 
63 }
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 130 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(), and ElectronAnalyzer::bookHistograms().

135  {
137  MonitorElement * me = iBooker.bookProfile(newName(name),title,nchX,lowX,highX,lowY,highY," ") ;
138  if (!titleX.empty()) { me->getTProfile()->GetXaxis()->SetTitle(titleX.c_str()) ; }
139  if (!titleY.empty()) { me->getTProfile()->GetYaxis()->SetTitle(titleY.c_str()) ; }
140  if (TString(option)!="") { me->getTProfile()->SetOption(option) ; }
141  if (bookStatOverflowFlag_) {me->getTH1()->StatOverflows(kTRUE) ; }
142  return me ;
143  }
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
MonitorElement* ElectronDqmAnalyzerBase::cloneH1 ( DQMStore::IBooker iBooker,
const std::string &  name,
const std::string &  original,
const std::string &  title = "" 
)
protected
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 90 of file ElectronDqmAnalyzerBase.h.

Referenced by setBookEfficiencyFlag().

short ElectronDqmAnalyzerBase::bookIndex_
private

Definition at line 89 of file ElectronDqmAnalyzerBase.h.

Referenced by newName(), and setBookIndex().

std::string ElectronDqmAnalyzerBase::bookPrefix_
private

Definition at line 88 of file ElectronDqmAnalyzerBase.h.

Referenced by newName(), and setBookPrefix().

bool ElectronDqmAnalyzerBase::bookStatOverflowFlag_ = false
private
std::string ElectronDqmAnalyzerBase::finalStep_
private

Definition at line 94 of file ElectronDqmAnalyzerBase.h.

Referenced by ElectronDqmAnalyzerBase().

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

Definition at line 93 of file ElectronDqmAnalyzerBase.h.

bool ElectronDqmAnalyzerBase::histoNamesReady
private

Definition at line 92 of file ElectronDqmAnalyzerBase.h.

std::string ElectronDqmAnalyzerBase::inputFile_
private

Definition at line 95 of file ElectronDqmAnalyzerBase.h.

Referenced by ElectronDqmAnalyzerBase().

std::string ElectronDqmAnalyzerBase::inputInternalPath_
private

Definition at line 97 of file ElectronDqmAnalyzerBase.h.

Referenced by ElectronDqmAnalyzerBase().

std::string ElectronDqmAnalyzerBase::outputFile_
private

Definition at line 96 of file ElectronDqmAnalyzerBase.h.

Referenced by ElectronDqmAnalyzerBase().

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

Definition at line 87 of file ElectronDqmAnalyzerBase.h.

Referenced by ElectronDqmAnalyzerBase().