CMS 3D CMS Logo

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