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:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator > 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
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

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 Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 18 of file ElectronDqmAnalyzerBase.h.

Constructor & Destructor Documentation

◆ ElectronDqmAnalyzerBase()

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

Definition at line 18 of file ElectronDqmAnalyzerBase.cc.

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

19  : bookPrefix_("ele"), bookIndex_(0), histoNamesReady(false) {
20  verbosity_ = conf.getUntrackedParameter<int>("Verbosity");
21  finalStep_ = conf.getParameter<std::string>("FinalStep");
22  inputFile_ = conf.getParameter<std::string>("InputFile");
23  outputFile_ = conf.getParameter<std::string>("OutputFile");
24  inputInternalPath_ = conf.getParameter<std::string>("InputFolderName");
25  outputInternalPath_ = conf.getParameter<std::string>("OutputFolderName");
26 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
T getUntrackedParameter(std::string const &, T const &) const

◆ ~ElectronDqmAnalyzerBase()

ElectronDqmAnalyzerBase::~ElectronDqmAnalyzerBase ( )
overrideprotected

Definition at line 28 of file ElectronDqmAnalyzerBase.cc.

28 {}

Member Function Documentation

◆ analyze()

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

◆ bookH1()

ElectronDqmAnalyzerBase::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 57 of file ElectronDqmAnalyzerBase.cc.

References dqm::implementation::IBooker::book1D(), bookStatOverflowFlag_, hlt_dqm_clientPB-live_cfg::me, Skims_PA_cff::name, newName(), fileinputsource_cfi::option, outputInternalPath_, dqm::implementation::NavigatorBase::setCurrentFolder(), and runGCPTkAlMap::title.

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

65  {
67  MonitorElement *me = iBooker.book1D(newName(name), title, nchX, lowX, highX);
68  if (!titleX.empty()) {
69  me->setAxisTitle(titleX);
70  }
71  if (!titleY.empty()) {
72  me->setAxisTitle(titleY, 2);
73  }
74  if (TString(option) != "") {
75  me->setOption(option);
76  }
78  me->setStatOverflows(kTRUE);
79  }
80  return me;
81 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
std::string newName(const std::string &name)

◆ bookH1withSumw2()

ElectronDqmAnalyzerBase::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 83 of file ElectronDqmAnalyzerBase.cc.

References dqm::implementation::IBooker::book1D(), bookStatOverflowFlag_, hlt_dqm_clientPB-live_cfg::me, Skims_PA_cff::name, newName(), fileinputsource_cfi::option, outputInternalPath_, dqm::implementation::NavigatorBase::setCurrentFolder(), and runGCPTkAlMap::title.

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

91  {
93  MonitorElement *me = iBooker.book1D(newName(name), title, nchX, lowX, highX);
94  if (me->getTH1F()->GetSumw2N() == 0)
95  me->enableSumw2();
96  if (!titleX.empty()) {
97  me->setAxisTitle(titleX);
98  }
99  if (!titleY.empty()) {
100  me->setAxisTitle(titleY, 2);
101  }
102  if (TString(option) != "") {
103  me->setOption(option);
104  }
105  if (bookStatOverflowFlag_) {
106  me->setStatOverflows(kTRUE);
107  }
108  return me;
109 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
std::string newName(const std::string &name)

◆ bookH2()

ElectronDqmAnalyzerBase::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 111 of file ElectronDqmAnalyzerBase.cc.

References dqm::implementation::IBooker::book2D(), bookStatOverflowFlag_, hlt_dqm_clientPB-live_cfg::me, Skims_PA_cff::name, newName(), fileinputsource_cfi::option, outputInternalPath_, dqm::implementation::NavigatorBase::setCurrentFolder(), and runGCPTkAlMap::title.

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

122  {
124  MonitorElement *me = iBooker.book2D(newName(name), title, nchX, lowX, highX, nchY, lowY, highY);
125  if (!titleX.empty()) {
126  me->setAxisTitle(titleX);
127  }
128  if (!titleY.empty()) {
129  me->setAxisTitle(titleY, 2);
130  }
131  if (TString(option) != "") {
132  me->setOption(option);
133  }
134  if (bookStatOverflowFlag_) {
135  me->setStatOverflows(kTRUE);
136  }
137  return me;
138 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
std::string newName(const std::string &name)

◆ bookH2withSumw2()

ElectronDqmAnalyzerBase::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 140 of file ElectronDqmAnalyzerBase.cc.

References dqm::implementation::IBooker::book2D(), bookStatOverflowFlag_, hlt_dqm_clientPB-live_cfg::me, Skims_PA_cff::name, newName(), fileinputsource_cfi::option, outputInternalPath_, dqm::implementation::NavigatorBase::setCurrentFolder(), and runGCPTkAlMap::title.

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

151  {
153  MonitorElement *me = iBooker.book2D(newName(name), title, nchX, lowX, highX, nchY, lowY, highY);
154  if (me->getTH2F()->GetSumw2N() == 0)
155  me->enableSumw2();
156  if (!titleX.empty()) {
157  me->setAxisTitle(titleX);
158  }
159  if (!titleY.empty()) {
160  me->setAxisTitle(titleY, 2);
161  }
162  if (TString(option) != "") {
163  me->setOption(option);
164  }
165  if (bookStatOverflowFlag_) {
166  me->setStatOverflows(kTRUE);
167  }
168  return me;
169 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
std::string newName(const std::string &name)

◆ bookHistograms()

void ElectronDqmAnalyzerBase::bookHistograms ( DQMStore::IBooker ibooker_,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Reimplemented in ElectronAnalyzer, ElectronMcFakeValidator, ElectronMcSignalValidator, ElectronTagProbeAnalyzer, ElectronGeneralAnalyzer, and ElectronMcSignalValidatorMiniAOD.

Definition at line 53 of file ElectronDqmAnalyzerBase.cc.

53  {
54  edm::LogInfo("DQMAnalyzeBase::bookHistograms") << std::endl;
55 }
Log< level::Info, false > LogInfo

◆ bookP1()

ElectronDqmAnalyzerBase::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 171 of file ElectronDqmAnalyzerBase.cc.

References dqm::implementation::IBooker::bookProfile(), bookStatOverflowFlag_, hlt_dqm_clientPB-live_cfg::me, Skims_PA_cff::name, newName(), fileinputsource_cfi::option, outputInternalPath_, dqm::implementation::NavigatorBase::setCurrentFolder(), and runGCPTkAlMap::title.

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

181  {
183  MonitorElement *me = iBooker.bookProfile(newName(name), title, nchX, lowX, highX, lowY, highY, " ");
184  if (!titleX.empty()) {
185  me->getTProfile()->GetXaxis()->SetTitle(titleX.c_str());
186  }
187  if (!titleY.empty()) {
188  me->setAxisTitle(titleY, 2);
189  }
190  if (TString(option) != "") {
191  me->getTProfile()->SetOption(option);
192  }
193  if (bookStatOverflowFlag_) {
194  me->setStatOverflows(kTRUE);
195  }
196  return me;
197 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:399
std::string newName(const std::string &name)

◆ cloneH1() [1/2]

MonitorElement* ElectronDqmAnalyzerBase::cloneH1 ( DQMStore::IBooker iBooker,
const std::string &  name,
MonitorElement original,
const std::string &  title = "" 
)
protected

◆ cloneH1() [2/2]

MonitorElement* ElectronDqmAnalyzerBase::cloneH1 ( DQMStore::IBooker iBooker,
const std::string &  name,
const std::string &  original,
const std::string &  title = "" 
)
protected

◆ newName()

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

Definition at line 40 of file ElectronDqmAnalyzerBase.cc.

References bookIndex_, bookPrefix_, and Skims_PA_cff::name.

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

40  {
41  if (bookPrefix_.empty()) {
42  return name;
43  }
44  std::ostringstream oss;
45  oss << bookPrefix_;
46  if (bookIndex_ >= 0) {
47  oss << bookIndex_++;
48  }
49  oss << "_" << name;
50  return oss.str();
51 }

◆ setBookEfficiencyFlag()

void ElectronDqmAnalyzerBase::setBookEfficiencyFlag ( const bool &  eff_flag)
protected

◆ setBookIndex()

void ElectronDqmAnalyzerBase::setBookIndex ( short  index)
protected

◆ setBookPrefix()

void ElectronDqmAnalyzerBase::setBookPrefix ( const std::string &  prefix)
protected

◆ setBookStatOverflowFlag()

void ElectronDqmAnalyzerBase::setBookStatOverflowFlag ( const bool &  statOverflow_flag)
protected

◆ verbosity()

int ElectronDqmAnalyzerBase::verbosity ( )
inlineprotected

Definition at line 30 of file ElectronDqmAnalyzerBase.h.

References verbosity_.

Member Data Documentation

◆ bookEfficiencyFlag_

bool ElectronDqmAnalyzerBase::bookEfficiencyFlag_ = false
private

Definition at line 109 of file ElectronDqmAnalyzerBase.h.

Referenced by setBookEfficiencyFlag().

◆ bookIndex_

short ElectronDqmAnalyzerBase::bookIndex_
private

Definition at line 108 of file ElectronDqmAnalyzerBase.h.

Referenced by newName(), and setBookIndex().

◆ bookPrefix_

std::string ElectronDqmAnalyzerBase::bookPrefix_
private

Definition at line 107 of file ElectronDqmAnalyzerBase.h.

Referenced by newName(), and setBookPrefix().

◆ bookStatOverflowFlag_

bool ElectronDqmAnalyzerBase::bookStatOverflowFlag_ = false
private

◆ finalStep_

std::string ElectronDqmAnalyzerBase::finalStep_
private

Definition at line 113 of file ElectronDqmAnalyzerBase.h.

Referenced by ElectronDqmAnalyzerBase().

◆ histoNames_

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

Definition at line 112 of file ElectronDqmAnalyzerBase.h.

◆ histoNamesReady

bool ElectronDqmAnalyzerBase::histoNamesReady
private

Definition at line 111 of file ElectronDqmAnalyzerBase.h.

◆ inputFile_

std::string ElectronDqmAnalyzerBase::inputFile_
private

Definition at line 114 of file ElectronDqmAnalyzerBase.h.

Referenced by ElectronDqmAnalyzerBase().

◆ inputInternalPath_

std::string ElectronDqmAnalyzerBase::inputInternalPath_
private

Definition at line 116 of file ElectronDqmAnalyzerBase.h.

Referenced by ElectronDqmAnalyzerBase().

◆ outputFile_

std::string ElectronDqmAnalyzerBase::outputFile_
private

Definition at line 115 of file ElectronDqmAnalyzerBase.h.

Referenced by ElectronDqmAnalyzerBase().

◆ outputInternalPath_

std::string ElectronDqmAnalyzerBase::outputInternalPath_
private

◆ verbosity_

int ElectronDqmAnalyzerBase::verbosity_
private

Definition at line 106 of file ElectronDqmAnalyzerBase.h.

Referenced by ElectronDqmAnalyzerBase(), and verbosity().