CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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&) override;
27  void book(DQMStore::IBooker&) override;
28  bool retrieve(DQMStore const&, std::string* = 0) const override;
29  void clear() const override;
30 
31  void fill(DetId const& _id, double _xyw = 1., double _yw = 1., double _w = 1.) override { current_->fill(_id, _xyw, _yw, _w); }
32  void fill(EcalElectronicsId const& _id, double _xyw = 1., double _yw = 1., double _w = 1.) override { current_->fill(_id, _xyw, _yw, _w); }
33  void fill(int _dcctccid, double _xyw = 1., double _yw = 1., double _w = 1.) override { current_->fill(_dcctccid, _xyw, _yw, _w); }
34  void fill(double _x, double _yw = 1., double _w = 1.) override { current_->fill(_x, _yw, _w); }
35 
36  void setBinContent(DetId const& _id, double _content) override { current_->setBinContent(_id, _content); }
37  void setBinContent(EcalElectronicsId const& _id, double _content) override { current_->setBinContent(_id, _content); }
38  void setBinContent(int _dcctccid, double _content) override { current_->setBinContent(_dcctccid, _content); }
39  void setBinContent(DetId const& _id, int _bin, double _content) override { current_->setBinContent(_id, _bin, _content); }
40  void setBinContent(EcalElectronicsId const& _id, int _bin, double _content) override { current_->setBinContent(_id, _bin, _content); }
41  void setBinContent(int _dcctccid, int _bin, double _content) override { current_->setBinContent(_dcctccid, _bin, _content); }
42 
43  void setBinError(DetId const& _id, double _error) override { current_->setBinError(_id, _error); }
44  void setBinError(EcalElectronicsId const& _id, double _error) override { current_->setBinError(_id, _error); }
45  void setBinError(int _dcctccid, double _error) override { current_->setBinError(_dcctccid, _error); }
46  void setBinError(DetId const& _id, int _bin, double _error) override { current_->setBinError(_id, _bin, _error); }
47  void setBinError(EcalElectronicsId const& _id, int _bin, double _error) override { current_->setBinError(_id, _bin, _error); }
48  void setBinError(int _dcctccid, int _bin, double _error) override { current_->setBinError(_dcctccid, _bin, _error); }
49 
50  void setBinEntries(DetId const& _id, double _entries) override { current_->setBinEntries(_id, _entries); }
51  void setBinEntries(EcalElectronicsId const& _id, double _entries) override { current_->setBinEntries(_id, _entries); }
52  void setBinEntries(int _dcctccid, double _entries) override { current_->setBinEntries(_dcctccid, _entries); }
53  void setBinEntries(DetId const& _id, int _bin, double _entries) override { current_->setBinEntries(_id, _bin, _entries); }
54  void setBinEntries(EcalElectronicsId const& _id, int _bin, double _entries) override { current_->setBinEntries(_id, _bin, _entries); }
55  void setBinEntries(int _dcctccid, int _bin, double _entries) override { current_->setBinEntries(_dcctccid, _bin, _entries); }
56 
57  double getBinContent(DetId const& _id, int _bin = 0) const override { return current_->getBinContent(_id, _bin); }
58  double getBinContent(EcalElectronicsId const& _id, int _bin = 0) const override { return current_->getBinContent(_id, _bin); }
59  double getBinContent(int _dcctccid, int _bin = 0) const override { return current_->getBinContent(_dcctccid, _bin); }
60 
61  double getBinError(DetId const& _id, int _bin = 0) const override { return current_->getBinError(_id, _bin); }
62  double getBinError(EcalElectronicsId const& _id, int _bin = 0) const override { return current_->getBinError(_id, _bin); }
63  double getBinError(int _dcctccid, int _bin = 0) const override { return current_->getBinError(_dcctccid, _bin); }
64 
65  double getBinEntries(DetId const& _id, int _bin = 0) const override { return current_->getBinEntries(_id, _bin); }
66  double getBinEntries(EcalElectronicsId const& _id, int _bin = 0) const override { return current_->getBinEntries(_id, _bin); }
67  double getBinEntries(int _dcctccid, int _bin = 0) const override { return current_->getBinEntries(_dcctccid, _bin); }
68 
69  void reset(double = 0., double = 0., double = 0.) override;
70  void resetAll(double = 0., double = 0., double = 0.) override;
71 
72  bool maskMatches(DetId const& _id, uint32_t _mask, StatusManager const* _statusManager) const override { return current_ && current_->maskMatches(_id, _mask, _statusManager); }
73 
74  bool isVariableBinning() const override { return current_->isVariableBinning(); }
75 
76  std::string const& getPath() const override { return current_->getPath(); }
77  MonitorElement const* getME(unsigned _iME) const override { return current_->getME(_iME); }
78  MonitorElement* getME(unsigned _iME) override { return current_->getME(_iME); }
79 
80  void use(unsigned) const;
81  MESet* getCurrent() const { return current_; }
82  unsigned getMultiplicity() const { return sets_.size(); }
83  unsigned getIndex(PathReplacements const&) const;
84 
85  const_iterator begin() const override { return const_iterator(*current_); }
86  const_iterator end() const override { return const_iterator(*current_, -1, -1); }
87  const_iterator beginChannel() const override { return current_->beginChannel(); }
88  iterator begin() override { return iterator(*current_); }
89  iterator end() override { return iterator(*current_, -1, -1); }
90  iterator beginChannel() override { return current_->beginChannel(); }
91 
92  protected:
93  mutable MESet* current_;
94  std::vector<MESet*> sets_;
96  };
97 }
98 
99 #endif
MESet * getCurrent() const
Definition: MESetMulti.h:81
virtual std::string const & getPath() const
Definition: MESet.h:93
void setBinContent(DetId const &_id, int _bin, double _content) override
Definition: MESetMulti.h:39
void fill(int _dcctccid, double _xyw=1., double _yw=1., double _w=1.) override
Definition: MESetMulti.h:33
virtual MonitorElement const * getME(unsigned _iME) const
Definition: MESet.h:99
double getBinContent(EcalElectronicsId const &_id, int _bin=0) const override
Definition: MESetMulti.h:58
std::vector< MESet * > sets_
Definition: MESetMulti.h:94
MonitorElement const * getME(unsigned _iME) const override
Definition: MESetMulti.h:77
void setBinError(int _dcctccid, int _bin, double _error) override
Definition: MESetMulti.h:48
void reset(double=0., double=0., double=0.) override
Definition: MESetMulti.cc:141
virtual double getBinError(DetId const &, int=0) const
Definition: MESet.h:77
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:50
void setBinContent(DetId const &_id, double _content) override
Definition: MESetMulti.h:36
virtual void setBinEntries(DetId const &, double)
Definition: MESet.h:66
double getBinError(DetId const &_id, int _bin=0) const override
Definition: MESetMulti.h:61
void setBinEntries(int _dcctccid, int _bin, double _entries) override
Definition: MESetMulti.h:55
void setBinError(int _dcctccid, double _error) override
Definition: MESetMulti.h:45
void fill(DetId const &_id, double _xyw=1., double _yw=1., double _w=1.) override
Definition: MESetMulti.h:31
virtual void setBinContent(DetId const &, double)
Definition: MESet.h:52
unsigned getMultiplicity() const
Definition: MESetMulti.h:82
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:40
bool isVariableBinning() const override
Definition: MESetMulti.h:74
std::map< std::string, std::vector< std::string > > ReplCandidates
Definition: MESetMulti.h:16
double getBinContent(int _dcctccid, int _bin=0) const override
Definition: MESetMulti.h:59
virtual void setBinError(DetId const &, double)
Definition: MESet.h:59
double getBinError(int _dcctccid, int _bin=0) const override
Definition: MESetMulti.h:63
void setBinEntries(DetId const &_id, int _bin, double _entries) override
Definition: MESetMulti.h:53
void setBinContent(EcalElectronicsId const &_id, double _content) override
Definition: MESetMulti.h:37
void use(unsigned) const
Definition: MESetMulti.cc:155
virtual double getBinContent(DetId const &, int=0) const
Definition: MESet.h:73
bool maskMatches(DetId const &_id, uint32_t _mask, StatusManager const *_statusManager) const override
Definition: MESetMulti.h:72
bool retrieve(DQMStore const &, std::string *=0) const override
Definition: MESetMulti.cc:122
MESet * clone(std::string const &="") const override
Definition: MESetMulti.cc:94
double getBinEntries(DetId const &_id, int _bin=0) const override
Definition: MESetMulti.h:65
void setBinError(EcalElectronicsId const &_id, int _bin, double _error) override
Definition: MESetMulti.h:47
void setBinEntries(EcalElectronicsId const &_id, double _entries) override
Definition: MESetMulti.h:51
void resetAll(double=0., double=0., double=0.) override
Definition: MESetMulti.cc:148
virtual const_iterator beginChannel() const
Definition: MESet.h:292
virtual bool isVariableBinning() const
Definition: MESet.h:98
void setBinContent(int _dcctccid, double _content) override
Definition: MESetMulti.h:38
void setBinError(DetId const &_id, int _bin, double _error) override
Definition: MESetMulti.h:46
std::string const & getPath() const override
Definition: MESetMulti.h:76
const_iterator beginChannel() const override
Definition: MESetMulti.h:87
double getBinContent(DetId const &_id, int _bin=0) const override
Definition: MESetMulti.h:57
void setBinEntries(int _dcctccid, double _entries) override
Definition: MESetMulti.h:52
Definition: DetId.h:18
MonitorElement * getME(unsigned _iME) override
Definition: MESetMulti.h:78
void setBinError(DetId const &_id, double _error) override
Definition: MESetMulti.h:43
void setBinContent(int _dcctccid, int _bin, double _content) override
Definition: MESetMulti.h:41
const_iterator end() const override
Definition: MESetMulti.h:86
virtual void fill(DetId const &, double=1., double=1., double=1.)
Definition: MESet.h:47
MESetMulti(MESet const &, ReplCandidates const &)
Definition: MESetMulti.cc:5
iterator begin() override
Definition: MESetMulti.h:88
double getBinEntries(int _dcctccid, int _bin=0) const override
Definition: MESetMulti.h:67
virtual double getBinEntries(DetId const &, int=0) const
Definition: MESet.h:81
iterator beginChannel() override
Definition: MESetMulti.h:90
const_iterator begin() const override
Definition: MESetMulti.h:85
void setBinError(EcalElectronicsId const &_id, double _error) override
Definition: MESetMulti.h:44
double getBinError(EcalElectronicsId const &_id, int _bin=0) const override
Definition: MESetMulti.h:62
ReplCandidates replCandidates_
Definition: MESetMulti.h:95
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:89
void fill(EcalElectronicsId const &_id, double _xyw=1., double _yw=1., double _w=1.) override
Definition: MESetMulti.h:32
void clear() const override
Definition: MESetMulti.cc:132
unsigned getIndex(PathReplacements const &) const
Definition: MESetMulti.cc:164
void setBinEntries(EcalElectronicsId const &_id, int _bin, double _entries) override
Definition: MESetMulti.h:54
void book(DQMStore &) override
Definition: MESetMulti.cc:104
void fill(double _x, double _yw=1., double _w=1.) override
Definition: MESetMulti.h:34
double getBinEntries(EcalElectronicsId const &_id, int _bin=0) const override
Definition: MESetMulti.h:66