CMS 3D CMS Logo

B2GDoubleLeptonHLTValidation.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HLTriggerOffline/B2G
4 // Class: B2GDoubleLeptonHLTValidation
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
74  // Electrons
78  double ptElectrons_;
79  double etaElectrons_;
80  double isoElectrons_;
81  unsigned int minElectrons_;
82  // Muons
86  double ptMuons_;
87  double etaMuons_;
88  double isoMuons_;
89  unsigned int minMuons_;
90 
91  //leptons
92  unsigned int minLeptons_;
93 
94  // Trigger
97  std::vector<std::string> vsPaths_;
98  // Flags
99  bool isAll_ = false;
100  bool isSel_ = false;
101 
102 };
103 
104 inline void B2GDoubleLeptonHLTValidation::triggerBinLabels(const std::vector<std::string>& labels)
105 {
106  for(unsigned int idx=0; idx<labels.size(); ++idx){
107  hNumTriggerMon->setBinLabel( idx+1, "["+monitorPath(labels[idx])+"]", 1);
108  hDenTriggerMon->setBinLabel( idx+1, "["+monitorPath(labels[idx])+"]", 1);
109  }
110 }
111 
112 //
113 // constants, enums and typedefs
114 //
115 
116 //
117 // static data member definitions
118 //
119 
120 //
121 // constructors and destructor
122 //
124  sDir_(iConfig.getUntrackedParameter<std::string>("sDir","HLTValidation/B2G/Efficiencies/")),
125  sElectrons_(iConfig.getUntrackedParameter<std::string>("sElectrons","gsfElectrons")),
126  ptElectrons_(iConfig.getUntrackedParameter<double>("ptElectrons",0.)),
127  etaElectrons_(iConfig.getUntrackedParameter<double>("etaElectrons",0.)),
128  isoElectrons_(iConfig.getUntrackedParameter<double>("isoElectrons",0.)),
129  minElectrons_(iConfig.getUntrackedParameter<unsigned int>("minElectrons",0)),
130  sMuons_(iConfig.getUntrackedParameter<std::string>("sMuons","muons")),
131  ptMuons_(iConfig.getUntrackedParameter<double>("ptMuons",0.)),
132  etaMuons_(iConfig.getUntrackedParameter<double>("etaMuons",0.)),
133  isoMuons_(iConfig.getUntrackedParameter<double>("isoMuons",0.)),
134  minMuons_(iConfig.getUntrackedParameter<unsigned int>("minMuons",0)),
135  minLeptons_(iConfig.getUntrackedParameter<unsigned int>("minLeptons",0)),
136  sTrigger_(iConfig.getUntrackedParameter<std::string>("sTrigger","TriggerResults")),
137  vsPaths_(iConfig.getUntrackedParameter< std::vector<std::string> >("vsPaths"))
138 
139 {
140  // Electrons
141  tokElectrons_ = consumes< edm::View<reco::GsfElectron> >(edm::InputTag(sElectrons_));
142  // Muons
143  tokMuons_ = consumes< edm::View<reco::Muon> >(edm::InputTag(sMuons_));
144  // Trigger
145  tokTrigger_ = consumes<edm::TriggerResults>(edm::InputTag(sTrigger_, "", "HLT"));
146 }
147 
148 
150 {
151 
152  // do anything here that needs to be done at desctruction time
153  // (e.g. close files, deallocate resources etc.)
154 
155 }
156 #endif
157 
158 //define this as a plug-in
void triggerBinLabels(const std::vector< std::string > &labels)
set configurable labels for trigger monitoring histograms
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
edm::EDGetTokenT< edm::View< reco::Muon > > tokMuons_
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)
edm::Ptr< reco::GsfElectron > elec_
B2GDoubleLeptonHLTValidation(const edm::ParameterSet &)
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
std::string monitorPath(const std::string &label) const
edm::EDGetTokenT< edm::View< reco::GsfElectron > > tokElectrons_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: Run.h:42