CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ContainerSingle2D.cc
Go to the documentation of this file.
1 
4 
5 namespace hcaldqm
6 {
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 
35  Container(c._folder, c._qname)
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 
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 
94  {
95  _me = ig.get(subsystem+"/"+_folder+"/"+_qname+"/"+
96  _qname+(aux==""?aux:"_"+aux));
97  }
98 
99  /* virtual */ void ContainerSingle2D::book(DQMStore *store,
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  for (unsigned int i=0; i<ylabels.size(); i++)
126  _me->setBinLabel(i+1, ylabels[i], 2);
127  }
128 
129  /* virtual */ void ContainerSingle2D::fill(int x, int y)
130  {
131  _me->Fill(_qx->getValue(x), _qy->getValue(y));
132  }
133 
134  /* virtual */ void ContainerSingle2D::fill(int x, double y)
135  {
136  _me->Fill(_qx->getValue(x), _qy->getValue(y));
137  }
138 
139  /* virtual */ void ContainerSingle2D::fill(int x, double y, double z)
140  {
141  _me->Fill(_qx->getValue(x), _qy->getValue(y), z);
142  }
143 
144  /* virtual */ void ContainerSingle2D::fill(double x, int y)
145  {
146  _me->Fill(_qx->getValue(x), _qy->getValue(y));
147  }
148 
149  /* virtual */ void ContainerSingle2D::fill(double x, double y)
150  {
151  _me->Fill(_qx->getValue(x), _qy->getValue(y));
152  }
153 
154  /* virtual */ void ContainerSingle2D::fill(double x, double y, double z)
155  {
156  _me->Fill(_qx->getValue(x), _qy->getValue(y), z);
157  }
158 
159  /* virtual */ void ContainerSingle2D::fill(int x, int y, double z)
160  {
161  _me->Fill(_qx->getValue(x), _qy->getValue(y), z);
162  }
163 
164  /* virtual */ void ContainerSingle2D::fill(int x, int y, int z)
165  {
166  _me->Fill(_qx->getValue(x), _qy->getValue(y), z);
167  }
168 
169  /* virtual */ void ContainerSingle2D::fill(HcalDetId const& id)
170  {
171  _me->Fill(_qx->getValue(id), _qy->getValue(id));
172  }
173 
174  /* virtual */ double ContainerSingle2D::getBinContent(int x, int y)
175  {
176  return _me->getBinContent(_qx->getBin(x), _qy->getBin(y));
177  }
178  /* virtual */ double ContainerSingle2D::getBinContent(int x, double y)
179  {
180  return _me->getBinContent(_qx->getBin(x), _qy->getBin(y));
181  }
182  /* virtual */ double ContainerSingle2D::getBinContent(double x, int y)
183  {
184  return _me->getBinContent(_qx->getBin(x), _qy->getBin(y));
185  }
186  /* virtual */ double ContainerSingle2D::getBinContent(double x, double y)
187  {
188  return _me->getBinContent(_qx->getBin(x), _qy->getBin(y));
189  }
190  /* virtual */ double ContainerSingle2D::getBinEntries(int x, int y)
191  {
192  return _me->getBinEntries(_qx->getBin(x)+_qx->wofnbins()*_qy->getBin(y));
193  }
194  /* virtual */ double ContainerSingle2D::getBinEntries(int x, double y)
195  {
196  return _me->getBinEntries(_qx->getBin(x)+_qx->wofnbins()*_qy->getBin(y));
197  }
198  /* virtual */ double ContainerSingle2D::getBinEntries(double x, int y)
199  {
200  return _me->getBinEntries(_qx->getBin(x)+_qx->wofnbins()*_qy->getBin(y));
201  }
202  /* virtual */ double ContainerSingle2D::getBinEntries(double x, double y)
203  {
204  return _me->getBinEntries(_qx->getBin(x)+_qx->wofnbins()*_qy->getBin(y));
205  }
206 
207  /* virtual */ void ContainerSingle2D::setBinContent(int x, int y, int z)
208  {
209  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
210  }
211  /* virtual */ void ContainerSingle2D::setBinContent(int x, double y, int z)
212  {
213  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
214  }
215  /* virtual */ void ContainerSingle2D::setBinContent(double x, int y, int z)
216  {
217  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
218  }
219  /* virtual */ void ContainerSingle2D::setBinContent(double x,
220  double y, int z)
221  {
222  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
223  }
224  /* virtual */ void ContainerSingle2D::setBinContent(int x, int y, double z)
225  {
226  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
227  }
228  /* virtual */ void ContainerSingle2D::setBinContent(int x, double y,
229  double z)
230  {
231  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
232  }
233  /* virtual */ void ContainerSingle2D::setBinContent(double x, int y,
234  double z)
235  {
236  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
237  }
238  /* virtual */ void ContainerSingle2D::setBinContent(double x,
239  double y, double z)
240  {
241  _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
242  }
243 
244  /* virtual */ void ContainerSingle2D::fill(HcalDetId const& id, double x)
245  {
246  if (_qx->isCoordinate() && _qy->isCoordinate())
247  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
248  else if (_qx->isCoordinate())
249  _me->Fill(_qx->getValue(id), _qy->getValue(x));
250  else if (_qy->isCoordinate())
251  _me->Fill(_qx->getValue(x), _qy->getValue(id));
252  }
253 
254  /* virtual */ void ContainerSingle2D::fill(HcalDetId const& id, int x)
255  {
256  if (_qx->isCoordinate() && _qy->isCoordinate())
257  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
258  else if (_qx->isCoordinate())
259  _me->Fill(_qx->getValue(id), _qy->getValue(x));
260  else if (_qy->isCoordinate())
261  _me->Fill(_qx->getValue(x), _qy->getValue(id));
262  }
263 
264  /* virtual */ void ContainerSingle2D::fill(HcalDetId const& id, double x,
265  double y)
266  {
267  if (_qx->isCoordinate() && _qy->isCoordinate())
268  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
269  else if (_qx->isCoordinate() && !_qy->isCoordinate())
270  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
271  else if (!_qx->isCoordinate() && _qy->isCoordinate())
272  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
273  }
274 
275  /* virtual */ void ContainerSingle2D::fill(HcalDetId const& id, int x,
276  int y)
277  {
278  if (_qx->isCoordinate() && _qy->isCoordinate())
279  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
280  else if (_qx->isCoordinate() && !_qy->isCoordinate())
281  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
282  else if (!_qx->isCoordinate() && _qy->isCoordinate())
283  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
284  }
285 
286  /* virtual */ void ContainerSingle2D::fill(HcalDetId const& id, int x,
287  double y)
288  {
289  if (_qx->isCoordinate() && _qy->isCoordinate())
290  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
291  else if (_qx->isCoordinate() && !_qy->isCoordinate())
292  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
293  else if (!_qx->isCoordinate() && _qy->isCoordinate())
294  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
295  }
296 
297  /* virtula */ double ContainerSingle2D::getBinContent(HcalDetId const& id)
298  {
299  return _me->getBinContent(_qx->getBin(id), _qy->getBin(id));
300  }
301  /* virtual */ double ContainerSingle2D::getBinContent(HcalDetId const& id,
302  int 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  /* virtual */ double ContainerSingle2D::getBinContent(HcalDetId const& id,
310  double x)
311  {
312  if (_qx->isCoordinate())
313  return _me->getBinContent(_qx->getBin(id), _qy->getBin(x));
314  else
315  return _me->getBinContent(_qx->getBin(x), _qy->getBin(id));
316  }
317  /* virtula */ double ContainerSingle2D::getBinEntries(HcalDetId const& id)
318  {
319  return _me->getBinEntries(_qx->getBin(id)+_qx->wofnbins()* _qy->getBin(id));
320  }
321  /* virtual */ double ContainerSingle2D::getBinEntries(HcalDetId const& id,
322  int 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  /* virtual */ double ContainerSingle2D::getBinEntries(HcalDetId const& id,
330  double x)
331  {
332  if (_qx->isCoordinate())
333  return _me->getBinEntries(_qx->getBin(id)+_qx->wofnbins()*_qy->getBin(x));
334  else
335  return _me->getBinEntries(_qx->getBin(x)+_qx->wofnbins()*_qy->getBin(id));
336  }
337 
338  /* virtual */ void ContainerSingle2D::setBinContent(HcalDetId const& id,
339  int x)
340  {
341  _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
342  }
343  /* virtual */ void ContainerSingle2D::setBinContent(HcalDetId const& id,
344  double x)
345  {
346  _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
347  }
348  /* virtual */ void ContainerSingle2D::setBinContent(HcalDetId const& id,
349  int x, int 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  int x, double 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, int 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  /* virtual */ void ContainerSingle2D::setBinContent(HcalDetId const& id,
373  double x, double y)
374  {
375  if (_qx->isCoordinate())
376  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
377  else
378  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
379  }
380 
381  // by ElectronicsId
382  /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const& id)
383  {
384  _me->Fill(_qx->getValue(id), _qy->getValue(id));
385  }
386 
387  /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const& id,
388  double x)
389  {
390  if (_qx->isCoordinate() && _qy->isCoordinate())
391  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
392  else if (_qx->isCoordinate())
393  _me->Fill(_qx->getValue(id), _qy->getValue(x));
394  else if (_qy->isCoordinate())
395  _me->Fill(_qx->getValue(x), _qy->getValue(id));
396  }
397 
398  /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const& id,
399  int x)
400  {
401  if (_qx->isCoordinate() && _qy->isCoordinate())
402  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
403  else if (_qx->isCoordinate())
404  _me->Fill(_qx->getValue(id), _qy->getValue(x));
405  else if (_qy->isCoordinate())
406  _me->Fill(_qx->getValue(x), _qy->getValue(id));
407  }
408 
409  /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const& id,
410  double x,
411  double y)
412  {
413  if (_qx->isCoordinate() && _qy->isCoordinate())
414  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
415  else if (_qx->isCoordinate() && !_qy->isCoordinate())
416  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
417  else if (!_qx->isCoordinate() && _qy->isCoordinate())
418  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
419  }
420 
421  /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const& id,
422  int x,
423  int y)
424  {
425  if (_qx->isCoordinate() && _qy->isCoordinate())
426  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
427  else if (_qx->isCoordinate() && !_qy->isCoordinate())
428  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
429  else if (!_qx->isCoordinate() && _qy->isCoordinate())
430  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
431  }
432 
433  /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const& id,
434  int x,
435  double y)
436  {
437  if (_qx->isCoordinate() && _qy->isCoordinate())
438  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
439  else if (_qx->isCoordinate() && !_qy->isCoordinate())
440  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
441  else if (!_qx->isCoordinate() && _qy->isCoordinate())
442  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
443  }
444 
445  /* virtula */ double ContainerSingle2D::getBinContent(HcalElectronicsId const& id)
446  {
447  return _me->getBinContent(_qx->getBin(id), _qy->getBin(id));
448  }
449  /* virtual */ double ContainerSingle2D::getBinContent(HcalElectronicsId const& id,
450  int 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  /* virtual */ double ContainerSingle2D::getBinContent(HcalElectronicsId const& id,
458  double x)
459  {
460  if (_qx->isCoordinate())
461  return _me->getBinContent(_qx->getBin(id), _qy->getBin(x));
462  else
463  return _me->getBinContent(_qx->getBin(x), _qy->getBin(id));
464  }
465  /* virtula */ double ContainerSingle2D::getBinEntries(HcalElectronicsId const& id)
466  {
467  return _me->getBinEntries(_qx->getBin(id)+_qx->wofnbins()*_qy->getBin(id));
468  }
469  /* virtual */ double ContainerSingle2D::getBinEntries(HcalElectronicsId const& id,
470  int 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  /* virtual */ double ContainerSingle2D::getBinEntries(HcalElectronicsId const& id,
478  double x)
479  {
480  if (_qx->isCoordinate())
481  return _me->getBinEntries(_qx->getBin(id)+_qx->wofnbins()*_qy->getBin(x));
482  else
483  return _me->getBinEntries(_qx->getBin(x)+_qx->wofnbins()*_qy->getBin(id));
484  }
485 
487  int x)
488  {
489  _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
490  }
492  double x)
493  {
494  _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
495  }
497  int x, int 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  int x, double 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, int 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  }
521  double x, double y)
522  {
523  if (_qx->isCoordinate())
524  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
525  else
526  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
527  }
528 
529  // by TrigTowerDetId
530  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const& id)
531  {
532  _me->Fill(_qx->getValue(id), _qy->getValue(id));
533  }
534 
535  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const& id,
536  double x)
537  {
538  if (_qx->isCoordinate() && _qy->isCoordinate())
539  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
540  else if (_qx->isCoordinate())
541  _me->Fill(_qx->getValue(id), _qy->getValue(x));
542  else if (_qy->isCoordinate())
543  _me->Fill(_qx->getValue(x), _qy->getValue(id));
544  }
545 
546  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const& id,
547  int x)
548  {
549  if (_qx->isCoordinate() && _qy->isCoordinate())
550  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
551  else if (_qx->isCoordinate())
552  _me->Fill(_qx->getValue(id), _qy->getValue(x));
553  else if (_qy->isCoordinate())
554  _me->Fill(_qx->getValue(x), _qy->getValue(id));
555  }
556 
557  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const& id,
558  double x, double y)
559  {
560  if (_qx->isCoordinate() && _qy->isCoordinate())
561  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
562  else if (_qx->isCoordinate() && !_qy->isCoordinate())
563  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
564  else if (!_qx->isCoordinate() && _qy->isCoordinate())
565  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
566  }
567 
568  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const& id,
569  int x, int y)
570  {
571  if (_qx->isCoordinate() && _qy->isCoordinate())
572  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
573  else if (_qx->isCoordinate() && !_qy->isCoordinate())
574  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
575  else if (!_qx->isCoordinate() && _qy->isCoordinate())
576  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
577  }
578 
579  /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const& id,
580  int x, double y)
581  {
582  if (_qx->isCoordinate() && _qy->isCoordinate())
583  _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
584  else if (_qx->isCoordinate() && !_qy->isCoordinate())
585  _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
586  else if (!_qx->isCoordinate() && _qy->isCoordinate())
587  _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
588  }
589 
590  /* virtual */ void ContainerSingle2D::fill(HcalDetId const& did,
591  HcalElectronicsId const& eid)
592  {
593  if (_qx->type()==fDetectorQuantity)
594  _me->Fill(_qx->getValue(did), _qy->getValue(eid));
595  else
596  _me->Fill(_qx->getValue(eid), _qy->getValue(did));
597  }
598 
599  /* virtual */ void ContainerSingle2D::fill(HcalDetId const& did,
600  HcalElectronicsId const& eid, double x)
601  {
602  if (_qx->type()==fDetectorQuantity)
603  _me->Fill(_qx->getValue(did), _qy->getValue(eid), x);
604  else
605  _me->Fill(_qx->getValue(eid), _qy->getValue(did), x);
606  }
607 
608  /* virtula */ double ContainerSingle2D::getBinContent(HcalTrigTowerDetId const& id)
609  {
610  return _me->getBinContent(_qx->getBin(id), _qy->getBin(id));
611  }
612  /* virtual */ double ContainerSingle2D::getBinContent(HcalTrigTowerDetId const& id,
613  int 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  /* virtual */ double ContainerSingle2D::getBinContent(HcalTrigTowerDetId const& id,
621  double x)
622  {
623  if (_qx->isCoordinate())
624  return _me->getBinContent(_qx->getBin(id), _qy->getBin(x));
625  else
626  return _me->getBinContent(_qx->getBin(x), _qy->getBin(id));
627  }
628  /* virtula */ double ContainerSingle2D::getBinEntries(HcalTrigTowerDetId const& id)
629  {
630  return _me->getBinEntries(_qx->getBin(id)+_qx->wofnbins()*_qy->getBin(id));
631  }
632  /* virtual */ double ContainerSingle2D::getBinEntries(HcalTrigTowerDetId const& id,
633  int 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  /* virtual */ double ContainerSingle2D::getBinEntries(HcalTrigTowerDetId const& id,
641  double x)
642  {
643  if (_qx->isCoordinate())
644  return _me->getBinEntries(_qx->getBin(id)+_qx->wofnbins()*_qy->getBin(x));
645  else
646  return _me->getBinEntries(_qx->getBin(x)+_qx->wofnbins()*_qy->getBin(id));
647  }
648 
650  int x)
651  {
652  _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
653  }
655  double x)
656  {
657  _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
658  }
660  int x, int 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  int x, double 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, int 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  }
684  double x, double y)
685  {
686  if (_qx->isCoordinate())
687  _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
688  else
689  _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
690  }
691 
692  /* virtual */ void ContainerSingle2D::extendAxisRange(int l)
693  {
694  if (l<_qx->nbins())
695  return;
696 
697  int x=_qx->nbins();
698  while(l>=x)
699  {
700  _me->getTH1()->LabelsInflate();
701  x*=2;
702  _qx->setMax(x);
703  }
704  }
705 }
706 
int i
Definition: DBlmapReader.cc:9
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
int ib
Definition: cuy.py:660
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:304
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:276
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:1149
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:727
tuple folder
Histograms Source for live online DQM in P5