CMS 3D CMS Logo

Container1D.cc
Go to the documentation of this file.
1 
3 
4 namespace hcaldqm
5 {
6  using namespace mapper;
7  using namespace constants;
8  using namespace quantity;
9 
11  _qx(nullptr), _qy(nullptr)
12  {}
13 
15  hashfunctions::HashType hashtype, Quantity *qx, Quantity *qy) :
16  Container(folder, qy->name()+"vs"+qx->name()), _hashmap(hashtype),
17  _qx(qx), _qy(qy)
18  {
21  }
22 
24  {
25  if (_qx!=nullptr)
26  delete _qx;
27  if (_qy!=nullptr)
28  delete _qy;
29  _qx = nullptr;
30  _qy = nullptr;
31  }
32 
33  /* virtual */ /*void Container1D::release()
34  {
35  BOOST_FOREACH(MEMap::value_type &pair, _mes)
36  {
37  pair.second=NULL;
38  }
39  }*/
40 
41  /* virtuial */ void Container1D::initialize(std::string const& folder,
42  hashfunctions::HashType hashtype, Quantity *qx, Quantity *qy/* = ... */,
43  int debug /* =0 */)
44  {
45  Container::initialize(folder, qy->name()+"vs"+qx->name(), debug);
46  _hashmap.initialize(hashtype);
47  _qx = qx;
48  _qy = qy;
51  }
52 
53  /* virtuial */ void Container1D::initialize(std::string const& folder,
54  std::string const& qname,
55  hashfunctions::HashType hashtype, Quantity *qx, Quantity *qy/* = ... */,
56  int debug /* =0 */)
57  {
58  Container::initialize(folder, qname, debug);
59  _hashmap.initialize(hashtype);
60  _qx = qx;
61  _qy = qy;
64  }
65 
66  /* virtual */ void Container1D::reset()
67  {
68  BOOST_FOREACH(MEMap::value_type &pair, _mes)
69  {
70  pair.second->Reset();
71  }
72  }
73 
74  /* virtual */ void Container1D::print()
75  {
76  std::cout << "Container by " << _hashmap.getHashTypeName() << std::endl;
77  BOOST_FOREACH(MEMap::value_type &pair, _mes)
78  {
79  std::cout << std::hex << pair.first << std::dec << std::endl;
80  }
81  }
82 
83  /* virtual */ void Container1D::fill(uint32_t hash)
84  {
85  if (_hashmap.isDHash())
86  this->fill(HcalDetId(hash));
87  else if (_hashmap.isEHash())
88  this->fill(HcalElectronicsId(hash));
89  else if (_hashmap.isTHash())
90  this->fill(HcalTrigTowerDetId(hash));
91  }
92 
93  /* virtual */ void Container1D::fill(uint32_t hash, int x)
94  {
95  if (_hashmap.isDHash())
96  this->fill(HcalDetId(hash), x);
97  else if (_hashmap.isEHash())
98  this->fill(HcalElectronicsId(hash), x);
99  else if (_hashmap.isTHash())
100  this->fill(HcalTrigTowerDetId(hash), x);
101  }
102 
103  /* virtual */ void Container1D::fill(uint32_t hash, double x)
104  {
105  if (_hashmap.isDHash())
106  this->fill(HcalDetId(hash), x);
107  else if (_hashmap.isEHash())
108  this->fill(HcalElectronicsId(hash), x);
109  else if (_hashmap.isTHash())
110  this->fill(HcalTrigTowerDetId(hash), x);
111  }
112 
113  /* virtual */ void Container1D::fill(uint32_t hash, int x, double y)
114  {
115  if (_hashmap.isDHash())
116  this->fill(HcalDetId(hash), x, y);
117  else if (_hashmap.isEHash())
118  this->fill(HcalElectronicsId(hash), x, y);
119  else if (_hashmap.isTHash())
120  this->fill(HcalTrigTowerDetId(hash), x, y);
121  }
122 
123  /* virtual */ void Container1D::fill(uint32_t hash, int x, int y)
124  {
125  if (_hashmap.isDHash())
126  this->fill(HcalDetId(hash), x, y);
127  else if (_hashmap.isEHash())
128  this->fill(HcalElectronicsId(hash), x, y);
129  else if (_hashmap.isTHash())
130  this->fill(HcalTrigTowerDetId(hash), x, y);
131  }
132 
133  /* virtual */ void Container1D::fill(uint32_t hash, double x, double y)
134  {
135  if (_hashmap.isDHash())
136  this->fill(HcalDetId(hash), x, y);
137  else if (_hashmap.isEHash())
138  this->fill(HcalElectronicsId(hash), x, y);
139  else if (_hashmap.isTHash())
140  this->fill(HcalTrigTowerDetId(hash), x, y);
141  }
142 
143  // by HcalDetId
144  /* virtual */ void Container1D::fill(HcalDetId const& did)
145  {
146  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(did));
147  }
148  /* virtual */ void Container1D::fill(HcalDetId const& did, int x)
149  {
150  QuantityType qtype = _qx->type();
151  if (qtype==fValueQuantity || qtype==fFlagQuantity)
152  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(x));
153  else
154  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(did),
155  _qy->getValue(x));
156  }
157  /* virtual */ void Container1D::fill(HcalDetId const& did, double x)
158  {
159  QuantityType qtype = _qx->type();
160  if (qtype==fValueQuantity || qtype==fFlagQuantity)
161  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(x));
162  else
163  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(did),
164  _qy->getValue(x));
165  }
166  /* virtual */ void Container1D::fill(HcalDetId const& did, int x, double y)
167  {
168  QuantityType qtype = _qx->type();
169  if (qtype==fValueQuantity || qtype==fFlagQuantity)
170  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(x),
171  _qy->getValue(y));
172  else
173  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(did),
174  _qy->getValue(x), y);
175  }
176  /* virtual */ void Container1D::fill(HcalDetId const& did, int x, int y)
177  {
178  QuantityType qtype = _qx->type();
179  if (qtype==fValueQuantity || qtype==fFlagQuantity)
180  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(x),
181  _qy->getValue(y));
182  else
183  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(did),
184  _qy->getValue(x), y);
185  }
186  /* virtual */ void Container1D::fill(HcalDetId const& did, double x ,
187  double y)
188  {
189  QuantityType qtype = _qx->type();
190  if (qtype==fValueQuantity || qtype==fFlagQuantity)
191  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(x),
192  _qy->getValue(y));
193  else
194  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(did),
195  _qy->getValue(x), y);
196  }
197 
198  /* virtual */ double Container1D::getBinEntries(HcalDetId const& id)
199  {
200  return _mes[_hashmap.getHash(id)]->getBinEntries(_qx->getBin(id));
201  }
202 
203  /* virtual */ double Container1D::getBinEntries(HcalDetId const& id,
204  int x)
205  {
206  return _mes[_hashmap.getHash(id)]->getBinEntries(_qx->getBin(x));
207  }
208 
209  /* virtual */ double Container1D::getBinEntries(HcalDetId const& id,
210  double x)
211  {
212  return _mes[_hashmap.getHash(id)]->getBinEntries(_qx->getBin(x));
213  }
214 
215  /* virtual */ double Container1D::getBinContent(HcalDetId const&
216  tid)
217  {
218  return _mes[_hashmap.getHash(tid)]->getBinContent(_qx->getBin(tid));
219  }
220 
221  /* virtual */ double Container1D::getBinContent(HcalDetId const&
222  tid, int x)
223  {
224  return _mes[_hashmap.getHash(tid)]->getBinContent(_qx->getBin(x));
225  }
226 
227  /* virtual */ double Container1D::getBinContent(HcalDetId const&
228  tid, double x)
229  {
230  return _mes[_hashmap.getHash(tid)]->getBinContent(_qx->getBin(x));
231  }
232 
233  /* virtual */ double Container1D::getMean(HcalDetId const& tid, int axis)
234  {
235  return _mes[_hashmap.getHash(tid)]->getMean(axis);
236  }
237 
238  /* virtual */ double Container1D::getRMS(HcalDetId const& id, int axis)
239  {
240  return _mes[_hashmap.getHash(id)]->getRMS(axis);
241  }
242 
243  // setBinContent
244  /* virtual */ void Container1D::setBinContent(HcalDetId const& id,
245  int x)
246  {
247  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(id), x);
248  }
249  /* virtual */ void Container1D::setBinContent(HcalDetId const& id,
250  double x)
251  {
252  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(id), x);
253  }
254  /* virtual */ void Container1D::setBinContent(HcalDetId const& id,
255  int x, int y)
256  {
257  QuantityType qtype = _qx->type();
258  if (qtype==fValueQuantity || qtype==fFlagQuantity)
259  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(x), y);
260  else
261  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(id), x);
262  }
263  /* virtual */ void Container1D::setBinContent(HcalDetId const& id,
264  int x, double y)
265  {
266  QuantityType qtype = _qx->type();
267  if (qtype==fValueQuantity || qtype==fFlagQuantity)
268  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(x), y);
269  else
270  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(id), x);
271  }
272  /* virtual */ void Container1D::setBinContent(HcalDetId const& id,
273  double x, int y)
274  {
275  QuantityType qtype = _qx->type();
276  if (qtype==fValueQuantity || qtype==fFlagQuantity)
277  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(x), y);
278  else
279  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(id), x);
280  }
281  /* virtual */ void Container1D::setBinContent(HcalDetId const& id,
282  double x, double y)
283  {
284  QuantityType qtype = _qx->type();
285  if (qtype==fValueQuantity || qtype==fFlagQuantity)
286  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(x), y);
287  else
288  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(id), x);
289  }
290 
291  // by HcalElectronicsId
292  /* virtual */ void Container1D::fill(HcalElectronicsId const& did)
293  {
294  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(did));
295  }
296  /* virtual */ void Container1D::fill(HcalElectronicsId const& did, int x)
297  {
298  QuantityType qtype = _qx->type();
299  if (qtype==fValueQuantity || qtype==fFlagQuantity)
300  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(x));
301  else
302  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(did),
303  _qy->getValue(x));
304  }
305  /* virtual */ void Container1D::fill(HcalElectronicsId const& did, double x)
306  {
307  QuantityType qtype = _qx->type();
308  if (qtype==fValueQuantity || qtype==fFlagQuantity)
309  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(x));
310  else
311  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(did),
312  _qy->getValue(x));
313  }
314  /* virtual */ void Container1D::fill(HcalElectronicsId const& did,
315  int x, double y)
316  {
317  QuantityType qtype = _qx->type();
318  if (qtype==fValueQuantity || qtype==fFlagQuantity)
319  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(x),
320  _qy->getValue(y));
321  else
322  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(did),
323  _qy->getValue(x), y);
324  }
325  /* virtual */ void Container1D::fill(HcalElectronicsId const& did,
326  int x, int y)
327  {
328  QuantityType qtype = _qx->type();
329  if (qtype==fValueQuantity || qtype==fFlagQuantity)
330  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(x),
331  _qy->getValue(y));
332  else
333  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(did),
334  _qy->getValue(x), y);
335  }
336  /* virtual */ void Container1D::fill(HcalElectronicsId const& did,
337  double x , double y)
338  {
339  QuantityType qtype = _qx->type();
340  if (qtype==fValueQuantity || qtype==fFlagQuantity)
341  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(x),
342  _qy->getValue(y));
343  else
344  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(did),
345  _qy->getValue(x), y);
346  }
347 
348  /* virtual */ double Container1D::getBinEntries(HcalElectronicsId const& id)
349  {
350  return _mes[_hashmap.getHash(id)]->getBinEntries(_qx->getBin(id));
351  }
352 
353  /* virtual */ double Container1D::getBinEntries(HcalElectronicsId const& id,
354  int x)
355  {
356  return _mes[_hashmap.getHash(id)]->getBinEntries(_qx->getBin(x));
357  }
358 
359  /* virtual */ double Container1D::getBinEntries(HcalElectronicsId const& id,
360  double x)
361  {
362  return _mes[_hashmap.getHash(id)]->getBinEntries(_qx->getBin(x));
363  }
364 
365  /* virtual */ double Container1D::getBinContent(HcalElectronicsId const&
366  tid)
367  {
368  return _mes[_hashmap.getHash(tid)]->getBinContent(_qx->getBin(tid));
369  }
370 
371  /* virtual */ double Container1D::getBinContent(HcalElectronicsId const&
372  tid, int x)
373  {
374  return _mes[_hashmap.getHash(tid)]->getBinContent(_qx->getBin(x));
375  }
376 
377  /* virtual */ double Container1D::getBinContent(HcalElectronicsId const&
378  tid, double x)
379  {
380  return _mes[_hashmap.getHash(tid)]->getBinContent(_qx->getBin(x));
381  }
382 
383  /* virtual */ double Container1D::getMean(HcalElectronicsId const& tid,
384  int axis)
385  {
386  return _mes[_hashmap.getHash(tid)]->getMean(axis);
387  }
388 
389  /* virtual */ double Container1D::getRMS(HcalElectronicsId const& id,
390  int axis)
391  {
392  return _mes[_hashmap.getHash(id)]->getRMS(axis);
393  }
394 
395  // setBinContent
396  /* virtual */ void Container1D::setBinContent(HcalElectronicsId const& id,
397  int x)
398  {
399  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(id), x);
400  }
401  /* virtual */ void Container1D::setBinContent(HcalElectronicsId const& id,
402  double x)
403  {
404  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(id), x);
405  }
406  /* virtual */ void Container1D::setBinContent(HcalElectronicsId const& id,
407  int x, int y)
408  {
409  QuantityType qtype = _qx->type();
410  if (qtype==fValueQuantity || qtype==fFlagQuantity)
411  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(x), y);
412  else
413  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(id), x);
414  }
415  /* virtual */ void Container1D::setBinContent(HcalElectronicsId const& id,
416  int x, double y)
417  {
418  QuantityType qtype = _qx->type();
419  if (qtype==fValueQuantity || qtype==fFlagQuantity)
420  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(x), y);
421  else
422  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(id), x);
423  }
424  /* virtual */ void Container1D::setBinContent(HcalElectronicsId const& id,
425  double x, int y)
426  {
427  QuantityType qtype = _qx->type();
428  if (qtype==fValueQuantity || qtype==fFlagQuantity)
429  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(x), y);
430  else
431  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(id), x);
432  }
433  /* virtual */ void Container1D::setBinContent(HcalElectronicsId const& id,
434  double x, double y)
435  {
436  QuantityType qtype = _qx->type();
437  if (qtype==fValueQuantity || qtype==fFlagQuantity)
438  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(x), y);
439  else
440  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(id), x);
441  }
442 
443  // by HcaTrigTowerlDetId
444  /* virtual */ void Container1D::fill(HcalTrigTowerDetId const& did)
445  {
446  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(did));
447  }
448  /* virtual */ void Container1D::fill(HcalTrigTowerDetId const& did, int x)
449  {
450  QuantityType qtype = _qx->type();
451  if (qtype==fValueQuantity || qtype==fFlagQuantity)
452  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(x));
453  else
454  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(did),
455  _qy->getValue(x));
456  }
457  /* virtual */ void Container1D::fill(HcalTrigTowerDetId const& did,
458  double x)
459  {
460  QuantityType qtype = _qx->type();
461  if (qtype==fValueQuantity || qtype==fFlagQuantity)
462  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(x));
463  else
464  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(did),
465  _qy->getValue(x));
466  }
467  /* virtual */ void Container1D::fill(HcalTrigTowerDetId const& did,
468  int x, double y)
469  {
470  QuantityType qtype = _qx->type();
471  if (qtype==fValueQuantity || qtype==fFlagQuantity)
472  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(x),
473  _qy->getValue(y));
474  else
475  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(did),
476  _qy->getValue(x), y);
477  }
478  /* virtual */ void Container1D::fill(HcalTrigTowerDetId const& did,
479  int x, int y)
480  {
481  QuantityType qtype = _qx->type();
482  if (qtype==fValueQuantity || qtype==fFlagQuantity)
483  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(x),
484  _qy->getValue(y));
485  else
486  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(did),
487  _qy->getValue(x), y);
488  }
489  /* virtual */ void Container1D::fill(HcalTrigTowerDetId const& did,
490  double x, double y)
491  {
492  QuantityType qtype = _qx->type();
493  if (qtype==fValueQuantity || qtype==fFlagQuantity)
494  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(x),
495  _qy->getValue(y));
496  else
497  _mes[_hashmap.getHash(did)]->Fill(_qx->getValue(did),
498  _qy->getValue(x), y);
499  }
500 
501  /* virtual */ double Container1D::getBinEntries(HcalTrigTowerDetId const&
502  id)
503  {
504  return _mes[_hashmap.getHash(id)]->getBinEntries(_qx->getBin(id));
505  }
506 
507  /* virtual */ double Container1D::getBinEntries(HcalTrigTowerDetId const&
508  id, int x)
509  {
510  return _mes[_hashmap.getHash(id)]->getBinEntries(_qx->getBin(x));
511  }
512 
513  /* virtual */ double Container1D::getBinEntries(HcalTrigTowerDetId const&
514  id, double x)
515  {
516  return _mes[_hashmap.getHash(id)]->getBinEntries(_qx->getBin(x));
517  }
518 
519  /* virtual */ double Container1D::getBinContent(HcalTrigTowerDetId const&
520  tid)
521  {
522  return _mes[_hashmap.getHash(tid)]->getBinContent(_qx->getBin(tid));
523  }
524 
525  /* virtual */ double Container1D::getBinContent(HcalTrigTowerDetId const&
526  tid, int x)
527  {
528  return _mes[_hashmap.getHash(tid)]->getBinContent(_qx->getBin(x));
529  }
530 
531  /* virtual */ double Container1D::getBinContent(HcalTrigTowerDetId const&
532  tid, double x)
533  {
534  return _mes[_hashmap.getHash(tid)]->getBinContent(_qx->getBin(x));
535  }
536 
537  /* virtual */ double Container1D::getMean(HcalTrigTowerDetId const& tid,
538  int axis)
539  {
540  return _mes[_hashmap.getHash(tid)]->getMean(axis);
541  }
542 
543  /* virtual */ double Container1D::getRMS(HcalTrigTowerDetId const& id,
544  int axis)
545  {
546  return _mes[_hashmap.getHash(id)]->getRMS(axis);
547  }
548 
549  // setBinContent
550  /* virtual */ void Container1D::setBinContent(HcalTrigTowerDetId const& id,
551  int x)
552  {
553  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(id), x);
554  }
555  /* virtual */ void Container1D::setBinContent(HcalTrigTowerDetId const& id,
556  double x)
557  {
558  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(id), x);
559  }
560  /* virtual */ void Container1D::setBinContent(HcalTrigTowerDetId const& id,
561  int x, int y)
562  {
563  QuantityType qtype = _qx->type();
564  if (qtype==fValueQuantity || qtype==fFlagQuantity)
565  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(x), y);
566  else
567  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(id), x);
568  }
569  /* virtual */ void Container1D::setBinContent(HcalTrigTowerDetId const& id,
570  int x, double y)
571  {
572  QuantityType qtype = _qx->type();
573  if (qtype==fValueQuantity || qtype==fFlagQuantity)
574  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(x), y);
575  else
576  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(id), x);
577  }
578  /* virtual */ void Container1D::setBinContent(HcalTrigTowerDetId const& id,
579  double x, int y)
580  {
581  QuantityType qtype = _qx->type();
582  if (qtype==fValueQuantity || qtype==fFlagQuantity)
583  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(x), y);
584  else
585  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(id), x);
586  }
587  /* virtual */ void Container1D::setBinContent(HcalTrigTowerDetId const& id,
588  double x, double y)
589  {
590  QuantityType qtype = _qx->type();
591  if (qtype==fValueQuantity || qtype==fFlagQuantity)
592  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(x), y);
593  else
594  _mes[_hashmap.getHash(id)]->setBinContent(_qx->getBin(id), x);
595  }
596 
597  /* virtual */ void Container1D::load(DQMStore *store,
598  HcalElectronicsMap const* emap, std::string const &subsystem,
599  std::string const& aux, std::string const& prepend,
601  {
602  // full path to where all the plots are living
603  // prepend/subsystem/taskname/QxvsQy_auxilary/HashType
604  // if loaded and not stripped, then
605  // prepend/subsystem/Run summary/taskname/...
607  std::string path = (prepend.empty()?prepend:prepend+"/")+
608  subsystem+"/"+(mode==DQMStore::KeepRunDirs?"Run summary/":"")
609  +_folder+"/"+_qname+
610  (aux.empty()?aux:"_"+aux)+"/"+_hashmap.getHashTypeName();
611  _logger.debug("FULLPATH::"+path);
612 
613  if (_hashmap.isDHash())
614  {
615  // for Detector Hashes
616  std::vector<HcalGenericDetId> dids = emap->allPrecisionId();
617  for (std::vector<HcalGenericDetId>::const_iterator it=
618  dids.begin(); it!=dids.end(); ++it)
619  {
620  // skip trigger towers and calibration
621  if (!it->isHcalDetId())
622  continue;
623 
624  HcalDetId did = HcalDetId(it->rawId());
625  uint32_t hash = _hashmap.getHash(did);
626  MEMap::iterator mit = _mes.find(hash);
627  if (mit!=_mes.end())
628  continue;
629 
631  _mes.insert(
632  std::make_pair(hash,
633  store->get(path+"/"+_hashmap.getName(did))));
634  }
635  }
636 
637  else if (_hashmap.isEHash())
638  {
639  // for Electronics Hashes
640  std::vector<HcalElectronicsId> eids =
642  for (std::vector<HcalElectronicsId>::const_iterator it=
643  eids.begin(); it!=eids.end(); ++it)
644  {
645  HcalElectronicsId eid = HcalElectronicsId(it->rawId());
646  uint32_t hash = _hashmap.getHash(eid);
647  MEMap::iterator mit = _mes.find(hash);
648  if (mit!=_mes.end())
649  continue;
650 
652  _mes.insert(
653  std::make_pair(hash,
654  store->get(path+"/"+_hashmap.getName(eid))));
655  }
656  }
657  else if (_hashmap.isTHash())
658  {
659  // for TrigTower Hashes
660  std::vector<HcalTrigTowerDetId> tids =
661  emap->allTriggerId();
662  for (std::vector<HcalTrigTowerDetId>::const_iterator it=
663  tids.begin(); it!=tids.end(); ++it)
664  {
665  HcalTrigTowerDetId tid = HcalTrigTowerDetId(it->rawId());
666  uint32_t hash = _hashmap.getHash(tid);
667  MEMap::iterator mit = _mes.find(hash);
668  if (mit!=_mes.end())
669  continue;
670 
672  _mes.insert(
673  std::make_pair(hash,
674  store->get(path+"/"+_hashmap.getName(tid))));
675  }
676  }
677  }
678 
679  /* virtual */ void Container1D::load(DQMStore *store,
680  HcalElectronicsMap const* emap, filter::HashFilter const& filter,
681  std::string const &subsystem,
682  std::string const& aux, std::string const& prepend,
684  {
685  // full path to where all the plots are living
686  // prepend/subsystem/taskname/QxvsQy_auxilary/HashType
687  // if loaded and not stripped, then
688  // prepend/subsystem/Run summary/taskname/...
690  std::string path = (prepend.empty()?prepend:prepend+"/")+
691  subsystem+"/"+(mode==DQMStore::KeepRunDirs?"Run summary/":"")
692  +_folder+"/"+_qname+
693  (aux.empty()?aux:"_"+aux)+"/"+_hashmap.getHashTypeName();
694  _logger.debug("FULLPATH::"+path);
695 
696  if (_hashmap.isDHash())
697  {
698  // for Detector Hashes
699  std::vector<HcalGenericDetId> dids = emap->allPrecisionId();
700  for (std::vector<HcalGenericDetId>::const_iterator it=
701  dids.begin(); it!=dids.end(); ++it)
702  {
703  // skip trigger towers and calibration
704  if (!it->isHcalDetId())
705  continue;
706 
707  HcalDetId did = HcalDetId(it->rawId());
708  uint32_t hash = _hashmap.getHash(did);
709  MEMap::iterator mit = _mes.find(hash);
710 
711  // skip this guy, it's already present
712  if (mit!=_mes.end())
713  continue;
714  // filter out what's not needed
715  if (filter.filter(did))
716  continue;
717 
719  _mes.insert(
720  std::make_pair(hash,
721  store->get(path+"/"+_hashmap.getName(did))));
722  }
723  }
724 
725  else if (_hashmap.isEHash())
726  {
727  // for Electronics Hashes
728  std::vector<HcalElectronicsId> eids =
730  for (std::vector<HcalElectronicsId>::const_iterator it=
731  eids.begin(); it!=eids.end(); ++it)
732  {
733  HcalElectronicsId eid = HcalElectronicsId(it->rawId());
734  uint32_t hash = _hashmap.getHash(eid);
735  MEMap::iterator mit = _mes.find(hash);
736 
737  // skip this guy, it's already present
738  if (mit!=_mes.end())
739  continue;
740  // filter out
741  if (filter.filter(eid))
742  continue;
743 
745  _mes.insert(
746  std::make_pair(hash,
747  store->get(path+"/"+_hashmap.getName(eid))));
748  }
749  }
750  else if (_hashmap.isTHash())
751  {
752  // for TrigTower Hashes
753  std::vector<HcalTrigTowerDetId> tids =
754  emap->allTriggerId();
755  for (std::vector<HcalTrigTowerDetId>::const_iterator it=
756  tids.begin(); it!=tids.end(); ++it)
757  {
758  HcalTrigTowerDetId tid = HcalTrigTowerDetId(it->rawId());
759  uint32_t hash = _hashmap.getHash(tid);
760  MEMap::iterator mit = _mes.find(hash);
761 
762  // skip if this guy already exists
763  if (mit!=_mes.end())
764  continue;
765  // filter out
766  if (filter.filter(tid))
767  continue;
768 
770  _mes.insert(
771  std::make_pair(hash,
772  store->get(path+"/"+_hashmap.getName(tid))));
773  }
774  }
775  }
776 
777  // load w/o a filter
778  /* virtual */ void Container1D::load(DQMStore::IGetter& ig,
779  HcalElectronicsMap const* emap, std::string const& subsystem,
780  std::string const& aux)
781  {
782  // full path to where all the plots are living
783  // prepend/subsystem/taskname/QxvsQy_auxilary/HashType
785  std::string path =
786  subsystem+"/"+_folder+"/"+_qname+
787  (aux.empty()?aux:"_"+aux)+"/"+_hashmap.getHashTypeName();
788  _logger.debug("FULLPATH::"+path);
789 
790  if (_hashmap.isDHash())
791  {
792  // for Detector Hashes
793  std::vector<HcalGenericDetId> dids = emap->allPrecisionId();
794  for (std::vector<HcalGenericDetId>::const_iterator it=
795  dids.begin(); it!=dids.end(); ++it)
796  {
797  // skip trigger towers and calibration
798  if (!it->isHcalDetId())
799  continue;
800 
801  HcalDetId did = HcalDetId(it->rawId());
802  uint32_t hash = _hashmap.getHash(did);
803  MEMap::iterator mit = _mes.find(hash);
804 
805  // skip this guy, it's already present
806  if (mit!=_mes.end())
807  continue;
808 
810  _mes.insert(
811  std::make_pair(hash,
812  ig.get(path+"/"+_hashmap.getName(did))));
813  }
814  }
815 
816  else if (_hashmap.isEHash())
817  {
818  // for Electronics Hashes
819  std::vector<HcalElectronicsId> eids =
821  for (std::vector<HcalElectronicsId>::const_iterator it=
822  eids.begin(); it!=eids.end(); ++it)
823  {
824  HcalElectronicsId eid = HcalElectronicsId(it->rawId());
825  uint32_t hash = _hashmap.getHash(eid);
826  MEMap::iterator mit = _mes.find(hash);
827 
828  // skip this guy, it's already present
829  if (mit!=_mes.end())
830  continue;
831 
833  _mes.insert(
834  std::make_pair(hash,
835  ig.get(path+"/"+_hashmap.getName(eid))));
836  }
837  }
838  else if (_hashmap.isTHash())
839  {
840  // for TrigTower Hashes
841  std::vector<HcalTrigTowerDetId> tids =
842  emap->allTriggerId();
843  for (std::vector<HcalTrigTowerDetId>::const_iterator it=
844  tids.begin(); it!=tids.end(); ++it)
845  {
846  HcalTrigTowerDetId tid = HcalTrigTowerDetId(it->rawId());
847  uint32_t hash = _hashmap.getHash(tid);
848  MEMap::iterator mit = _mes.find(hash);
849 
850  // skip if this guy already exists
851  if (mit!=_mes.end())
852  continue;
853 
855  _mes.insert(
856  std::make_pair(hash,
857  ig.get(path+"/"+_hashmap.getName(tid))));
858  }
859  }
860  }
861 
862  // load w/ a filter
863  /* virtual */ void Container1D::load(DQMStore::IGetter& ig,
864  HcalElectronicsMap const* emap, filter::HashFilter const& filter,
865  std::string const& subsystem,
866  std::string const& aux)
867  {
868  // full path to where all the plots are living
869  // prepend/subsystem/taskname/QxvsQy_auxilary/HashType
871  std::string path =
872  subsystem+"/"+_folder+"/"+_qname+
873  (aux.empty()?aux:"_"+aux)+"/"+_hashmap.getHashTypeName();
874  _logger.debug("FULLPATH::"+path);
875 
876  if (_hashmap.isDHash())
877  {
878  // for Detector Hashes
879  std::vector<HcalGenericDetId> dids = emap->allPrecisionId();
880  for (std::vector<HcalGenericDetId>::const_iterator it=
881  dids.begin(); it!=dids.end(); ++it)
882  {
883  // skip trigger towers and calibration
884  if (!it->isHcalDetId())
885  continue;
886 
887  HcalDetId did = HcalDetId(it->rawId());
888  uint32_t hash = _hashmap.getHash(did);
889  MEMap::iterator mit = _mes.find(hash);
890 
891  // skip this guy, it's already present
892  if (mit!=_mes.end())
893  continue;
894  // filter out what's not needed
895  if (filter.filter(did))
896  continue;
897 
899  _mes.insert(
900  std::make_pair(hash,
901  ig.get(path+"/"+_hashmap.getName(did))));
902  }
903  }
904 
905  else if (_hashmap.isEHash())
906  {
907  // for Electronics Hashes
908  std::vector<HcalElectronicsId> eids =
910  for (std::vector<HcalElectronicsId>::const_iterator it=
911  eids.begin(); it!=eids.end(); ++it)
912  {
913  HcalElectronicsId eid = HcalElectronicsId(it->rawId());
914  uint32_t hash = _hashmap.getHash(eid);
915  MEMap::iterator mit = _mes.find(hash);
916 
917  // skip this guy, it's already present
918  if (mit!=_mes.end())
919  continue;
920  // filter out
921  if (filter.filter(eid))
922  continue;
923 
925  _mes.insert(
926  std::make_pair(hash,
927  ig.get(path+"/"+_hashmap.getName(eid))));
928  }
929  }
930  else if (_hashmap.isTHash())
931  {
932  // for TrigTower Hashes
933  std::vector<HcalTrigTowerDetId> tids =
934  emap->allTriggerId();
935  for (std::vector<HcalTrigTowerDetId>::const_iterator it=
936  tids.begin(); it!=tids.end(); ++it)
937  {
938  HcalTrigTowerDetId tid = HcalTrigTowerDetId(it->rawId());
939  uint32_t hash = _hashmap.getHash(tid);
940  MEMap::iterator mit = _mes.find(hash);
941 
942  // skip if this guy already exists
943  if (mit!=_mes.end())
944  continue;
945  // filter out
946  if (filter.filter(tid))
947  continue;
948 
950  _mes.insert(
951  std::make_pair(hash,
952  ig.get(path+"/"+_hashmap.getName(tid))));
953  }
954  }
955  }
956 
957  // Book
958  /* virtual */ void Container1D::book(DQMStore::IBooker& ib,
959  HcalElectronicsMap const *emap,
960  std::string subsystem, std::string aux)
961  {
962  // full path to where all the plots are living
963  // subsystem/taskname/QxvsQy_auxilary/HashType
964  ib.setCurrentFolder(subsystem+"/"+_folder+"/"+_qname+
965  (aux.empty()?aux:"_"+aux)+"/"+_hashmap.getHashTypeName());
967  if (_hashmap.isDHash())
968  {
969  // for Detector Hashes
970  std::vector<HcalGenericDetId> dids = emap->allPrecisionId();
971  for (std::vector<HcalGenericDetId>::const_iterator it=
972  dids.begin(); it!=dids.end(); ++it)
973  {
974  // skip trigger towers and calibration
975  if (!it->isHcalDetId())
976  continue;
977 
978  HcalDetId did = HcalDetId(it->rawId());
979  uint32_t hash = _hashmap.getHash(did);
980  MEMap::iterator mit = _mes.find(hash);
981  if (mit!=_mes.end())
982  continue;
983 
985  _mes.insert(
986  std::make_pair(hash, ib.book1D(_hashmap.getName(did),
987  _hashmap.getName(did), _qx->nbins(), _qx->min(),
988  _qx->max())));
989 
990  // customize
991  customize(_mes[hash]);
992  }
993  }
994 
995  else if (_hashmap.isEHash())
996  {
997  // for Electronics Hashes
998  std::vector<HcalElectronicsId> eids =
1000  for (std::vector<HcalElectronicsId>::const_iterator it=
1001  eids.begin(); it!=eids.end(); ++it)
1002  {
1003 
1004  HcalElectronicsId eid = HcalElectronicsId(it->rawId());
1005  uint32_t hash = _hashmap.getHash(eid);
1006  MEMap::iterator mit = _mes.find(hash);
1007  if (mit!=_mes.end())
1008  continue;
1009 
1010  _logger.debug(_hashmap.getName(eid));
1011  _mes.insert(
1012  std::make_pair(hash,
1013  ib.book1D(_hashmap.getName(eid),
1014  _hashmap.getName(eid),
1015  _qx->nbins(), _qx->min(), _qx->max())));
1016 
1017  // customize
1018  customize(_mes[hash]);
1019  }
1020  }
1021  else if (_hashmap.isTHash())
1022  {
1023  // for TrigTower Hashes
1024  std::vector<HcalTrigTowerDetId> tids =
1025  emap->allTriggerId();
1026  for (std::vector<HcalTrigTowerDetId>::const_iterator it=
1027  tids.begin(); it!=tids.end(); ++it)
1028  {
1029  HcalTrigTowerDetId tid = HcalTrigTowerDetId(it->rawId());
1030  uint32_t hash = _hashmap.getHash(tid);
1031  MEMap::iterator mit = _mes.find(hash);
1032  if (mit!=_mes.end())
1033  continue;
1034 
1035  _logger.debug(_hashmap.getName(tid));
1036  _mes.insert(
1037  std::make_pair(hash,
1038  ib.book1D(_hashmap.getName(tid),
1039  _hashmap.getName(tid),
1040  _qx->nbins(), _qx->min(), _qx->max())));
1041  // customize
1042  customize(_mes[hash]);
1043  }
1044  }
1045  }
1046 
1047  // Book
1049  HcalElectronicsMap const *emap, filter::HashFilter const& filter,
1050  std::string subsystem, std::string aux)
1051  {
1052  // full path to where all the plots are living
1053  // subsystem/taskname/QxvsQy_auxilary/HashType
1054  ib.setCurrentFolder(subsystem+"/"+_folder+"/"+_qname+
1055  (aux.empty()?aux:"_"+aux)+"/"+_hashmap.getHashTypeName());
1057 
1058  if (_hashmap.isDHash())
1059  {
1060  // for Detector Hashes
1061  std::vector<HcalGenericDetId> dids = emap->allPrecisionId();
1062  for (std::vector<HcalGenericDetId>::const_iterator it=
1063  dids.begin(); it!=dids.end(); ++it)
1064  {
1065  // skip trigger towers and calibration
1066  if (!it->isHcalDetId())
1067  continue;
1068 
1069  HcalDetId did = HcalDetId(it->rawId());
1070  uint32_t hash = _hashmap.getHash(did);
1071  MEMap::iterator mit = _mes.find(hash);
1072  if (mit!=_mes.end())
1073  continue;
1074  if (filter.filter(did))
1075  continue;
1076 
1077  _logger.debug(_hashmap.getName(did));
1078  _mes.insert(
1079  std::make_pair(hash, ib.book1D(_hashmap.getName(did),
1080  _hashmap.getName(did), _qx->nbins(), _qx->min(),
1081  _qx->max())));
1082 
1083  // customize
1084  customize(_mes[hash]);
1085  }
1086  }
1087 
1088  else if (_hashmap.isEHash())
1089  {
1090  // for Electronics Hashes
1091  std::vector<HcalElectronicsId> eids =
1092  emap->allElectronicsIdPrecision();
1093  for (std::vector<HcalElectronicsId>::const_iterator it=
1094  eids.begin(); it!=eids.end(); ++it)
1095  {
1096  HcalElectronicsId eid = HcalElectronicsId(it->rawId());
1097  uint32_t hash = _hashmap.getHash(eid);
1098  MEMap::iterator mit = _mes.find(hash);
1099  if (mit!=_mes.end())
1100  continue;
1101  if (filter.filter(eid))
1102  continue;
1103 
1104  _logger.debug(_hashmap.getName(eid));
1105  _mes.insert(
1106  std::make_pair(hash,
1107  ib.book1D(_hashmap.getName(eid),
1108  _hashmap.getName(eid),
1109  _qx->nbins(), _qx->min(), _qx->max())));
1110 
1111  // customize
1112  customize(_mes[hash]);
1113  }
1114  }
1115  else if (_hashmap.isTHash())
1116  {
1117  // for TrigTower Hashes
1118  std::vector<HcalTrigTowerDetId> tids =
1119  emap->allTriggerId();
1120  for (std::vector<HcalTrigTowerDetId>::const_iterator it=
1121  tids.begin(); it!=tids.end(); ++it)
1122  {
1123  HcalTrigTowerDetId tid = HcalTrigTowerDetId(it->rawId());
1124  uint32_t hash = _hashmap.getHash(tid);
1125  MEMap::iterator mit = _mes.find(hash);
1126  if (mit!=_mes.end())
1127  continue;
1128  if (filter.filter(tid))
1129  continue;
1130 
1131  _logger.debug(_hashmap.getName(tid));
1132  _mes.insert(
1133  std::make_pair(hash,
1134  ib.book1D(_hashmap.getName(tid),
1135  _hashmap.getName(tid),
1136  _qx->nbins(), _qx->min(), _qx->max())));
1137  // customize
1138  customize(_mes[hash]);
1139  }
1140  }
1141  }
1142 
1143  /* virtual */ void Container1D::book(DQMStore *store,
1144  HcalElectronicsMap const *emap,
1145  std::string subsystem, std::string aux)
1146  {
1147  // full path to where all the plots are living
1148  // subsystem/taskname/QxvsQy_auxilary/HashType
1149  store->setCurrentFolder(subsystem+"/"+_folder+"/"+_qname+
1150  (aux.empty()?aux:"_"+aux)+"/"+_hashmap.getHashTypeName());
1152  if (_hashmap.isDHash())
1153  {
1154  // for Detector Hashes
1155  std::vector<HcalGenericDetId> dids = emap->allPrecisionId();
1156  for (std::vector<HcalGenericDetId>::const_iterator it=
1157  dids.begin(); it!=dids.end(); ++it)
1158  {
1159  // skip trigger towers and calibration
1160  if (!it->isHcalDetId())
1161  continue;
1162 
1163  HcalDetId did = HcalDetId(it->rawId());
1164  uint32_t hash = _hashmap.getHash(did);
1165  MEMap::iterator mit = _mes.find(hash);
1166  if (mit!=_mes.end())
1167  continue;
1168 
1169  _logger.debug(_hashmap.getName(did));
1170  _mes.insert(
1171  std::make_pair(hash, store->book1D(_hashmap.getName(did),
1172  _hashmap.getName(did), _qx->nbins(), _qx->min(),
1173  _qx->max())));
1174 
1175  // customize
1176  customize(_mes[hash]);
1177  }
1178  }
1179 
1180  else if (_hashmap.isEHash())
1181  {
1182  // for Electronics Hashes
1183  std::vector<HcalElectronicsId> eids =
1184  emap->allElectronicsIdPrecision();
1185  for (std::vector<HcalElectronicsId>::const_iterator it=
1186  eids.begin(); it!=eids.end(); ++it)
1187  {
1188  HcalElectronicsId eid = HcalElectronicsId(it->rawId());
1189  uint32_t hash = _hashmap.getHash(eid);
1190  MEMap::iterator mit = _mes.find(hash);
1191  if (mit!=_mes.end())
1192  continue;
1193 
1194  _logger.debug(_hashmap.getName(eid));
1195  _mes.insert(
1196  std::make_pair(hash,
1197  store->book1D(_hashmap.getName(eid),
1198  _hashmap.getName(eid),
1199  _qx->nbins(), _qx->min(), _qx->max())));
1200 
1201  // customize
1202  customize(_mes[hash]);
1203  }
1204  }
1205  else if (_hashmap.isTHash())
1206  {
1207  // for TrigTower Hashes
1208  std::vector<HcalTrigTowerDetId> tids =
1209  emap->allTriggerId();
1210  for (std::vector<HcalTrigTowerDetId>::const_iterator it=
1211  tids.begin(); it!=tids.end(); ++it)
1212  {
1213  HcalTrigTowerDetId tid = HcalTrigTowerDetId(it->rawId());
1214  uint32_t hash = _hashmap.getHash(tid);
1215  MEMap::iterator mit = _mes.find(hash);
1216  if (mit!=_mes.end())
1217  continue;
1218 
1219  _logger.debug(_hashmap.getName(tid));
1220  _mes.insert(
1221  std::make_pair(hash,
1222  store->book1D(_hashmap.getName(tid),
1223  _hashmap.getName(tid),
1224  _qx->nbins(), _qx->min(), _qx->max())));
1225  // customize
1226  customize(_mes[hash]);
1227  }
1228  }
1229  }
1230 
1231  /* virtual */ void Container1D::book(DQMStore *store,
1232  HcalElectronicsMap const *emap, filter::HashFilter const& filter,
1233  std::string subsystem, std::string aux)
1234  {
1235  // full path to where all the plots are living
1236  // subsystem/taskname/QxvsQy_auxilary/HashType
1237  store->setCurrentFolder(subsystem+"/"+_folder+"/"+_qname+
1238  (aux.empty()?aux:"_"+aux)+"/"+_hashmap.getHashTypeName());
1240  if (_hashmap.isDHash())
1241  {
1242  // for Detector Hashes
1243  std::vector<HcalGenericDetId> dids = emap->allPrecisionId();
1244  for (std::vector<HcalGenericDetId>::const_iterator it=
1245  dids.begin(); it!=dids.end(); ++it)
1246  {
1247  // skip trigger towers and calibration
1248  if (!it->isHcalDetId())
1249  continue;
1250 
1251  HcalDetId did = HcalDetId(it->rawId());
1252  uint32_t hash = _hashmap.getHash(did);
1253  MEMap::iterator mit = _mes.find(hash);
1254  if (mit!=_mes.end())
1255  continue;
1256  if (filter.filter(did))
1257  continue;
1258 
1259  _logger.debug(_hashmap.getName(did));
1260  _mes.insert(
1261  std::make_pair(hash, store->book1D(_hashmap.getName(did),
1262  _hashmap.getName(did), _qx->nbins(), _qx->min(),
1263  _qx->max())));
1264 
1265  // customize
1266  customize(_mes[hash]);
1267  }
1268  }
1269 
1270  else if (_hashmap.isEHash())
1271  {
1272  // for Electronics Hashes
1273  std::vector<HcalElectronicsId> eids =
1274  emap->allElectronicsIdPrecision();
1275  for (std::vector<HcalElectronicsId>::const_iterator it=
1276  eids.begin(); it!=eids.end(); ++it)
1277  {
1278  HcalElectronicsId eid = HcalElectronicsId(it->rawId());
1279  uint32_t hash = _hashmap.getHash(eid);
1280  MEMap::iterator mit = _mes.find(hash);
1281  if (mit!=_mes.end())
1282  continue;
1283  if (filter.filter(eid))
1284  continue;
1285 
1286  _logger.debug(_hashmap.getName(eid));
1287  _mes.insert(
1288  std::make_pair(hash,
1289  store->book1D(_hashmap.getName(eid),
1290  _hashmap.getName(eid),
1291  _qx->nbins(), _qx->min(), _qx->max())));
1292 
1293  // customize
1294  customize(_mes[hash]);
1295  }
1296  }
1297  else if (_hashmap.isTHash())
1298  {
1299  // for TrigTower Hashes
1300  std::vector<HcalTrigTowerDetId> tids =
1301  emap->allTriggerId();
1302  for (std::vector<HcalTrigTowerDetId>::const_iterator it=
1303  tids.begin(); it!=tids.end(); ++it)
1304  {
1305  HcalTrigTowerDetId tid = HcalTrigTowerDetId(it->rawId());
1306  uint32_t hash = _hashmap.getHash(tid);
1307  MEMap::iterator mit = _mes.find(hash);
1308  if (mit!=_mes.end())
1309  continue;
1310  if (filter.filter(tid))
1311  continue;
1312 
1313  _logger.debug(_hashmap.getName(tid));
1314  _mes.insert(
1315  std::make_pair(hash,
1316  store->book1D(_hashmap.getName(tid),
1317  _hashmap.getName(tid),
1318  _qx->nbins(), _qx->min(), _qx->max())));
1319  // customize
1320  customize(_mes[hash]);
1321  }
1322  }
1323  }
1324 
1325  /* virtual */ void Container1D::customize(MonitorElement* me)
1326  {
1327  // set labels
1328  me->setAxisTitle(_qx->name(), 1);
1329  me->setAxisTitle(_qy->name(), 2);
1330 
1331  // set bits
1332  TH1 *h = me->getTH1();
1333  _qx->setBits(h);
1334  _qy->setBits(h);
1335 
1336  // set labels
1337  std::vector<std::string> xlabels = _qx->getLabels();
1338  for (unsigned int i=0; i<xlabels.size(); i++) {
1339  me->setBinLabel(i+1, xlabels[i], 1);
1340  }
1341  }
1342 
1343  /* virtual */ void Container1D::extendAxisRange(int l)
1344  {
1345  if (l<_qx->nbins())
1346  return;
1347 
1348  // inflate all the mes
1349  BOOST_FOREACH(MEMap::value_type &pair, _mes)
1350  {
1351  int x=_qx->nbins();
1352  while (l>=x)
1353  {
1354  pair.second->getTH1()->LabelsInflate();
1355  x*=2;
1356  _qx->setMax(x);
1357  }
1358  }
1359  }
1360 
1361  /* virtual */ void Container1D::setLumiFlag()
1362  {
1363  BOOST_FOREACH(MEMap::value_type &pair, _mes)
1364  {
1365  pair.second->setLumiFlag();
1366  }
1367  }
1368 
1369  void Container1D::showOverflowX(bool showOverflow) {
1370  _qx->showOverflow(showOverflow);
1371  }
1372 
1373  void Container1D::showOverflowY(bool showOverflow) {
1374  _qy->showOverflow(showOverflow);
1375  }
1376 
1377 }
1378 
1379 
1380 
1381 
1382 
1383 
1384 
virtual void setBits(TH1 *o)
Definition: Quantity.h:65
virtual void customize(MonitorElement *)
virtual void initialize(std::string const &folder, std::string const &qname, int debug=0)
Definition: Container.h:33
virtual void initialize(std::string const &folder, hashfunctions::HashType, quantity::Quantity *, quantity::Quantity *qy=new quantity::ValueQuantity(quantity::fN), int debug=0)
Definition: Container1D.cc:41
virtual std::string name()
Definition: Quantity.h:47
virtual void setAxisType(AxisType at)
Definition: Quantity.h:49
std::vector< HcalElectronicsId > allElectronicsIdPrecision() const
virtual double getRMS(HcalDetId const &, int axix=1)
Definition: Container1D.cc:238
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
virtual std::vector< std::string > getLabels()
Definition: Quantity.h:78
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:837
virtual bool isTHash() const
Definition: HashMapper.h:63
virtual double max()
Definition: Quantity.h:76
virtual void initialize(hashfunctions::HashType htype)
Definition: HashMapper.h:29
void debug(STDTYPE const &msg) const
Definition: Logger.h:31
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)
#define nullptr
OpenRunDirs
Definition: DQMStore.h:87
virtual std::string getHashTypeName() const
Definition: HashMapper.h:50
~Container1D() override
Definition: Container1D.cc:23
virtual void fill(uint32_t)
Definition: Container1D.cc:83
virtual void reset()
Definition: Container1D.cc:66
quantity::Quantity * _qx
Definition: Container1D.h:332
virtual int getValue(HcalDetId const &)
Definition: Quantity.h:59
virtual void showOverflowX(bool showOverflow)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
virtual uint32_t getBin(HcalDetId const &)
Definition: Quantity.h:53
std::vector< HcalGenericDetId > allPrecisionId() const
virtual void showOverflowY(bool showOverflow)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
Definition: DQMStore.cc:1610
virtual double getMean(HcalDetId const &, int axis=1)
Definition: Container1D.cc:233
virtual void showOverflow(bool showOverflow)
Definition: Quantity.h:85
std::string _folder
Definition: Container.h:42
uint32_t getHash(HcalDetId const &did) const override
Definition: HashMapper.h:33
#define debug
Definition: HDRShower.cc:19
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
virtual void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="")
Definition: Container1D.cc:958
virtual void load(DQMStore *, HcalElectronicsMap const *, std::string const &subsystem="Hcal", std::string const &aux="", std::string const &prepend="", DQMStore::OpenRunDirs mode=DQMStore::StripRunDirs)
Definition: Container1D.cc:597
virtual void setBinContent(HcalDetId const &, int)
Definition: Container1D.cc:244
mapper::HashMapper _hashmap
Definition: Container1D.h:331
virtual void print()
Definition: Container1D.cc:74
virtual double min()
Definition: Quantity.h:75
virtual bool isDHash() const
Definition: HashMapper.h:56
virtual void setLumiFlag()
virtual double getBinContent(HcalDetId const &)
Definition: Container1D.cc:215
std::string _qname
Definition: Container.h:43
virtual bool filter(HcalDetId const &) const
Definition: HashFilter.cc:38
virtual QuantityType type()
Definition: Quantity.h:46
virtual bool isEHash() const
Definition: HashMapper.h:58
virtual double getBinEntries(HcalDetId const &)
Definition: Container1D.cc:198
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
quantity::Quantity * _qy
Definition: Container1D.h:333
Readout chain identification for Hcal.
std::vector< HcalTrigTowerDetId > allTriggerId() const
std::string getName(HcalDetId const &did) const override
Definition: HashMapper.h:42
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:545
virtual void extendAxisRange(int)
ib
Definition: cuy.py:661