CMS 3D CMS Logo

TriggerDQMBase.cc
Go to the documentation of this file.
2 
3 void TriggerDQMBase::setMETitle(ObjME& me, const std::string& titleX, const std::string& titleY) {
4  me.numerator->setAxisTitle(titleX, 1);
5  me.numerator->setAxisTitle(titleY, 2);
6  me.denominator->setAxisTitle(titleX, 1);
7  me.denominator->setAxisTitle(titleY, 2);
8 }
9 
11  ObjME& me,
12  const std::string& histname,
13  const std::string& histtitle,
14  unsigned nbins,
15  double min,
16  double max) {
17  me.numerator = ibooker.book1D(histname + "_numerator", histtitle + " (numerator)", nbins, min, max);
18  me.denominator = ibooker.book1D(histname + "_denominator", histtitle + " (denominator)", nbins, min, max);
19 }
21  ObjME& me,
22  const std::string& histname,
23  const std::string& histtitle,
24  const std::vector<double>& binning) {
25  unsigned nbins = binning.size() - 1;
26  std::vector<float> fbinning(binning.begin(), binning.end());
27  float* arr = &fbinning[0];
28  me.numerator = ibooker.book1D(histname + "_numerator", histtitle + " (numerator)", nbins, arr);
29  me.denominator = ibooker.book1D(histname + "_denominator", histtitle + " (denominator)", nbins, arr);
30 }
32  ObjME& me,
33  const std::string& histname,
34  const std::string& histtitle,
35  unsigned nbinsX,
36  double xmin,
37  double xmax,
38  double ymin,
39  double ymax) {
40  me.numerator =
41  ibooker.bookProfile(histname + "_numerator", histtitle + " (numerator)", nbinsX, xmin, xmax, ymin, ymax);
42  me.denominator =
43  ibooker.bookProfile(histname + "_denominator", histtitle + " (denominator)", nbinsX, xmin, xmax, ymin, ymax);
44 }
46  ObjME& me,
47  const std::string& histname,
48  const std::string& histtitle,
49  unsigned nbinsX,
50  double xmin,
51  double xmax,
52  unsigned nbinsY,
53  double ymin,
54  double ymax) {
55  me.numerator =
56  ibooker.book2D(histname + "_numerator", histtitle + " (numerator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
57  me.denominator =
58  ibooker.book2D(histname + "_denominator", histtitle + " (denominator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
59 }
61  ObjME& me,
62  const std::string& histname,
63  const std::string& histtitle,
64  const std::vector<double>& binningX,
65  const std::vector<double>& binningY) {
66  unsigned nbinsX = binningX.size() - 1;
67  std::vector<float> fbinningX(binningX.begin(), binningX.end());
68  float* arrX = &fbinningX[0];
69  unsigned nbinsY = binningY.size() - 1;
70  std::vector<float> fbinningY(binningY.begin(), binningY.end());
71  float* arrY = &fbinningY[0];
72 
73  me.numerator = ibooker.book2D(histname + "_numerator", histtitle + " (numerator)", nbinsX, arrX, nbinsY, arrY);
74  me.denominator = ibooker.book2D(histname + "_denominator", histtitle + " (denominator)", nbinsX, arrX, nbinsY, arrY);
75 }
76 
78  pset.add<unsigned>("nbins");
79  pset.add<double>("xmin");
80  pset.add<double>("xmax");
81 }
82 
84  pset.add<unsigned int>("nbins", 2500);
85  pset.add<double>("xmin", 0.);
86  pset.add<double>("xmax", 2500.);
87 }
88 
91  pset.getParameter<uint32_t>("nbins"),
92  pset.getParameter<double>("xmin"),
93  pset.getParameter<double>("xmax"),
94  };
95 }
96 
99  pset.getParameter<uint32_t>("nbins"), 0., double(pset.getParameter<uint32_t>("nbins"))};
100 }
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
Definition: DQMStore.cc:239
T getParameter(std::string const &) const
static void fillHistoLSPSetDescription(edm::ParameterSetDescription &pset)
static MEbinning getHistoLSPSet(const edm::ParameterSet &pset)
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
void setMETitle(ObjME &me, const std::string &titleX, const std::string &titleY)
static MEbinning getHistoPSet(const edm::ParameterSet &pset)
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
Definition: DQMStore.cc:333
MonitorElement * denominator
MonitorElement * numerator
T min(T a, T b)
Definition: MathUtil.h:58
ParameterDescriptionBase * add(U const &iLabel, T const &value)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Definition: DQMStore.cc:266
void bookME(DQMStore::IBooker &, ObjME &me, const std::string &histname, const std::string &histtitle, unsigned nbins, double xmin, double xmax)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)