CMS 3D CMS Logo

TopDiLeptonHLTValidation.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HLTriggerOffline/Top
4 // Class: TopDiLeptonHLTValidation
5 //
18 //
19 // Original Author: Elvire Bouvier
20 // Created: Thu, 16 Jan 2014 16:27:35 GMT
21 //
22 //
23 #ifndef TOPDILEPTONHLTVALIDATION
24 #define TOPDILEPTONHLTVALIDATION
25 
26 // system include files
27 #include <memory>
28 
29 // user include files
32 
35 
39 
42 
48 
49 //
50 // class declaration
51 //
52 
54 public:
56  ~TopDiLeptonHLTValidation() override;
57 
58  static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
59 
60 private:
61  void analyze(const edm::Event &, const edm::EventSetup &) override;
62  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
65  std::string monitorPath(const std::string &label) const { return label.substr(label.find(':') + 1); };
67  void triggerBinLabels(const std::vector<std::string> &labels);
68 
69  // ----------member data ---------------------------
70  // DQM
82  // Electrons
87  double ptElectrons_;
88  double etaElectrons_;
89  double isoElectrons_;
90  unsigned int minElectrons_;
91  // Muons
92  const reco::Muon *mu1_;
93  const reco::Muon *mu2_;
96  double ptMuons_;
97  double etaMuons_;
98  double isoMuons_;
99  unsigned int minMuons_;
100  // Jets
101  const reco::Jet *jet_;
104  double ptJets_;
105  double etaJets_;
106  unsigned int minJets_;
107  // Trigger
110  std::vector<std::string> vsPaths_;
111  // Flags
112  bool isAll_ = false;
113  bool isSel_ = false;
114 };
115 
116 inline void TopDiLeptonHLTValidation::triggerBinLabels(const std::vector<std::string> &labels) {
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 
165  // do anything here that needs to be done at desctruction time
166  // (e.g. close files, deallocate resources etc.)
167 }
168 #endif
169 
170 // 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)
edm::EDGetTokenT< edm::View< reco::GsfElectron > > tokElectrons_
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)
char const * label
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::EDGetTokenT< edm::View< reco::Muon > > tokMuons_
const reco::GsfElectron * elec1_
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
void analyze(const edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< edm::View< reco::Jet > > tokJets_
Definition: Run.h:45