CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MESetDet0D.cc
Go to the documentation of this file.
2 
3 namespace ecaldqm
4 {
6  MESetEcal(_fullPath, _otype, _btype, _kind, 0, 0, 0)
7  {
8  switch(kind_){
10  break;
11  default:
12  throw_("Unsupported MonitorElement kind");
13  }
14  }
15 
17  MESetEcal(_orig)
18  {
19  }
20 
22  {
23  }
24 
25  MESet*
26  MESetDet0D::clone(std::string const& _path/* = ""*/) const
27  {
29  if(_path != "") path_ = _path;
30  MESet* copy(new MESetDet0D(*this));
31  path_ = path;
32  return copy;
33  }
34 
35  void
36  MESetDet0D::fill(DetId const& _id, double _value, double, double)
37  {
38  if(!active_) return;
39 
40  unsigned iME(binning::findPlotIndex(otype_, _id));
41  checkME_(iME);
42 
43  mes_[iME]->Fill(_value);
44  }
45 
46  void
47  MESetDet0D::fill(EcalElectronicsId const& _id, double _value, double, double)
48  {
49  if(!active_) return;
50 
51  unsigned iME(binning::findPlotIndex(otype_, _id));
52  checkME_(iME);
53 
54  mes_[iME]->Fill(_value);
55  }
56 
57  void
58  MESetDet0D::fill(int _dcctccid, double _value, double, double)
59  {
60  if(!active_) return;
61 
62  unsigned iME(binning::findPlotIndex(otype_, _dcctccid, btype_));
63  checkME_(iME);
64 
65  mes_[iME]->Fill(_value);
66  }
67 
68  double
69  MESetDet0D::getBinContent(DetId const& _id, int) const
70  {
71  if(!active_) return 0.;
72 
73  unsigned iME(binning::findPlotIndex(otype_, _id));
74  checkME_(iME);
75 
76  return mes_[iME]->getFloatValue();
77  }
78 
79  double
81  {
82  if(!active_) return 0.;
83 
84  unsigned iME(binning::findPlotIndex(otype_, _id));
85  checkME_(iME);
86 
87  return mes_[iME]->getFloatValue();
88  }
89 
90  double
91  MESetDet0D::getBinContent(int _dcctccid, int) const
92  {
93  if(!active_) return 0.;
94 
95  unsigned iME(binning::findPlotIndex(otype_, _dcctccid, btype_));
96  checkME_(iME);
97 
98  return mes_[iME]->getFloatValue();
99  }
100 
101  void
102  MESetDet0D::reset(double _value/* = 0.*/, double, double)
103  {
104  unsigned nME(mes_.size());
105  for(unsigned iME(0); iME < nME; iME++)
106  mes_[iME]->Fill(_value);
107  }
108 }
MonitorElement::Kind kind_
Definition: MESet.h:134
virtual void checkME_(unsigned _iME) const
Definition: MESet.h:115
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
void fill(DetId const &, double, double=0., double=0.) override
Definition: MESetDet0D.cc:36
double getBinContent(DetId const &, int=0) const override
Definition: MESetDet0D.cc:69
MESet * clone(std::string const &="") const override
Definition: MESetDet0D.cc:26
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
void throw_(std::string const &_message) const
Definition: MESet.h:124
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MESetDet0D(std::string const &, binning::ObjectType, binning::BinningType, MonitorElement::Kind)
Definition: MESetDet0D.cc:5
Definition: DetId.h:18
unsigned findPlotIndex(ObjectType, DetId const &)
bool active_
Definition: MESet.h:138
binning::ObjectType otype_
Definition: MESet.h:132
void reset(double=0., double=0., double=0.) override
Definition: MESetDet0D.cc:102
binning::BinningType btype_
Definition: MESet.h:133
std::string path_
Definition: MESet.h:131