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 
28  Container(c._folder, c._name)
29  {
30  _xaxis = c._xaxis->makeCopy();
31  _yaxis = c._yaxis->makeCopy();
32  }
33 
34  /* virtual */ void ContainerSingle1D::initialize(std::string const& folder,
35  std::string const& nametitle,
36  Axis *xaxis, Axis *yaxis, int debug/*=0*/)
37  {
38  Container::initialize(folder, nametitle, debug);
39  _xaxis = xaxis;
40  _yaxis = yaxis;
41  }
42 
45  {
46  ib.setCurrentFolder(subsystem+"/"+_folder+aux);
47  _me = ib.book1D(_name, _name,
49  TObject *o = _me->getRootObject();
50  _xaxis->setLog(o);
51  _yaxis->setLog(o);
52  _xaxis->setBitAxisLS(o);
53  _yaxis->setBitAxisLS(o);
58  for (unsigned int i=0; i<_xaxis->_labels.size(); i++)
59  _me->setBinLabel(i+1, _xaxis->_labels[i], 1);
60  }
61 
62  /* virtual */ void ContainerSingle1D::fill(int x)
63  {
64  _me->Fill(_xaxis->get(x));
65  }
66 
67  /* virtual */ void ContainerSingle1D::fill(double x)
68  {
69  _me->Fill(_xaxis->get(x));
70  }
71 
72  /* virtual */ void ContainerSingle1D::fill(int x, int y)
73  {
74  _me->Fill(_xaxis->get(x), _yaxis->get(y));
75  }
76 
77  /* virtual */ void ContainerSingle1D::fill(int x, double y)
78  {
79  _me->Fill(_xaxis->get(x), _yaxis->get(y));
80  }
81 
82  /* virtual */ void ContainerSingle1D::fill(double x, int y)
83  {
84  _me->Fill(_xaxis->get(x), _yaxis->get(y));
85  }
86 
87  /* virtual */ void ContainerSingle1D::fill(double x, double y)
88  {
89  _me->Fill(_xaxis->get(x), _yaxis->get(y));
90  }
91 
92  /* virtual */ void ContainerSingle1D::fill(HcalDetId const& id)
93  {
94  _me->Fill(_xaxis->get(id));
95  }
96 
97  /* virtual */ void ContainerSingle1D::fill(HcalDetId const& id, double x)
98  {
99  AxisQType xact = _xaxis->getType();
100  if (xact==fCoordinate)
101  _me->Fill(_xaxis->get(id), _yaxis->get(x));
102  else
103  _me->Fill(_xaxis->get(x));
104  }
105 
106  /* virtual */ void ContainerSingle1D::fill(HcalDetId const& id, double x,
107  double y)
108  {
109  AxisQType xact = _xaxis->getType();
110  if (xact==fCoordinate)
111  _me->Fill(_xaxis->get(id), _yaxis->get(x), y);
112  else
113  _me->Fill(_xaxis->get(x), _yaxis->get(y));
114  }
115 
116  /* virtual */ void ContainerSingle1D::fill(HcalElectronicsId const& id)
117  {
118  _me->Fill(_xaxis->get(id));
119  }
120 
121  /* virtual */ void ContainerSingle1D::fill(HcalElectronicsId const& id,
122  double x)
123  {
124  AxisQType xact = _xaxis->getType();
125  if (xact==fCoordinate)
126  _me->Fill(_xaxis->get(id), _yaxis->get(x));
127  else
128  _me->Fill(_xaxis->get(x));
129  }
130 }
131 
132 
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:98
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:72
void Fill(long long x)
std::string _title
Definition: Axis.h:108
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:109
AxisQType getType()
Definition: Axis.h:88
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:89
virtual void setBitAxisLS(TObject *o)
Definition: Axis.h:94
virtual Axis * makeCopy()
Definition: Axis.h:67
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