CMS 3D CMS Logo

TopSingleLeptonHLTValidation.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HLTriggerOffline/Top
4 // Class: TopSingleLeptonHLTValidation
5 //
15 //
16 // Original Author: Elvire Bouvier
17 // Created: Thu, 16 Jan 2014 16:27:35 GMT
18 //
19 //
20 #ifndef TOPSINGLELEPTONHLTVALIDATION
21 #define TOPSINGLELEPTONHLTVALIDATION
22 
23 // system include files
24 #include <memory>
25 
26 // user include files
29 
32 
36 
39 
45 
46 //
47 // class declaration
48 //
49 
51 public:
54 
55  static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
56 
57 private:
58  void analyze(const edm::Event &, const edm::EventSetup &) override;
59  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
62  std::string monitorPath(const std::string &label) const { return label.substr(label.find(':') + 1); };
64  void triggerBinLabels(const std::vector<std::string> &labels);
65 
66  // ----------member data ---------------------------
67  // DQM
79  // Electrons
83  double ptElectrons_;
84  double etaElectrons_;
85  double isoElectrons_;
86  unsigned int minElectrons_;
87  // Muons
88  const reco::Muon *mu_;
91  double ptMuons_;
92  double etaMuons_;
93  double isoMuons_;
94  unsigned int minMuons_;
95  // Jets
96  const reco::Jet *jet_;
99  double ptJets_;
100  double etaJets_;
101  unsigned int minJets_;
102  // Trigger
105  std::vector<std::string> vsPaths_;
106  // Flags
107  bool isAll_ = false;
108  bool isSel_ = false;
109 };
110 
111 inline void TopSingleLeptonHLTValidation::triggerBinLabels(const std::vector<std::string> &labels) {
112  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
113  hNumTriggerMon->setBinLabel(idx + 1, "[" + monitorPath(labels[idx]) + "]", 1);
114  hDenTriggerMon->setBinLabel(idx + 1, "[" + monitorPath(labels[idx]) + "]", 1);
115  }
116 }
117 
118 //
119 // constants, enums and typedefs
120 //
121 
122 //
123 // static data member definitions
124 //
125 
126 //
127 // constructors and destructor
128 //
130  : sDir_(iConfig.getUntrackedParameter<std::string>("sDir", "HLTValidation/Top/Efficiencies/")),
131  sElectrons_(iConfig.getUntrackedParameter<std::string>("sElectrons", "gsfElectrons")),
132  ptElectrons_(iConfig.getUntrackedParameter<double>("ptElectrons", 0.)),
133  etaElectrons_(iConfig.getUntrackedParameter<double>("etaElectrons", 0.)),
134  isoElectrons_(iConfig.getUntrackedParameter<double>("isoElectrons", 0.)),
135  minElectrons_(iConfig.getUntrackedParameter<unsigned int>("minElectrons", 0)),
136  sMuons_(iConfig.getUntrackedParameter<std::string>("sMuons", "muons")),
137  ptMuons_(iConfig.getUntrackedParameter<double>("ptMuons", 0.)),
138  etaMuons_(iConfig.getUntrackedParameter<double>("etaMuons", 0.)),
139  isoMuons_(iConfig.getUntrackedParameter<double>("isoMuons", 0.)),
140  minMuons_(iConfig.getUntrackedParameter<unsigned int>("minMuons", 0)),
141  sJets_(iConfig.getUntrackedParameter<std::string>("sJets", "ak5PFJets")),
142  ptJets_(iConfig.getUntrackedParameter<double>("ptJets", 0.)),
143  etaJets_(iConfig.getUntrackedParameter<double>("etaJets", 0.)),
144  minJets_(iConfig.getUntrackedParameter<unsigned int>("minJets", 0)),
145  iTrigger_(iConfig.getUntrackedParameter<edm::InputTag>("iTrigger")),
146  vsPaths_(iConfig.getUntrackedParameter<std::vector<std::string>>("vsPaths"))
147 
148 {
149  // Electrons
150  tokElectrons_ = consumes<edm::View<reco::GsfElectron>>(edm::InputTag(sElectrons_));
151  // Muons
152  tokMuons_ = consumes<edm::View<reco::Muon>>(edm::InputTag(sMuons_));
153  // Jets
154  tokJets_ = consumes<edm::View<reco::Jet>>(edm::InputTag(sJets_));
155  // Trigger
156  tokTrigger_ = consumes<edm::TriggerResults>(iTrigger_);
157 }
158 
160  // do anything here that needs to be done at desctruction time
161  // (e.g. close files, deallocate resources etc.)
162 }
163 #endif
164 
165 // define this as a plug-in
Base class for all types of Jets.
Definition: Jet.h:20
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
TopSingleLeptonHLTValidation(const edm::ParameterSet &)
void analyze(const edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< edm::TriggerResults > tokTrigger_
char const * label
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void triggerBinLabels(const std::vector< std::string > &labels)
set configurable labels for trigger monitoring histograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
edm::EDGetTokenT< edm::View< reco::Jet > > tokJets_
edm::EDGetTokenT< edm::View< reco::GsfElectron > > tokElectrons_
HLT enums.
edm::EDGetTokenT< edm::View< reco::Muon > > tokMuons_
std::string monitorPath(const std::string &label) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: Run.h:45