CMS 3D CMS Logo

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