CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
B2GSingleLeptonHLTValidation.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HLTriggerOffline/B2G
4 // Class: B2GSingleLeptonHLTValidation
5 //
13 //
14 // Original Author: Elvire Bouvier
15 // Created: Thu, 16 Jan 2014 16:27:35 GMT
16 //
17 //
18 #ifndef B2GSINGLELEPTONHLTVALIDATION
19 #define B2GSINGLELEPTONHLTVALIDATION
20 
21 // system include files
22 #include <memory>
23 
24 // user include files
27 
30 
34 
37 
43 
44 //
45 // class declaration
46 //
47 
49  public:
52 
53  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
54 
55 
56  private:
57  virtual void analyze(const edm::Event&, const edm::EventSetup&) override;
58  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
61  std::string monitorPath(const std::string& label) const { return label.substr(label.find(':')+1); };
63  void triggerBinLabels(const std::vector<std::string>& labels);
64 
65  // ----------member data ---------------------------
66  // DQM
78  // Electrons
82  double ptElectrons_;
83  double etaElectrons_;
84  double isoElectrons_;
85  unsigned int minElectrons_;
86  // Muons
90  double ptMuons_;
91  double etaMuons_;
92  double isoMuons_;
93  unsigned int minMuons_;
94  // Jets
98  double ptJets_;
99  double ptJets0_;
100  double ptJets1_;
101  double etaJets_;
102  unsigned int minJets_;
103  // Trigger
106  std::vector<std::string> vsPaths_;
107  // Flags
108  bool isAll_ = false;
109  bool isSel_ = false;
110 
111 };
112 
113 inline void B2GSingleLeptonHLTValidation::triggerBinLabels(const std::vector<std::string>& labels)
114 {
115  for(unsigned int idx=0; idx<labels.size(); ++idx){
116  hNumTriggerMon->setBinLabel( idx+1, "["+monitorPath(labels[idx])+"]", 1);
117  hDenTriggerMon->setBinLabel( idx+1, "["+monitorPath(labels[idx])+"]", 1);
118  }
119 }
120 
121 //
122 // constants, enums and typedefs
123 //
124 
125 //
126 // static data member definitions
127 //
128 
129 //
130 // constructors and destructor
131 //
133  sDir_(iConfig.getUntrackedParameter<std::string>("sDir","HLTValidation/B2G/Efficiencies/")),
134  sElectrons_(iConfig.getUntrackedParameter<std::string>("sElectrons","gsfElectrons")),
135  ptElectrons_(iConfig.getUntrackedParameter<double>("ptElectrons",0.)),
136  etaElectrons_(iConfig.getUntrackedParameter<double>("etaElectrons",0.)),
137  isoElectrons_(iConfig.getUntrackedParameter<double>("isoElectrons",0.)),
138  minElectrons_(iConfig.getUntrackedParameter<unsigned int>("minElectrons",0)),
139  sMuons_(iConfig.getUntrackedParameter<std::string>("sMuons","muons")),
140  ptMuons_(iConfig.getUntrackedParameter<double>("ptMuons",0.)),
141  etaMuons_(iConfig.getUntrackedParameter<double>("etaMuons",0.)),
142  isoMuons_(iConfig.getUntrackedParameter<double>("isoMuons",0.)),
143  minMuons_(iConfig.getUntrackedParameter<unsigned int>("minMuons",0)),
144  sJets_(iConfig.getUntrackedParameter<std::string>("sJets","ak5PFJets")),
145  ptJets_(iConfig.getUntrackedParameter<double>("ptJets",0.)),
146  ptJets0_(iConfig.getUntrackedParameter<double>("ptJets0",0.)),
147  ptJets1_(iConfig.getUntrackedParameter<double>("ptJets1",0.)),
148  etaJets_(iConfig.getUntrackedParameter<double>("etaJets",0.)),
149  minJets_(iConfig.getUntrackedParameter<unsigned int>("minJets",0)),
150  sTrigger_(iConfig.getUntrackedParameter<std::string>("sTrigger","TriggerResults")),
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>(edm::InputTag(sTrigger_, "", "HLT"));
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
B2GSingleLeptonHLTValidation(const edm::ParameterSet &)
edm::EDGetTokenT< edm::View< reco::GsfElectron > > tokElectrons_
edm::EDGetTokenT< edm::View< reco::Jet > > tokJets_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
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)
edm::Ptr< reco::GsfElectron > elec_
edm::EDGetTokenT< edm::TriggerResults > tokTrigger_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
std::string monitorPath(const std::string &label) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
void triggerBinLabels(const std::vector< std::string > &labels)
set configurable labels for trigger monitoring histograms
edm::EDGetTokenT< edm::View< reco::Muon > > tokMuons_
Definition: Run.h:43