CMS 3D CMS Logo

B2GSingleLeptonHLTValidation.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HLTriggerOffline/B2G
4 // Class: B2GSingleLeptonHLTValidation
5 //
15 //
16 // Original Author: Elvire Bouvier
17 // Created: Thu, 16 Jan 2014 16:27:35 GMT
18 //
19 //
20 #ifndef B2GSINGLELEPTONHLTVALIDATION
21 #define B2GSINGLELEPTONHLTVALIDATION
22 
23 // system include files
24 #include <memory>
25 
26 // user include files
29 
32 
36 
38 
44 
45 //
46 // class declaration
47 //
48 
50 public:
53 
54  static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
55 
56 private:
57  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 inline void B2GSingleLeptonHLTValidation::triggerBinLabels(const std::vector<std::string> &labels) {
113  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
114  hNumTriggerMon->setBinLabel(idx + 1, "[" + monitorPath(labels[idx]) + "]", 1);
115  hDenTriggerMon->setBinLabel(idx + 1, "[" + monitorPath(labels[idx]) + "]", 1);
116  }
117 }
118 
119 //
120 // constants, enums and typedefs
121 //
122 
123 //
124 // static data member definitions
125 //
126 
127 //
128 // constructors and destructor
129 //
131  : sDir_(iConfig.getUntrackedParameter<std::string>("sDir", "HLTValidation/B2G/Efficiencies/")),
132  sElectrons_(iConfig.getUntrackedParameter<std::string>("sElectrons", "gsfElectrons")),
133  ptElectrons_(iConfig.getUntrackedParameter<double>("ptElectrons", 0.)),
134  etaElectrons_(iConfig.getUntrackedParameter<double>("etaElectrons", 0.)),
135  isoElectrons_(iConfig.getUntrackedParameter<double>("isoElectrons", 0.)),
136  minElectrons_(iConfig.getUntrackedParameter<unsigned int>("minElectrons", 0)),
137  sMuons_(iConfig.getUntrackedParameter<std::string>("sMuons", "muons")),
138  ptMuons_(iConfig.getUntrackedParameter<double>("ptMuons", 0.)),
139  etaMuons_(iConfig.getUntrackedParameter<double>("etaMuons", 0.)),
140  isoMuons_(iConfig.getUntrackedParameter<double>("isoMuons", 0.)),
141  minMuons_(iConfig.getUntrackedParameter<unsigned int>("minMuons", 0)),
142  sJets_(iConfig.getUntrackedParameter<std::string>("sJets", "ak5PFJets")),
143  ptJets_(iConfig.getUntrackedParameter<double>("ptJets", 0.)),
144  ptJets0_(iConfig.getUntrackedParameter<double>("ptJets0", 0.)),
145  ptJets1_(iConfig.getUntrackedParameter<double>("ptJets1", 0.)),
146  etaJets_(iConfig.getUntrackedParameter<double>("etaJets", 0.)),
147  minJets_(iConfig.getUntrackedParameter<unsigned int>("minJets", 0)),
148  sTrigger_(iConfig.getUntrackedParameter<std::string>("sTrigger", "TriggerResults")),
149  vsPaths_(iConfig.getUntrackedParameter<std::vector<std::string>>("vsPaths"))
150 
151 {
152  // Electrons
153  tokElectrons_ = consumes<edm::View<reco::GsfElectron>>(edm::InputTag(sElectrons_));
154  // Muons
155  tokMuons_ = consumes<edm::View<reco::Muon>>(edm::InputTag(sMuons_));
156  // Jets
157  tokJets_ = consumes<edm::View<reco::Jet>>(edm::InputTag(sJets_));
158  // Trigger
159  tokTrigger_ = consumes<edm::TriggerResults>(edm::InputTag(sTrigger_, "", "HLT"));
160 }
161 
163  // do anything here that needs to be done at desctruction time
164  // (e.g. close files, deallocate resources etc.)
165 }
166 #endif
167 
168 // define this as a plug-in
SummaryClient_cfi.labels
labels
Definition: SummaryClient_cfi.py:61
B2GSingleLeptonHLTValidation::isoMuons_
double isoMuons_
Definition: B2GSingleLeptonHLTValidation.h:92
B2GSingleLeptonHLTValidation::hNumJetPt
MonitorElement * hNumJetPt
Definition: B2GSingleLeptonHLTValidation.h:72
Muon.h
MessageLogger.h
B2GSingleLeptonHLTValidation::isSel_
bool isSel_
Definition: B2GSingleLeptonHLTValidation.h:109
B2GSingleLeptonHLTValidation::ptJets0_
double ptJets0_
Definition: B2GSingleLeptonHLTValidation.h:99
TriggerResults.h
B2GSingleLeptonHLTValidation::hNumTriggerMon
MonitorElement * hNumTriggerMon
Definition: B2GSingleLeptonHLTValidation.h:76
B2GSingleLeptonHLTValidation::hDenJetEta
MonitorElement * hDenJetEta
Definition: B2GSingleLeptonHLTValidation.h:75
edm::Run
Definition: Run.h:45
edm::EDGetTokenT
Definition: EDGetToken.h:33
B2GSingleLeptonHLTValidation::monitorPath
std::string monitorPath(const std::string &label) const
Definition: B2GSingleLeptonHLTValidation.h:61
B2GSingleLeptonHLTValidation::tokElectrons_
edm::EDGetTokenT< edm::View< reco::GsfElectron > > tokElectrons_
Definition: B2GSingleLeptonHLTValidation.h:81
charmTagsComputerCvsB_cfi.idx
idx
Definition: charmTagsComputerCvsB_cfi.py:108
DQMStore.h
B2GSingleLeptonHLTValidation::triggerBinLabels
void triggerBinLabels(const std::vector< std::string > &labels)
set configurable labels for trigger monitoring histograms
Definition: B2GSingleLeptonHLTValidation.h:112
Jet.h
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
B2GSingleLeptonHLTValidation::ptJets_
double ptJets_
Definition: B2GSingleLeptonHLTValidation.h:98
B2GSingleLeptonHLTValidation::hDenLeptonEta
MonitorElement * hDenLeptonEta
Definition: B2GSingleLeptonHLTValidation.h:71
B2GSingleLeptonHLTValidation::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: B2GSingleLeptonHLTValidation.cc:46
B2GSingleLeptonHLTValidation::vsPaths_
std::vector< std::string > vsPaths_
Definition: B2GSingleLeptonHLTValidation.h:106
B2GSingleLeptonHLTValidation::hDenJetPt
MonitorElement * hDenJetPt
Definition: B2GSingleLeptonHLTValidation.h:73
B2GSingleLeptonHLTValidation::hNumLeptonPt
MonitorElement * hNumLeptonPt
Definition: B2GSingleLeptonHLTValidation.h:68
B2GSingleLeptonHLTValidation::jet_
edm::Ptr< reco::Jet > jet_
Definition: B2GSingleLeptonHLTValidation.h:95
MakerMacros.h
B2GSingleLeptonHLTValidation::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: B2GSingleLeptonHLTValidation.cc:183
B2GSingleLeptonHLTValidation::~B2GSingleLeptonHLTValidation
~B2GSingleLeptonHLTValidation() override
Definition: B2GSingleLeptonHLTValidation.h:162
B2GSingleLeptonHLTValidation::sDir_
std::string sDir_
Definition: B2GSingleLeptonHLTValidation.h:67
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Service.h
B2GSingleLeptonHLTValidation::minElectrons_
unsigned int minElectrons_
Definition: B2GSingleLeptonHLTValidation.h:85
B2GSingleLeptonHLTValidation::etaMuons_
double etaMuons_
Definition: B2GSingleLeptonHLTValidation.h:91
GsfElectron.h
B2GSingleLeptonHLTValidation::sJets_
std::string sJets_
Definition: B2GSingleLeptonHLTValidation.h:96
B2GSingleLeptonHLTValidation::isAll_
bool isAll_
Definition: B2GSingleLeptonHLTValidation.h:108
B2GSingleLeptonHLTValidation::isoElectrons_
double isoElectrons_
Definition: B2GSingleLeptonHLTValidation.h:84
B2GSingleLeptonHLTValidation::minJets_
unsigned int minJets_
Definition: B2GSingleLeptonHLTValidation.h:102
DQMEDAnalyzer.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
B2GSingleLeptonHLTValidation::hNumLeptonEta
MonitorElement * hNumLeptonEta
Definition: B2GSingleLeptonHLTValidation.h:70
DQMEDAnalyzer
Definition: DQMEDAnalyzer.py:1
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
B2GSingleLeptonHLTValidation::sTrigger_
std::string sTrigger_
Definition: B2GSingleLeptonHLTValidation.h:104
Event.h
B2GSingleLeptonHLTValidation::hDenTriggerMon
MonitorElement * hDenTriggerMon
Definition: B2GSingleLeptonHLTValidation.h:77
B2GSingleLeptonHLTValidation::tokJets_
edm::EDGetTokenT< edm::View< reco::Jet > > tokJets_
Definition: B2GSingleLeptonHLTValidation.h:97
createfilelist.int
int
Definition: createfilelist.py:10
B2GSingleLeptonHLTValidation::hNumJetEta
MonitorElement * hNumJetEta
Definition: B2GSingleLeptonHLTValidation.h:74
dqm::impl::MonitorElement::setBinLabel
virtual 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)
Definition: MonitorElement.cc:771
B2GSingleLeptonHLTValidation::etaElectrons_
double etaElectrons_
Definition: B2GSingleLeptonHLTValidation.h:83
B2GSingleLeptonHLTValidation::B2GSingleLeptonHLTValidation
B2GSingleLeptonHLTValidation(const edm::ParameterSet &)
Definition: B2GSingleLeptonHLTValidation.h:130
edm::EventSetup
Definition: EventSetup.h:57
B2GSingleLeptonHLTValidation::ptElectrons_
double ptElectrons_
Definition: B2GSingleLeptonHLTValidation.h:82
HLTConfigProvider.h
B2GSingleLeptonHLTValidation::tokMuons_
edm::EDGetTokenT< edm::View< reco::Muon > > tokMuons_
Definition: B2GSingleLeptonHLTValidation.h:89
B2GSingleLeptonHLTValidation::ptMuons_
double ptMuons_
Definition: B2GSingleLeptonHLTValidation.h:90
B2GSingleLeptonHLTValidation::mu_
edm::Ptr< reco::Muon > mu_
Definition: B2GSingleLeptonHLTValidation.h:87
edm::Ptr< reco::GsfElectron >
std
Definition: JetResolutionObject.h:76
B2GSingleLeptonHLTValidation::tokTrigger_
edm::EDGetTokenT< edm::TriggerResults > tokTrigger_
Definition: B2GSingleLeptonHLTValidation.h:105
B2GSingleLeptonHLTValidation::hDenLeptonPt
MonitorElement * hDenLeptonPt
Definition: B2GSingleLeptonHLTValidation.h:69
B2GSingleLeptonHLTValidation::ptJets1_
double ptJets1_
Definition: B2GSingleLeptonHLTValidation.h:100
Frameworkfwd.h
B2GSingleLeptonHLTValidation::sMuons_
std::string sMuons_
Definition: B2GSingleLeptonHLTValidation.h:88
B2GSingleLeptonHLTValidation::elec_
edm::Ptr< reco::GsfElectron > elec_
Definition: B2GSingleLeptonHLTValidation.h:79
dqm::implementation::IBooker
Definition: DQMStore.h:43
B2GSingleLeptonHLTValidation::sElectrons_
std::string sElectrons_
Definition: B2GSingleLeptonHLTValidation.h:80
B2GSingleLeptonHLTValidation
Definition: B2GSingleLeptonHLTValidation.h:49
ParameterSet.h
B2GSingleLeptonHLTValidation::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: B2GSingleLeptonHLTValidation.cc:204
B2GSingleLeptonHLTValidation::minMuons_
unsigned int minMuons_
Definition: B2GSingleLeptonHLTValidation.h:93
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
label
const char * label
Definition: PFTauDecayModeTools.cc:11
B2GSingleLeptonHLTValidation::etaJets_
double etaJets_
Definition: B2GSingleLeptonHLTValidation.h:101