CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
38 
44 
45 //
46 // class declaration
47 //
48 
50 public:
52  ~B2GHadronicHLTValidation() override;
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
74  // Jets
78  double ptJets_;
79  double ptJets0_;
80  double ptJets1_;
81  double etaJets_;
82  unsigned int minJets_;
83  double htMin_;
84  // Trigger
87  std::vector<std::string> vsPaths_;
88  // Flags
89  bool isAll_ = false;
90  bool isSel_ = false;
91 };
92 
93 inline void B2GHadronicHLTValidation::triggerBinLabels(const std::vector<std::string> &labels) {
94  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
95  hNumTriggerMon->setBinLabel(idx + 1, "[" + monitorPath(labels[idx]) + "]", 1);
96  hDenTriggerMon->setBinLabel(idx + 1, "[" + monitorPath(labels[idx]) + "]", 1);
97  }
98 }
99 
100 //
101 // constants, enums and typedefs
102 //
103 
104 //
105 // static data member definitions
106 //
107 
108 //
109 // constructors and destructor
110 //
112  : sDir_(iConfig.getUntrackedParameter<std::string>("sDir", "HLTValidation/B2G/Efficiencies/")),
113  sJets_(iConfig.getUntrackedParameter<std::string>("sJets", "ak5PFJets")),
114  ptJets_(iConfig.getUntrackedParameter<double>("ptJets", 0.)),
115  ptJets0_(iConfig.getUntrackedParameter<double>("ptJets0", 0.)),
116  ptJets1_(iConfig.getUntrackedParameter<double>("ptJets1", 0.)),
117  etaJets_(iConfig.getUntrackedParameter<double>("etaJets", 0.)),
118  minJets_(iConfig.getUntrackedParameter<unsigned int>("minJets", 0)),
119  htMin_(iConfig.getUntrackedParameter<double>("htMin", 0.0)),
120  sTrigger_(iConfig.getUntrackedParameter<std::string>("sTrigger", "TriggerResults")),
121  vsPaths_(iConfig.getUntrackedParameter<std::vector<std::string>>("vsPaths"))
122 
123 {
124  // Jets
125  tokJets_ = consumes<edm::View<reco::Jet>>(edm::InputTag(sJets_));
126  // Trigger
127  tokTrigger_ = consumes<edm::TriggerResults>(edm::InputTag(sTrigger_, "", "HLT"));
128 }
129 
131  // do anything here that needs to be done at desctruction time
132  // (e.g. close files, deallocate resources etc.)
133 }
134 #endif
135 
136 // define this as a plug-in
B2GHadronicHLTValidation(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
char const * label
void analyze(const edm::Event &, const edm::EventSetup &) override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< edm::TriggerResults > tokTrigger_
void triggerBinLabels(const std::vector< std::string > &labels)
set configurable labels for trigger monitoring histograms
std::string monitorPath(const std::string &label) const
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)
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