CMS 3D CMS Logo

MESetMulti.h
Go to the documentation of this file.
1 #ifndef MESetMulti_H
2 #define MESetMulti_H
3 
4 #include "MESet.h"
5 
6 namespace ecaldqm {
7  /* class MESetMulti
8  wrapper for a set of MESets
9  limit() filters out unused MESets
10  use() method sets the MESet to be used
11 */
12 
13  class MESetMulti : public MESet {
14  public:
15  typedef std::map<std::string, std::vector<std::string>> ReplCandidates;
16 
17  MESetMulti(MESet const &, ReplCandidates const &);
18  MESetMulti(MESetMulti const &);
19  ~MESetMulti() override;
20 
21  MESet &operator=(MESet const &) override;
22 
23  MESet *clone(std::string const & = "") const override;
24 
25  void book(DQMStore::IBooker &) override;
26  bool retrieve(DQMStore::IGetter &, std::string * = nullptr) const override;
27  void clear() const override;
28 
29  void fill(DetId const &_id, double _xyw = 1., double _yw = 1., double _w = 1.) override {
30  current_->fill(_id, _xyw, _yw, _w);
31  }
32  void fill(EcalElectronicsId const &_id, double _xyw = 1., double _yw = 1., double _w = 1.) override {
33  current_->fill(_id, _xyw, _yw, _w);
34  }
35  void fill(int _dcctccid, double _xyw = 1., double _yw = 1., double _w = 1.) override {
36  current_->fill(_dcctccid, _xyw, _yw, _w);
37  }
38  void fill(double _x, double _yw = 1., double _w = 1.) override { current_->fill(_x, _yw, _w); }
39 
40  void setBinContent(DetId const &_id, double _content) override { current_->setBinContent(_id, _content); }
41  void setBinContent(EcalElectronicsId const &_id, double _content) override {
42  current_->setBinContent(_id, _content);
43  }
44  void setBinContent(int _dcctccid, double _content) override { current_->setBinContent(_dcctccid, _content); }
45  void setBinContent(DetId const &_id, int _bin, double _content) override {
46  current_->setBinContent(_id, _bin, _content);
47  }
48  void setBinContent(EcalElectronicsId const &_id, int _bin, double _content) override {
49  current_->setBinContent(_id, _bin, _content);
50  }
51  void setBinContent(int _dcctccid, int _bin, double _content) override {
52  current_->setBinContent(_dcctccid, _bin, _content);
53  }
54 
55  void setBinError(DetId const &_id, double _error) override { current_->setBinError(_id, _error); }
56  void setBinError(EcalElectronicsId const &_id, double _error) override { current_->setBinError(_id, _error); }
57  void setBinError(int _dcctccid, double _error) override { current_->setBinError(_dcctccid, _error); }
58  void setBinError(DetId const &_id, int _bin, double _error) override { current_->setBinError(_id, _bin, _error); }
59  void setBinError(EcalElectronicsId const &_id, int _bin, double _error) override {
60  current_->setBinError(_id, _bin, _error);
61  }
62  void setBinError(int _dcctccid, int _bin, double _error) override {
63  current_->setBinError(_dcctccid, _bin, _error);
64  }
65 
66  void setBinEntries(DetId const &_id, double _entries) override { current_->setBinEntries(_id, _entries); }
67  void setBinEntries(EcalElectronicsId const &_id, double _entries) override {
68  current_->setBinEntries(_id, _entries);
69  }
70  void setBinEntries(int _dcctccid, double _entries) override { current_->setBinEntries(_dcctccid, _entries); }
71  void setBinEntries(DetId const &_id, int _bin, double _entries) override {
72  current_->setBinEntries(_id, _bin, _entries);
73  }
74  void setBinEntries(EcalElectronicsId const &_id, int _bin, double _entries) override {
75  current_->setBinEntries(_id, _bin, _entries);
76  }
77  void setBinEntries(int _dcctccid, int _bin, double _entries) override {
78  current_->setBinEntries(_dcctccid, _bin, _entries);
79  }
80 
81  double getBinContent(DetId const &_id, int _bin = 0) const override { return current_->getBinContent(_id, _bin); }
82  double getBinContent(EcalElectronicsId const &_id, int _bin = 0) const override {
83  return current_->getBinContent(_id, _bin);
84  }
85  double getBinContent(int _dcctccid, int _bin = 0) const override {
86  return current_->getBinContent(_dcctccid, _bin);
87  }
88 
89  double getBinError(DetId const &_id, int _bin = 0) const override { return current_->getBinError(_id, _bin); }
90  double getBinError(EcalElectronicsId const &_id, int _bin = 0) const override {
91  return current_->getBinError(_id, _bin);
92  }
93  double getBinError(int _dcctccid, int _bin = 0) const override { return current_->getBinError(_dcctccid, _bin); }
94 
95  double getBinEntries(DetId const &_id, int _bin = 0) const override { return current_->getBinEntries(_id, _bin); }
96  double getBinEntries(EcalElectronicsId const &_id, int _bin = 0) const override {
97  return current_->getBinEntries(_id, _bin);
98  }
99  double getBinEntries(int _dcctccid, int _bin = 0) const override {
100  return current_->getBinEntries(_dcctccid, _bin);
101  }
102 
103  void reset(double = 0., double = 0., double = 0.) override;
104  void resetAll(double = 0., double = 0., double = 0.) override;
105 
106  bool maskMatches(DetId const &_id, uint32_t _mask, StatusManager const *_statusManager) const override {
107  return current_ && current_->maskMatches(_id, _mask, _statusManager);
108  }
109 
110  bool isVariableBinning() const override { return current_->isVariableBinning(); }
111 
112  std::string const &getPath() const override { return current_->getPath(); }
113  MonitorElement const *getME(unsigned _iME) const override { return current_->getME(_iME); }
114  MonitorElement *getME(unsigned _iME) override { return current_->getME(_iME); }
115 
116  void use(unsigned) const;
117  MESet *getCurrent() const { return current_; }
118  unsigned getMultiplicity() const { return sets_.size(); }
119  unsigned getIndex(PathReplacements const &) const;
120 
121  const_iterator begin() const override { return const_iterator(*current_); }
122  const_iterator end() const override { return const_iterator(*current_, -1, -1); }
123  const_iterator beginChannel() const override { return current_->beginChannel(); }
124  iterator begin() override { return iterator(*current_); }
125  iterator end() override { return iterator(*current_, -1, -1); }
126  iterator beginChannel() override { return current_->beginChannel(); }
127 
128  protected:
129  mutable MESet *current_;
130  std::vector<MESet *> sets_;
131  ReplCandidates replCandidates_;
132  };
133 } // namespace ecaldqm
134 
135 #endif
MESet * getCurrent() const
Definition: MESetMulti.h:117
virtual std::string const & getPath() const
Definition: MESet.h:92
void setBinContent(DetId const &_id, int _bin, double _content) override
Definition: MESetMulti.h:45
void fill(int _dcctccid, double _xyw=1., double _yw=1., double _w=1.) override
Definition: MESetMulti.h:35
virtual MonitorElement const * getME(unsigned _iME) const
Definition: MESet.h:98
double getBinError(EcalElectronicsId const &_id, int _bin=0) const override
Definition: MESetMulti.h:90
void setBinError(int _dcctccid, int _bin, double _error) override
Definition: MESetMulti.h:62
void reset(double=0., double=0., double=0.) override
Definition: MESetMulti.cc:120
virtual double getBinError(DetId const &, int=0) const
Definition: MESet.h:76
double getBinError(int _dcctccid, int _bin=0) const override
Definition: MESetMulti.h:93
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
void setBinEntries(DetId const &_id, double _entries) override
Definition: MESetMulti.h:66
void clear() const override
Definition: MESetMulti.cc:113
double getBinContent(DetId const &_id, int _bin=0) const override
Definition: MESetMulti.h:81
void setBinContent(DetId const &_id, double _content) override
Definition: MESetMulti.h:40
double getBinError(DetId const &_id, int _bin=0) const override
Definition: MESetMulti.h:89
virtual void setBinEntries(DetId const &, double)
Definition: MESet.h:65
double getBinContent(int _dcctccid, int _bin=0) const override
Definition: MESetMulti.h:85
void setBinEntries(int _dcctccid, int _bin, double _entries) override
Definition: MESetMulti.h:77
bool isVariableBinning() const override
Definition: MESetMulti.h:110
void setBinError(int _dcctccid, double _error) override
Definition: MESetMulti.h:57
void fill(DetId const &_id, double _xyw=1., double _yw=1., double _w=1.) override
Definition: MESetMulti.h:29
virtual void setBinContent(DetId const &, double)
Definition: MESet.h:51
unsigned getMultiplicity() const
Definition: MESetMulti.h:118
virtual bool maskMatches(DetId const &, uint32_t, StatusManager const *) const
Definition: MESet.cc:167
void setBinContent(EcalElectronicsId const &_id, int _bin, double _content) override
Definition: MESetMulti.h:48
const_iterator beginChannel() const override
Definition: MESetMulti.h:123
std::map< std::string, std::vector< std::string > > ReplCandidates
Definition: MESetMulti.h:15
virtual void setBinError(DetId const &, double)
Definition: MESet.h:58
void setBinEntries(DetId const &_id, int _bin, double _entries) override
Definition: MESetMulti.h:71
void setBinContent(EcalElectronicsId const &_id, double _content) override
Definition: MESetMulti.h:41
void use(unsigned) const
Definition: MESetMulti.cc:130
MESet * clone(std::string const &="") const override
Definition: MESetMulti.cc:88
virtual double getBinContent(DetId const &, int=0) const
Definition: MESet.h:72
MonitorElement const * getME(unsigned _iME) const override
Definition: MESetMulti.h:113
void setBinError(EcalElectronicsId const &_id, int _bin, double _error) override
Definition: MESetMulti.h:59
void setBinEntries(EcalElectronicsId const &_id, double _entries) override
Definition: MESetMulti.h:67
void resetAll(double=0., double=0., double=0.) override
Definition: MESetMulti.cc:125
virtual const_iterator beginChannel() const
Definition: MESet.h:323
bool maskMatches(DetId const &_id, uint32_t _mask, StatusManager const *_statusManager) const override
Definition: MESetMulti.h:106
virtual bool isVariableBinning() const
Definition: MESet.h:97
void setBinContent(int _dcctccid, double _content) override
Definition: MESetMulti.h:44
double getBinEntries(int _dcctccid, int _bin=0) const override
Definition: MESetMulti.h:99
void setBinError(DetId const &_id, int _bin, double _error) override
Definition: MESetMulti.h:58
double getBinContent(EcalElectronicsId const &_id, int _bin=0) const override
Definition: MESetMulti.h:82
~MESetMulti() override
Definition: MESetMulti.cc:61
void setBinEntries(int _dcctccid, double _entries) override
Definition: MESetMulti.h:70
const_iterator end() const override
Definition: MESetMulti.h:122
double getBinEntries(EcalElectronicsId const &_id, int _bin=0) const override
Definition: MESetMulti.h:96
Definition: DetId.h:17
void book(DQMStore::IBooker &) override
Definition: MESetMulti.cc:97
MonitorElement * getME(unsigned _iME) override
Definition: MESetMulti.h:114
std::vector< MESet * > sets_
Definition: MESetMulti.h:130
void setBinError(DetId const &_id, double _error) override
Definition: MESetMulti.h:55
void setBinContent(int _dcctccid, int _bin, double _content) override
Definition: MESetMulti.h:51
bool retrieve(DQMStore::IGetter &, std::string *=0) const override
Definition: MESetMulti.cc:104
virtual void fill(DetId const &, double=1., double=1., double=1.)
Definition: MESet.h:46
MESetMulti(MESet const &, ReplCandidates const &)
Definition: MESetMulti.cc:4
iterator begin() override
Definition: MESetMulti.h:124
std::string const & getPath() const override
Definition: MESetMulti.h:112
virtual double getBinEntries(DetId const &, int=0) const
Definition: MESet.h:80
const_iterator begin() const override
Definition: MESetMulti.h:121
iterator beginChannel() override
Definition: MESetMulti.h:126
double getBinEntries(DetId const &_id, int _bin=0) const override
Definition: MESetMulti.h:95
void setBinError(EcalElectronicsId const &_id, double _error) override
Definition: MESetMulti.h:56
ReplCandidates replCandidates_
Definition: MESetMulti.h:131
MESet & operator=(MESet const &) override
Definition: MESetMulti.cc:66
std::map< std::string, std::string > PathReplacements
Definition: MESet.h:31
iterator end() override
Definition: MESetMulti.h:125
void fill(EcalElectronicsId const &_id, double _xyw=1., double _yw=1., double _w=1.) override
Definition: MESetMulti.h:32
unsigned getIndex(PathReplacements const &) const
Definition: MESetMulti.cc:137
void setBinEntries(EcalElectronicsId const &_id, int _bin, double _entries) override
Definition: MESetMulti.h:74
void fill(double _x, double _yw=1., double _w=1.) override
Definition: MESetMulti.h:38