CMS 3D CMS Logo

ContainerSingle2D.cc
Go to the documentation of this file.
3 
4 namespace hcaldqm
5 {
6  using namespace constants;
7  using namespace quantity;
9  {
10  _qx = nullptr;
11  _qy = nullptr;
12  _qz = nullptr;
13  }
14 
16  Quantity *qx, Quantity *qy, Quantity *qz):
17  Container(folder, qz->name()+"vs"+qy->name()+"vs"+qx->name()),
18  _qx(qx), _qy(qy), _qz(qz)
19  {
23  }
24 
26  std::string const& qname,
27  Quantity *qx, Quantity *qy, Quantity *qz, int debug/*=0*/):
28  Container(folder, qname), _qx(qx), _qy(qy), _qz(qz)
29  {
33  }
34 
37  {
38  _qx = c._qx->makeCopy();
39  _qy = c._qy->makeCopy();
40  _qz = c._qz->makeCopy();
41  }
42 
44  {
45  if (_qx!=nullptr)
46  delete _qx;
47  if (_qy!=nullptr)
48  delete _qy;
49  if (_qz!=nullptr)
50  delete _qz;
51  _qx=nullptr;
52  _qy=nullptr;
53  _qz=nullptr;
54  }
55 
57  Quantity *qx, Quantity *qy, Quantity *qz, int debug/*=0*/)
58  {
59  Container::initialize(folder, qz->name()+"vs"+qy->name()+"vs"+
60  qx->name(), debug);
61  _qx = qx;
62  _qy = qy;
63  _qz = qz;
67  }
68 
70  std::string const& qname,
71  Quantity *qx, Quantity *qy, Quantity *qz, int debug/*=0*/)
72  {
73  Container::initialize(folder, qname, debug);
74  _qx = qx;
75  _qy = qy;
76  _qz = qz;
80  }
81 
83  std::string subsystem, std::string aux)
84  {
85  ib.setCurrentFolder(subsystem+"/"+_folder+"/"+_qname);
86  _me = ib.book2D(_qname+(aux.empty()?aux:"_"+aux),
87  _qname+(aux.empty()?aux:" "+aux),
88  _qx->nbins(), _qx->min(), _qx->max(),
89  _qy->nbins(), _qy->min(), _qy->max());
90  customize();
91  }
92 
94  std::string subsystem, std::string aux)
95  {
96  _me = ig.get(subsystem+"/"+_folder+"/"+_qname+"/"+
97  _qname+(aux.empty()?aux:"_"+aux));
98  }
99 
100  /* virtual */ void ContainerSingle2D::customize()
101  {
102  _me->setAxisTitle(_qx->name(), 1);
103  _me->setAxisTitle(_qy->name(), 2);
104  _me->setAxisTitle(_qz->name(), 3);
105 
106  TH1 *h = _me->getTH1();
107  _qx->setBits(h);
108  _qy->setBits(h);
109  _qz->setBits(h);
110 
111  std::vector<std::string> xlabels = _qx->getLabels();
112  std::vector<std::string> ylabels = _qy->getLabels();
113  for (unsigned int i=0; i<xlabels.size(); i++) {
114  _me->setBinLabel(i+1, xlabels[i], 1);
115  }
116  for (unsigned int i=0; i<ylabels.size(); i++) {
117  _me->setBinLabel(i+1, ylabels[i], 2);
118  }
119  }
120 
121  /* virtual */ void ContainerSingle2D::fill(int x, int y)
122  {
123  _me->Fill(_qx->getValue(x), _qy->getValue(y));
124  }
125 
126  /* virtual */ void ContainerSingle2D::fill(int x, double y)
127  {
128  _me->Fill(_qx->getValue(x), _qy->getValue(y));
129  }
130 
131  /* virtual */ void ContainerSingle2D::fill(int x, double y, double z)
132  {
133  _me->Fill(_qx->getValue(x), _qy->getValue(y), z);
134  }
135 
136  /* virtual */ void ContainerSingle2D::fill(double x, int y)
137  {
138  _me->Fill(_qx->getValue(x), _qy->getValue(y));
139  }
140 
141  /* virtual */ void ContainerSingle2D::fill(double x, double y)
142  {
143  _me->Fill(_qx->getValue(x), _qy->getValue(y));
144  }
145 
146  /* virtual */ void ContainerSingle2D::fill(double x, double y, double z)
147  {
148  _me->Fill(_qx->getValue(x), _qy->getValue(y), z);
149  }
150 
151  /* virtual */ void ContainerSingle2D::fill(int x, int y, double z)
152  {
153  _me->Fill(_qx->getValue(x), _qy->getValue(y), z);
154  }
155 
156  /* virtual */ void ContainerSingle2D::fill(int x, int y, int z)
157  {
158  _me->Fill(_qx->getValue(x), _qy->getValue(y), z);
159  }
160 
161  /* virtual */ void ContainerSingle2D::fill(HcalDetId const& id)
162  {
163  _me->Fill(_qx->getValue(id), _qy->getValue(id));
164  }
165 
166  /* virtual */ double ContainerSingle2D::getBinContent(int x, int y)
167  {
168  return _me->getBinContent(_qx->getBin(x), _qy->getBin(y));
169  }
170  /* virtual */ double ContainerSingle2D::getBinContent(int x, double y)
171  {
172  return _me->getBinContent(_qx->getBin(x), _qy->getBin(y));
173  }
174  /* virtual */ double ContainerSingle2D::getBinContent(double x, int y)
175  {
176  return _me->getBinContent(_qx->getBin(x), _qy->getBin(y));
177  }
178  /* virtual */ double ContainerSingle2D::getBinContent(double x, double y)
179  {
180  return _me->getBinContent(_qx->getBin(x), _qy->getBin(y));
181  }
182  /* virtual */ double ContainerSingle2D::getBinEntries(int x, int y)
183  {
184  return _me->getBinEntries(_qx->getBin(x)+_qx->wofnbins()*_qy->getBin(y));
185  }
186  /* virtual */ double ContainerSingle2D::getBinEntries(int x, double y)
187  {
188  return _me->getBinEntries(_qx->getBin(x)+_qx->wofnbins()*_qy->getBin(y));
189  }
190  /* virtual */ double ContainerSingle2D::getBinEntries(double x, int y)
191  {
192  return _me->getBinEntries(_qx->getBin(x)+_qx->wofnbins()*_qy->getBin(y));
193  }
194  /* virtual */ double ContainerSingle2D::getBinEntries(double x, double y)
195  {
196  return _me->getBinEntries(_qx->getBin(x)+_qx->wofnbins()*_qy->getBin(y));
197  }
198 
199  /* virtual */ void ContainerSingle2D::setBinContent(int x, int y, int z)
200  {
201  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
202  }
203  /* virtual */ void ContainerSingle2D::setBinContent(int x, double y, int z)
204  {
205  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
206  }
207  /* virtual */ void ContainerSingle2D::setBinContent(double x, int y, int z)
208  {
209  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
210  }
211  /* virtual */ void ContainerSingle2D::setBinContent(double x,
212  double y, int z)
213  {
214  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
215  }
216  /* virtual */ void ContainerSingle2D::setBinContent(int x, int y, double z)
217  {
218  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
219  }
220  /* virtual */ void ContainerSingle2D::setBinContent(int x, double y,
221  double z)
222  {
223  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
224  }
225  /* virtual */ void ContainerSingle2D::setBinContent(double x, int y,
226  double z)
227  {
228  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
229  }
230  /* virtual */ void ContainerSingle2D::setBinContent(double x,
231  double y, double z)
232  {
233  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
234  }
235 
236  /* virtual */ void ContainerSingle2D::fill(HcalDetId const& id, double x)
237  {
238  if (_qx->isCoordinate() && _qy->isCoordinate())
239  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
240  else if (_qx->isCoordinate())
241  _me->Fill(_qx->getValue(id), _qy->getValue(x));
242  else if (_qy->isCoordinate())
243  _me->Fill(_qx->getValue(x), _qy->getValue(id));
244  }
245 
246  /* virtual */ void ContainerSingle2D::fill(HcalDetId const& id, int x)
247  {
248  if (_qx->isCoordinate() && _qy->isCoordinate())
249  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
250  else if (_qx->isCoordinate())
251  _me->Fill(_qx->getValue(id), _qy->getValue(x));
252  else if (_qy->isCoordinate())
253  _me->Fill(_qx->getValue(x), _qy->getValue(id));
254  }
255 
256  /* virtual */ void ContainerSingle2D::fill(HcalDetId const& id, double x,
257  double y)
258  {
259  if (_qx->isCoordinate() && _qy->isCoordinate())
260  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
261  else if (_qx->isCoordinate() && !_qy->isCoordinate())
262  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
263  else if (!_qx->isCoordinate() && _qy->isCoordinate())
264  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
265  }
266 
267  /* virtual */ void ContainerSingle2D::fill(HcalDetId const& id, int x,
268  int y)
269  {
270  if (_qx->isCoordinate() && _qy->isCoordinate())
271  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
272  else if (_qx->isCoordinate() && !_qy->isCoordinate())
273  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
274  else if (!_qx->isCoordinate() && _qy->isCoordinate())
275  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
276  }
277 
278  /* virtual */ void ContainerSingle2D::fill(HcalDetId const& id, int x,
279  double y)
280  {
281  if (_qx->isCoordinate() && _qy->isCoordinate())
282  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
283  else if (_qx->isCoordinate() && !_qy->isCoordinate())
284  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
285  else if (!_qx->isCoordinate() && _qy->isCoordinate())
286  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
287  }
288 
289  /* virtula */ double ContainerSingle2D::getBinContent(HcalDetId const& id)
290  {
291  return _me->getBinContent(_qx->getBin(id), _qy->getBin(id));
292  }
293  /* virtual */ double ContainerSingle2D::getBinContent(HcalDetId const& id,
294  int x)
295  {
296  if (_qx->isCoordinate())
297  return _me->getBinContent(_qx->getBin(id), _qy->getBin(x));
298  else
299  return _me->getBinContent(_qx->getBin(x), _qy->getBin(id));
300  }
301  /* virtual */ double ContainerSingle2D::getBinContent(HcalDetId const& id,
302  double x)
303  {
304  if (_qx->isCoordinate())
305  return _me->getBinContent(_qx->getBin(id), _qy->getBin(x));
306  else
307  return _me->getBinContent(_qx->getBin(x), _qy->getBin(id));
308  }
309  /* virtula */ double ContainerSingle2D::getBinEntries(HcalDetId const& id)
310  {
311  return _me->getBinEntries(_qx->getBin(id)+_qx->wofnbins()* _qy->getBin(id));
312  }
313  /* virtual */ double ContainerSingle2D::getBinEntries(HcalDetId const& id,
314  int x)
315  {
316  if (_qx->isCoordinate())
317  return _me->getBinEntries(_qx->getBin(id)+_qx->wofnbins()*_qy->getBin(x));
318  else
319  return _me->getBinEntries(_qx->getBin(x)+_qx->wofnbins()*_qy->getBin(id));
320  }
321  /* virtual */ double ContainerSingle2D::getBinEntries(HcalDetId const& id,
322  double x)
323  {
324  if (_qx->isCoordinate())
325  return _me->getBinEntries(_qx->getBin(id)+_qx->wofnbins()*_qy->getBin(x));
326  else
327  return _me->getBinEntries(_qx->getBin(x)+_qx->wofnbins()*_qy->getBin(id));
328  }
329 
330  /* virtual */ void ContainerSingle2D::setBinContent(HcalDetId const& id,
331  int x)
332  {
333  _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
334  }
335  /* virtual */ void ContainerSingle2D::setBinContent(HcalDetId const& id,
336  double x)
337  {
338  _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
339  }
340  /* virtual */ void ContainerSingle2D::setBinContent(HcalDetId const& id,
341  int x, int y)
342  {
343  if (_qx->isCoordinate())
344  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
345  else
346  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
347  }
348  /* virtual */ void ContainerSingle2D::setBinContent(HcalDetId const& id,
349  int x, double y)
350  {
351  if (_qx->isCoordinate())
352  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
353  else
354  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
355  }
356  /* virtual */ void ContainerSingle2D::setBinContent(HcalDetId const& id,
357  double x, int y)
358  {
359  if (_qx->isCoordinate())
360  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
361  else
362  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
363  }
364  /* virtual */ void ContainerSingle2D::setBinContent(HcalDetId const& id,
365  double x, double y)
366  {
367  if (_qx->isCoordinate())
368  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
369  else
370  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
371  }
372 
373  // by ElectronicsId
374  /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const& id)
375  {
376  _me->Fill(_qx->getValue(id), _qy->getValue(id));
377  }
378 
379  /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const& id,
380  double x)
381  {
382  if (_qx->isCoordinate() && _qy->isCoordinate())
383  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
384  else if (_qx->isCoordinate())
385  _me->Fill(_qx->getValue(id), _qy->getValue(x));
386  else if (_qy->isCoordinate())
387  _me->Fill(_qx->getValue(x), _qy->getValue(id));
388  }
389 
390  /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const& id,
391  int x)
392  {
393  if (_qx->isCoordinate() && _qy->isCoordinate())
394  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
395  else if (_qx->isCoordinate())
396  _me->Fill(_qx->getValue(id), _qy->getValue(x));
397  else if (_qy->isCoordinate())
398  _me->Fill(_qx->getValue(x), _qy->getValue(id));
399  }
400 
401  /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const& id,
402  double x,
403  double y)
404  {
405  if (_qx->isCoordinate() && _qy->isCoordinate())
406  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
407  else if (_qx->isCoordinate() && !_qy->isCoordinate())
408  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
409  else if (!_qx->isCoordinate() && _qy->isCoordinate())
410  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
411  }
412 
413  /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const& id,
414  int x,
415  int y)
416  {
417  if (_qx->isCoordinate() && _qy->isCoordinate())
418  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
419  else if (_qx->isCoordinate() && !_qy->isCoordinate())
420  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
421  else if (!_qx->isCoordinate() && _qy->isCoordinate())
422  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
423  }
424 
425  /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const& id,
426  int x,
427  double y)
428  {
429  if (_qx->isCoordinate() && _qy->isCoordinate())
430  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
431  else if (_qx->isCoordinate() && !_qy->isCoordinate())
432  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
433  else if (!_qx->isCoordinate() && _qy->isCoordinate())
434  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
435  }
436 
437  /* virtula */ double ContainerSingle2D::getBinContent(HcalElectronicsId const& id)
438  {
439  return _me->getBinContent(_qx->getBin(id), _qy->getBin(id));
440  }
441  /* virtual */ double ContainerSingle2D::getBinContent(HcalElectronicsId const& id,
442  int x)
443  {
444  if (_qx->isCoordinate())
445  return _me->getBinContent(_qx->getBin(id), _qy->getBin(x));
446  else
447  return _me->getBinContent(_qx->getBin(x), _qy->getBin(id));
448  }
449  /* virtual */ double ContainerSingle2D::getBinContent(HcalElectronicsId const& id,
450  double x)
451  {
452  if (_qx->isCoordinate())
453  return _me->getBinContent(_qx->getBin(id), _qy->getBin(x));
454  else
455  return _me->getBinContent(_qx->getBin(x), _qy->getBin(id));
456  }
457  /* virtula */ double ContainerSingle2D::getBinEntries(HcalElectronicsId const& id)
458  {
459  return _me->getBinEntries(_qx->getBin(id)+_qx->wofnbins()*_qy->getBin(id));
460  }
461  /* virtual */ double ContainerSingle2D::getBinEntries(HcalElectronicsId const& id,
462  int x)
463  {
464  if (_qx->isCoordinate())
465  return _me->getBinEntries(_qx->getBin(id)+_qx->wofnbins()*_qy->getBin(x));
466  else
467  return _me->getBinEntries(_qx->getBin(x)+_qx->wofnbins()*_qy->getBin(id));
468  }
469  /* virtual */ double ContainerSingle2D::getBinEntries(HcalElectronicsId const& id,
470  double x)
471  {
472  if (_qx->isCoordinate())
473  return _me->getBinEntries(_qx->getBin(id)+_qx->wofnbins()*_qy->getBin(x));
474  else
475  return _me->getBinEntries(_qx->getBin(x)+_qx->wofnbins()*_qy->getBin(id));
476  }
477 
479  int x)
480  {
481  _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
482  }
484  double x)
485  {
486  _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
487  }
489  int x, int y)
490  {
491  if (_qx->isCoordinate())
492  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
493  else
494  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
495  }
497  int x, double y)
498  {
499  if (_qx->isCoordinate())
500  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
501  else
502  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
503  }
505  double x, int y)
506  {
507  if (_qx->isCoordinate())
508  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
509  else
510  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
511  }
513  double x, double y)
514  {
515  if (_qx->isCoordinate())
516  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
517  else
518  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
519  }
520 
521  // by TrigTowerDetId
522  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const& id)
523  {
524  _me->Fill(_qx->getValue(id), _qy->getValue(id));
525  }
526 
527  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const& id,
528  double x)
529  {
530  if (_qx->isCoordinate() && _qy->isCoordinate())
531  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
532  else if (_qx->isCoordinate())
533  _me->Fill(_qx->getValue(id), _qy->getValue(x));
534  else if (_qy->isCoordinate())
535  _me->Fill(_qx->getValue(x), _qy->getValue(id));
536  }
537 
538  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const& id,
539  int x)
540  {
541  if (_qx->isCoordinate() && _qy->isCoordinate())
542  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
543  else if (_qx->isCoordinate())
544  _me->Fill(_qx->getValue(id), _qy->getValue(x));
545  else if (_qy->isCoordinate())
546  _me->Fill(_qx->getValue(x), _qy->getValue(id));
547  }
548 
549  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const& id,
550  double x, double y)
551  {
552  if (_qx->isCoordinate() && _qy->isCoordinate())
553  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
554  else if (_qx->isCoordinate() && !_qy->isCoordinate())
555  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
556  else if (!_qx->isCoordinate() && _qy->isCoordinate())
557  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
558  }
559 
560  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const& id,
561  int x, int y)
562  {
563  if (_qx->isCoordinate() && _qy->isCoordinate())
564  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
565  else if (_qx->isCoordinate() && !_qy->isCoordinate())
566  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
567  else if (!_qx->isCoordinate() && _qy->isCoordinate())
568  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
569  }
570 
571  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const& id,
572  int x, double y)
573  {
574  if (_qx->isCoordinate() && _qy->isCoordinate())
575  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
576  else if (_qx->isCoordinate() && !_qy->isCoordinate())
577  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
578  else if (!_qx->isCoordinate() && _qy->isCoordinate())
579  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
580  }
581 
582  /* virtual */ void ContainerSingle2D::fill(HcalDetId const& did,
583  HcalElectronicsId const& eid)
584  {
585  if (_qx->type()==fDetectorQuantity)
586  _me->Fill(_qx->getValue(did), _qy->getValue(eid));
587  else
588  _me->Fill(_qx->getValue(eid), _qy->getValue(did));
589  }
590 
591  /* virtual */ void ContainerSingle2D::fill(HcalDetId const& did,
592  HcalElectronicsId const& eid, double x)
593  {
594  if (_qx->type()==fDetectorQuantity)
595  _me->Fill(_qx->getValue(did), _qy->getValue(eid), x);
596  else
597  _me->Fill(_qx->getValue(eid), _qy->getValue(did), x);
598  }
599 
600  /* virtula */ double ContainerSingle2D::getBinContent(HcalTrigTowerDetId const& id)
601  {
602  return _me->getBinContent(_qx->getBin(id), _qy->getBin(id));
603  }
604  /* virtual */ double ContainerSingle2D::getBinContent(HcalTrigTowerDetId const& id,
605  int x)
606  {
607  if (_qx->isCoordinate())
608  return _me->getBinContent(_qx->getBin(id), _qy->getBin(x));
609  else
610  return _me->getBinContent(_qx->getBin(x), _qy->getBin(id));
611  }
612  /* virtual */ double ContainerSingle2D::getBinContent(HcalTrigTowerDetId const& id,
613  double x)
614  {
615  if (_qx->isCoordinate())
616  return _me->getBinContent(_qx->getBin(id), _qy->getBin(x));
617  else
618  return _me->getBinContent(_qx->getBin(x), _qy->getBin(id));
619  }
620  /* virtula */ double ContainerSingle2D::getBinEntries(HcalTrigTowerDetId const& id)
621  {
622  return _me->getBinEntries(_qx->getBin(id)+_qx->wofnbins()*_qy->getBin(id));
623  }
624  /* virtual */ double ContainerSingle2D::getBinEntries(HcalTrigTowerDetId const& id,
625  int x)
626  {
627  if (_qx->isCoordinate())
628  return _me->getBinEntries(_qx->getBin(id)+_qx->wofnbins()*_qy->getBin(x));
629  else
630  return _me->getBinEntries(_qx->getBin(x)+_qx->wofnbins()*_qy->getBin(id));
631  }
632  /* virtual */ double ContainerSingle2D::getBinEntries(HcalTrigTowerDetId const& id,
633  double x)
634  {
635  if (_qx->isCoordinate())
636  return _me->getBinEntries(_qx->getBin(id)+_qx->wofnbins()*_qy->getBin(x));
637  else
638  return _me->getBinEntries(_qx->getBin(x)+_qx->wofnbins()*_qy->getBin(id));
639  }
640 
642  int x)
643  {
644  _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
645  }
647  double x)
648  {
649  _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
650  }
652  int x, int y)
653  {
654  if (_qx->isCoordinate())
655  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
656  else
657  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
658  }
660  int x, double y)
661  {
662  if (_qx->isCoordinate())
663  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
664  else
665  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
666  }
668  double x, int y)
669  {
670  if (_qx->isCoordinate())
671  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
672  else
673  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
674  }
676  double x, double y)
677  {
678  if (_qx->isCoordinate())
679  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
680  else
681  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
682  }
683 
684  /* virtual */ void ContainerSingle2D::extendAxisRange(int l)
685  {
686  if (l<_qx->nbins())
687  return;
688 
689  int x=_qx->nbins();
690  while(l>=x)
691  {
692  _me->getTH1()->LabelsInflate();
693  x*=2;
694  _qx->setMax(x);
695  }
696  }
697 
698  void ContainerSingle2D::showOverflowZ(bool showOverflow) {
699  _qz->showOverflow(showOverflow);
700  }
701 }
virtual void setBits(TH1 *o)
Definition: Quantity.h:65
void setBinContent(int binx, double content)
set content of bin (1-D)
virtual void initialize(std::string const &folder, std::string const &qname, int debug=0)
Definition: Container.h:33
virtual std::string name()
Definition: Quantity.h:47
virtual void setAxisType(AxisType at)
Definition: Quantity.h:49
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
virtual int wofnbins()
Definition: Quantity.h:74
virtual std::vector< std::string > getLabels()
Definition: Quantity.h:78
virtual double getBinEntries(int, int)
virtual double max()
Definition: Quantity.h:76
TH1 * getTH1() const
virtual void setMax(double)
Definition: Quantity.h:81
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 initialize(std::string const &folder, quantity::Quantity *, quantity::Quantity *, quantity::Quantity *qz=new quantity::ValueQuantity(quantity::fN), int debug=0)
virtual void extendAxisRange(int)
void Fill(long long x)
quantity::Quantity * _qx
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
quantity::Quantity * _qy
virtual int getValue(HcalDetId const &)
Definition: Quantity.h:59
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
virtual void setBinContent(int, int, int)
virtual Quantity * makeCopy()
Definition: Quantity.h:50
void showOverflowZ(bool showOverflow)
virtual uint32_t getBin(HcalDetId const &)
Definition: Quantity.h:53
MonitorElement * get(std::string const &path)
Definition: DQMStore.cc:303
virtual void showOverflow(bool showOverflow)
Definition: Quantity.h:85
std::string _folder
Definition: Container.h:42
#define debug
Definition: HDRShower.cc:19
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
virtual double min()
Definition: Quantity.h:75
virtual bool isCoordinate()
Definition: Quantity.h:77
double getBinContent(int binx) const
get content of bin (1-D)
std::string _qname
Definition: Container.h:43
double getBinEntries(int bin) const
get # of bin entries (for profiles)
virtual QuantityType type()
Definition: Quantity.h:46
virtual double getBinContent(int, int)
virtual void fill(int, int)
virtual void load(DQMStore::IGetter &, std::string subsystem="Hcal", std::string aux="")
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.
quantity::Quantity * _qz
ib
Definition: cuy.py:662