CMS 3D CMS Logo

ContainerSingle2D.cc
Go to the documentation of this file.
3 
4 namespace hcaldqm {
5  using namespace constants;
6  using namespace quantity;
8  _qx = nullptr;
9  _qy = nullptr;
10  _qz = nullptr;
11  }
12 
14  : Container(folder, qz->name() + "vs" + qy->name() + "vs" + qx->name()), _qx(qx), _qy(qy), _qz(qz) {
18  }
19 
21  std::string const &folder, std::string const &qname, Quantity *qx, Quantity *qy, Quantity *qz, int debug /*=0*/)
22  : Container(folder, qname), _qx(qx), _qy(qy), _qz(qz) {
26  }
27 
29  _qx = c._qx->makeCopy();
30  _qy = c._qy->makeCopy();
31  _qz = c._qz->makeCopy();
32  }
33 
35  if (_qx != nullptr)
36  delete _qx;
37  if (_qy != nullptr)
38  delete _qy;
39  if (_qz != nullptr)
40  delete _qz;
41  _qx = nullptr;
42  _qy = nullptr;
43  _qz = nullptr;
44  }
45 
46  /* virtual */ void ContainerSingle2D::initialize(
47  std::string const &folder, Quantity *qx, Quantity *qy, Quantity *qz, int debug /*=0*/) {
48  Container::initialize(folder, qz->name() + "vs" + qy->name() + "vs" + qx->name(), debug);
49  _qx = qx;
50  _qy = qy;
51  _qz = qz;
55  }
56 
57  /* virtual */ void ContainerSingle2D::initialize(
58  std::string const &folder, std::string const &qname, Quantity *qx, Quantity *qy, Quantity *qz, int debug /*=0*/) {
60  _qx = qx;
61  _qy = qy;
62  _qz = qz;
66  }
67 
69  ib.setCurrentFolder(subsystem + "/" + _folder + "/" + _qname);
70  _me = ib.book2D(_qname + (aux.empty() ? aux : "_" + aux),
71  _qname + (aux.empty() ? aux : " " + aux),
72  _qx->nbins(),
73  _qx->min(),
74  _qx->max(),
75  _qy->nbins(),
76  _qy->min(),
77  _qy->max());
78  customize();
79  }
80 
82  _me = ig.get(subsystem + "/" + _folder + "/" + _qname + "/" + _qname + (aux.empty() ? aux : "_" + aux));
83  }
84 
85  /* virtual */ void ContainerSingle2D::customize() {
86  _me->setAxisTitle(_qx->name(), 1);
87  _me->setAxisTitle(_qy->name(), 2);
88  _me->setAxisTitle(_qz->name(), 3);
89 
90  TH1 *h = _me->getTH1();
91  _qx->setBits(h);
92  _qy->setBits(h);
93  _qz->setBits(h);
94 
95  std::vector<std::string> xlabels = _qx->getLabels();
96  std::vector<std::string> ylabels = _qy->getLabels();
97  for (unsigned int i = 0; i < xlabels.size(); i++) {
98  _me->setBinLabel(i + 1, xlabels[i], 1);
99  }
100  for (unsigned int i = 0; i < ylabels.size(); i++) {
101  _me->setBinLabel(i + 1, ylabels[i], 2);
102  }
103  }
104 
105  /* virtual */ void ContainerSingle2D::fill(int x, int y) { _me->Fill(_qx->getValue(x), _qy->getValue(y)); }
106 
107  /* virtual */ void ContainerSingle2D::fill(int x, double y) { _me->Fill(_qx->getValue(x), _qy->getValue(y)); }
108 
109  /* virtual */ void ContainerSingle2D::fill(int x, double y, double z) {
110  _me->Fill(_qx->getValue(x), _qy->getValue(y), z);
111  }
112 
113  /* virtual */ void ContainerSingle2D::fill(double x, int y) { _me->Fill(_qx->getValue(x), _qy->getValue(y)); }
114 
115  /* virtual */ void ContainerSingle2D::fill(double x, double y) { _me->Fill(_qx->getValue(x), _qy->getValue(y)); }
116 
117  /* virtual */ void ContainerSingle2D::fill(double x, double y, double z) {
118  _me->Fill(_qx->getValue(x), _qy->getValue(y), z);
119  }
120 
121  /* virtual */ void ContainerSingle2D::fill(int x, int y, double z) {
122  _me->Fill(_qx->getValue(x), _qy->getValue(y), z);
123  }
124 
125  /* virtual */ void ContainerSingle2D::fill(int x, int y, int z) { _me->Fill(_qx->getValue(x), _qy->getValue(y), z); }
126 
127  /* virtual */ void ContainerSingle2D::fill(HcalDetId const &id) { _me->Fill(_qx->getValue(id), _qy->getValue(id)); }
128 
129  /* virtual */ double ContainerSingle2D::getBinContent(int x, int y) {
130  return _me->getBinContent(_qx->getBin(x), _qy->getBin(y));
131  }
132  /* virtual */ double ContainerSingle2D::getBinContent(int x, double y) {
133  return _me->getBinContent(_qx->getBin(x), _qy->getBin(y));
134  }
135  /* virtual */ double ContainerSingle2D::getBinContent(double x, int y) {
136  return _me->getBinContent(_qx->getBin(x), _qy->getBin(y));
137  }
138  /* virtual */ double ContainerSingle2D::getBinContent(double x, double y) {
139  return _me->getBinContent(_qx->getBin(x), _qy->getBin(y));
140  }
141  /* virtual */ double ContainerSingle2D::getBinEntries(int x, int y) {
142  return _me->getBinEntries(_qx->getBin(x) + _qx->wofnbins() * _qy->getBin(y));
143  }
144  /* virtual */ double ContainerSingle2D::getBinEntries(int x, double y) {
145  return _me->getBinEntries(_qx->getBin(x) + _qx->wofnbins() * _qy->getBin(y));
146  }
147  /* virtual */ double ContainerSingle2D::getBinEntries(double x, int y) {
148  return _me->getBinEntries(_qx->getBin(x) + _qx->wofnbins() * _qy->getBin(y));
149  }
150  /* virtual */ double ContainerSingle2D::getBinEntries(double x, double y) {
151  return _me->getBinEntries(_qx->getBin(x) + _qx->wofnbins() * _qy->getBin(y));
152  }
153 
154  /* virtual */ void ContainerSingle2D::setBinContent(int x, int y, int z) {
155  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
156  }
157  /* virtual */ void ContainerSingle2D::setBinContent(int x, double y, int z) {
158  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
159  }
160  /* virtual */ void ContainerSingle2D::setBinContent(double x, int y, int z) {
161  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
162  }
163  /* virtual */ void ContainerSingle2D::setBinContent(double x, double y, int z) {
164  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
165  }
166  /* virtual */ void ContainerSingle2D::setBinContent(int x, int y, double z) {
167  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
168  }
169  /* virtual */ void ContainerSingle2D::setBinContent(int x, double y, double z) {
170  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
171  }
172  /* virtual */ void ContainerSingle2D::setBinContent(double x, int y, double z) {
173  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
174  }
175  /* virtual */ void ContainerSingle2D::setBinContent(double x, double y, double z) {
176  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
177  }
178 
179  /* virtual */ void ContainerSingle2D::fill(HcalDetId const &id, double x) {
180  if (_qx->isCoordinate() && _qy->isCoordinate())
181  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
182  else if (_qx->isCoordinate())
183  _me->Fill(_qx->getValue(id), _qy->getValue(x));
184  else if (_qy->isCoordinate())
185  _me->Fill(_qx->getValue(x), _qy->getValue(id));
186  }
187 
188  /* virtual */ void ContainerSingle2D::fill(HcalDetId const &id, int x) {
189  if (_qx->isCoordinate() && _qy->isCoordinate())
190  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
191  else if (_qx->isCoordinate())
192  _me->Fill(_qx->getValue(id), _qy->getValue(x));
193  else if (_qy->isCoordinate())
194  _me->Fill(_qx->getValue(x), _qy->getValue(id));
195  }
196 
197  /* virtual */ void ContainerSingle2D::fill(HcalDetId const &id, double x, double y) {
198  if (_qx->isCoordinate() && _qy->isCoordinate())
199  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
200  else if (_qx->isCoordinate() && !_qy->isCoordinate())
201  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
202  else if (!_qx->isCoordinate() && _qy->isCoordinate())
203  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
204  }
205 
206  /* virtual */ void ContainerSingle2D::fill(HcalDetId const &id, int x, int y) {
207  if (_qx->isCoordinate() && _qy->isCoordinate())
208  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
209  else if (_qx->isCoordinate() && !_qy->isCoordinate())
210  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
211  else if (!_qx->isCoordinate() && _qy->isCoordinate())
212  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
213  }
214 
215  /* virtual */ void ContainerSingle2D::fill(HcalDetId const &id, int x, double y) {
216  if (_qx->isCoordinate() && _qy->isCoordinate())
217  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
218  else if (_qx->isCoordinate() && !_qy->isCoordinate())
219  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
220  else if (!_qx->isCoordinate() && _qy->isCoordinate())
221  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
222  }
223 
224  /* virtula */ double ContainerSingle2D::getBinContent(HcalDetId const &id) {
225  return _me->getBinContent(_qx->getBin(id), _qy->getBin(id));
226  }
227  /* virtual */ double ContainerSingle2D::getBinContent(HcalDetId const &id, int x) {
228  if (_qx->isCoordinate())
229  return _me->getBinContent(_qx->getBin(id), _qy->getBin(x));
230  else
231  return _me->getBinContent(_qx->getBin(x), _qy->getBin(id));
232  }
233  /* virtual */ double ContainerSingle2D::getBinContent(HcalDetId const &id, double x) {
234  if (_qx->isCoordinate())
235  return _me->getBinContent(_qx->getBin(id), _qy->getBin(x));
236  else
237  return _me->getBinContent(_qx->getBin(x), _qy->getBin(id));
238  }
239  /* virtula */ double ContainerSingle2D::getBinEntries(HcalDetId const &id) {
240  return _me->getBinEntries(_qx->getBin(id) + _qx->wofnbins() * _qy->getBin(id));
241  }
242  /* virtual */ double ContainerSingle2D::getBinEntries(HcalDetId const &id, int x) {
243  if (_qx->isCoordinate())
244  return _me->getBinEntries(_qx->getBin(id) + _qx->wofnbins() * _qy->getBin(x));
245  else
246  return _me->getBinEntries(_qx->getBin(x) + _qx->wofnbins() * _qy->getBin(id));
247  }
248  /* virtual */ double ContainerSingle2D::getBinEntries(HcalDetId const &id, double x) {
249  if (_qx->isCoordinate())
250  return _me->getBinEntries(_qx->getBin(id) + _qx->wofnbins() * _qy->getBin(x));
251  else
252  return _me->getBinEntries(_qx->getBin(x) + _qx->wofnbins() * _qy->getBin(id));
253  }
254 
255  /* virtual */ void ContainerSingle2D::setBinContent(HcalDetId const &id, int x) {
256  _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
257  }
258  /* virtual */ void ContainerSingle2D::setBinContent(HcalDetId const &id, double x) {
259  _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
260  }
261  /* virtual */ void ContainerSingle2D::setBinContent(HcalDetId const &id, int x, int y) {
262  if (_qx->isCoordinate())
263  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
264  else
265  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
266  }
267  /* virtual */ void ContainerSingle2D::setBinContent(HcalDetId const &id, int x, double y) {
268  if (_qx->isCoordinate())
269  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
270  else
271  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
272  }
273  /* virtual */ void ContainerSingle2D::setBinContent(HcalDetId const &id, double x, int y) {
274  if (_qx->isCoordinate())
275  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
276  else
277  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
278  }
279  /* virtual */ void ContainerSingle2D::setBinContent(HcalDetId const &id, double x, double y) {
280  if (_qx->isCoordinate())
281  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
282  else
283  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
284  }
285 
286  // by ElectronicsId
287  /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const &id) {
288  _me->Fill(_qx->getValue(id), _qy->getValue(id));
289  }
290 
291  /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const &id, double x) {
292  if (_qx->isCoordinate() && _qy->isCoordinate())
293  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
294  else if (_qx->isCoordinate())
295  _me->Fill(_qx->getValue(id), _qy->getValue(x));
296  else if (_qy->isCoordinate())
297  _me->Fill(_qx->getValue(x), _qy->getValue(id));
298  }
299 
300  /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const &id, int x) {
301  if (_qx->isCoordinate() && _qy->isCoordinate())
302  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
303  else if (_qx->isCoordinate())
304  _me->Fill(_qx->getValue(id), _qy->getValue(x));
305  else if (_qy->isCoordinate())
306  _me->Fill(_qx->getValue(x), _qy->getValue(id));
307  }
308 
309  /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const &id, double x, double y) {
310  if (_qx->isCoordinate() && _qy->isCoordinate())
311  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
312  else if (_qx->isCoordinate() && !_qy->isCoordinate())
313  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
314  else if (!_qx->isCoordinate() && _qy->isCoordinate())
315  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
316  }
317 
318  /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const &id, int x, int y) {
319  if (_qx->isCoordinate() && _qy->isCoordinate())
320  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
321  else if (_qx->isCoordinate() && !_qy->isCoordinate())
322  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
323  else if (!_qx->isCoordinate() && _qy->isCoordinate())
324  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
325  }
326 
327  /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const &id, int x, double y) {
328  if (_qx->isCoordinate() && _qy->isCoordinate())
329  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
330  else if (_qx->isCoordinate() && !_qy->isCoordinate())
331  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
332  else if (!_qx->isCoordinate() && _qy->isCoordinate())
333  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
334  }
335 
336  /* virtula */ double ContainerSingle2D::getBinContent(HcalElectronicsId const &id) {
337  return _me->getBinContent(_qx->getBin(id), _qy->getBin(id));
338  }
339  /* virtual */ double ContainerSingle2D::getBinContent(HcalElectronicsId const &id, int x) {
340  if (_qx->isCoordinate())
341  return _me->getBinContent(_qx->getBin(id), _qy->getBin(x));
342  else
343  return _me->getBinContent(_qx->getBin(x), _qy->getBin(id));
344  }
345  /* virtual */ double ContainerSingle2D::getBinContent(HcalElectronicsId const &id, double x) {
346  if (_qx->isCoordinate())
347  return _me->getBinContent(_qx->getBin(id), _qy->getBin(x));
348  else
349  return _me->getBinContent(_qx->getBin(x), _qy->getBin(id));
350  }
351  /* virtula */ double ContainerSingle2D::getBinEntries(HcalElectronicsId const &id) {
352  return _me->getBinEntries(_qx->getBin(id) + _qx->wofnbins() * _qy->getBin(id));
353  }
354  /* virtual */ double ContainerSingle2D::getBinEntries(HcalElectronicsId const &id, int x) {
355  if (_qx->isCoordinate())
356  return _me->getBinEntries(_qx->getBin(id) + _qx->wofnbins() * _qy->getBin(x));
357  else
358  return _me->getBinEntries(_qx->getBin(x) + _qx->wofnbins() * _qy->getBin(id));
359  }
360  /* virtual */ double ContainerSingle2D::getBinEntries(HcalElectronicsId const &id, double x) {
361  if (_qx->isCoordinate())
362  return _me->getBinEntries(_qx->getBin(id) + _qx->wofnbins() * _qy->getBin(x));
363  else
364  return _me->getBinEntries(_qx->getBin(x) + _qx->wofnbins() * _qy->getBin(id));
365  }
366 
367  /* virtual */ void ContainerSingle2D::setBinContent(HcalElectronicsId const &id, int x) {
368  _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
369  }
370  /* virtual */ void ContainerSingle2D::setBinContent(HcalElectronicsId const &id, double x) {
371  _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
372  }
373  /* virtual */ void ContainerSingle2D::setBinContent(HcalElectronicsId const &id, int x, int y) {
374  if (_qx->isCoordinate())
375  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
376  else
377  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
378  }
379  /* virtual */ void ContainerSingle2D::setBinContent(HcalElectronicsId const &id, int x, double y) {
380  if (_qx->isCoordinate())
381  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
382  else
383  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
384  }
385  /* virtual */ void ContainerSingle2D::setBinContent(HcalElectronicsId const &id, double x, int y) {
386  if (_qx->isCoordinate())
387  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
388  else
389  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
390  }
391  /* virtual */ void ContainerSingle2D::setBinContent(HcalElectronicsId const &id, double x, double y) {
392  if (_qx->isCoordinate())
393  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
394  else
395  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
396  }
397 
398  // by TrigTowerDetId
399  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const &id) {
400  _me->Fill(_qx->getValue(id), _qy->getValue(id));
401  }
402 
403  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const &id, double x) {
404  if (_qx->isCoordinate() && _qy->isCoordinate())
405  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
406  else if (_qx->isCoordinate())
407  _me->Fill(_qx->getValue(id), _qy->getValue(x));
408  else if (_qy->isCoordinate())
409  _me->Fill(_qx->getValue(x), _qy->getValue(id));
410  }
411 
412  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const &id, int x) {
413  if (_qx->isCoordinate() && _qy->isCoordinate())
414  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
415  else if (_qx->isCoordinate())
416  _me->Fill(_qx->getValue(id), _qy->getValue(x));
417  else if (_qy->isCoordinate())
418  _me->Fill(_qx->getValue(x), _qy->getValue(id));
419  }
420 
421  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const &id, double x, double y) {
422  if (_qx->isCoordinate() && _qy->isCoordinate())
423  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
424  else if (_qx->isCoordinate() && !_qy->isCoordinate())
425  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
426  else if (!_qx->isCoordinate() && _qy->isCoordinate())
427  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
428  }
429 
430  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const &id, int x, int y) {
431  if (_qx->isCoordinate() && _qy->isCoordinate())
432  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
433  else if (_qx->isCoordinate() && !_qy->isCoordinate())
434  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
435  else if (!_qx->isCoordinate() && _qy->isCoordinate())
436  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
437  }
438 
439  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const &id, int x, double y) {
440  if (_qx->isCoordinate() && _qy->isCoordinate())
441  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
442  else if (_qx->isCoordinate() && !_qy->isCoordinate())
443  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
444  else if (!_qx->isCoordinate() && _qy->isCoordinate())
445  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
446  }
447 
448  /* virtual */ void ContainerSingle2D::fill(HcalDetId const &did, HcalElectronicsId const &eid) {
449  if (_qx->type() == fDetectorQuantity)
450  _me->Fill(_qx->getValue(did), _qy->getValue(eid));
451  else
452  _me->Fill(_qx->getValue(eid), _qy->getValue(did));
453  }
454 
455  /* virtual */ void ContainerSingle2D::fill(HcalDetId const &did, HcalElectronicsId const &eid, double x) {
456  if (_qx->type() == fDetectorQuantity)
457  _me->Fill(_qx->getValue(did), _qy->getValue(eid), x);
458  else
459  _me->Fill(_qx->getValue(eid), _qy->getValue(did), x);
460  }
461 
462  /* virtula */ double ContainerSingle2D::getBinContent(HcalTrigTowerDetId const &id) {
463  return _me->getBinContent(_qx->getBin(id), _qy->getBin(id));
464  }
465  /* virtual */ double ContainerSingle2D::getBinContent(HcalTrigTowerDetId const &id, int x) {
466  if (_qx->isCoordinate())
467  return _me->getBinContent(_qx->getBin(id), _qy->getBin(x));
468  else
469  return _me->getBinContent(_qx->getBin(x), _qy->getBin(id));
470  }
471  /* virtual */ double ContainerSingle2D::getBinContent(HcalTrigTowerDetId const &id, double x) {
472  if (_qx->isCoordinate())
473  return _me->getBinContent(_qx->getBin(id), _qy->getBin(x));
474  else
475  return _me->getBinContent(_qx->getBin(x), _qy->getBin(id));
476  }
477  /* virtula */ double ContainerSingle2D::getBinEntries(HcalTrigTowerDetId const &id) {
478  return _me->getBinEntries(_qx->getBin(id) + _qx->wofnbins() * _qy->getBin(id));
479  }
480  /* virtual */ double ContainerSingle2D::getBinEntries(HcalTrigTowerDetId const &id, int x) {
481  if (_qx->isCoordinate())
482  return _me->getBinEntries(_qx->getBin(id) + _qx->wofnbins() * _qy->getBin(x));
483  else
484  return _me->getBinEntries(_qx->getBin(x) + _qx->wofnbins() * _qy->getBin(id));
485  }
486  /* virtual */ double ContainerSingle2D::getBinEntries(HcalTrigTowerDetId const &id, double x) {
487  if (_qx->isCoordinate())
488  return _me->getBinEntries(_qx->getBin(id) + _qx->wofnbins() * _qy->getBin(x));
489  else
490  return _me->getBinEntries(_qx->getBin(x) + _qx->wofnbins() * _qy->getBin(id));
491  }
492 
493  /* virtual */ void ContainerSingle2D::setBinContent(HcalTrigTowerDetId const &id, int x) {
494  _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
495  }
496  /* virtual */ void ContainerSingle2D::setBinContent(HcalTrigTowerDetId const &id, double x) {
497  _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
498  }
499  /* virtual */ void ContainerSingle2D::setBinContent(HcalTrigTowerDetId const &id, int x, int y) {
500  if (_qx->isCoordinate())
501  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
502  else
503  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
504  }
505  /* virtual */ void ContainerSingle2D::setBinContent(HcalTrigTowerDetId const &id, int x, double y) {
506  if (_qx->isCoordinate())
507  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
508  else
509  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
510  }
511  /* virtual */ void ContainerSingle2D::setBinContent(HcalTrigTowerDetId const &id, double x, int y) {
512  if (_qx->isCoordinate())
513  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
514  else
515  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
516  }
517  /* virtual */ void ContainerSingle2D::setBinContent(HcalTrigTowerDetId const &id, double x, double y) {
518  if (_qx->isCoordinate())
519  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
520  else
521  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
522  }
523 
524  /* virtual */ void ContainerSingle2D::extendAxisRange(int l) {
525  if (l < _qx->nbins())
526  return;
527 
528  int x = _qx->nbins();
529  while (l >= x) {
530  _me->getTH1()->LabelsInflate();
531  x *= 2;
532  _qx->setMax(x);
533  }
534  }
535 
536  void ContainerSingle2D::showOverflowZ(bool showOverflow) { _qz->showOverflow(showOverflow); }
537 } // namespace hcaldqm
virtual void setBits(TH1 *o)
Definition: Quantity.h:51
virtual void initialize(std::string const &folder, std::string const &qname, int debug=0)
Definition: Container.h:30
virtual std::string name()
Definition: Quantity.h:34
virtual void setAxisType(AxisType at)
Definition: Quantity.h:36
virtual double getBinEntries(int bin) const
get # of bin entries (for profiles)
virtual int wofnbins()
Definition: Quantity.h:58
virtual std::vector< std::string > getLabels()
Definition: Quantity.h:62
virtual double getBinEntries(int, int)
virtual double max()
Definition: Quantity.h:60
virtual void setMax(double)
Definition: Quantity.h:64
virtual void initialize(std::string const &folder, quantity::Quantity *, quantity::Quantity *, quantity::Quantity *qz=new quantity::ValueQuantity(quantity::fN), int debug=0)
virtual void extendAxisRange(int)
quantity::Quantity * _qx
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
void Fill(long long x)
quantity::Quantity * _qy
virtual int getValue(HcalDetId const &)
Definition: Quantity.h:45
virtual void setBinContent(int, int, int)
void showOverflowZ(bool showOverflow)
virtual uint32_t getBin(HcalDetId const &)
Definition: Quantity.h:39
virtual 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)
virtual void showOverflow(bool showOverflow)
Definition: Quantity.h:68
std::string _folder
Definition: Container.h:37
#define debug
Definition: HDRShower.cc:19
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
virtual double min()
Definition: Quantity.h:59
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:690
virtual bool isCoordinate()
Definition: Quantity.h:61
virtual TH1 * getTH1() const
std::string _qname
Definition: Container.h:38
virtual QuantityType type()
Definition: Quantity.h:33
float x
virtual double getBinContent(int, int)
virtual void fill(int, int)
virtual void load(DQMStore::IGetter &, std::string subsystem="Hcal", std::string aux="")
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
Readout chain identification for Hcal.
quantity::Quantity * _qz
ib
Definition: cuy.py:661
virtual double getBinContent(int binx) const
get content of bin (1-D)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)