CMS 3D CMS Logo

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

#include <TriggerMatchEfficiencyPlotter.h>

Inheritance diagram for TriggerMatchEfficiencyPlotter:
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

 TriggerMatchEfficiencyPlotter (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~TriggerMatchEfficiencyPlotter () override
 Destructor. More...
 
- 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 dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 DQM Client Diagnostic. More...
 
- 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 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<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)
 

Private Attributes

MonitorElementh_eff_Path1_eta_tight
 
MonitorElementh_eff_Path1_phi_tight
 
MonitorElementh_eff_Path1_pt_tight
 
MonitorElementh_eff_Path2_eta_tight
 
MonitorElementh_eff_Path2_phi_tight
 
MonitorElementh_eff_Path2_pt_tight
 
edm::ParameterSet parameters
 
std::string theFolder
 
std::string triggerhistName1_
 
std::string triggerhistName2_
 

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 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 30 of file TriggerMatchEfficiencyPlotter.h.

Constructor & Destructor Documentation

◆ TriggerMatchEfficiencyPlotter()

TriggerMatchEfficiencyPlotter::TriggerMatchEfficiencyPlotter ( const edm::ParameterSet ps)

Constructor.

Definition at line 32 of file TriggerMatchEfficiencyPlotter.cc.

References gather_cfg::cout.

32  {
33 #ifdef DEBUG
34  cout << "TriggerMatchEfficiencyPlotter(): Constructor " << endl;
35 #endif
36  parameters = ps;
37 
38  triggerhistName1_ = parameters.getParameter<string>("triggerhistName1");
39  triggerhistName2_ = parameters.getParameter<string>("triggerhistName2");
40  theFolder = parameters.getParameter<string>("folder");
41 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307

◆ ~TriggerMatchEfficiencyPlotter()

TriggerMatchEfficiencyPlotter::~TriggerMatchEfficiencyPlotter ( )
override

Destructor.

Definition at line 42 of file TriggerMatchEfficiencyPlotter.cc.

42 {}

Member Function Documentation

◆ dqmEndJob()

void TriggerMatchEfficiencyPlotter::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

DQM Client Diagnostic.

— Tight Muon trigger mathcing efficiency

Implements DQMEDHarvester.

Definition at line 44 of file TriggerMatchEfficiencyPlotter.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IGetter::get(), dqm::legacy::MonitorElement::getTH1F(), dqm::implementation::NavigatorBase::setCurrentFolder(), and dqm::impl::MonitorElement::setEfficiencyFlag().

44  {
45  ibooker.setCurrentFolder(theFolder);
46 
47  // efficiency plot
48  h_eff_Path1_eta_tight = ibooker.book1D(
49  "matchingEff_eta_" + triggerhistName1_ + "_tight", triggerhistName1_ + ":matching Eff. vs #eta", 8, -2.5, 2.5);
50  h_eff_Path1_pt_tight = ibooker.book1D(
51  "matchingEff_pt_" + triggerhistName1_ + "_tight", triggerhistName1_ + ":matching Eff. vs pt", 10, 20, 220);
52  h_eff_Path1_phi_tight = ibooker.book1D(
53  "matchingEff_phi_" + triggerhistName1_ + "_tight", triggerhistName1_ + ":matching Eff. vs #phi", 8, -3.0, 3.0);
54  h_eff_Path2_eta_tight = ibooker.book1D(
55  "matchingEff_eta_" + triggerhistName2_ + "_tight", triggerhistName2_ + ":matching Eff. vs #eta", 8, -2.5, 2.5);
56  h_eff_Path2_pt_tight = ibooker.book1D(
57  "matchingEff_pt_" + triggerhistName2_ + "_tight", triggerhistName2_ + ":matching Eff. vs pt", 10, 20, 220);
58  h_eff_Path2_phi_tight = ibooker.book1D(
59  "matchingEff_phi_" + triggerhistName2_ + "_tight", triggerhistName2_ + ":matching Eff. vs #phi", 8, -3.0, 3.0);
60 
61  // This prevents this ME to be normalized when drawn into the GUI
68 
69  // AXIS TITLES....
76 
78  string inputdir = "Muons_miniAOD/TriggerMatchMonitor/EfficiencyInput";
79  string numpath_eta_path1 = inputdir + "/passHLT" + triggerhistName1_ + "_eta_Tight";
80  string denpath_eta_path1 = inputdir + "/totalHLT" + triggerhistName1_ + "_eta_Tight";
81 
82  string numpath_pt_path1 = inputdir + "/passHLT" + triggerhistName1_ + "_pt_Tight";
83  string denpath_pt_path1 = inputdir + "/totalHLT" + triggerhistName1_ + "_pt_Tight";
84 
85  string numpath_phi_path1 = inputdir + "/passHLT" + triggerhistName1_ + "_phi_Tight";
86  string denpath_phi_path1 = inputdir + "/totalHLT" + triggerhistName1_ + "_phi_Tight";
87 
88  string numpath_eta_path2 = inputdir + "/passHLT" + triggerhistName2_ + "_eta_Tight";
89  string denpath_eta_path2 = inputdir + "/totalHLT" + triggerhistName2_ + "_eta_Tight";
90 
91  string numpath_pt_path2 = inputdir + "/passHLT" + triggerhistName2_ + "_pt_Tight";
92  string denpath_pt_path2 = inputdir + "/totalHLT" + triggerhistName2_ + "_pt_Tight";
93 
94  string numpath_phi_path2 = inputdir + "/passHLT" + triggerhistName2_ + "_phi_Tight";
95  string denpath_phi_path2 = inputdir + "/totalHLT" + triggerhistName2_ + "_phi_Tight";
96 
97  MonitorElement *Numerator_eta_path1 = igetter.get(numpath_eta_path1);
98  MonitorElement *Denominator_eta_path1 = igetter.get(denpath_eta_path1);
99 
100  MonitorElement *Numerator_pt_path1 = igetter.get(numpath_pt_path1);
101  MonitorElement *Denominator_pt_path1 = igetter.get(denpath_pt_path1);
102 
103  MonitorElement *Numerator_phi_path1 = igetter.get(numpath_phi_path1);
104  MonitorElement *Denominator_phi_path1 = igetter.get(denpath_phi_path1);
105 
106  MonitorElement *Numerator_eta_path2 = igetter.get(numpath_eta_path2);
107  MonitorElement *Denominator_eta_path2 = igetter.get(denpath_eta_path2);
108 
109  MonitorElement *Numerator_pt_path2 = igetter.get(numpath_pt_path2);
110  MonitorElement *Denominator_pt_path2 = igetter.get(denpath_pt_path2);
111 
112  MonitorElement *Numerator_phi_path2 = igetter.get(numpath_phi_path2);
113  MonitorElement *Denominator_phi_path2 = igetter.get(denpath_phi_path2);
114 
115  if (Numerator_eta_path1 && Denominator_eta_path1) {
116  TH1F *h_numerator_eta_path1 = Numerator_eta_path1->getTH1F();
117  TH1F *h_denominator_eta_path1 = Denominator_eta_path1->getTH1F();
118  TH1F *h_eff_eta_path1 = h_eff_Path1_eta_tight->getTH1F();
119 
120  if (h_eff_eta_path1->GetSumw2N() == 0)
121  h_eff_eta_path1->Sumw2();
122  h_eff_eta_path1->Divide(h_numerator_eta_path1, h_denominator_eta_path1, 1., 1., "B");
123  }
124 
125  if (Numerator_pt_path1 && Denominator_pt_path1) {
126  TH1F *h_numerator_pt_path1 = Numerator_pt_path1->getTH1F();
127  TH1F *h_denominator_pt_path1 = Denominator_pt_path1->getTH1F();
128  TH1F *h_eff_pt_path1 = h_eff_Path1_pt_tight->getTH1F();
129 
130  if (h_eff_pt_path1->GetSumw2N() == 0)
131  h_eff_pt_path1->Sumw2();
132  h_eff_pt_path1->Divide(h_numerator_pt_path1, h_denominator_pt_path1, 1., 1., "B");
133  }
134 
135  if (Numerator_phi_path1 && Denominator_phi_path1) {
136  TH1F *h_numerator_phi_path1 = Numerator_phi_path1->getTH1F();
137  TH1F *h_denominator_phi_path1 = Denominator_phi_path1->getTH1F();
138  TH1F *h_eff_phi_path1 = h_eff_Path1_phi_tight->getTH1F();
139 
140  if (h_eff_phi_path1->GetSumw2N() == 0)
141  h_eff_phi_path1->Sumw2();
142  h_eff_phi_path1->Divide(h_numerator_phi_path1, h_denominator_phi_path1, 1., 1., "B");
143  }
144 
145  //trigger path2
146  if (Numerator_eta_path2 && Denominator_eta_path2) {
147  TH1F *h_numerator_eta_path2 = Numerator_eta_path2->getTH1F();
148  TH1F *h_denominator_eta_path2 = Denominator_eta_path2->getTH1F();
149  TH1F *h_eff_eta_path2 = h_eff_Path2_eta_tight->getTH1F();
150 
151  if (h_eff_eta_path2->GetSumw2N() == 0)
152  h_eff_eta_path2->Sumw2();
153  h_eff_eta_path2->Divide(h_numerator_eta_path2, h_denominator_eta_path2, 1., 1., "B");
154  }
155 
156  if (Numerator_pt_path2 && Denominator_pt_path2) {
157  TH1F *h_numerator_pt_path2 = Numerator_pt_path2->getTH1F();
158  TH1F *h_denominator_pt_path2 = Denominator_pt_path2->getTH1F();
159  TH1F *h_eff_pt_path2 = h_eff_Path2_pt_tight->getTH1F();
160 
161  if (h_eff_pt_path2->GetSumw2N() == 0)
162  h_eff_pt_path2->Sumw2();
163  h_eff_pt_path2->Divide(h_numerator_pt_path2, h_denominator_pt_path2, 1., 1., "B");
164  }
165 
166  if (Numerator_phi_path2 && Denominator_phi_path2) {
167  TH1F *h_numerator_phi_path2 = Numerator_phi_path2->getTH1F();
168  TH1F *h_denominator_phi_path2 = Denominator_phi_path2->getTH1F();
169  TH1F *h_eff_phi_path2 = h_eff_Path2_phi_tight->getTH1F();
170 
171  if (h_eff_phi_path2->GetSumw2N() == 0)
172  h_eff_phi_path2->Sumw2();
173  h_eff_phi_path2->Divide(h_numerator_phi_path2, h_denominator_phi_path2, 1., 1., "B");
174  }
175 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
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
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

Member Data Documentation

◆ h_eff_Path1_eta_tight

MonitorElement* TriggerMatchEfficiencyPlotter::h_eff_Path1_eta_tight
private

Definition at line 49 of file TriggerMatchEfficiencyPlotter.h.

◆ h_eff_Path1_phi_tight

MonitorElement* TriggerMatchEfficiencyPlotter::h_eff_Path1_phi_tight
private

Definition at line 51 of file TriggerMatchEfficiencyPlotter.h.

◆ h_eff_Path1_pt_tight

MonitorElement* TriggerMatchEfficiencyPlotter::h_eff_Path1_pt_tight
private

Definition at line 50 of file TriggerMatchEfficiencyPlotter.h.

◆ h_eff_Path2_eta_tight

MonitorElement* TriggerMatchEfficiencyPlotter::h_eff_Path2_eta_tight
private

Definition at line 53 of file TriggerMatchEfficiencyPlotter.h.

◆ h_eff_Path2_phi_tight

MonitorElement* TriggerMatchEfficiencyPlotter::h_eff_Path2_phi_tight
private

Definition at line 55 of file TriggerMatchEfficiencyPlotter.h.

◆ h_eff_Path2_pt_tight

MonitorElement* TriggerMatchEfficiencyPlotter::h_eff_Path2_pt_tight
private

Definition at line 54 of file TriggerMatchEfficiencyPlotter.h.

◆ parameters

edm::ParameterSet TriggerMatchEfficiencyPlotter::parameters
private

Definition at line 43 of file TriggerMatchEfficiencyPlotter.h.

◆ theFolder

std::string TriggerMatchEfficiencyPlotter::theFolder
private

Definition at line 57 of file TriggerMatchEfficiencyPlotter.h.

◆ triggerhistName1_

std::string TriggerMatchEfficiencyPlotter::triggerhistName1_
private

Definition at line 45 of file TriggerMatchEfficiencyPlotter.h.

◆ triggerhistName2_

std::string TriggerMatchEfficiencyPlotter::triggerhistName2_
private

Definition at line 46 of file TriggerMatchEfficiencyPlotter.h.