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::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources > 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 beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
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
 
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)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 DQM Client Diagnostic. More...
 
- 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 ESProduct , Transition Tr = Transition::Event>
auto esConsumes (eventsetup::EventSetupRecordKey const &, 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 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
 
DQMStoretheDbe
 
std::string theFolder
 
std::string triggerhistName1_
 
std::string triggerhistName2_
 

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

Constructor & Destructor Documentation

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

Constructor.

Definition at line 34 of file TriggerMatchEfficiencyPlotter.cc.

References gather_cfg::cout, and edm::ParameterSet::getParameter().

34  {
35 #ifdef DEBUG
36  cout << "TriggerMatchEfficiencyPlotter(): Constructor " << endl;
37 #endif
38  parameters = ps;
39 
40  triggerhistName1_ = parameters.getParameter<string>("triggerhistName1");
41  triggerhistName2_ = parameters.getParameter<string>("triggerhistName2");
42  theFolder = parameters.getParameter<string>("folder");
43 }
TriggerMatchEfficiencyPlotter::~TriggerMatchEfficiencyPlotter ( )
override

Destructor.

Definition at line 44 of file TriggerMatchEfficiencyPlotter.cc.

44 {}

Member Function Documentation

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

DQM Client Diagnostic.

— Tight Muon trigger mathcing efficiency

Implements DQMEDHarvester.

Definition at line 46 of file TriggerMatchEfficiencyPlotter.cc.

References DQMStore::IBooker::book1D(), DQMStore::IGetter::get(), MonitorElement::getTH1F(), specificLumi::inputdir, DQMStore::IBooker::setCurrentFolder(), and MonitorElement::setEfficiencyFlag().

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

Member Data Documentation

MonitorElement* TriggerMatchEfficiencyPlotter::h_eff_Path1_eta_tight
private

Definition at line 56 of file TriggerMatchEfficiencyPlotter.h.

MonitorElement* TriggerMatchEfficiencyPlotter::h_eff_Path1_phi_tight
private

Definition at line 58 of file TriggerMatchEfficiencyPlotter.h.

MonitorElement* TriggerMatchEfficiencyPlotter::h_eff_Path1_pt_tight
private

Definition at line 57 of file TriggerMatchEfficiencyPlotter.h.

MonitorElement* TriggerMatchEfficiencyPlotter::h_eff_Path2_eta_tight
private

Definition at line 60 of file TriggerMatchEfficiencyPlotter.h.

MonitorElement* TriggerMatchEfficiencyPlotter::h_eff_Path2_phi_tight
private

Definition at line 62 of file TriggerMatchEfficiencyPlotter.h.

MonitorElement* TriggerMatchEfficiencyPlotter::h_eff_Path2_pt_tight
private

Definition at line 61 of file TriggerMatchEfficiencyPlotter.h.

edm::ParameterSet TriggerMatchEfficiencyPlotter::parameters
private
DQMStore* TriggerMatchEfficiencyPlotter::theDbe
private

Definition at line 49 of file TriggerMatchEfficiencyPlotter.h.

std::string TriggerMatchEfficiencyPlotter::theFolder
private

Definition at line 64 of file TriggerMatchEfficiencyPlotter.h.

std::string TriggerMatchEfficiencyPlotter::triggerhistName1_
private

Definition at line 52 of file TriggerMatchEfficiencyPlotter.h.

std::string TriggerMatchEfficiencyPlotter::triggerhistName2_
private

Definition at line 53 of file TriggerMatchEfficiencyPlotter.h.