CMS 3D CMS Logo

HTDQM.cc
Go to the documentation of this file.
2 
3 HTDQM::HTDQM() = default;
4 
5 HTDQM::~HTDQM() = default;
6 
7 void HTDQM::initialise(const edm::ParameterSet& iConfig) {
9  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("htBinning");
11  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("metBinning2");
12  ht_binning_ =
14  ls_binning_ =
15  getHistoPSet(iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("htlsPSet"));
16 }
17 
19  std::string histname, histtitle;
20 
21  histname = "ht_variable";
22  histtitle = "PFHT";
23  bookME(ibooker, htME_variableBinning_, histname, histtitle, ht_variable_binning_);
24  setMETitle(htME_variableBinning_, "PF HT [GeV]", "events / [GeV]");
25 
26  histname = "htVsMET";
27  histtitle = "PFHT vs PFMET";
28  bookME(ibooker, htVsMET_, histname, histtitle, met_variable_binning_, ht_variable_binning_);
29  setMETitle(htVsMET_, "PF MET [GeV]", "PF HT [GeV]");
30 
31  histname = "htVsLS";
32  histtitle = "PFHT vs LS";
33  bookME(ibooker,
34  htVsLS_,
35  histname,
36  histtitle,
42  setMETitle(htVsLS_, "LS", "PF HT [GeV]");
43 }
44 
45 void HTDQM::fillHistograms(const std::vector<reco::PFJet>& htjets,
46  const double& met,
47  const int& ls,
48  const bool passCond) {
49  // filling histograms (denominator)
50  double htSum = 0;
51  for (auto const& htjet : htjets) {
52  htSum += htjet.pt();
53  }
54 
56 
57  htVsMET_.denominator->Fill(met, htSum);
58  htVsLS_.denominator->Fill(ls, htSum);
59 
60  // applying selection for numerator
61  if (passCond) {
62  // filling histograms (num_genTriggerEventFlag_)
64  htVsMET_.numerator->Fill(met, htSum);
65  htVsLS_.numerator->Fill(ls, htSum);
66  }
67 }
68 
72  histoPSet.add<edm::ParameterSetDescription>("htPSet", htPSet);
73 
74  std::vector<double> bins = {0., 50., 100., 150., 200., 250., 300., 350., 400., 450., 500.,
75  550., 600., 650., 700., 750., 800., 900., 1000., 1200., 1500., 2000.};
76  histoPSet.add<std::vector<double> >("htBinning", bins);
77 
78  std::vector<double> metbins = {0., 20., 40., 60., 80., 100., 120., 140., 160., 180., 200., 220.,
79  240., 260., 280., 300., 320., 340., 360., 380., 400., 450., 500., 1000.};
80  histoPSet.add<std::vector<double> >("metBinning2", metbins);
81 
84  histoPSet.add<edm::ParameterSetDescription>("htlsPSet", lsPSet);
85 }
T getParameter(std::string const &) const
static void fillHistoLSPSetDescription(edm::ParameterSetDescription &pset)
~HTDQM() override
void bookHistograms(DQMStore::IBooker &)
Definition: HTDQM.cc:18
void initialise(const edm::ParameterSet &iConfig)
Definition: HTDQM.cc:7
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
std::vector< double > ht_variable_binning_
Definition: HTDQM.h:22
ObjME htVsLS_
Definition: HTDQM.h:29
void setMETitle(ObjME &me, const std::string &titleX, const std::string &titleY)
MEbinning ht_binning_
Definition: HTDQM.h:24
void Fill(long long x)
static MEbinning getHistoPSet(const edm::ParameterSet &pset)
std::vector< double > met_variable_binning_
Definition: HTDQM.h:23
MonitorElement * denominator
MonitorElement * numerator
static void fillHtDescription(edm::ParameterSetDescription &histoPSet)
Definition: HTDQM.cc:69
ParameterDescriptionBase * add(U const &iLabel, T const &value)
ObjME htVsMET_
Definition: HTDQM.h:28
def ls(path, rec=False)
Definition: eostools.py:349
MEbinning ls_binning_
Definition: HTDQM.h:25
void fillHistograms(const std::vector< reco::PFJet > &htjets, const double &met, const int &ls, const bool passCond)
Definition: HTDQM.cc:45
void bookME(DQMStore::IBooker &, ObjME &me, const std::string &histname, const std::string &histtitle, unsigned nbins, double xmin, double xmax)
ObjME htME_variableBinning_
Definition: HTDQM.h:27