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 {
5  me.numerator->setAxisTitle(titleX,1);
6  me.numerator->setAxisTitle(titleY,2);
7  me.denominator->setAxisTitle(titleX,1);
8  me.denominator->setAxisTitle(titleY,2);
9 
10 }
11 
12 void TriggerDQMBase::bookME(DQMStore::IBooker &ibooker, ObjME& me, const std::string& histname, const std::string& histtitle, unsigned nbins, double min, double max)
13 {
14  me.numerator = ibooker.book1D(histname+"_numerator", histtitle+" (numerator)", nbins, min, max);
15  me.denominator = ibooker.book1D(histname+"_denominator", histtitle+" (denominator)", nbins, min, max);
16 }
17 void TriggerDQMBase::bookME(DQMStore::IBooker &ibooker, ObjME& me, const std::string& histname, const std::string& histtitle, const std::vector<double>& binning)
18 {
19  unsigned nbins = binning.size()-1;
20  std::vector<float> fbinning(binning.begin(),binning.end());
21  float* arr = &fbinning[0];
22  me.numerator = ibooker.book1D(histname+"_numerator", histtitle+" (numerator)", nbins, arr);
23  me.denominator = ibooker.book1D(histname+"_denominator", histtitle+" (denominator)", nbins, arr);
24 }
25 void TriggerDQMBase::bookME(DQMStore::IBooker &ibooker, ObjME& me, const std::string& histname, const std::string& histtitle, unsigned nbinsX, double xmin, double xmax, double ymin, double ymax)
26 {
27  me.numerator = ibooker.bookProfile(histname+"_numerator", histtitle+" (numerator)", nbinsX, xmin, xmax, ymin, ymax);
28  me.denominator = ibooker.bookProfile(histname+"_denominator", histtitle+" (denominator)", nbinsX, xmin, xmax, ymin, ymax);
29 }
30 void TriggerDQMBase::bookME(DQMStore::IBooker &ibooker, ObjME& me, const std::string& histname, const std::string& histtitle, unsigned nbinsX, double xmin, double xmax, unsigned nbinsY, double ymin, double ymax)
31 {
32  me.numerator = ibooker.book2D(histname+"_numerator", histtitle+" (numerator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
33  me.denominator = ibooker.book2D(histname+"_denominator", histtitle+" (denominator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
34 }
35 void TriggerDQMBase::bookME(DQMStore::IBooker &ibooker, ObjME& me, const std::string& histname, const std::string& histtitle, const std::vector<double>& binningX, const std::vector<double>& binningY)
36 {
37  unsigned nbinsX = binningX.size()-1;
38  std::vector<float> fbinningX(binningX.begin(),binningX.end());
39  float* arrX = &fbinningX[0];
40  unsigned nbinsY = binningY.size()-1;
41  std::vector<float> fbinningY(binningY.begin(),binningY.end());
42  float* arrY = &fbinningY[0];
43 
44  me.numerator = ibooker.book2D(histname+"_numerator", histtitle+" (numerator)", nbinsX, arrX, nbinsY, arrY);
45  me.denominator = ibooker.book2D(histname+"_denominator", histtitle+" (denominator)", nbinsX, arrX, nbinsY, arrY);
46 }
47 
49 {
50  pset.add<unsigned> ( "nbins");
51  pset.add<double>( "xmin" );
52  pset.add<double>( "xmax" );
53 }
54 
56 {
57  pset.add<unsigned int> ( "nbins", 2500 );
58  pset.add<double> ( "xmin", 0.);
59  pset.add<double> ( "xmax", 2500.);
60 }
61 
63 {
65  pset.getParameter<uint32_t>("nbins"),
66  pset.getParameter<double>("xmin"),
67  pset.getParameter<double>("xmax"),
68  };
69 }
70 
72 {
74  pset.getParameter<uint32_t>("nbins"),
75  0.,
76  double(pset.getParameter<uint32_t>("nbins"))
77  };
78 }
T getParameter(std::string const &) const
MonitorElement * numerator
static void fillHistoLSPSetDescription(edm::ParameterSetDescription &pset)
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:160
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 * denominator
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
T min(T a, T b)
Definition: MathUtil.h:58
ParameterDescriptionBase * add(U const &iLabel, T const &value)
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void bookME(DQMStore::IBooker &, ObjME &me, const std::string &histname, const std::string &histtitle, unsigned nbins, double xmin, double xmax)