CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ContainerSingle1D.cc
Go to the documentation of this file.
1 
3 
4 namespace hcaldqm
5 {
6  using namespace axis;
7 
9  {
10  _xaxis = NULL;
11  _yaxis = NULL;
12  }
13 
15  {
16  delete _xaxis; _xaxis=NULL;
17  delete _yaxis; _yaxis=NULL;
18  }
19 
21  std::string const& nametitle,
22  Axis *xaxis, Axis *yaxis):
23  Container(folder, nametitle),
24  _xaxis(xaxis), _yaxis(yaxis)
25  {}
26 
27  /* virtual */ void ContainerSingle1D::initialize(std::string const& folder,
28  std::string const& nametitle,
29  Axis *xaxis, Axis *yaxis, int debug/*=0*/)
30  {
31  Container::initialize(folder, nametitle, debug);
32  _xaxis = xaxis;
33  _yaxis = yaxis;
34  }
35 
38  {
39  ib.setCurrentFolder(subsystem+"/"+_folder+aux);
40  _me = ib.book1D(_name, _name,
42  TObject *o = _me->getRootObject();
43  _xaxis->setLog(o);
44  _yaxis->setLog(o);
45  _xaxis->setBitAxisLS(o);
46  _yaxis->setBitAxisLS(o);
51  for (unsigned int i=0; i<_xaxis->_labels.size(); i++)
52  _me->setBinLabel(i+1, _xaxis->_labels[i], 1);
53  }
54 
55  /* virtual */ void ContainerSingle1D::fill(int x)
56  {
57  _me->Fill(_xaxis->get(x));
58  }
59 
60  /* virtual */ void ContainerSingle1D::fill(double x)
61  {
62  _me->Fill(_xaxis->get(x));
63  }
64 
65  /* virtual */ void ContainerSingle1D::fill(int x, int y)
66  {
67  _me->Fill(_xaxis->get(x), _yaxis->get(y));
68  }
69 
70  /* virtual */ void ContainerSingle1D::fill(int x, double y)
71  {
72  _me->Fill(_xaxis->get(x), _yaxis->get(y));
73  }
74 
75  /* virtual */ void ContainerSingle1D::fill(double x, int y)
76  {
77  _me->Fill(_xaxis->get(x), _yaxis->get(y));
78  }
79 
80  /* virtual */ void ContainerSingle1D::fill(double x, double y)
81  {
82  _me->Fill(_xaxis->get(x), _yaxis->get(y));
83  }
84 
85  /* virtual */ void ContainerSingle1D::fill(HcalDetId const& id)
86  {
87  _me->Fill(_xaxis->get(id));
88  }
89 
90  /* virtual */ void ContainerSingle1D::fill(HcalDetId const& id, double x)
91  {
92  AxisQType xact = _xaxis->getType();
93  if (xact==fCoordinate)
94  _me->Fill(_xaxis->get(id), _yaxis->get(x));
95  else
96  _me->Fill(_xaxis->get(x));
97  }
98 
99  /* virtual */ void ContainerSingle1D::fill(HcalDetId const& id, double x,
100  double y)
101  {
102  AxisQType xact = _xaxis->getType();
103  if (xact==fCoordinate)
104  _me->Fill(_xaxis->get(id), _yaxis->get(x), y);
105  else
106  _me->Fill(_xaxis->get(x), _yaxis->get(y));
107  }
108 
109  /* virtual */ void ContainerSingle1D::fill(HcalElectronicsId const& id)
110  {
111  _me->Fill(_xaxis->get(id));
112  }
113 
114  /* virtual */ void ContainerSingle1D::fill(HcalElectronicsId const& id,
115  double x)
116  {
117  AxisQType xact = _xaxis->getType();
118  if (xact==fCoordinate)
119  _me->Fill(_xaxis->get(id), _yaxis->get(x));
120  else
121  _me->Fill(_xaxis->get(x));
122  }
123 }
124 
125 
int i
Definition: DBlmapReader.cc:9
int ib
Definition: cuy.py:660
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
virtual void setBitAxisFlag(TObject *o)
Definition: Axis.h:95
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)
#define NULL
Definition: scimark2.h:8
virtual int get(HcalDetId const &)
Definition: Axis.h:69
void Fill(long long x)
std::string _title
Definition: Axis.h:105
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
virtual void initialize(std::string const &folder, std::string const &name, int debug=0)
Definition: Container.h:33
std::vector< std::string > _labels
Definition: Axis.h:106
AxisQType getType()
Definition: Axis.h:85
std::string _folder
Definition: Container.h:42
virtual void initialize(std::string const &folder, std::string const &nametitle, axis::Axis *xaxis, axis::Axis *yaxis=new ValueAxis(fYaxis, axis::fEntries), int debug=0)
TObject * getRootObject(void) const
#define debug
Definition: HDRShower.cc:19
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:273
void setLog(TObject *o)
Definition: Axis.h:86
virtual void setBitAxisLS(TObject *o)
Definition: Axis.h:91
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Readout chain identification for Hcal.
std::string _name
Definition: Container.h:43