CMS 3D CMS Logo

B2GHadronicHLTValidation.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HLTriggerOffline/B2G
4 // Class: B2GHadronicHLTValidation
5 //
15 //
16 // Original Author: Elvire Bouvier
17 // Created: Thu, 16 Jan 2014 16:27:35 GMT
18 //
19 //
20 #ifndef B2GHADRONICHLTVALIDATION
21 #define B2GHADRONICHLTVALIDATION
22 
23 // system include files
24 #include <memory>
25 
26 // user include files
29 
32 
36 
39 
45 
46 //
47 // class declaration
48 //
49 
51 public:
53  ~B2GHadronicHLTValidation() override;
54 
55  static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
56 
57 private:
58  void analyze(const edm::Event &, const edm::EventSetup &) override;
59  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
62  std::string monitorPath(const std::string &label) const { return label.substr(label.find(':') + 1); };
64  void triggerBinLabels(const std::vector<std::string> &labels);
65 
66  // ----------member data ---------------------------
67  // DQM
75  // Jets
79  double ptJets_;
80  double ptJets0_;
81  double ptJets1_;
82  double etaJets_;
83  unsigned int minJets_;
84  double htMin_;
85  // Trigger
88  std::vector<std::string> vsPaths_;
89  // Flags
90  bool isAll_ = false;
91  bool isSel_ = false;
92 };
93 
94 inline void B2GHadronicHLTValidation::triggerBinLabels(const std::vector<std::string> &labels) {
95  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
96  hNumTriggerMon->setBinLabel(idx + 1, "[" + monitorPath(labels[idx]) + "]", 1);
97  hDenTriggerMon->setBinLabel(idx + 1, "[" + monitorPath(labels[idx]) + "]", 1);
98  }
99 }
100 
101 //
102 // constants, enums and typedefs
103 //
104 
105 //
106 // static data member definitions
107 //
108 
109 //
110 // constructors and destructor
111 //
113  : sDir_(iConfig.getUntrackedParameter<std::string>("sDir", "HLTValidation/B2G/Efficiencies/")),
114  sJets_(iConfig.getUntrackedParameter<std::string>("sJets", "ak5PFJets")),
115  ptJets_(iConfig.getUntrackedParameter<double>("ptJets", 0.)),
116  ptJets0_(iConfig.getUntrackedParameter<double>("ptJets0", 0.)),
117  ptJets1_(iConfig.getUntrackedParameter<double>("ptJets1", 0.)),
118  etaJets_(iConfig.getUntrackedParameter<double>("etaJets", 0.)),
119  minJets_(iConfig.getUntrackedParameter<unsigned int>("minJets", 0)),
120  htMin_(iConfig.getUntrackedParameter<double>("htMin", 0.0)),
121  sTrigger_(iConfig.getUntrackedParameter<std::string>("sTrigger", "TriggerResults")),
122  vsPaths_(iConfig.getUntrackedParameter<std::vector<std::string>>("vsPaths"))
123 
124 {
125  // Jets
126  tokJets_ = consumes<edm::View<reco::Jet>>(edm::InputTag(sJets_));
127  // Trigger
128  tokTrigger_ = consumes<edm::TriggerResults>(edm::InputTag(sTrigger_, "", "HLT"));
129 }
130 
132  // do anything here that needs to be done at desctruction time
133  // (e.g. close files, deallocate resources etc.)
134 }
135 #endif
136 
137 // define this as a plug-in
B2GHadronicHLTValidation(const edm::ParameterSet &)
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
void analyze(const edm::Event &, const edm::EventSetup &) override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< edm::TriggerResults > tokTrigger_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void triggerBinLabels(const std::vector< std::string > &labels)
set configurable labels for trigger monitoring histograms
std::string monitorPath(const std::string &label) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
edm::EDGetTokenT< edm::View< reco::Jet > > tokJets_
std::vector< std::string > vsPaths_
Definition: Run.h:45