CMS 3D CMS Logo

TopDiLeptonHLTValidation.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HLTriggerOffline/Top
4 // Class: TopDiLeptonHLTValidation
5 //
16 //
17 // Original Author: Elvire Bouvier
18 // Created: Thu, 16 Jan 2014 16:27:35 GMT
19 //
20 //
21 #ifndef TOPDILEPTONHLTVALIDATION
22 #define TOPDILEPTONHLTVALIDATION
23 
24 // system include files
25 #include <memory>
26 
27 // user include files
30 
33 
37 
40 
46 
47 //
48 // class declaration
49 //
50 
52  public:
54  ~TopDiLeptonHLTValidation() override;
55 
56  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
57 
58 
59  private:
60  void analyze(const edm::Event&, const edm::EventSetup&) override;
61  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
64  std::string monitorPath(const std::string& label) const { return label.substr(label.find(':')+1); };
66  void triggerBinLabels(const std::vector<std::string>& labels);
67 
68  // ----------member data ---------------------------
69  // DQM
81  // Electrons
86  double ptElectrons_;
87  double etaElectrons_;
88  double isoElectrons_;
89  unsigned int minElectrons_;
90  // Muons
91  const reco::Muon *mu1_;
92  const reco::Muon *mu2_;
95  double ptMuons_;
96  double etaMuons_;
97  double isoMuons_;
98  unsigned int minMuons_;
99  // Jets
100  const reco::Jet *jet_;
103  double ptJets_;
104  double etaJets_;
105  unsigned int minJets_;
106  // Trigger
109  std::vector<std::string> vsPaths_;
110  // Flags
111  bool isAll_ = false;
112  bool isSel_ = false;
113 };
114 
115 inline void TopDiLeptonHLTValidation::triggerBinLabels(const std::vector<std::string>& labels)
116 {
117  for(unsigned int idx=0; idx<labels.size(); ++idx){
118  hNumTriggerMon->setBinLabel( idx+1, "["+monitorPath(labels[idx])+"]", 1);
119  hDenTriggerMon->setBinLabel( idx+1, "["+monitorPath(labels[idx])+"]", 1);
120  }
121 }
122 
123 //
124 // constants, enums and typedefs
125 //
126 
127 //
128 // static data member definitions
129 //
130 
131 //
132 // constructors and destructor
133 //
135  sDir_(iConfig.getUntrackedParameter<std::string>("sDir","Validation/Top/Efficiencies/")),
136  sElectrons_(iConfig.getUntrackedParameter<std::string>("sElectrons","gsfElectrons")),
137  ptElectrons_(iConfig.getUntrackedParameter<double>("ptElectrons",0.)),
138  etaElectrons_(iConfig.getUntrackedParameter<double>("etaElectrons",0.)),
139  isoElectrons_(iConfig.getUntrackedParameter<double>("isoElectrons",0.)),
140  minElectrons_(iConfig.getUntrackedParameter<unsigned int>("minElectrons",0)),
141  sMuons_(iConfig.getUntrackedParameter<std::string>("sMuons","muons")),
142  ptMuons_(iConfig.getUntrackedParameter<double>("ptMuons",0.)),
143  etaMuons_(iConfig.getUntrackedParameter<double>("etaMuons",0.)),
144  isoMuons_(iConfig.getUntrackedParameter<double>("isoMuons",0.)),
145  minMuons_(iConfig.getUntrackedParameter<unsigned int>("minMuons",0)),
146  sJets_(iConfig.getUntrackedParameter<std::string>("sJets","ak5PFJets")),
147  ptJets_(iConfig.getUntrackedParameter<double>("ptJets",0.)),
148  etaJets_(iConfig.getUntrackedParameter<double>("etaJets",0.)),
149  minJets_(iConfig.getUntrackedParameter<unsigned int>("minJets",0)),
150  iTrigger_(iConfig.getUntrackedParameter<edm::InputTag>("iTrigger")),
151  vsPaths_(iConfig.getUntrackedParameter< std::vector<std::string> >("vsPaths"))
152 
153 {
154  // Electrons
155  tokElectrons_ = consumes< edm::View<reco::GsfElectron> >(edm::InputTag(sElectrons_));
156  // Muons
157  tokMuons_ = consumes< edm::View<reco::Muon> >(edm::InputTag(sMuons_));
158  // Jets
159  tokJets_ = consumes< edm::View<reco::Jet> >(edm::InputTag(sJets_));
160  // Trigger
161  tokTrigger_ = consumes<edm::TriggerResults>(iTrigger_);
162 }
163 
164 
166 {
167 
168  // do anything here that needs to be done at desctruction time
169  // (e.g. close files, deallocate resources etc.)
170 
171 }
172 #endif
173 
174 //define this as a plug-in
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
TopDiLeptonHLTValidation(const edm::ParameterSet &)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
Base class for all types of Jets.
Definition: Jet.h:20
const reco::GsfElectron * elec2_
edm::EDGetTokenT< edm::TriggerResults > tokTrigger_
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)
const reco::GsfElectron * elec1_
edm::EDGetTokenT< edm::View< reco::Jet > > tokJets_
edm::EDGetTokenT< edm::View< reco::Muon > > tokMuons_
std::string monitorPath(const std::string &label) const
HLT enums.
std::vector< std::string > vsPaths_
void triggerBinLabels(const std::vector< std::string > &labels)
set configurable labels for trigger monitoring histograms
edm::EDGetTokenT< edm::View< reco::GsfElectron > > tokElectrons_
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: Run.h:43