CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
EgHLTOfflineClient Class Reference

#include <EgHLTOfflineClient.h>

Inheritance diagram for EgHLTOfflineClient:
DQMEDHarvester edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginRun (const edm::Run &run, const edm::EventSetup &c) override
 
void createHLTvsOfflineHists (const std::string &filterName, const std::string &baseName, const std::string &region, const std::vector< std::string > &varNames, DQMStore::IBooker &, DQMStore::IGetter &)
 
void createLooseTightTrigEff (const std::vector< std::string > &tightLooseTrigNames, const std::string &region, const std::vector< std::string > &vsVarNames, const std::string &objName, DQMStore::IBooker &, DQMStore::IGetter &)
 
void createN1EffHists (const std::string &filterName, const std::string &baseName, const std::string &region, const std::vector< std::string > &varNames, DQMStore::IBooker &, DQMStore::IGetter &)
 
void createSingleEffHists (const std::string &filterName, const std::string &baseName, const std::string &region, const std::vector< std::string > &varNames, DQMStore::IBooker &, DQMStore::IGetter &)
 
void createTrigTagProbeEffHists (const std::string &filterName, const std::string &region, const std::vector< std::string > &vsVarNames, const std::string &objName, DQMStore::IBooker &, DQMStore::IGetter &)
 
void createTrigTagProbeEffHists2Leg (const std::string &filterNameLeg1, const std::string &filterNameLeg2, const std::string &region, const std::vector< std::string > &vsVarNames, const std::string &objName, DQMStore::IBooker &, DQMStore::IGetter &)
 
void createTrigTagProbeEffHistsNewAlgo (const std::string &filterName, const std::string &region, const std::vector< std::string > &vsVarNames, const std::string &objName, DQMStore::IBooker &, DQMStore::IGetter &)
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 
 EgHLTOfflineClient (const edm::ParameterSet &)
 
MonitorElementFillHLTvsOfflineHist (const std::string &filter, const std::string &name, const std::string &title, const MonitorElement *numer, const MonitorElement *denom, DQMStore::IBooker &, DQMStore::IGetter &)
 
MonitorElementmakeEffMonElem2Leg (const std::string &filter, const std::string &name, const std::string &title, const MonitorElement *Leg1Eff, const MonitorElement *Leg2NotLeg1Source, const MonitorElement *all, DQMStore::IBooker &, DQMStore::IGetter &)
 
MonitorElementmakeEffMonElemFromPassAndAll (const std::string &filterName, const std::string &name, const std::string &title, const MonitorElement *pass, const MonitorElement *all, DQMStore::IBooker &, DQMStore::IGetter &)
 
MonitorElementmakeEffMonElemFromPassAndFail (const std::string &filterName, const std::string &name, const std::string &title, const MonitorElement *pass, const MonitorElement *fail, DQMStore::IBooker &, DQMStore::IGetter &)
 
MonitorElementmakeEffMonElemFromPassAndFailAndTagTag (const std::string &filter, const std::string &name, const std::string &title, const MonitorElement *pass, const MonitorElement *fail, const MonitorElement *tagtag, DQMStore::IBooker &, DQMStore::IGetter &)
 
 ~EgHLTOfflineClient () override
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &) override
 
virtual void dqmAnalyze (DQMStore::IBooker &, DQMStore::IGetter &, edm::Event const &, edm::EventSetup const &)
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
 DQMEDHarvester ()
 
virtual void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) final
 
void endProcessBlockProduce (edm::ProcessBlock &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &es) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
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
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void runClient_ (DQMStore::IBooker &, DQMStore::IGetter &)
 

Private Attributes

std::string dirName_
 
std::vector< std::string > eleEffTags_
 
std::vector< std::string > eleHLTFilterNames2Leg_
 
std::vector< std::string > eleHLTFilterNames_
 
std::vector< std::string > eleHLTvOfflineVars_
 
std::vector< std::string > eleLooseTightTrigEffVsVars_
 
std::vector< std::string > eleN1EffVars_
 
std::vector< std::string > eleSingleEffVars_
 
std::vector< std::string > eleTightLooseTrigNames_
 
std::vector< std::string > eleTrigTPEffVsVars_
 
bool filterInactiveTriggers_
 
std::string hltTag_
 
bool isSetup_
 
std::vector< std::string > phoEffTags_
 
std::vector< std::string > phoHLTFilterNames2Leg_
 
std::vector< std::string > phoHLTFilterNames_
 
std::vector< std::string > phoHLTvOfflineVars_
 
std::vector< std::string > phoLooseTightTrigEffVsVars_
 
std::vector< std::string > phoN1EffVars_
 
std::vector< std::string > phoSingleEffVars_
 
std::vector< std::string > phoTightLooseTrigNames_
 
std::vector< std::string > phoTrigTPEffVsVars_
 
bool runClientEndJob_
 
bool runClientEndLumiBlock_
 
bool runClientEndRun_
 

Additional Inherited Members

- Public Types inherited from DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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
 
- 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 Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 
- Protected Attributes inherited from DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 34 of file EgHLTOfflineClient.h.

Constructor & Destructor Documentation

◆ EgHLTOfflineClient()

EgHLTOfflineClient::EgHLTOfflineClient ( const edm::ParameterSet iConfig)
explicit

Definition at line 20 of file EgHLTOfflineClient.cc.

References dirName_, eleEffTags_, eleHLTFilterNames2Leg_, eleHLTFilterNames_, eleHLTvOfflineVars_, eleLooseTightTrigEffVsVars_, eleN1EffVars_, eleSingleEffVars_, eleTightLooseTrigNames_, eleTrigTPEffVsVars_, filterInactiveTriggers_, edm::ParameterSet::getParameter(), hltTag_, phoEffTags_, phoHLTFilterNames2Leg_, phoHLTFilterNames_, phoHLTvOfflineVars_, phoLooseTightTrigEffVsVars_, phoN1EffVars_, phoSingleEffVars_, phoTightLooseTrigNames_, phoTrigTPEffVsVars_, runClientEndJob_, runClientEndLumiBlock_, runClientEndRun_, and AlCaHLTBitMon_QueryRunRegistry::string.

20  : isSetup_(false) {
21  eleHLTFilterNames_ = iConfig.getParameter<std::vector<std::string> >("eleHLTFilterNames");
22  eleHLTFilterNames2Leg_ = iConfig.getParameter<std::vector<std::string> >("eleHLTFilterNames2Leg");
23  eleTightLooseTrigNames_ = iConfig.getParameter<std::vector<std::string> >("eleTightLooseTrigNames");
24  phoHLTFilterNames_ = iConfig.getParameter<std::vector<std::string> >("phoHLTFilterNames");
25  phoHLTFilterNames2Leg_ = iConfig.getParameter<std::vector<std::string> >("phoHLTFilterNames2Leg");
26  phoTightLooseTrigNames_ = iConfig.getParameter<std::vector<std::string> >("phoTightLooseTrigNames");
27 
28  eleN1EffVars_ = iConfig.getParameter<std::vector<std::string> >("eleN1EffVars");
29  eleSingleEffVars_ = iConfig.getParameter<std::vector<std::string> >("eleSingleEffVars");
30  eleEffTags_ = iConfig.getParameter<std::vector<std::string> >("eleEffTags");
31  eleTrigTPEffVsVars_ = iConfig.getParameter<std::vector<std::string> >("eleTrigTPEffVsVars");
32  eleLooseTightTrigEffVsVars_ = iConfig.getParameter<std::vector<std::string> >("eleLooseTightTrigEffVsVars");
33  eleHLTvOfflineVars_ = iConfig.getParameter<std::vector<std::string> >("eleHLTvOfflineVars");
34 
35  phoN1EffVars_ = iConfig.getParameter<std::vector<std::string> >("phoN1EffVars");
36  phoSingleEffVars_ = iConfig.getParameter<std::vector<std::string> >("phoSingleEffVars");
37  phoEffTags_ = iConfig.getParameter<std::vector<std::string> >("phoEffTags");
38  phoTrigTPEffVsVars_ = iConfig.getParameter<std::vector<std::string> >("phoTrigTPEffVsVars");
39  phoLooseTightTrigEffVsVars_ = iConfig.getParameter<std::vector<std::string> >("phoLooseTightTrigEffVsVars");
40  phoHLTvOfflineVars_ = iConfig.getParameter<std::vector<std::string> >("phoHLTvOfflineVars");
41 
42  runClientEndLumiBlock_ = iConfig.getParameter<bool>("runClientEndLumiBlock");
43  runClientEndRun_ = iConfig.getParameter<bool>("runClientEndRun");
44  runClientEndJob_ = iConfig.getParameter<bool>("runClientEndJob");
45 
46  dirName_ = iConfig.getParameter<std::string>("DQMDirName");
47 
48  filterInactiveTriggers_ = iConfig.getParameter<bool>("filterInactiveTriggers");
49  hltTag_ = iConfig.getParameter<std::string>("hltTag");
50 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::vector< std::string > eleHLTFilterNames_
std::vector< std::string > phoHLTFilterNames2Leg_
std::vector< std::string > phoLooseTightTrigEffVsVars_
std::vector< std::string > phoTrigTPEffVsVars_
std::vector< std::string > eleTightLooseTrigNames_
std::vector< std::string > phoN1EffVars_
std::vector< std::string > eleHLTvOfflineVars_
std::vector< std::string > eleTrigTPEffVsVars_
std::vector< std::string > phoEffTags_
std::vector< std::string > phoSingleEffVars_
std::vector< std::string > eleN1EffVars_
std::vector< std::string > phoTightLooseTrigNames_
std::vector< std::string > phoHLTvOfflineVars_
std::vector< std::string > phoHLTFilterNames_
std::vector< std::string > eleLooseTightTrigEffVsVars_
std::vector< std::string > eleEffTags_
std::vector< std::string > eleHLTFilterNames2Leg_
std::vector< std::string > eleSingleEffVars_

◆ ~EgHLTOfflineClient()

EgHLTOfflineClient::~EgHLTOfflineClient ( )
overridedefault

Member Function Documentation

◆ beginRun()

void EgHLTOfflineClient::beginRun ( const edm::Run run,
const edm::EventSetup c 
)
override

Definition at line 59 of file EgHLTOfflineClient.cc.

References HltBtagPostValidation_cff::c, eleHLTFilterNames2Leg_, eleHLTFilterNames_, eleTightLooseTrigNames_, egHLT::trigTools::filterInactiveTightLooseTriggers(), egHLT::trigTools::filterInactiveTriggers(), filterInactiveTriggers_, egHLT::trigTools::getActiveFilters(), HltComparatorCreateWorkflow::hltConfig, hltTag_, isSetup_, phoHLTFilterNames_, phoTightLooseTrigNames_, and writedatasetfile::run.

59  {
60  if (!isSetup_) {
63  bool changed = false;
64  hltConfig.init(run, c, hltTag_, changed);
65  std::vector<std::string> activeFilters;
66  std::vector<std::string> activeEleFilters;
67  std::vector<std::string> activeEle2LegFilters;
68  std::vector<std::string> activePhoFilters;
69  std::vector<std::string> activePho2LegFilters;
71  hltConfig, activeFilters, activeEleFilters, activeEle2LegFilters, activePhoFilters, activePho2LegFilters);
72 
78  }
79  isSetup_ = true;
80  }
81 }
std::vector< std::string > eleHLTFilterNames_
std::vector< std::string > eleTightLooseTrigNames_
void getActiveFilters(const HLTConfigProvider &hltConfig, std::vector< std::string > &activeFilters, std::vector< std::string > &activeEleFilters, std::vector< std::string > &activeEle2LegFilters, std::vector< std::string > &activePhoFilters, std::vector< std::string > &activePho2LegFilters)
std::vector< std::string > phoTightLooseTrigNames_
std::vector< std::string > phoHLTFilterNames_
void filterInactiveTriggers(std::vector< std::string > &namesToFilter, std::vector< std::string > &activeFilters)
void filterInactiveTightLooseTriggers(std::vector< std::string > &namesToFilter, const std::vector< std::string > &activeFilters)
std::vector< std::string > eleHLTFilterNames2Leg_

◆ createHLTvsOfflineHists()

void EgHLTOfflineClient::createHLTvsOfflineHists ( const std::string &  filterName,
const std::string &  baseName,
const std::string &  region,
const std::vector< std::string > &  varNames,
DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 169 of file EgHLTOfflineClient.cc.

References makePileupJSON::denom, dirName_, FillHLTvsOfflineHist(), pdwgDoubleElectron_cfi::filterName, dqm::implementation::IGetter::get(), nano_mu_digi_cff::region, AlCaHLTBitMon_QueryRunRegistry::string, and varNames.

Referenced by runClient_().

174  {
175  //need to do Energy manually to get SC Energy
176  /*
177  MonitorElement* numer = dbe_->get(dirName_+"/Source_Histos/"+filterName+"/"+baseName+"_HLTenergy"+"_"+region);
178  MonitorElement* denom = dbe_->get(dirName_+"/Source_Histos/"+filterName+"/"+baseName+"_energy"+"_"+region);
179 
180  if(numer!=NULL && denom!=NULL){
181  std::string effHistName(baseName+"_HLToverOfflineSC_energy_"+region);//std::cout<<"hltVSoffline: "<<effHistName<<std::endl;
182  std::string effHistTitle(effHistName);
183  if(region=="eb" || region=="ee"){
184  if(region=="eb") effHistTitle = "Barrel "+baseName+" HLToverOfflineSC Energy";
185  if(region=="ee") effHistTitle = "Endcap "+baseName+" HLToverOfflineSC Energy";
186  FillHLTvsOfflineHist(filterName,effHistName,effHistTitle,numer,denom);
187  }
188  }//end Et
189  */
190 
191  //now eta, phi automatically
192  for (auto const& varName : varNames) {
193  MonitorElement* numer =
194  igetter.get(dirName_ + "/Source_Histos/" + filterName + "/" + baseName + "_HLT" + varName + "_" + region);
196  igetter.get(dirName_ + "/Source_Histos/" + filterName + "/" + baseName + "_" + varName + "_" + region);
197  if (numer != nullptr && denom != nullptr) {
198  std::string effHistName(baseName + "_HLToverOffline_" + varName + "_" +
199  region); //std::cout<<"hltVSoffline: "<<effHistName<<std::endl;
200  std::string effHistTitle(effHistName);
201  if (region == "eb" || region == "ee") {
202  if (region == "eb")
203  effHistTitle = "Barrel " + baseName + " HLToverOffline " + varName;
204  if (region == "ee")
205  effHistTitle = "Endcap " + baseName + " HLToverOffline " + varName;
206  FillHLTvsOfflineHist(filterName, effHistName, effHistTitle, numer, denom, ibooker, igetter);
207  }
208  }
209  } //end loop over varNames
210 }
constexpr char const * varNames[]
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
MonitorElement * FillHLTvsOfflineHist(const std::string &filter, const std::string &name, const std::string &title, const MonitorElement *numer, const MonitorElement *denom, DQMStore::IBooker &, DQMStore::IGetter &)

◆ createLooseTightTrigEff()

void EgHLTOfflineClient::createLooseTightTrigEff ( const std::vector< std::string > &  tightLooseTrigNames,
const std::string &  region,
const std::vector< std::string > &  vsVarNames,
const std::string &  objName,
DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 446 of file EgHLTOfflineClient.cc.

References dirName_, dqm::implementation::IGetter::get(), makeEffMonElemFromPassAndFail(), mkLumiAveragedPlots::objName, nano_mu_digi_cff::region, submitPVValidationJobs::split(), splitString(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by runClient_().

451  {
452  for (auto const& vsVarName : vsVarNames) {
453  for (auto const& tightLooseTrigName : tightLooseTrigNames) {
454  std::vector<std::string> splitString;
455  boost::split(splitString, tightLooseTrigName, boost::is_any_of(std::string(":")));
456  if (splitString.size() != 2) {
457  continue; //format incorrect
458  }
459 
460  const std::string& tightTrig = splitString[0];
461  const std::string& looseTrig = splitString[1];
462  MonitorElement* fail = igetter.get(dirName_ + "/Source_Histos/" + tightTrig + "_" + looseTrig + "_" + objName +
463  "_failTrig_" + vsVarName + "_" + region);
464  if (fail == nullptr) {
465  continue;
466  }
467 
468  MonitorElement* pass = igetter.get(dirName_ + "/Source_Histos/" + tightTrig + "_" + looseTrig + "_" + objName +
469  "_passTrig_" + vsVarName + "_" + region);
470  if (pass == nullptr) {
471  continue;
472  }
473 
474  const std::string newHistName(tightTrig + "_trigEffTo_" + looseTrig + "_" + objName + "_vs_" + vsVarName + "_" +
475  region);
476  //----Morse-----
477  std::string effHistTitle(newHistName); //std::cout<<effHistTitle<<std::endl;
478  if (region == "eb" || region == "ee") {
479  if (region == "eb")
480  effHistTitle = "Barrel " + tightTrig + "_TrigEffTo_" + looseTrig + "_" + objName + " vs " + vsVarName;
481  if (region == "ee")
482  effHistTitle = "Endcap " + tightTrig + "_TrigEffTo_" + looseTrig + "_" + objName + " vs " + vsVarName;
483  }
484  //------------
485  makeEffMonElemFromPassAndFail("LooseTight", newHistName, effHistTitle, pass, fail, ibooker, igetter);
486 
487  } //end loop over trigger pairs
488  } //end loop over vsVarNames
489 }
std::vector< std::string > splitString(const std::string &fLine)
MonitorElement * makeEffMonElemFromPassAndFail(const std::string &filterName, const std::string &name, const std::string &title, const MonitorElement *pass, const MonitorElement *fail, DQMStore::IBooker &, DQMStore::IGetter &)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712

◆ createN1EffHists()

void EgHLTOfflineClient::createN1EffHists ( const std::string &  filterName,
const std::string &  baseName,
const std::string &  region,
const std::vector< std::string > &  varNames,
DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 240 of file EgHLTOfflineClient.cc.

References makePileupJSON::denom, dirName_, pdwgDoubleElectron_cfi::filterName, dqm::implementation::IGetter::get(), makeEffMonElemFromPassAndAll(), nano_mu_digi_cff::region, AlCaHLTBitMon_QueryRunRegistry::string, and varNames.

Referenced by runClient_().

245  {
246  MonitorElement* numer =
247  igetter.get(dirName_ + "/Source_Histos/" + filterName + "/" + baseName + "_allCuts_" + region);
248 
249  for (auto const& varName : varNames) {
251  igetter.get(dirName_ + "/Source_Histos/" + filterName + "/" + baseName + "_n1_" + varName + "_" + region);
252  if (numer != nullptr && denom != nullptr) {
253  std::string effHistName(baseName + "_n1Eff_" + varName + "_" +
254  region); //std::cout<<"N1: "<<effHistName<<std::endl;
255  //std::cout<<region<<" ";
256  //----Morse-----------
257  std::string effHistTitle(effHistName); //std::cout<<effHistTitle<<std::endl;
258  if (region == "eb" || region == "ee") {
259  if (region == "eb")
260  effHistTitle = "Barrel " + baseName + " N1eff " + varName;
261  if (region == "ee")
262  effHistTitle = "Endcap " + baseName + " N1eff " + varName;
263  } //std::cout<<effHistTitle<<std::endl;
264  makeEffMonElemFromPassAndAll(filterName, effHistName, effHistTitle, numer, denom, ibooker, igetter);
265  //---------------------
266  }
267  } //end loop over varNames
268 }
constexpr char const * varNames[]
MonitorElement * makeEffMonElemFromPassAndAll(const std::string &filterName, const std::string &name, const std::string &title, const MonitorElement *pass, const MonitorElement *all, DQMStore::IBooker &, DQMStore::IGetter &)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712

◆ createSingleEffHists()

void EgHLTOfflineClient::createSingleEffHists ( const std::string &  filterName,
const std::string &  baseName,
const std::string &  region,
const std::vector< std::string > &  varNames,
DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 270 of file EgHLTOfflineClient.cc.

References makePileupJSON::denom, dirName_, pdwgDoubleElectron_cfi::filterName, dqm::implementation::IGetter::get(), makeEffMonElemFromPassAndAll(), nano_mu_digi_cff::region, AlCaHLTBitMon_QueryRunRegistry::string, and varNames.

Referenced by runClient_().

275  {
276  MonitorElement* denom = igetter.get(dirName_ + "/Source_Histos/" + filterName + "/" + baseName + "_noCuts_" + region);
277 
278  for (auto const& varName : varNames) {
279  MonitorElement* numer =
280  igetter.get(dirName_ + "/Source_Histos/" + filterName + "/" + baseName + "_single_" + varName + "_" + region);
281  if (numer != nullptr && denom != nullptr) {
282  std::string effHistName(baseName + "_singleEff_" + varName + "_" +
283  region); //std::cout<<"Si: "<<effHistName<<std::endl;
284  //----Morse-----------
285  std::string effHistTitle(effHistName); //std::cout<<effHistTitle<<std::endl;
286  if (region == "eb" || region == "ee") {
287  if (region == "eb")
288  effHistTitle = "Barrel " + baseName + " SingleEff " + varName;
289  if (region == "ee")
290  effHistTitle = "Endcap " + baseName + " SingleEff " + varName;
291  } //std::cout<<effHistTitle<<std::endl;
292  makeEffMonElemFromPassAndAll(filterName, effHistName, effHistTitle, numer, denom, ibooker, igetter);
293  //--------------------
294  }
295  } //end loop over varNames
296 }
constexpr char const * varNames[]
MonitorElement * makeEffMonElemFromPassAndAll(const std::string &filterName, const std::string &name, const std::string &title, const MonitorElement *pass, const MonitorElement *all, DQMStore::IBooker &, DQMStore::IGetter &)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712

◆ createTrigTagProbeEffHists()

void EgHLTOfflineClient::createTrigTagProbeEffHists ( const std::string &  filterName,
const std::string &  region,
const std::vector< std::string > &  vsVarNames,
const std::string &  objName,
DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 298 of file EgHLTOfflineClient.cc.

References python.cmstools::all(), dirName_, pdwgDoubleElectron_cfi::filterName, dqm::implementation::IGetter::get(), makeEffMonElemFromPassAndAll(), mkLumiAveragedPlots::objName, nano_mu_digi_cff::region, and AlCaHLTBitMon_QueryRunRegistry::string.

303  {
304  for (auto const& vsVarName : vsVarNames) {
305  std::string allName(dirName_ + "/Source_Histos/" + filterName + "/" + filterName + "_trigTagProbe_" + objName +
306  "_all_" + vsVarName + "_" + region);
307  MonitorElement* all = igetter.get(allName);
308  if (all == nullptr) {
309  continue;
310  }
311  std::string passName(dirName_ + "/Source_Histos/" + filterName + "/" + filterName + "_trigTagProbe_" + objName +
312  "_pass_" + vsVarName + "_" + region);
313  MonitorElement* pass = igetter.get(passName);
314  if (pass == nullptr) {
315  continue;
316  }
317  //----Morse-----
318  std::string effHistTitle(filterName + "_trigTagProbeEff_" + objName + "_vs_" + vsVarName + "_" +
319  region); //std::cout<<effHistTitle<<std::endl;
320  if (region == "eb" || region == "ee") {
321  if (region == "eb")
322  effHistTitle = "Barrel " + filterName + "_" + objName + " TrigTagProbeEff vs " + vsVarName;
323  if (region == "ee")
324  effHistTitle = "Endcap " + filterName + "_" + objName + " TrigTagProbeEff vs " + vsVarName;
325  }
326  //------------
328  filterName + "_trigTagProbeEff_" + objName + "_vs_" + vsVarName + "_" + region,
329  effHistTitle,
330  pass,
331  all,
332  ibooker,
333  igetter);
334 
335  } //end loop over vsVarNames
336 }
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:25
MonitorElement * makeEffMonElemFromPassAndAll(const std::string &filterName, const std::string &name, const std::string &title, const MonitorElement *pass, const MonitorElement *all, DQMStore::IBooker &, DQMStore::IGetter &)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712

◆ createTrigTagProbeEffHists2Leg()

void EgHLTOfflineClient::createTrigTagProbeEffHists2Leg ( const std::string &  filterNameLeg1,
const std::string &  filterNameLeg2,
const std::string &  region,
const std::vector< std::string > &  vsVarNames,
const std::string &  objName,
DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 395 of file EgHLTOfflineClient.cc.

References python.cmstools::all(), dirName_, dqm::implementation::IGetter::get(), makeEffMonElem2Leg(), mkLumiAveragedPlots::objName, nano_mu_digi_cff::region, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by runClient_().

401  {
402  for (auto const& vsVarName : vsVarNames) {
403  std::string allName(dirName_ + "/Source_Histos/" + filterNameLeg2 + "/" + filterNameLeg2 + "_trigTagProbe_" +
404  objName + "_all_" + vsVarName + "_" + region);
405  MonitorElement* all = igetter.get(allName);
406  if (all == nullptr) {
407  edm::LogInfo("EgHLTOfflineClient") << " couldnt get hist " << allName;
408  continue;
409  }
410 
411  std::string Leg2NotLeg1SourceName(dirName_ + "/Source_Histos/" + filterNameLeg2 + "/" + filterNameLeg2 +
412  "_trigTagProbe_" + objName + "_passLeg2failLeg1_" + vsVarName + "_" + region);
413  MonitorElement* Leg2NotLeg1Source = igetter.get(Leg2NotLeg1SourceName);
414  if (Leg2NotLeg1Source == nullptr) {
415  edm::LogInfo("EgHLTOfflineClient") << " couldnt get hist " << Leg2NotLeg1SourceName;
416  continue;
417  }
418 
419  std::string Leg1EffName(dirName_ + "/Client_Histos/" + filterNameLeg1 + "/" + filterNameLeg1 + "_trigTagProbeEff_" +
420  objName + "_vs_" + vsVarName + "_" + region);
421  MonitorElement* Leg1Eff = igetter.get(Leg1EffName);
422  if (Leg1Eff == nullptr) {
423  edm::LogInfo("EgHLTOfflineClient") << " couldnt get hist " << Leg1EffName;
424  continue;
425  }
426 
427  std::string effHistTitle(filterNameLeg2 + "_trigTagProbeEff2Leg_" + objName + "_vs_" + vsVarName + "_" +
428  region); //std::cout<<effHistTitle<<std::endl;
429  if (region == "eb" || region == "ee") {
430  if (region == "eb")
431  effHistTitle = "Barrel " + filterNameLeg2 + "_" + objName + " TrigTagProbeEff2Leg vs " + vsVarName;
432  if (region == "ee")
433  effHistTitle = "Endcap " + filterNameLeg2 + "_" + objName + " TrigTagProbeEff2Leg vs " + vsVarName;
434  } //std::cout<<effHistTitle<<std::endl;
435  makeEffMonElem2Leg(filterNameLeg2,
436  filterNameLeg2 + "_trigTagProbeEff2Leg_" + objName + "_vs_" + vsVarName + "_" + region,
437  effHistTitle,
438  Leg1Eff,
439  Leg2NotLeg1Source,
440  all,
441  ibooker,
442  igetter);
443  } //end loop over vsVarNames
444 }
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:25
Log< level::Info, false > LogInfo
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
MonitorElement * makeEffMonElem2Leg(const std::string &filter, const std::string &name, const std::string &title, const MonitorElement *Leg1Eff, const MonitorElement *Leg2NotLeg1Source, const MonitorElement *all, DQMStore::IBooker &, DQMStore::IGetter &)

◆ createTrigTagProbeEffHistsNewAlgo()

void EgHLTOfflineClient::createTrigTagProbeEffHistsNewAlgo ( const std::string &  filterName,
const std::string &  region,
const std::vector< std::string > &  vsVarNames,
const std::string &  objName,
DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 338 of file EgHLTOfflineClient.cc.

References dirName_, pdwgDoubleElectron_cfi::filterName, dqm::implementation::IGetter::get(), makeEffMonElemFromPassAndFailAndTagTag(), mkLumiAveragedPlots::objName, nano_mu_digi_cff::region, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by runClient_().

343  {
344  for (auto const& vsVarName : vsVarNames) {
345  /*
346  std::string allName(dirName_+"/Source_Histos/"+filterName+"/"+filterName+"_trigTagProbe_"+objName+"_all_"+vsVarNames[varNr]+"_"+region);
347  MonitorElement* all = dbe_->get(allName);
348  if(all==NULL){
349  //edm::LogInfo("EgHLTOfflineClient") <<" couldnt get hist "<<allName;
350  continue;
351  }*/
352  std::string passName(dirName_ + "/Source_Histos/" + filterName + "/" + filterName + "_trigTagProbe_" + objName +
353  "_passNotTag_" + vsVarName + "_" + region);
354  MonitorElement* passNotTag = igetter.get(passName);
355  if (passNotTag == nullptr) {
356  //edm::LogInfo("EgHLTOfflineClient") <<" couldnt get hist "<<passName;
357  continue;
358  }
359  std::string passTagTagName(dirName_ + "/Source_Histos/" + filterName + "/" + filterName + "_trigTagProbe_" +
360  objName + "_passTagTag_" + vsVarName + "_" + region);
361  MonitorElement* passTagTag = igetter.get(passTagTagName);
362  if (passTagTag == nullptr) {
363  //edm::LogInfo("EgHLTOfflineClient") <<" couldnt get hist "<<passTagTagName;
364  continue;
365  }
366  std::string failName(dirName_ + "/Source_Histos/" + filterName + "/" + filterName + "_trigTagProbe_" + objName +
367  "_fail_" + vsVarName + "_" + region);
368  MonitorElement* fail = igetter.get(failName);
369  if (fail == nullptr) {
370  //edm::LogInfo("EgHLTOfflineClient") <<" couldnt get hist "<<failName;
371  continue;
372  }
373  //----Morse-----
374  std::string effHistTitle(filterName + "_trigTagProbeEff_" + objName + "_vs_" + vsVarName + "_" +
375  region); //std::cout<<effHistTitle<<std::endl;
376  if (region == "eb" || region == "ee") {
377  if (region == "eb")
378  effHistTitle = "Barrel " + filterName + "_" + objName + " TrigTagProbeEff vs " + vsVarName;
379  if (region == "ee")
380  effHistTitle = "Endcap " + filterName + "_" + objName + " TrigTagProbeEff vs " + vsVarName;
381  } //std::cout<<effHistTitle<<std::endl;
382  //------------
384  filterName,
385  filterName + "_trigTagProbeEff_" + objName + "_vs_" + vsVarName + "_" + region,
386  effHistTitle,
387  passNotTag,
388  fail,
389  passTagTag,
390  ibooker,
391  igetter);
392  } //end loop over vsVarNames
393 }
MonitorElement * makeEffMonElemFromPassAndFailAndTagTag(const std::string &filter, const std::string &name, const std::string &title, const MonitorElement *pass, const MonitorElement *fail, const MonitorElement *tagtag, DQMStore::IBooker &, DQMStore::IGetter &)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712

◆ dqmEndJob()

void EgHLTOfflineClient::dqmEndJob ( DQMStore::IBooker ibooker_,
DQMStore::IGetter igetter_ 
)
overridevirtual

Implements DQMEDHarvester.

Definition at line 54 of file EgHLTOfflineClient.cc.

References runClient_(), and runClientEndJob_.

54  {
55  if (runClientEndJob_)
56  runClient_(ibooker_, igetter_);
57 }
void runClient_(DQMStore::IBooker &, DQMStore::IGetter &)

◆ dqmEndLuminosityBlock()

void EgHLTOfflineClient::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker_,
DQMStore::IGetter igetter_,
edm::LuminosityBlock const &  iLumi,
edm::EventSetup const &  iSetup 
)
overridevirtual

Reimplemented from DQMEDHarvester.

Definition at line 83 of file EgHLTOfflineClient.cc.

References runClient_(), and runClientEndLumiBlock_.

86  {
88  runClient_(ibooker_, igetter_);
89 }
void runClient_(DQMStore::IBooker &, DQMStore::IGetter &)

◆ FillHLTvsOfflineHist()

EgHLTOfflineClient::MonitorElement * EgHLTOfflineClient::FillHLTvsOfflineHist ( const std::string &  filter,
const std::string &  name,
const std::string &  title,
const MonitorElement numer,
const MonitorElement denom,
DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 212 of file EgHLTOfflineClient.cc.

References dqm::implementation::IBooker::book1D(), makePileupJSON::denom, dirName_, ALCARECOTkAlBeamHalo_cff::filter, dqm::implementation::IGetter::get(), dqm::legacy::MonitorElement::getTH1F(), Skims_PA_cff::name, EgammaValidation_cff::num, and runGCPTkAlMap::title.

Referenced by createHLTvsOfflineHists().

218  {
219  TH1F* num = numer->getTH1F();
220  if (num->GetSumw2N() == 0)
221  num->Sumw2();
222 
223  TH1F* den = denom->getTH1F();
224  if (den->GetSumw2N() == 0)
225  den->Sumw2();
226 
227  auto* h_eff = (TH1F*)num->Clone(name.c_str());
228  h_eff->Divide(num, den, 1, 1, "B");
229  h_eff->SetTitle(title.c_str());
230  MonitorElement* eff = igetter.get(dirName_ + "/Client_Histos/" + filter + "/" + name);
231  if (eff == nullptr) {
232  eff = ibooker.book1D(name, h_eff);
233  } else { //I was having problems with collating the histograms, hence why I'm just resetting the histogram value
234  *eff->getTH1F() = *h_eff;
235  delete h_eff;
236  }
237  return eff;
238 }
virtual TH1F * getTH1F() const
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ makeEffMonElem2Leg()

EgHLTOfflineClient::MonitorElement * EgHLTOfflineClient::makeEffMonElem2Leg ( const std::string &  filter,
const std::string &  name,
const std::string &  title,
const MonitorElement Leg1Eff,
const MonitorElement Leg2NotLeg1Source,
const MonitorElement all,
DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 564 of file EgHLTOfflineClient.cc.

References python.cmstools::all(), dqm::implementation::IBooker::book1D(), dirName_, ALCARECOTkAlBeamHalo_cff::filter, dqm::implementation::IGetter::get(), dqm::legacy::MonitorElement::getTH1F(), Skims_PA_cff::name, and runGCPTkAlMap::title.

Referenced by createTrigTagProbeEffHists2Leg().

571  {
572  TH1F* allHist = all->getTH1F();
573  if (allHist->GetSumw2() == nullptr)
574  allHist->Sumw2();
575  TH1F* Leg2NotLeg1SourceHist = Leg2NotLeg1Source->getTH1F();
576  if (Leg2NotLeg1SourceHist->GetSumw2() == nullptr)
577  Leg2NotLeg1SourceHist->Sumw2();
578 
579  auto* effHistLeg2NotLeg1 = (TH1F*)allHist->Clone(name.c_str());
580  if (effHistLeg2NotLeg1->GetSumw2() == nullptr)
581  effHistLeg2NotLeg1->Sumw2();
582  effHistLeg2NotLeg1->Divide(Leg2NotLeg1SourceHist, allHist, 1, 1, "B");
583 
584  TH1F* Leg1EffHist = Leg1Eff->getTH1F();
585  if (Leg1EffHist->GetSumw2() == nullptr)
586  Leg1EffHist->Sumw2();
587 
588  auto* effHistTerm1 = (TH1F*)allHist->Clone(name.c_str());
589  if (effHistTerm1->GetSumw2() == nullptr)
590  effHistTerm1->Sumw2();
591  effHistTerm1->Multiply(Leg1EffHist, Leg1EffHist, 1, 1, "B");
592 
593  auto* effHistTerm2 = (TH1F*)allHist->Clone(name.c_str());
594  if (effHistTerm2->GetSumw2() == nullptr)
595  effHistTerm2->Sumw2();
596  effHistTerm2->Multiply(Leg1EffHist, effHistLeg2NotLeg1, 1, 1, "B");
597  effHistTerm2->Scale(2);
598 
599  auto* effHist = (TH1F*)allHist->Clone(name.c_str());
600  if (effHist->GetSumw2() == nullptr)
601  effHist->Sumw2();
602  effHist->Add(effHistTerm1, effHistTerm2, 1, 1);
603  effHist->SetTitle(title.c_str());
604 
605  MonitorElement* eff = igetter.get(dirName_ + "/Client_Histos/" + filter + "/" + name);
606  if (eff == nullptr) {
607  eff = ibooker.book1D(name, effHist);
608  } else { //I was having problems with collating the histograms, hence why I'm just resetting the histogram value
609  *eff->getTH1F() = *effHist;
610  delete effHist;
611  }
612  return eff;
613 }
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:25
virtual TH1F * getTH1F() const
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ makeEffMonElemFromPassAndAll()

EgHLTOfflineClient::MonitorElement * EgHLTOfflineClient::makeEffMonElemFromPassAndAll ( const std::string &  filterName,
const std::string &  name,
const std::string &  title,
const MonitorElement pass,
const MonitorElement all,
DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 491 of file EgHLTOfflineClient.cc.

References python.cmstools::all(), dqm::implementation::IBooker::book1D(), dirName_, pdwgDoubleElectron_cfi::filterName, dqm::implementation::IGetter::get(), dqm::legacy::MonitorElement::getTH1F(), Skims_PA_cff::name, and runGCPTkAlMap::title.

Referenced by createN1EffHists(), createSingleEffHists(), and createTrigTagProbeEffHists().

497  {
498  TH1F* passHist = pass->getTH1F();
499  if (passHist->GetSumw2N() == 0)
500  passHist->Sumw2();
501  TH1F* allHist = all->getTH1F();
502  if (allHist->GetSumw2N() == 0)
503  allHist->Sumw2();
504  auto* effHist = (TH1F*)passHist->Clone(name.c_str());
505  effHist->Divide(passHist, allHist, 1, 1, "B");
506  //----Morse---------
507  effHist->SetTitle(title.c_str());
508  //------------------
509  MonitorElement* eff = igetter.get(dirName_ + "/Client_Histos/" + filterName + "/" + name);
510  if (eff == nullptr) {
511  eff = ibooker.book1D(name, effHist);
512  } else { //I was having problems with collating the histograms, hence why I'm just resetting the histogram value
513  *eff->getTH1F() = *effHist;
514  delete effHist;
515  }
516  return eff;
517 }
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:25
virtual TH1F * getTH1F() const
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ makeEffMonElemFromPassAndFail()

EgHLTOfflineClient::MonitorElement * EgHLTOfflineClient::makeEffMonElemFromPassAndFail ( const std::string &  filterName,
const std::string &  name,
const std::string &  title,
const MonitorElement pass,
const MonitorElement fail,
DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 616 of file EgHLTOfflineClient.cc.

References dqm::implementation::IBooker::book1D(), dirName_, pdwgDoubleElectron_cfi::filterName, dqm::implementation::IGetter::get(), dqm::legacy::MonitorElement::getTH1F(), Skims_PA_cff::name, and runGCPTkAlMap::title.

Referenced by createLooseTightTrigEff().

622  {
623  TH1F* failHist = fail->getTH1F();
624  if (failHist->GetSumw2N() == 0)
625  failHist->Sumw2();
626  TH1F* passHist = pass->getTH1F();
627  if (passHist->GetSumw2N() == 0)
628  passHist->Sumw2();
629 
630  auto* effHist = (TH1F*)passHist->Clone(name.c_str());
631  effHist->Add(failHist);
632  effHist->Divide(passHist, effHist, 1, 1, "B");
633  //----Morse---------
634  effHist->SetTitle(title.c_str());
635  //------------------
636  MonitorElement* eff = igetter.get(dirName_ + "/Client_Histos/" + filterName + "/" + name);
637  if (eff == nullptr) {
638  eff = ibooker.book1D(name, effHist);
639  } else { //I was having problems with collating the histograms, hence why I'm just reseting the histogram value
640  *eff->getTH1F() = *effHist;
641  delete effHist;
642  }
643  return eff;
644 }
virtual TH1F * getTH1F() const
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ makeEffMonElemFromPassAndFailAndTagTag()

EgHLTOfflineClient::MonitorElement * EgHLTOfflineClient::makeEffMonElemFromPassAndFailAndTagTag ( const std::string &  filter,
const std::string &  name,
const std::string &  title,
const MonitorElement pass,
const MonitorElement fail,
const MonitorElement tagtag,
DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 519 of file EgHLTOfflineClient.cc.

References dqm::implementation::IBooker::book1D(), makePileupJSON::denom, dirName_, ALCARECOTkAlBeamHalo_cff::filter, dqm::implementation::IGetter::get(), dqm::legacy::MonitorElement::getTH1F(), Skims_PA_cff::name, and runGCPTkAlMap::title.

Referenced by createTrigTagProbeEffHistsNewAlgo().

527  {
528  TH1F* passHist = passNotTag->getTH1F();
529  if (passHist->GetSumw2N() == 0)
530  passHist->Sumw2();
531  TH1F* failHist = fail->getTH1F();
532  if (failHist->GetSumw2N() == 0)
533  failHist->Sumw2();
534  TH1F* tagtagHist = tagtag->getTH1F();
535  if (tagtagHist->GetSumw2N() == 0)
536  tagtagHist->Sumw2();
537  auto* numer = (TH1F*)passHist->Clone(name.c_str());
538  if (numer->GetSumw2N() == 0)
539  numer->Sumw2();
540  numer->Add(tagtagHist, passHist, 2, 1);
541  auto* denom = (TH1F*)passHist->Clone(name.c_str());
542  if (denom->GetSumw2N() == 0)
543  denom->Sumw2();
544  denom->Add(tagtagHist, passHist, 2, 1);
545  denom->Add(failHist, 1);
546  auto* effHist = (TH1F*)passHist->Clone(name.c_str());
547  //TGraphAsymmErrors *effHist = new TGraphAsymmErrors(numer,denom,"cl=0.683 b(1,1) mode");
548  effHist->Divide(numer, denom, 1, 1, "B");
549  //effHist->Divide(numer,denom,"cl=0.683 b(1,1) mode");
550  //----Morse---------
551  effHist->SetTitle(title.c_str());
552  //------------------
553  MonitorElement* eff = igetter.get(dirName_ + "/Client_Histos/" + filter + "/" + name);
554  if (eff == nullptr) {
555  eff = ibooker.book1D(name, effHist);
556  } else { //I was having problems with collating the histograms, hence why I'm just resetting the histogram value
557  *eff->getTH1F() = *effHist;
558  //*eff->getTGraphAsymmErrors()=*effHist;
559  delete effHist;
560  }
561  return eff;
562 }
virtual TH1F * getTH1F() const
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ runClient_()

void EgHLTOfflineClient::runClient_ ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
private

Definition at line 91 of file EgHLTOfflineClient.cc.

References createHLTvsOfflineHists(), createLooseTightTrigEff(), createN1EffHists(), createSingleEffHists(), createTrigTagProbeEffHists2Leg(), createTrigTagProbeEffHistsNewAlgo(), dirName_, eleEffTags_, eleHLTFilterNames2Leg_, eleHLTFilterNames_, eleHLTvOfflineVars_, eleLooseTightTrigEffVsVars_, eleN1EffVars_, eleSingleEffVars_, eleTightLooseTrigNames_, eleTrigTPEffVsVars_, phoEffTags_, phoHLTFilterNames_, phoHLTvOfflineVars_, phoLooseTightTrigEffVsVars_, phoN1EffVars_, phoSingleEffVars_, phoTightLooseTrigNames_, phoTrigTPEffVsVars_, nano_mu_digi_cff::region, dqm::implementation::NavigatorBase::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

91  {
92  ibooker.setCurrentFolder(dirName_ + "/Client_Histos");
93 
94  std::vector<std::string> regions;
95  regions.emplace_back("eb");
96  regions.emplace_back("ee");
97 
98  for (auto const& eleHLTFilterName : eleHLTFilterNames_) {
99  //std::cout<<"FilterName: "<<eleHLTFilterNames_[filterNr]<<std::endl;
100  for (auto const& region : regions) {
101  for (auto const& eleEffTag : eleEffTags_) {
102  //----Morse----
103  ibooker.setCurrentFolder(dirName_ + "/Client_Histos/" + eleHLTFilterName);
104  //--------------
106  eleHLTFilterName, eleHLTFilterName + "_gsfEle_" + eleEffTag, region, eleN1EffVars_, ibooker, igetter);
107 
109  eleHLTFilterName, eleHLTFilterName + "_gsfEle_" + eleEffTag, region, eleSingleEffVars_, ibooker, igetter);
110 
111  createTrigTagProbeEffHistsNewAlgo(eleHLTFilterName, region, eleTrigTPEffVsVars_, "gsfEle", ibooker, igetter);
112 
114  eleHLTFilterName, eleHLTFilterName + "_gsfEle_passFilter", region, eleHLTvOfflineVars_, ibooker, igetter);
115  }
116  }
117  }
118  for (auto& filterNr : eleHLTFilterNames2Leg_) {
119  for (auto const& region : regions) {
120  for (size_t effNr = 0; effNr < eleEffTags_.size(); effNr++) {
121  std::string trigNameLeg1 = filterNr.substr(0, filterNr.find("::"));
122 
123  std::string trigNameLeg2 = filterNr.substr(filterNr.find("::") + 2);
124 
125  ibooker.setCurrentFolder(dirName_ + "/Client_Histos/" + trigNameLeg2);
127  trigNameLeg1, trigNameLeg2, region, eleTrigTPEffVsVars_, "gsfEle", ibooker, igetter);
128  }
129  }
130  }
131 
132  for (auto const& phoHLTFilterName : phoHLTFilterNames_) {
133  for (auto const& region : regions) {
134  for (auto const& phoEffTag : phoEffTags_) {
135  //----Morse----
136  ibooker.setCurrentFolder(dirName_ + "/Client_Histos/" + phoHLTFilterName);
138  phoHLTFilterName, phoHLTFilterName + "_pho_" + phoEffTag, region, phoN1EffVars_, ibooker, igetter);
139 
141  phoHLTFilterName, phoHLTFilterName + "_pho_" + phoEffTag, region, phoSingleEffVars_, ibooker, igetter);
142 
143  createTrigTagProbeEffHistsNewAlgo(phoHLTFilterName, region, phoTrigTPEffVsVars_, "pho", ibooker, igetter);
144 
146  phoHLTFilterName, phoHLTFilterName + "_pho_passFilter", region, phoHLTvOfflineVars_, ibooker, igetter);
147 
148  //--------------
149  }
150  }
151  }
152 
153  for (auto const& region : regions) {
155 
157  eleTightLooseTrigNames_, region, eleLooseTightTrigEffVsVars_, "gsfEle_trigCuts", ibooker, igetter);
158 
160 
162  phoTightLooseTrigNames_, region, phoLooseTightTrigEffVsVars_, "pho_trigCuts", ibooker, igetter);
163  }
164  //----Morse-----
165  ibooker.setCurrentFolder(dirName_);
166  //----------
167 }
void createTrigTagProbeEffHistsNewAlgo(const std::string &filterName, const std::string &region, const std::vector< std::string > &vsVarNames, const std::string &objName, DQMStore::IBooker &, DQMStore::IGetter &)
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::vector< std::string > eleHLTFilterNames_
std::vector< std::string > phoLooseTightTrigEffVsVars_
std::vector< std::string > phoTrigTPEffVsVars_
std::vector< std::string > eleTightLooseTrigNames_
std::vector< std::string > phoN1EffVars_
std::vector< std::string > eleHLTvOfflineVars_
std::vector< std::string > eleTrigTPEffVsVars_
void createSingleEffHists(const std::string &filterName, const std::string &baseName, const std::string &region, const std::vector< std::string > &varNames, DQMStore::IBooker &, DQMStore::IGetter &)
void createLooseTightTrigEff(const std::vector< std::string > &tightLooseTrigNames, const std::string &region, const std::vector< std::string > &vsVarNames, const std::string &objName, DQMStore::IBooker &, DQMStore::IGetter &)
std::vector< std::string > phoEffTags_
std::vector< std::string > phoSingleEffVars_
void createHLTvsOfflineHists(const std::string &filterName, const std::string &baseName, const std::string &region, const std::vector< std::string > &varNames, DQMStore::IBooker &, DQMStore::IGetter &)
void createTrigTagProbeEffHists2Leg(const std::string &filterNameLeg1, const std::string &filterNameLeg2, const std::string &region, const std::vector< std::string > &vsVarNames, const std::string &objName, DQMStore::IBooker &, DQMStore::IGetter &)
std::vector< std::string > eleN1EffVars_
std::vector< std::string > phoTightLooseTrigNames_
std::vector< std::string > phoHLTvOfflineVars_
std::vector< std::string > phoHLTFilterNames_
std::vector< std::string > eleLooseTightTrigEffVsVars_
void createN1EffHists(const std::string &filterName, const std::string &baseName, const std::string &region, const std::vector< std::string > &varNames, DQMStore::IBooker &, DQMStore::IGetter &)
std::vector< std::string > eleEffTags_
std::vector< std::string > eleHLTFilterNames2Leg_
std::vector< std::string > eleSingleEffVars_

Member Data Documentation

◆ dirName_

std::string EgHLTOfflineClient::dirName_
private

◆ eleEffTags_

std::vector<std::string> EgHLTOfflineClient::eleEffTags_
private

Definition at line 47 of file EgHLTOfflineClient.h.

Referenced by EgHLTOfflineClient(), and runClient_().

◆ eleHLTFilterNames2Leg_

std::vector<std::string> EgHLTOfflineClient::eleHLTFilterNames2Leg_
private

Definition at line 39 of file EgHLTOfflineClient.h.

Referenced by beginRun(), EgHLTOfflineClient(), and runClient_().

◆ eleHLTFilterNames_

std::vector<std::string> EgHLTOfflineClient::eleHLTFilterNames_
private

Definition at line 38 of file EgHLTOfflineClient.h.

Referenced by beginRun(), EgHLTOfflineClient(), and runClient_().

◆ eleHLTvOfflineVars_

std::vector<std::string> EgHLTOfflineClient::eleHLTvOfflineVars_
private

Definition at line 58 of file EgHLTOfflineClient.h.

Referenced by EgHLTOfflineClient(), and runClient_().

◆ eleLooseTightTrigEffVsVars_

std::vector<std::string> EgHLTOfflineClient::eleLooseTightTrigEffVsVars_
private

Definition at line 55 of file EgHLTOfflineClient.h.

Referenced by EgHLTOfflineClient(), and runClient_().

◆ eleN1EffVars_

std::vector<std::string> EgHLTOfflineClient::eleN1EffVars_
private

Definition at line 45 of file EgHLTOfflineClient.h.

Referenced by EgHLTOfflineClient(), and runClient_().

◆ eleSingleEffVars_

std::vector<std::string> EgHLTOfflineClient::eleSingleEffVars_
private

Definition at line 46 of file EgHLTOfflineClient.h.

Referenced by EgHLTOfflineClient(), and runClient_().

◆ eleTightLooseTrigNames_

std::vector<std::string> EgHLTOfflineClient::eleTightLooseTrigNames_
private

Definition at line 40 of file EgHLTOfflineClient.h.

Referenced by beginRun(), EgHLTOfflineClient(), and runClient_().

◆ eleTrigTPEffVsVars_

std::vector<std::string> EgHLTOfflineClient::eleTrigTPEffVsVars_
private

Definition at line 53 of file EgHLTOfflineClient.h.

Referenced by EgHLTOfflineClient(), and runClient_().

◆ filterInactiveTriggers_

bool EgHLTOfflineClient::filterInactiveTriggers_
private

Definition at line 65 of file EgHLTOfflineClient.h.

Referenced by beginRun(), and EgHLTOfflineClient().

◆ hltTag_

std::string EgHLTOfflineClient::hltTag_
private

Definition at line 67 of file EgHLTOfflineClient.h.

Referenced by beginRun(), and EgHLTOfflineClient().

◆ isSetup_

bool EgHLTOfflineClient::isSetup_
private

Definition at line 66 of file EgHLTOfflineClient.h.

Referenced by beginRun().

◆ phoEffTags_

std::vector<std::string> EgHLTOfflineClient::phoEffTags_
private

Definition at line 51 of file EgHLTOfflineClient.h.

Referenced by EgHLTOfflineClient(), and runClient_().

◆ phoHLTFilterNames2Leg_

std::vector<std::string> EgHLTOfflineClient::phoHLTFilterNames2Leg_
private

Definition at line 42 of file EgHLTOfflineClient.h.

Referenced by EgHLTOfflineClient().

◆ phoHLTFilterNames_

std::vector<std::string> EgHLTOfflineClient::phoHLTFilterNames_
private

Definition at line 41 of file EgHLTOfflineClient.h.

Referenced by beginRun(), EgHLTOfflineClient(), and runClient_().

◆ phoHLTvOfflineVars_

std::vector<std::string> EgHLTOfflineClient::phoHLTvOfflineVars_
private

Definition at line 59 of file EgHLTOfflineClient.h.

Referenced by EgHLTOfflineClient(), and runClient_().

◆ phoLooseTightTrigEffVsVars_

std::vector<std::string> EgHLTOfflineClient::phoLooseTightTrigEffVsVars_
private

Definition at line 56 of file EgHLTOfflineClient.h.

Referenced by EgHLTOfflineClient(), and runClient_().

◆ phoN1EffVars_

std::vector<std::string> EgHLTOfflineClient::phoN1EffVars_
private

Definition at line 49 of file EgHLTOfflineClient.h.

Referenced by EgHLTOfflineClient(), and runClient_().

◆ phoSingleEffVars_

std::vector<std::string> EgHLTOfflineClient::phoSingleEffVars_
private

Definition at line 50 of file EgHLTOfflineClient.h.

Referenced by EgHLTOfflineClient(), and runClient_().

◆ phoTightLooseTrigNames_

std::vector<std::string> EgHLTOfflineClient::phoTightLooseTrigNames_
private

Definition at line 43 of file EgHLTOfflineClient.h.

Referenced by beginRun(), EgHLTOfflineClient(), and runClient_().

◆ phoTrigTPEffVsVars_

std::vector<std::string> EgHLTOfflineClient::phoTrigTPEffVsVars_
private

Definition at line 54 of file EgHLTOfflineClient.h.

Referenced by EgHLTOfflineClient(), and runClient_().

◆ runClientEndJob_

bool EgHLTOfflineClient::runClientEndJob_
private

Definition at line 63 of file EgHLTOfflineClient.h.

Referenced by dqmEndJob(), and EgHLTOfflineClient().

◆ runClientEndLumiBlock_

bool EgHLTOfflineClient::runClientEndLumiBlock_
private

Definition at line 61 of file EgHLTOfflineClient.h.

Referenced by dqmEndLuminosityBlock(), and EgHLTOfflineClient().

◆ runClientEndRun_

bool EgHLTOfflineClient::runClientEndRun_
private

Definition at line 62 of file EgHLTOfflineClient.h.

Referenced by EgHLTOfflineClient().