CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ContainerSingle2D.cc
Go to the documentation of this file.
1 
4 
5 namespace hcaldqm
6 {
7  using namespace axis;
8 
10  {
11  _xaxis = NULL;
12  _yaxis = NULL;
13  _zaxis = NULL;
14  }
15 
17  {
18  delete _xaxis; _xaxis=NULL;
19  delete _yaxis; _yaxis=NULL;
20  delete _zaxis; _zaxis=NULL;
21  }
22 
24  std::string const& nametitle,
25  Axis *xaxis, Axis *yaxis, Axis *zaxis):
26  Container(folder, nametitle),
27  _xaxis(xaxis), _yaxis(yaxis), _zaxis(zaxis)
28  {}
29 
30  /* virtual */ void ContainerSingle2D::initialize(std::string const& folder,
31  std::string const& nametitle,
32  Axis *xaxis, Axis *yaxis, Axis *zaxis, int debug/*=0*/)
33  {
34  Container::initialize(folder, nametitle, debug);
35  _xaxis =xaxis;
36  _yaxis = yaxis;
37  _zaxis = zaxis;
38  }
39 
42  {
43  ib.setCurrentFolder(subsystem+"/"+_folder+aux);
44  _me = ib.book2D(_name, _name,
47  TObject *o = _me->getRootObject();
48  _xaxis->setLog(o);
49  _yaxis->setLog(o);
50  _zaxis->setLog(o);
51  _xaxis->setBitAxisLS(o);
52  _yaxis->setBitAxisLS(o);
58  for (unsigned int i=0; i<_xaxis->_labels.size(); i++)
59  _me->setBinLabel(i+1, _xaxis->_labels[i], 1);
60  for (unsigned int i=0; i<_yaxis->_labels.size(); i++)
61  _me->setBinLabel(i+1, _yaxis->_labels[i], 2);
62  }
63 
64  /* virtual */ void ContainerSingle2D::fill(int x, int y)
65  {
66  _me->Fill(_xaxis->get(x), _yaxis->get(y));
67  }
68 
69  /* virtual */ void ContainerSingle2D::fill(int x, double y)
70  {
71  _me->Fill(_xaxis->get(x), _yaxis->get(y));
72  }
73 
74  /* virtual */ void ContainerSingle2D::fill(int x, double y, double z)
75  {
76  _me->Fill(_xaxis->get(x), _yaxis->get(y), z);
77  }
78 
79  /* virtual */ void ContainerSingle2D::fill(double x, int y)
80  {
81  _me->Fill(_xaxis->get(x), _yaxis->get(y));
82  }
83 
84  /* virtual */ void ContainerSingle2D::fill(double x, double y)
85  {
86  _me->Fill(_xaxis->get(x), _yaxis->get(y));
87  }
88 
89  /* virtual */ void ContainerSingle2D::fill(double x, double y, double z)
90  {
91  _me->Fill(_xaxis->get(x), _yaxis->get(y), z);
92  }
93 
94  /* virtual */ void ContainerSingle2D::fill(int x, int y, double z)
95  {
96  _me->Fill(_xaxis->get(x), _yaxis->get(y), z);
97  }
98 
99  /* virtual */ void ContainerSingle2D::fill(int x, int y, int z)
100  {
101  _me->Fill(_xaxis->get(x), _yaxis->get(y), z);
102  }
103 
104  /* virtual */ void ContainerSingle2D::setBinContent(int x, int y, double z)
105  {
106  _me->setBinContent(_xaxis->getBin(x), _yaxis->getBin(y), z);
107  }
108 
109  /* virtual */ void ContainerSingle2D::setBinContent(unsigned int x,
110  int y, double z)
111  {
112  _me->setBinContent(_xaxis->getBin(x), _yaxis->getBin(y), z);
113  }
114 
115  /* virtual */ void ContainerSingle2D::setBinContent(int x, double y, double z)
116  {
117  _me->setBinContent(_xaxis->getBin(x), _yaxis->getBin(y), z);
118  }
119 
120  /* virtual */ void ContainerSingle2D::setBinContent(double x, int y, double z)
121  {
122  _me->setBinContent(_xaxis->getBin(x), _yaxis->getBin(y), z);
123  }
124 
125  /* virtual */ void ContainerSingle2D::setBinContent(double x, double y, double z)
126  {
127  _me->setBinContent(_xaxis->getBin(x), _yaxis->getBin(y), z);
128  }
129 
130  /* virtual */ void ContainerSingle2D::fill(HcalDetId const& id)
131  {
132  _me->Fill(_xaxis->get(id), _yaxis->get(id));
133  }
134 
135  /* virtual */ void ContainerSingle2D::fill(HcalDetId const& id, double x)
136  {
137  AxisQType xact = _xaxis->getType();
138  AxisQType yact = _yaxis->getType();
139  if (xact==fCoordinate && yact==fCoordinate)
140  _me->Fill(_xaxis->get(id), _yaxis->get(id), x);
141  else if (xact==fCoordinate)
142  _me->Fill(_xaxis->get(id), _yaxis->get(x));
143  else if (yact==fCoordinate)
144  _me->Fill(_xaxis->get(x), _yaxis->get(id));
145  }
146 
147  /* virtual */ void ContainerSingle2D::fill(HcalDetId const& id, double x,
148  double y)
149  {
150  AxisQType xact = _xaxis->getType();
151  AxisQType yact = _yaxis->getType();
152  if (xact==fCoordinate && yact!=fCoordinate)
153  _me->Fill(_xaxis->get(id), _yaxis->get(x), y);
154  else if (xact!=fCoordinate && yact==fCoordinate)
155  _me->Fill(_xaxis->get(x), _yaxis->get(id), y);
156  else if (xact!=fCoordinate && yact!=fCoordinate)
157  _me->Fill(_xaxis->get(x), _yaxis->get(y));
158  }
159 
160  /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const& id)
161  {
162  _me->Fill(_xaxis->get(id), _yaxis->get(id));
163  }
164 
165  /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const& id,
166  double x)
167  {
168  AxisQType xact = _xaxis->getType();
169  AxisQType yact = _yaxis->getType();
170  if (xact==fCoordinate && yact==fCoordinate)
171  _me->Fill(_xaxis->get(id), _yaxis->get(id), x);
172  else if (xact==fCoordinate)
173  _me->Fill(_xaxis->get(id), _yaxis->get(x));
174  else if (yact==fCoordinate)
175  _me->Fill(_xaxis->get(x), _yaxis->get(id));
176  }
177 
178  /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const& id,
179  double x, double y)
180  {
181  AxisQType xact = _xaxis->getType();
182  AxisQType yact = _yaxis->getType();
183  if (xact==fCoordinate && yact!=fCoordinate)
184  _me->Fill(_xaxis->get(id), _yaxis->get(x), y);
185  else if (xact!=fCoordinate && yact==fCoordinate)
186  _me->Fill(_xaxis->get(x), _yaxis->get(id), y);
187  else if (xact!=fCoordinate && yact!=fCoordinate)
188  _me->Fill(_xaxis->get(x), _yaxis->get(y));
189  }
190 
191  /* virtual */ void ContainerSingle2D::fill(HcalDetId const& did,
192  HcalElectronicsId const& eid)
193  {
194  _me->Fill(_xaxis->get(did), _yaxis->get(eid));
195  }
196 
197  /* virtual */ void ContainerSingle2D::fill(HcalDetId const& did,
198  HcalElectronicsId const& eid, double x)
199  {
200  _me->Fill(_xaxis->get(did), _yaxis->get(eid), x);
201  }
202 
203  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const& tid)
204  {
205  _me->Fill(_xaxis->get(tid), _yaxis->get(tid));
206  }
207 
208  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const& id,
209  double x)
210  {
211  AxisQType xact = _xaxis->getType();
212  AxisQType yact = _yaxis->getType();
213  if (xact==fCoordinate && yact==fCoordinate)
214  _me->Fill(_xaxis->get(id), _yaxis->get(id), x);
215  else if (xact==fCoordinate)
216  _me->Fill(_xaxis->get(id), _yaxis->get(x));
217  else if (yact==fCoordinate)
218  _me->Fill(_xaxis->get(x), _yaxis->get(id));
219  }
220 
221  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const& id,
222  int x)
223  {
224  AxisQType xact = _xaxis->getType();
225  AxisQType yact = _yaxis->getType();
226  if (xact==fCoordinate && yact==fCoordinate)
227  _me->Fill(_xaxis->get(id), _yaxis->get(id), x);
228  else if (xact==fCoordinate)
229  _me->Fill(_xaxis->get(id), _yaxis->get(x));
230  else if (yact==fCoordinate)
231  _me->Fill(_xaxis->get(x), _yaxis->get(id));
232  }
233 
234  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const& id,
235  int x, int y)
236  {
237  AxisQType xact = _xaxis->getType();
238  AxisQType yact = _yaxis->getType();
239  if (xact==fCoordinate && yact!=fCoordinate)
240  _me->Fill(_xaxis->get(id), _yaxis->get(x), y);
241  else if (xact!=fCoordinate && yact==fCoordinate)
242  _me->Fill(_xaxis->get(x), _yaxis->get(id), y);
243  else if (xact!=fCoordinate && yact!=fCoordinate)
244  _me->Fill(_xaxis->get(x), _yaxis->get(y));
245  }
246 
247  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const& id,
248  int x, double y)
249  {
250  AxisQType xact = _xaxis->getType();
251  AxisQType yact = _yaxis->getType();
252  if (xact==fCoordinate && yact!=fCoordinate)
253  _me->Fill(_xaxis->get(id), _yaxis->get(x), y);
254  else if (xact!=fCoordinate && yact==fCoordinate)
255  _me->Fill(_xaxis->get(x), _yaxis->get(id), y);
256  else if (xact!=fCoordinate && yact!=fCoordinate)
257  _me->Fill(_xaxis->get(x), _yaxis->get(y));
258  }
259 
260  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const& id,
261  double x, double y)
262  {
263  AxisQType xact = _xaxis->getType();
264  AxisQType yact = _yaxis->getType();
265  if (xact==fCoordinate && yact!=fCoordinate)
266  _me->Fill(_xaxis->get(id), _yaxis->get(x), y);
267  else if (xact!=fCoordinate && yact==fCoordinate)
268  _me->Fill(_xaxis->get(x), _yaxis->get(id), y);
269  else if (xact!=fCoordinate && yact!=fCoordinate)
270  _me->Fill(_xaxis->get(x), _yaxis->get(y));
271  }
272 
273  /* virtual */ void ContainerSingle2D::fill(int x,
274  HcalElectronicsId const& eid)
275  {
276  _me->Fill(_xaxis->get(x), _yaxis->get(eid));
277  }
278 
279  /* virtual */ void ContainerSingle2D::fill(int x,
280  HcalElectronicsId const& eid, int z)
281  {
282  _me->Fill(_xaxis->get(x), _yaxis->get(eid), z);
283  }
284 
285  /* virtual */ void ContainerSingle2D::fill(int x,
286  HcalElectronicsId const& eid, double z)
287  {
288  _me->Fill(_xaxis->get(x), _yaxis->get(eid), z);
289  }
290 
291  /* virtual */ void ContainerSingle2D::loadLabels(
292  std::vector<std::string> const& labels)
293  {
294  AxisQType xact = _xaxis->getType();
295  AxisQType yact = _yaxis->getType();
296  if (xact!=fFlag && yact!=fFlag)
297  return;
298  else if (xact!=fFlag)
299  _yaxis->loadLabels(labels);
300  else
301  _xaxis->loadLabels(labels);
302  }
303 
304  /* virtual */ void ContainerSingle2D::reset()
305  {
306  _me->Reset();
307  }
308 }
309 
310 
virtual void initialize(std::string const &folder, std::string const &nametitle, axis::Axis *xaxis, axis::Axis *yaxis=new CoordinateAxis(fYaxis, axis::fiphi), axis::Axis *zaxis=new ValueAxis(fZaxis, fEntries), int debug=0)
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
int ib
Definition: cuy.py:660
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 void setBinContent(int, int, double)
virtual void loadLabels(std::vector< std::string > const &)
virtual int getBin(HcalDetId const &)
Definition: Axis.h:79
virtual int get(HcalDetId const &)
Definition: Axis.h:72
void Fill(long long x)
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
std::string _title
Definition: Axis.h:108
virtual void loadLabels(std::vector< std::string > const &)
Definition: Axis.h:85
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
TObject * getRootObject(void) const
#define debug
Definition: HDRShower.cc:19
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:273
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
void setLog(TObject *o)
Definition: Axis.h:89
virtual void setBitAxisLS(TObject *o)
Definition: Axis.h:94
virtual void fill(int, int)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)
Readout chain identification for Hcal.
std::string _name
Definition: Container.h:43