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 {
8  /* class MESetMulti
9  wrapper for a set of MESets
10  limit() filters out unused MESets
11  use() method sets the MESet to be used
12  */
13 
14  class MESetMulti : public MESet {
15  public:
16  typedef std::map<std::string, std::vector<std::string> > ReplCandidates;
17 
18  MESetMulti(MESet const&, ReplCandidates const&);
19  MESetMulti(MESetMulti const&);
20  ~MESetMulti();
21 
22  MESet& operator=(MESet const&) override;
23 
24  MESet* clone(std::string const& = "") const override;
25 
26  void book(DQMStore::IBooker&) override;
27  bool retrieve(DQMStore::IGetter&, std::string* = 0) const override;
28  void clear() const override;
29 
30  void fill(DetId const& _id, double _xyw = 1., double _yw = 1., double _w = 1.) override { current_->fill(_id, _xyw, _yw, _w); }
31  void fill(EcalElectronicsId const& _id, double _xyw = 1., double _yw = 1., double _w = 1.) override { current_->fill(_id, _xyw, _yw, _w); }
32  void fill(int _dcctccid, double _xyw = 1., double _yw = 1., double _w = 1.) override { current_->fill(_dcctccid, _xyw, _yw, _w); }
33  void fill(double _x, double _yw = 1., double _w = 1.) override { current_->fill(_x, _yw, _w); }
34 
35  void setBinContent(DetId const& _id, double _content) override { current_->setBinContent(_id, _content); }
36  void setBinContent(EcalElectronicsId const& _id, double _content) override { current_->setBinContent(_id, _content); }
37  void setBinContent(int _dcctccid, double _content) override { current_->setBinContent(_dcctccid, _content); }
38  void setBinContent(DetId const& _id, int _bin, double _content) override { current_->setBinContent(_id, _bin, _content); }
39  void setBinContent(EcalElectronicsId const& _id, int _bin, double _content) override { current_->setBinContent(_id, _bin, _content); }
40  void setBinContent(int _dcctccid, int _bin, double _content) override { current_->setBinContent(_dcctccid, _bin, _content); }
41 
42  void setBinError(DetId const& _id, double _error) override { current_->setBinError(_id, _error); }
43  void setBinError(EcalElectronicsId const& _id, double _error) override { current_->setBinError(_id, _error); }
44  void setBinError(int _dcctccid, double _error) override { current_->setBinError(_dcctccid, _error); }
45  void setBinError(DetId const& _id, int _bin, double _error) override { current_->setBinError(_id, _bin, _error); }
46  void setBinError(EcalElectronicsId const& _id, int _bin, double _error) override { current_->setBinError(_id, _bin, _error); }
47  void setBinError(int _dcctccid, int _bin, double _error) override { current_->setBinError(_dcctccid, _bin, _error); }
48 
49  void setBinEntries(DetId const& _id, double _entries) override { current_->setBinEntries(_id, _entries); }
50  void setBinEntries(EcalElectronicsId const& _id, double _entries) override { current_->setBinEntries(_id, _entries); }
51  void setBinEntries(int _dcctccid, double _entries) override { current_->setBinEntries(_dcctccid, _entries); }
52  void setBinEntries(DetId const& _id, int _bin, double _entries) override { current_->setBinEntries(_id, _bin, _entries); }
53  void setBinEntries(EcalElectronicsId const& _id, int _bin, double _entries) override { current_->setBinEntries(_id, _bin, _entries); }
54  void setBinEntries(int _dcctccid, int _bin, double _entries) override { current_->setBinEntries(_dcctccid, _bin, _entries); }
55 
56  double getBinContent(DetId const& _id, int _bin = 0) const override { return current_->getBinContent(_id, _bin); }
57  double getBinContent(EcalElectronicsId const& _id, int _bin = 0) const override { return current_->getBinContent(_id, _bin); }
58  double getBinContent(int _dcctccid, int _bin = 0) const override { return current_->getBinContent(_dcctccid, _bin); }
59 
60  double getBinError(DetId const& _id, int _bin = 0) const override { return current_->getBinError(_id, _bin); }
61  double getBinError(EcalElectronicsId const& _id, int _bin = 0) const override { return current_->getBinError(_id, _bin); }
62  double getBinError(int _dcctccid, int _bin = 0) const override { return current_->getBinError(_dcctccid, _bin); }
63 
64  double getBinEntries(DetId const& _id, int _bin = 0) const override { return current_->getBinEntries(_id, _bin); }
65  double getBinEntries(EcalElectronicsId const& _id, int _bin = 0) const override { return current_->getBinEntries(_id, _bin); }
66  double getBinEntries(int _dcctccid, int _bin = 0) const override { return current_->getBinEntries(_dcctccid, _bin); }
67 
68  void reset(double = 0., double = 0., double = 0.) override;
69  void resetAll(double = 0., double = 0., double = 0.) override;
70 
71  bool maskMatches(DetId const& _id, uint32_t _mask, StatusManager const* _statusManager) const override { return current_ && current_->maskMatches(_id, _mask, _statusManager); }
72 
73  bool isVariableBinning() const override { return current_->isVariableBinning(); }
74 
75  std::string const& getPath() const override { return current_->getPath(); }
76  MonitorElement const* getME(unsigned _iME) const override { return current_->getME(_iME); }
77  MonitorElement* getME(unsigned _iME) override { return current_->getME(_iME); }
78 
79  void use(unsigned) const;
80  MESet* getCurrent() const { return current_; }
81  unsigned getMultiplicity() const { return sets_.size(); }
82  unsigned getIndex(PathReplacements const&) const;
83 
84  const_iterator begin() const override { return const_iterator(*current_); }
85  const_iterator end() const override { return const_iterator(*current_, -1, -1); }
86  const_iterator beginChannel() const override { return current_->beginChannel(); }
87  iterator begin() override { return iterator(*current_); }
88  iterator end() override { return iterator(*current_, -1, -1); }
89  iterator beginChannel() override { return current_->beginChannel(); }
90 
91  protected:
92  mutable MESet* current_;
93  std::vector<MESet*> sets_;
94  ReplCandidates replCandidates_;
95  };
96 }
97 
98 #endif
MESet * getCurrent() const
Definition: MESetMulti.h:80
virtual std::string const & getPath() const
Definition: MESet.h:92
void setBinContent(DetId const &_id, int _bin, double _content) override
Definition: MESetMulti.h:38
void fill(int _dcctccid, double _xyw=1., double _yw=1., double _w=1.) override
Definition: MESetMulti.h:32
virtual MonitorElement const * getME(unsigned _iME) const
Definition: MESet.h:98
std::vector< MESet * > sets_
Definition: MESetMulti.h:93
double getBinError(EcalElectronicsId const &_id, int _bin=0) const override
Definition: MESetMulti.h:61
void setBinError(int _dcctccid, int _bin, double _error) override
Definition: MESetMulti.h:47
void reset(double=0., double=0., double=0.) override
Definition: MESetMulti.cc:132
virtual double getBinError(DetId const &, int=0) const
Definition: MESet.h:76
double getBinError(int _dcctccid, int _bin=0) const override
Definition: MESetMulti.h:62
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:49
void clear() const override
Definition: MESetMulti.cc:123
double getBinContent(DetId const &_id, int _bin=0) const override
Definition: MESetMulti.h:56
void setBinContent(DetId const &_id, double _content) override
Definition: MESetMulti.h:35
double getBinError(DetId const &_id, int _bin=0) const override
Definition: MESetMulti.h:60
virtual void setBinEntries(DetId const &, double)
Definition: MESet.h:65
double getBinContent(int _dcctccid, int _bin=0) const override
Definition: MESetMulti.h:58
void setBinEntries(int _dcctccid, int _bin, double _entries) override
Definition: MESetMulti.h:54
bool isVariableBinning() const override
Definition: MESetMulti.h:73
void setBinError(int _dcctccid, double _error) override
Definition: MESetMulti.h:44
void fill(DetId const &_id, double _xyw=1., double _yw=1., double _w=1.) override
Definition: MESetMulti.h:30
virtual void setBinContent(DetId const &, double)
Definition: MESet.h:51
unsigned getMultiplicity() const
Definition: MESetMulti.h:81
virtual bool maskMatches(DetId const &, uint32_t, StatusManager const *) const
Definition: MESet.cc:181
void setBinContent(EcalElectronicsId const &_id, int _bin, double _content) override
Definition: MESetMulti.h:39
const_iterator beginChannel() const override
Definition: MESetMulti.h:86
std::map< std::string, std::vector< std::string > > ReplCandidates
Definition: MESetMulti.h:16
virtual void setBinError(DetId const &, double)
Definition: MESet.h:58
void setBinEntries(DetId const &_id, int _bin, double _entries) override
Definition: MESetMulti.h:52
void setBinContent(EcalElectronicsId const &_id, double _content) override
Definition: MESetMulti.h:36
void use(unsigned) const
Definition: MESetMulti.cc:146
MESet * clone(std::string const &="") const override
Definition: MESetMulti.cc:94
virtual double getBinContent(DetId const &, int=0) const
Definition: MESet.h:72
MonitorElement const * getME(unsigned _iME) const override
Definition: MESetMulti.h:76
void setBinError(EcalElectronicsId const &_id, int _bin, double _error) override
Definition: MESetMulti.h:46
void setBinEntries(EcalElectronicsId const &_id, double _entries) override
Definition: MESetMulti.h:50
void resetAll(double=0., double=0., double=0.) override
Definition: MESetMulti.cc:139
virtual const_iterator beginChannel() const
Definition: MESet.h:291
bool maskMatches(DetId const &_id, uint32_t _mask, StatusManager const *_statusManager) const override
Definition: MESetMulti.h:71
virtual bool isVariableBinning() const
Definition: MESet.h:97
void setBinContent(int _dcctccid, double _content) override
Definition: MESetMulti.h:37
double getBinEntries(int _dcctccid, int _bin=0) const override
Definition: MESetMulti.h:66
void setBinError(DetId const &_id, int _bin, double _error) override
Definition: MESetMulti.h:45
double getBinContent(EcalElectronicsId const &_id, int _bin=0) const override
Definition: MESetMulti.h:57
void setBinEntries(int _dcctccid, double _entries) override
Definition: MESetMulti.h:51
const_iterator end() const override
Definition: MESetMulti.h:85
double getBinEntries(EcalElectronicsId const &_id, int _bin=0) const override
Definition: MESetMulti.h:65
Definition: DetId.h:18
void book(DQMStore::IBooker &) override
Definition: MESetMulti.cc:104
MonitorElement * getME(unsigned _iME) override
Definition: MESetMulti.h:77
void setBinError(DetId const &_id, double _error) override
Definition: MESetMulti.h:42
void setBinContent(int _dcctccid, int _bin, double _content) override
Definition: MESetMulti.h:40
bool retrieve(DQMStore::IGetter &, std::string *=0) const override
Definition: MESetMulti.cc:113
virtual void fill(DetId const &, double=1., double=1., double=1.)
Definition: MESet.h:46
MESetMulti(MESet const &, ReplCandidates const &)
Definition: MESetMulti.cc:5
iterator begin() override
Definition: MESetMulti.h:87
std::string const & getPath() const override
Definition: MESetMulti.h:75
virtual double getBinEntries(DetId const &, int=0) const
Definition: MESet.h:80
const_iterator begin() const override
Definition: MESetMulti.h:84
iterator beginChannel() override
Definition: MESetMulti.h:89
double getBinEntries(DetId const &_id, int _bin=0) const override
Definition: MESetMulti.h:64
void setBinError(EcalElectronicsId const &_id, double _error) override
Definition: MESetMulti.h:43
ReplCandidates replCandidates_
Definition: MESetMulti.h:94
MESet & operator=(MESet const &) override
Definition: MESetMulti.cc:71
std::map< std::string, std::string > PathReplacements
Definition: MESet.h:31
iterator end() override
Definition: MESetMulti.h:88
void fill(EcalElectronicsId const &_id, double _xyw=1., double _yw=1., double _w=1.) override
Definition: MESetMulti.h:31
unsigned getIndex(PathReplacements const &) const
Definition: MESetMulti.cc:155
void setBinEntries(EcalElectronicsId const &_id, int _bin, double _entries) override
Definition: MESetMulti.h:53
void fill(double _x, double _yw=1., double _w=1.) override
Definition: MESetMulti.h:33