CMS 3D CMS Logo

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

#include <ElectronDqmHarvesterBase.h>

Inheritance diagram for ElectronDqmHarvesterBase:
DQMEDHarvester edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper ElectronMcFakePostValidator ElectronMcSignalPostValidator ElectronMcSignalPostValidatorMiniAOD ElectronOfflineClient

Protected Member Functions

void beginJob () 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")
 
MonitorElementbookH1andDivide (DQMStore::IBooker &iBooker, DQMStore::IGetter &, const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
 
MonitorElementbookH1andDivide (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, const std::string &name, const std::string &num, const std::string &denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
 
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")
 
MonitorElementbookH2andDivide (DQMStore::IBooker &iBooker, DQMStore::IGetter &, const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
 
MonitorElementbookH2andDivide (DQMStore::IBooker &iBooker, DQMStore::IGetter &, const std::string &name, const std::string &num, const std::string &denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
 
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")
 
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, DQMStore::IGetter &, const std::string &name, MonitorElement *original, const std::string &title="")
 
MonitorElementcloneH1 (DQMStore::IBooker &iBooker, DQMStore::IGetter &, const std::string &name, const std::string &original, const std::string &title="")
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 
 ElectronDqmHarvesterBase (const edm::ParameterSet &conf)
 
virtual void finalize (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter)
 
bool finalStepDone ()
 
MonitorElementget (DQMStore::IGetter &iGetter, const std::string &name)
 
MonitorElementprofileX (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
 
MonitorElementprofileX (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, const std::string &me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
 
MonitorElementprofileY (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
 
MonitorElementprofileY (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, const std::string &me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
 
void remove (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, const std::string &name)
 
void setBookEfficiencyFlag (const bool &)
 
void setBookIndex (short)
 
void setBookPrefix (const std::string &)
 
void setBookStatOverflowFlag (const bool &)
 
int verbosity ()
 
 ~ElectronDqmHarvesterBase () override
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Member Functions

const std::string * find (DQMStore::IGetter &iGetter, const std::string &name)
 
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 Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 19 of file ElectronDqmHarvesterBase.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file ElectronDqmHarvesterBase.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  }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
ElectronDqmHarvesterBase::~ElectronDqmHarvesterBase ( )
overrideprotected

Definition at line 30 of file ElectronDqmHarvesterBase.cc.

31  {
32  }

Member Function Documentation

void ElectronDqmHarvesterBase::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 103 of file ElectronDqmHarvesterBase.cc.

104  {
105  }
MonitorElement * ElectronDqmHarvesterBase::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 192 of file ElectronDqmHarvesterBase.cc.

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

Referenced by profileY(), and verbosity().

196  {
198  MonitorElement * me = iBooker.book1D(newName(name),title,nchX,lowX,highX) ;
199  if (titleX!="") { me->getTH1F()->GetXaxis()->SetTitle(titleX.c_str()) ; }
200  if (titleY!="") { me->getTH1F()->GetYaxis()->SetTitle(titleY.c_str()) ; }
201  if (TString(option)!="") { me->getTH1F()->SetOption(option) ; }
202  if (bookStatOverflowFlag_) {me->getTH1F()->StatOverflows(kTRUE) ; }
203  return me ;
204  }
TH1F * getTH1F() 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 * ElectronDqmHarvesterBase::bookH1andDivide ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
const std::string &  name,
MonitorElement num,
MonitorElement denom,
const std::string &  titleX,
const std::string &  titleY,
const std::string &  title = "" 
)
protected

Definition at line 272 of file ElectronDqmHarvesterBase.cc.

References DQMStore::IBooker::book1D(), bookEfficiencyFlag_, bookH2andDivide(), MonitorElement::getTH1(), MonitorElement::getTH1F(), newName(), nullptr, outputInternalPath_, DQMStore::IBooker::setCurrentFolder(), MonitorElement::setEfficiencyFlag(), AlCaHLTBitMon_QueryRunRegistry::string, and verbosity_.

Referenced by bookH1andDivide(), bookP1(), ElectronMcSignalPostValidator::finalize(), ElectronOfflineClient::finalize(), ElectronMcFakePostValidator::finalize(), remove(), and verbosity().

276  {
277  if ((!num)||(!denom)) return nullptr ;
279  std::string name2 = newName(name) ;
280  TH1F * h_temp = (TH1F *)num->getTH1F()->Clone(name2.c_str()) ;
281  h_temp->Reset() ;
282  h_temp->Divide(num->getTH1(),denom->getTH1(),1,1,"b") ;
283  h_temp->GetXaxis()->SetTitle(titleX.c_str()) ;
284  h_temp->GetYaxis()->SetTitle(titleY.c_str()) ;
285  if (title!="") { h_temp->SetTitle(title.c_str()) ; }
286  if (verbosity_>0) { h_temp->Print() ; }
287  MonitorElement * me = iBooker.book1D(name2,h_temp) ;
288  if (bookEfficiencyFlag_) { me->setEfficiencyFlag(); }
289  delete h_temp ;
290  return me ;
291  }
TH1F * getTH1F() const
#define nullptr
TH1 * getTH1() const
void setEfficiencyFlag()
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 * ElectronDqmHarvesterBase::bookH1andDivide ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
const std::string &  name,
const std::string &  num,
const std::string &  denom,
const std::string &  titleX,
const std::string &  titleY,
const std::string &  title = "" 
)
protected

Definition at line 156 of file ElectronDqmHarvesterBase.cc.

References bookH1andDivide(), and bookH2andDivide().

160  {
161  return bookH1andDivide(iBooker, iGetter, name,get(iGetter, num),get(iGetter, denom),titleX,titleY,title) ;
162  }
MonitorElement * bookH1andDivide(DQMStore::IBooker &iBooker, DQMStore::IGetter &, const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
MonitorElement * ElectronDqmHarvesterBase::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 207 of file ElectronDqmHarvesterBase.cc.

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

Referenced by bookH1(), ElectronMcSignalPostValidator::finalize(), ElectronMcFakePostValidator::finalize(), and verbosity().

211  {
213  MonitorElement * me = iBooker.book1D(newName(name),title,nchX,lowX,highX) ;
214  me->getTH1F()->Sumw2() ;
215  if (titleX!="") { me->getTH1F()->GetXaxis()->SetTitle(titleX.c_str()) ; }
216  if (titleY!="") { me->getTH1F()->GetYaxis()->SetTitle(titleY.c_str()) ; }
217  if (TString(option)!="") { me->getTH1F()->SetOption(option) ; }
218  if (bookStatOverflowFlag_) {me->getTH1F()->StatOverflows(kTRUE) ; }
219  return me ;
220  }
TH1F * getTH1F() 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 * ElectronDqmHarvesterBase::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 223 of file ElectronDqmHarvesterBase.cc.

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

Referenced by bookH1withSumw2(), and verbosity().

228  {
230  MonitorElement * me = iBooker.book2D(newName(name),title,nchX,lowX,highX,nchY,lowY,highY) ;
231  if (titleX!="") { me->getTH2F()->GetXaxis()->SetTitle(titleX.c_str()) ; }
232  if (titleY!="") { me->getTH2F()->GetYaxis()->SetTitle(titleY.c_str()) ; }
233  if (TString(option)!="") { me->getTH2F()->SetOption(option) ; }
234  if (bookStatOverflowFlag_) {me->getTH1F()->StatOverflows(kTRUE) ; }
235  return me ;
236  }
TH1F * getTH1F() 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 * ElectronDqmHarvesterBase::bookH2andDivide ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
const std::string &  name,
MonitorElement num,
MonitorElement denom,
const std::string &  titleX,
const std::string &  titleY,
const std::string &  title = "" 
)
protected

Definition at line 294 of file ElectronDqmHarvesterBase.cc.

References DQMStore::IBooker::book2D(), bookEfficiencyFlag_, cloneH1(), MonitorElement::getTH1(), MonitorElement::getTH2F(), newName(), nullptr, outputInternalPath_, DQMStore::IBooker::setCurrentFolder(), MonitorElement::setEfficiencyFlag(), AlCaHLTBitMon_QueryRunRegistry::string, and verbosity_.

Referenced by bookH1andDivide(), bookH2andDivide(), ElectronMcSignalPostValidator::finalize(), and verbosity().

298  {
299  if ((!num)||(!denom)) return nullptr ;
301  std::string name2 = newName(name) ;
302  TH2F * h_temp = (TH2F *)num->getTH2F()->Clone(name2.c_str()) ;
303  h_temp->Reset() ;
304  h_temp->Divide(num->getTH1(),denom->getTH1(),1,1,"b") ;
305  h_temp->GetXaxis()->SetTitle(titleX.c_str()) ;
306  h_temp->GetYaxis()->SetTitle(titleY.c_str()) ;
307  if (title!="") { h_temp->SetTitle(title.c_str()) ; }
308  if (verbosity_>0) { h_temp->Print() ; }
309  MonitorElement * me = iBooker.book2D(name2,h_temp) ;
310  if (bookEfficiencyFlag_) { me->setEfficiencyFlag(); }
311  delete h_temp ;
312  return me ;
313  }
#define nullptr
TH1 * getTH1() const
void setEfficiencyFlag()
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 * ElectronDqmHarvesterBase::bookH2andDivide ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
const std::string &  name,
const std::string &  num,
const std::string &  denom,
const std::string &  titleX,
const std::string &  titleY,
const std::string &  title = "" 
)
protected

Definition at line 165 of file ElectronDqmHarvesterBase.cc.

References bookH2andDivide(), and cloneH1().

169  { return bookH2andDivide(iBooker, iGetter, name,get(iGetter, num),get(iGetter, denom),titleX,titleY,title) ; }
MonitorElement * bookH2andDivide(DQMStore::IBooker &iBooker, DQMStore::IGetter &, const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
MonitorElement * ElectronDqmHarvesterBase::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 239 of file ElectronDqmHarvesterBase.cc.

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

Referenced by bookH2(), and verbosity().

244  {
246  MonitorElement * me = iBooker.book2D(newName(name),title,nchX,lowX,highX,nchY,lowY,highY) ;
247  me->getTH2F()->Sumw2() ;
248  if (titleX!="") { me->getTH2F()->GetXaxis()->SetTitle(titleX.c_str()) ; }
249  if (titleY!="") { me->getTH2F()->GetYaxis()->SetTitle(titleY.c_str()) ; }
250  if (TString(option)!="") { me->getTH2F()->SetOption(option) ; }
251  if (bookStatOverflowFlag_) {me->getTH1F()->StatOverflows(kTRUE) ; }
252  return me ;
253  }
TH1F * getTH1F() 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 * ElectronDqmHarvesterBase::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 256 of file ElectronDqmHarvesterBase.cc.

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

Referenced by bookH2withSumw2(), and verbosity().

261  {
263  MonitorElement * me = iBooker.bookProfile(newName(name),title,nchX,lowX,highX,lowY,highY," ") ;
264  if (titleX!="") { me->getTProfile()->GetXaxis()->SetTitle(titleX.c_str()) ; }
265  if (titleY!="") { me->getTProfile()->GetYaxis()->SetTitle(titleY.c_str()) ; }
266  if (TString(option)!="") { me->getTProfile()->SetOption(option) ; }
267  if (bookStatOverflowFlag_) {me->getTH1F()->StatOverflows(kTRUE) ; }
268  return me ;
269  }
TProfile * getTProfile() const
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:113
TH1F * getTH1F() const
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
std::string newName(const std::string &name)
MonitorElement * ElectronDqmHarvesterBase::cloneH1 ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
const std::string &  name,
MonitorElement original,
const std::string &  title = "" 
)
protected

Definition at line 316 of file ElectronDqmHarvesterBase.cc.

References DQMStore::IBooker::book1D(), MonitorElement::getTH1F(), newName(), nullptr, outputInternalPath_, profileX(), DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by bookH2andDivide(), cloneH1(), and verbosity().

319  {
320  if (!original) return nullptr ;
322  std::string name2 = newName(name) ;
323  TH1F * h_temp = (TH1F *)original->getTH1F()->Clone(name2.c_str()) ;
324  h_temp->Reset() ;
325  if (title!="") { h_temp->SetTitle(title.c_str()) ; }
326  MonitorElement * me = iBooker.book1D(name2,h_temp) ;
327  delete h_temp ;
328  return me ;
329  }
TH1F * getTH1F() const
#define nullptr
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 * ElectronDqmHarvesterBase::cloneH1 ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
const std::string &  name,
const std::string &  original,
const std::string &  title = "" 
)
protected

Definition at line 172 of file ElectronDqmHarvesterBase.cc.

References cloneH1(), and profileX().

175  { return cloneH1(iBooker, iGetter, clone,get(iGetter, original),title) ; }
MonitorElement * cloneH1(DQMStore::IBooker &iBooker, DQMStore::IGetter &, const std::string &name, MonitorElement *original, const std::string &title="")
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
void ElectronDqmHarvesterBase::dqmEndJob ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 121 of file ElectronDqmHarvesterBase.cc.

References finalDone_, finalize(), finalStep_, outputInternalPath_, DQMStore::IBooker::setCurrentFolder(), and funct::true.

122  {
123 
124  if (finalStep_=="AtJobEnd")
125  {
126  if (finalDone_)
127  { edm::LogWarning("ElectronDqmHarvesterBase::dqmEndJob")<<"finalize() already called" ; }
129  finalDone_ = true ;
130  }
132  finalize( iBooker, iGetter ) ;
133 
134  }
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
virtual void finalize(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter)
void ElectronDqmHarvesterBase::dqmEndLuminosityBlock ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 107 of file ElectronDqmHarvesterBase.cc.

References finalDone_, finalStep_, outputInternalPath_, DQMStore::IBooker::setCurrentFolder(), and funct::true.

108  {
109  if (finalStep_=="AtLumiEnd")
110  {
111  if (finalDone_)
112  {
113  edm::LogWarning("ElectronDqmHarvesterBase::endLuminosityBlock")<<"finalize() already called" ;
114  }
116  finalDone_ = true ;
117  }
118 
119  }
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
virtual void ElectronDqmHarvesterBase::finalize ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter 
)
inlineprotectedvirtual

Reimplemented in ElectronOfflineClient, ElectronMcFakePostValidator, ElectronMcSignalPostValidator, and ElectronMcSignalPostValidatorMiniAOD.

Definition at line 33 of file ElectronDqmHarvesterBase.h.

Referenced by dqmEndJob().

33 {} ; // override ;, const edm::Event& e, const edm::EventSetup & c
bool ElectronDqmHarvesterBase::finalStepDone ( )
inlineprotected

Definition at line 36 of file ElectronDqmHarvesterBase.h.

References finalDone_.

const std::string * ElectronDqmHarvesterBase::find ( DQMStore::IGetter iGetter,
const std::string &  name 
)
private

Definition at line 58 of file ElectronDqmHarvesterBase.cc.

References DQMStore::IGetter::getMEs(), histoNames_, histoNamesReady, nullptr, outputInternalPath_, and funct::true.

Referenced by get(), and remove().

59  {
60  typedef std::vector<std::string> HistoNames ;
61  typedef HistoNames::iterator HistoNamesItr ;
62  if (!histoNamesReady)
63  { histoNamesReady = true ; histoNames_ = iGetter.getMEs() ; }
64  HistoNamesItr histoName ;
65  std::vector<HistoNamesItr> res ;
66 
67  for ( histoName = histoNames_.begin() ; histoName != histoNames_.end() ; ++histoName )
68  {
69  std::size_t nsize = name.size(), lsize = histoName->size() ;
70  if ( (lsize>=nsize) &&
71  (histoName->find(name)==(lsize-nsize)) )
72  { res.push_back(histoName) ; }
73  }
74  if (res.empty())
75  {
76  std::ostringstream oss ;
77  oss<<"Histogram "<<name<<" not found in "<<outputInternalPath_ ;
78  char sep = ':' ;
79  for ( histoName = histoNames_.begin() ; histoName != histoNames_.end() ; ++histoName )
80  { oss<<sep<<' '<<*histoName ; sep = ',' ; }
81  oss<<'.' ;
82  edm::LogWarning("ElectronDqmHarvesterBase::find")<<oss.str() ;
83  return nullptr ;
84  }
85  else if (res.size()>1)
86  {
87  std::ostringstream oss ;
88  oss<<"Ambiguous histograms for "<<name<<" in "<<outputInternalPath_ ;
89  char sep = ':' ;
90  std::vector<HistoNamesItr>::iterator resItr ;
91  for ( resItr = res.begin() ; resItr != res.end() ; ++resItr )
92  { oss<<sep<<' '<<(**resItr) ; sep = ',' ; }
93  oss<<'.' ;
94  edm::LogWarning("ElectronDqmHarvesterBase::find")<<oss.str() ;
95  return nullptr ;
96  }
97  else
98  {
99  return &*res[0] ;
100  }
101  }
#define nullptr
Definition: Electron.h:6
std::vector< std::string > histoNames_
std::vector< std::string > getMEs()
Definition: DQMStore.cc:331
MonitorElement * ElectronDqmHarvesterBase::get ( DQMStore::IGetter iGetter,
const std::string &  name 
)
protected

Definition at line 136 of file ElectronDqmHarvesterBase.cc.

References find(), DQMStore::IGetter::get(), inputInternalPath_, nullptr, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), util.rrapi.RRApi::count(), rrapi.RRApi::count(), rrapi.RRApi::data(), util.rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), rrapi.RRApi::report(), util.rrapi.RRApi::report(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), util.rrapi.RRApi::tables(), rrapi.RRApi::tables(), rrapi.RRApi::tags(), util.rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), util.rrapi.RRApi::workspaces(), and rrapi.RRApi::workspaces().

137  {
138  const std::string * fullName = find(iGetter, name) ;
139  if (fullName)
140  { return iGetter.get(inputInternalPath_+"/"+*fullName) ; }
141  else
142  { return nullptr ; }
143  }
const std::string * find(DQMStore::IGetter &iGetter, const std::string &name)
#define nullptr
MonitorElement * get(std::string const &path)
Definition: DQMStore.cc:303
std::string ElectronDqmHarvesterBase::newName ( const std::string &  name)
private

Definition at line 46 of file ElectronDqmHarvesterBase.cc.

References bookIndex_, bookPrefix_, and dataset::name.

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

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  }
MonitorElement * ElectronDqmHarvesterBase::profileX ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
MonitorElement me2d,
const std::string &  title = "",
const std::string &  titleX = "",
const std::string &  titleY = "",
Double_t  minimum = -1111,
Double_t  maximum = -1111 
)
protected

Definition at line 332 of file ElectronDqmHarvesterBase.cc.

References DQMStore::IBooker::bookProfile(), MonitorElement::getName(), MonitorElement::getTH2F(), outputInternalPath_, profileY(), DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by cloneH1(), ElectronMcSignalPostValidatorMiniAOD::finalize(), ElectronMcFakePostValidator::finalize(), ElectronMcSignalPostValidator::finalize(), profileX(), and verbosity().

335  {
337  std::string name2 = me2d->getName()+"_pfx" ;
338  TProfile * p1_temp = me2d->getTH2F()->ProfileX() ;
339  if (title!="") { p1_temp->SetTitle(title.c_str()) ; }
340  if (titleX!="") { p1_temp->GetXaxis()->SetTitle(titleX.c_str()) ; }
341  if (titleY!="") { p1_temp->GetYaxis()->SetTitle(titleY.c_str()) ; }
342  if (minimum!=-1111) { p1_temp->SetMinimum(minimum) ; }
343  if (maximum!=-1111) { p1_temp->SetMaximum(maximum) ; }
344  MonitorElement * me = iBooker.bookProfile(name2,p1_temp) ;
345  delete p1_temp ;
346  return me ;
347  }
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:113
const std::string & getName() const
get name of ME
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
TH2F * getTH2F() const
MonitorElement * ElectronDqmHarvesterBase::profileX ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
const std::string &  me2d,
const std::string &  title = "",
const std::string &  titleX = "",
const std::string &  titleY = "",
Double_t  minimum = -1111,
Double_t  maximum = -1111 
)
protected

Definition at line 178 of file ElectronDqmHarvesterBase.cc.

References profileX(), and profileY().

182  { return profileX(iBooker, iGetter, get(iGetter, me2d),title,titleX,titleY,minimum,maximum) ; }
MonitorElement * profileX(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
MonitorElement * ElectronDqmHarvesterBase::profileY ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
MonitorElement me2d,
const std::string &  title = "",
const std::string &  titleX = "",
const std::string &  titleY = "",
Double_t  minimum = -1111,
Double_t  maximum = -1111 
)
protected

Definition at line 350 of file ElectronDqmHarvesterBase.cc.

References DQMStore::IBooker::bookProfile(), MonitorElement::getName(), MonitorElement::getTH2F(), outputInternalPath_, DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ElectronMcSignalPostValidator::finalize(), profileX(), profileY(), and verbosity().

353  {
355  std::string name2 = me2d->getName()+"_pfy" ;
356  TProfile * p1_temp = me2d->getTH2F()->ProfileY() ;
357  if (title!="") { p1_temp->SetTitle(title.c_str()) ; }
358  if (titleX!="") { p1_temp->GetXaxis()->SetTitle(titleX.c_str()) ; }
359  if (titleY!="") { p1_temp->GetYaxis()->SetTitle(titleY.c_str()) ; }
360  if (minimum!=-1111) { p1_temp->SetMinimum(minimum) ; }
361  if (maximum!=-1111) { p1_temp->SetMaximum(maximum) ; }
362  MonitorElement * me = iBooker.bookProfile(name2,p1_temp) ;
363  delete p1_temp ;
364  return me ;
365  }
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:113
const std::string & getName() const
get name of ME
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
TH2F * getTH2F() const
MonitorElement * ElectronDqmHarvesterBase::profileY ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
const std::string &  me2d,
const std::string &  title = "",
const std::string &  titleX = "",
const std::string &  titleY = "",
Double_t  minimum = -1111,
Double_t  maximum = -1111 
)
protected

Definition at line 185 of file ElectronDqmHarvesterBase.cc.

References bookH1(), and profileY().

189  { return profileY(iBooker, iGetter, get(iGetter, me2d),title,titleX,titleY,minimum,maximum) ; }
MonitorElement * profileY(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
void ElectronDqmHarvesterBase::remove ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
const std::string &  name 
)
protected

Definition at line 145 of file ElectronDqmHarvesterBase.cc.

References bookH1andDivide(), find(), inputInternalPath_, DQMStore::IGetter::removeElement(), DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

146  {
147  const std::string * fullName = find(iGetter, name) ;
148  if (fullName)
149  {
151  iGetter.removeElement(*fullName) ;
152  }
153  }
const std::string * find(DQMStore::IGetter &iGetter, const std::string &name)
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
void removeElement(Args &&...args)
Definition: DQMStore.h:199
void ElectronDqmHarvesterBase::setBookEfficiencyFlag ( const bool &  eff_flag)
protected
void ElectronDqmHarvesterBase::setBookIndex ( short  index)
protected
void ElectronDqmHarvesterBase::setBookPrefix ( const std::string &  prefix)
protected
void ElectronDqmHarvesterBase::setBookStatOverflowFlag ( const bool &  statOverflow_flag)
protected
int ElectronDqmHarvesterBase::verbosity ( )
inlineprotected

Member Data Documentation

bool ElectronDqmHarvesterBase::bookEfficiencyFlag_ = false
private
short ElectronDqmHarvesterBase::bookIndex_
private

Definition at line 137 of file ElectronDqmHarvesterBase.h.

Referenced by newName(), and setBookIndex().

std::string ElectronDqmHarvesterBase::bookPrefix_
private

Definition at line 136 of file ElectronDqmHarvesterBase.h.

Referenced by newName(), and setBookPrefix().

bool ElectronDqmHarvesterBase::bookStatOverflowFlag_ = false
private
bool ElectronDqmHarvesterBase::finalDone_
private

Definition at line 147 of file ElectronDqmHarvesterBase.h.

Referenced by dqmEndJob(), dqmEndLuminosityBlock(), and finalStepDone().

std::string ElectronDqmHarvesterBase::finalStep_
private
std::vector<std::string> ElectronDqmHarvesterBase::histoNames_
private

Definition at line 141 of file ElectronDqmHarvesterBase.h.

Referenced by find().

bool ElectronDqmHarvesterBase::histoNamesReady
private

Definition at line 140 of file ElectronDqmHarvesterBase.h.

Referenced by find().

std::string ElectronDqmHarvesterBase::inputFile_
private

Definition at line 143 of file ElectronDqmHarvesterBase.h.

Referenced by ElectronDqmHarvesterBase().

std::string ElectronDqmHarvesterBase::inputInternalPath_
private

Definition at line 145 of file ElectronDqmHarvesterBase.h.

Referenced by ElectronDqmHarvesterBase(), get(), and remove().

std::string ElectronDqmHarvesterBase::outputFile_
private

Definition at line 144 of file ElectronDqmHarvesterBase.h.

Referenced by ElectronDqmHarvesterBase().

std::string ElectronDqmHarvesterBase::outputInternalPath_
private
int ElectronDqmHarvesterBase::verbosity_
private