CMS 3D CMS Logo

MESetDet0D.cc
Go to the documentation of this file.
2 
3 namespace ecaldqm {
5  binning::ObjectType _otype,
8  : MESetEcal(_fullPath, _otype, _btype, _kind, 0, nullptr, nullptr) {
9  switch (kind_) {
11  break;
12  default:
13  throw_("Unsupported MonitorElement kind");
14  }
15  }
16 
17  MESetDet0D::MESetDet0D(MESetDet0D const &_orig) : MESetEcal(_orig) {}
18 
20 
21  MESet *MESetDet0D::clone(std::string const &_path /* = ""*/) const {
23  if (!_path.empty())
24  path_ = _path;
25  MESet *copy(new MESetDet0D(*this));
26  path_ = path;
27  return copy;
28  }
29 
30  void MESetDet0D::fill(DetId const &_id, double _value, double, double) {
31  if (!active_)
32  return;
33 
34  unsigned iME(binning::findPlotIndex(otype_, _id));
35  checkME_(iME);
36 
37  mes_[iME]->Fill(_value);
38  }
39 
40  void MESetDet0D::fill(EcalElectronicsId const &_id, double _value, double, double) {
41  if (!active_)
42  return;
43 
44  unsigned iME(binning::findPlotIndex(otype_, _id));
45  checkME_(iME);
46 
47  mes_[iME]->Fill(_value);
48  }
49 
50  void MESetDet0D::fill(int _dcctccid, double _value, double, double) {
51  if (!active_)
52  return;
53 
54  unsigned iME(binning::findPlotIndex(otype_, _dcctccid, btype_));
55  checkME_(iME);
56 
57  mes_[iME]->Fill(_value);
58  }
59 
60  double MESetDet0D::getBinContent(DetId const &_id, int) const {
61  if (!active_)
62  return 0.;
63 
64  unsigned iME(binning::findPlotIndex(otype_, _id));
65  checkME_(iME);
66 
67  return mes_[iME]->getFloatValue();
68  }
69 
70  double MESetDet0D::getBinContent(EcalElectronicsId const &_id, int) const {
71  if (!active_)
72  return 0.;
73 
74  unsigned iME(binning::findPlotIndex(otype_, _id));
75  checkME_(iME);
76 
77  return mes_[iME]->getFloatValue();
78  }
79 
80  double MESetDet0D::getBinContent(int _dcctccid, int) const {
81  if (!active_)
82  return 0.;
83 
84  unsigned iME(binning::findPlotIndex(otype_, _dcctccid, btype_));
85  checkME_(iME);
86 
87  return mes_[iME]->getFloatValue();
88  }
89 
90  void MESetDet0D::reset(double _value /* = 0.*/, double, double) {
91  unsigned nME(mes_.size());
92  for (unsigned iME(0); iME < nME; iME++)
93  mes_[iME]->Fill(_value);
94  }
95 } // namespace ecaldqm
MonitorElement::Kind kind_
Definition: MESet.h:129
~MESetDet0D() override
Definition: MESetDet0D.cc:19
def copy(args, dbName)
virtual void checkME_(unsigned _iME) const
Definition: MESet.h:114
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
#define nullptr
void fill(DetId const &, double, double=0., double=0.) override
Definition: MESetDet0D.cc:30
MESet * clone(std::string const &="") const override
Definition: MESetDet0D.cc:21
void throw_(std::string const &_message) const
Definition: MESet.h:122
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MESetDet0D(std::string const &, binning::ObjectType, binning::BinningType, MonitorElement::Kind)
Definition: MESetDet0D.cc:4
Definition: DetId.h:18
unsigned findPlotIndex(ObjectType, DetId const &)
bool active_
Definition: MESet.h:134
binning::ObjectType otype_
Definition: MESet.h:127
void reset(double=0., double=0., double=0.) override
Definition: MESetDet0D.cc:90
double getBinContent(DetId const &, int=0) const override
Definition: MESetDet0D.cc:60
binning::BinningType btype_
Definition: MESet.h:128
std::string path_
Definition: MESet.h:126
std::vector< MonitorElement * > mes_
Definition: MESet.h:124