CMS 3D CMS Logo

Container1D.h
Go to the documentation of this file.
1 #ifndef Container1D_h
2 #define Container1D_h
3 
4 /*
5  * file: Container1D.h
6  * Author: Viktor Khristenko
7  *
8  * Description:
9  * 1D Container
10  */
19 
20 #include "boost/unordered_map.hpp"
21 #include <string>
22 #include <vector>
23 
24 namespace hcaldqm {
25  class Container1D : public Container {
26  public:
27  Container1D();
28  // Initialize Container
29  // @folder - folder name where to start saving - root.
30  // By default it will be the Task's name.
31  //
36  ~Container1D() override;
37 
38  // Initialize Container
39  // @folder - folder name where to save. Should already include the
40  // Tasks's name
41  // @nametitle - namebase of the name and of the title
42  //
43  virtual void initialize(std::string const &folder,
47  int debug = 0);
48 
49  // @qname - to replace the QyvsQx naming
50  virtual void initialize(std::string const &folder,
51  std::string const &qname,
55  int debug = 0);
57 
58  // filling by hash
59  virtual void fill(uint32_t);
60  virtual void fill(uint32_t, int);
61  virtual void fill(uint32_t, double);
62  virtual void fill(uint32_t, int, double);
63  virtual void fill(uint32_t, int, int);
64  virtual void fill(uint32_t, double, double);
65 
66  // using DetId as mapper
67  virtual void fill(HcalDetId const &);
68  virtual void fill(HcalDetId const &, int);
69  virtual void fill(HcalDetId const &, double);
70  virtual void fill(HcalDetId const &, int, double);
71  virtual void fill(HcalDetId const &, int, int);
72  virtual void fill(HcalDetId const &, double, double);
73 
74  virtual double getBinEntries(HcalDetId const &);
75  virtual double getBinEntries(HcalDetId const &, int);
76  virtual double getBinEntries(HcalDetId const &, double);
77  virtual double getBinEntries(HcalDetId const &did, int x, int) { return getBinEntries(did, x); }
78  virtual double getBinEntries(HcalDetId const &did, int x, double) { return getBinEntries(did, x); }
79  virtual double getBinEntries(HcalDetId const &did, double x, double) { return getBinEntries(did, x); }
80 
81  virtual double getBinContent(HcalDetId const &);
82  virtual double getBinContent(HcalDetId const &, int);
83  virtual double getBinContent(HcalDetId const &, double);
84  virtual double getBinContent(HcalDetId const &did, int x, int) { return getBinContent(did, x); }
85  virtual double getBinContent(HcalDetId const &did, int x, double) { return getBinContent(did, x); }
86  virtual double getBinContent(HcalDetId const &did, double x, double) { return getBinContent(did, x); }
87  virtual double getMean(HcalDetId const &, int axis = 1);
88  virtual double getRMS(HcalDetId const &, int axix = 1);
89 
90  virtual void setBinContent(HcalDetId const &, int);
91  virtual void setBinContent(HcalDetId const &, double);
92  virtual void setBinContent(HcalDetId const &, int, int);
93  virtual void setBinContent(HcalDetId const &, int, double);
94  virtual void setBinContent(HcalDetId const &, double, double);
95  virtual void setBinContent(HcalDetId const &, double, int);
96  virtual void setBinContent(HcalDetId const &id, int x, int y, int) { setBinContent(id, x, y); }
97  virtual void setBinContent(HcalDetId const &id, int x, double y, int) { setBinContent(id, x, y); }
98  virtual void setBinContent(HcalDetId const &id, double x, int y, int) { setBinContent(id, x, y); }
99  virtual void setBinContent(HcalDetId const &id, double x, double y, int) { setBinContent(id, x, y); }
100  virtual void setBinContent(HcalDetId const &id, int x, int y, double) { setBinContent(id, x, y); }
101  virtual void setBinContent(HcalDetId const &id, int x, double y, double) { setBinContent(id, x, y); }
102  virtual void setBinContent(HcalDetId const &id, double x, int y, double) { setBinContent(id, x, y); }
103  virtual void setBinContent(HcalDetId const &id, double x, double y, double) { setBinContent(id, x, y); }
104 
105  // using ElectronicsId
106  virtual void fill(HcalElectronicsId const &);
107  virtual void fill(HcalElectronicsId const &, int);
108  virtual void fill(HcalElectronicsId const &, double);
109  virtual void fill(HcalElectronicsId const &, int, double);
110  virtual void fill(HcalElectronicsId const &, int, int);
111  virtual void fill(HcalElectronicsId const &, double, double);
112 
113  virtual double getBinEntries(HcalElectronicsId const &);
114  virtual double getBinEntries(HcalElectronicsId const &, int);
115  virtual double getBinEntries(HcalElectronicsId const &, double);
116  virtual double getBinEntries(HcalElectronicsId const &eid, int x, int) { return getBinEntries(eid, x); }
117  virtual double getBinEntries(HcalElectronicsId const &eid, int x, double) { return getBinEntries(eid, x); }
118  virtual double getBinEntries(HcalElectronicsId const &eid, double x, double) { return getBinEntries(eid, x); }
119 
120  virtual double getBinContent(HcalElectronicsId const &);
121  virtual double getBinContent(HcalElectronicsId const &, int);
122  virtual double getBinContent(HcalElectronicsId const &, double);
123  virtual double getBinContent(HcalElectronicsId const &eid, int x, int) { return getBinContent(eid, x); }
124  virtual double getBinContent(HcalElectronicsId const &eid, int x, double) { return getBinContent(eid, x); }
125  virtual double getBinContent(HcalElectronicsId const &eid, double x, double) { return getBinContent(eid, x); }
126  virtual double getMean(HcalElectronicsId const &, int axis = 1);
127  virtual double getRMS(HcalElectronicsId const &, int axis = 1);
128 
129  virtual void setBinContent(HcalElectronicsId const &, int);
130  virtual void setBinContent(HcalElectronicsId const &, double);
131  virtual void setBinContent(HcalElectronicsId const &, int, int);
132  virtual void setBinContent(HcalElectronicsId const &, int, double);
133  virtual void setBinContent(HcalElectronicsId const &, double, double);
134  virtual void setBinContent(HcalElectronicsId const &, double, int);
135  virtual void setBinContent(HcalElectronicsId const &id, int x, int y, int) { setBinContent(id, x, y); }
136  virtual void setBinContent(HcalElectronicsId const &id, int x, double y, int) { setBinContent(id, x, y); }
137  virtual void setBinContent(HcalElectronicsId const &id, double x, int y, int) { setBinContent(id, x, y); }
138  virtual void setBinContent(HcalElectronicsId const &id, double x, double y, int) { setBinContent(id, x, y); }
139  virtual void setBinContent(HcalElectronicsId const &id, int x, int y, double) { setBinContent(id, x, y); }
140  virtual void setBinContent(HcalElectronicsId const &id, int x, double y, double) { setBinContent(id, x, y); }
141  virtual void setBinContent(HcalElectronicsId const &id, double x, int y, double) { setBinContent(id, x, y); }
142  virtual void setBinContent(HcalElectronicsId const &id, double x, double y, double) { setBinContent(id, x, y); }
143 
144  // using DetId as mapper
145  virtual void fill(HcalTrigTowerDetId const &);
146  virtual void fill(HcalTrigTowerDetId const &, int);
147  virtual void fill(HcalTrigTowerDetId const &, double);
148  virtual void fill(HcalTrigTowerDetId const &, int, double);
149  virtual void fill(HcalTrigTowerDetId const &, int, int);
150  virtual void fill(HcalTrigTowerDetId const &, double, double);
151 
152  virtual double getBinEntries(HcalTrigTowerDetId const &);
153  virtual double getBinEntries(HcalTrigTowerDetId const &, int);
154  virtual double getBinEntries(HcalTrigTowerDetId const &, double);
155  virtual double getBinEntries(HcalTrigTowerDetId const &tid, int x, int) { return getBinEntries(tid, x); }
156  virtual double getBinEntries(HcalTrigTowerDetId const &tid, int x, double) { return getBinEntries(tid, x); }
157  virtual double getBinEntries(HcalTrigTowerDetId const &tid, double x, double) { return getBinEntries(tid, x); }
158 
159  virtual double getBinContent(HcalTrigTowerDetId const &);
160  virtual double getBinContent(HcalTrigTowerDetId const &, int);
161  virtual double getBinContent(HcalTrigTowerDetId const &, double);
162  virtual double getBinContent(HcalTrigTowerDetId const &tid, int x, int) { return getBinContent(tid, x); }
163  virtual double getBinContent(HcalTrigTowerDetId const &tid, int x, double) { return getBinContent(tid, x); }
164  virtual double getBinContent(HcalTrigTowerDetId const &tid, double x, double) { return getBinContent(tid, x); }
165  virtual double getMean(HcalTrigTowerDetId const &, int axis = 1);
166  virtual double getRMS(HcalTrigTowerDetId const &, int axis = 1);
167 
168  virtual void setBinContent(HcalTrigTowerDetId const &, int);
169  virtual void setBinContent(HcalTrigTowerDetId const &, double);
170  virtual void setBinContent(HcalTrigTowerDetId const &, int, int);
171  virtual void setBinContent(HcalTrigTowerDetId const &, int, double);
172  virtual void setBinContent(HcalTrigTowerDetId const &, double, double);
173  virtual void setBinContent(HcalTrigTowerDetId const &, double, int);
174  virtual void setBinContent(HcalTrigTowerDetId const &id, int x, int y, int) { setBinContent(id, x, y); }
175  virtual void setBinContent(HcalTrigTowerDetId const &id, int x, double y, int) { setBinContent(id, x, y); }
176  virtual void setBinContent(HcalTrigTowerDetId const &id, double x, int y, int) { setBinContent(id, x, y); }
177  virtual void setBinContent(HcalTrigTowerDetId const &id, double x, double y, int) { setBinContent(id, x, y); }
178  virtual void setBinContent(HcalTrigTowerDetId const &id, int x, int y, double) { setBinContent(id, x, y); }
179  virtual void setBinContent(HcalTrigTowerDetId const &id, int x, double y, double) { setBinContent(id, x, y); }
180  virtual void setBinContent(HcalTrigTowerDetId const &id, double x, int y, double) { setBinContent(id, x, y); }
181  virtual void setBinContent(HcalTrigTowerDetId const &id, double x, double y, double) { setBinContent(id, x, y); }
182 
183  // booking using IBooker
184  // @aux - typically a cut or anything else
185  // @subsystem - subsystem under which to save
186  //
187  virtual void book(DQMStore::IBooker &,
188  HcalElectronicsMap const *,
189  std::string subsystem = "Hcal",
190  std::string aux = "");
191  virtual void book(DQMStore::IBooker &,
192  HcalElectronicsMap const *,
193  filter::HashFilter const &,
194  std::string subsystem = "Hcal",
195  std::string aux = "");
196 
197  // loading using DQMStore
198  // @DQMStore
199  // @emap
200  // @prepend - name to prepend to /<subsystem> - used when load
201  // a file to DQMStore without stripping and in case a name is
202  // appended
203  // @mode - if StripRunDirs - then there will be no Run Summary
204  // otherwise there is Run Summary folde. Used for retrieving
205  // MEs which were loaded into the DQM store from a file
206  virtual void load(DQMStore::IGetter &,
207  HcalElectronicsMap const *,
208  std::string const &subsystem = "Hcal",
209  std::string const &aux = "");
210  virtual void load(DQMStore::IGetter &,
211  HcalElectronicsMap const *,
212  filter::HashFilter const &,
213  std::string const &subsystem = "Hcal",
214  std::string const &aux = "");
215 
216  // reset all the elements
217  virtual void reset();
218 
219  // print all the elements
220  virtual void print();
221 
222  // TO BE USED IN THE FUTURE!
223  virtual void extendAxisRange(int);
224 
225  // set lumi flags for all mes
226  virtual void setLumiFlag();
227 
228  virtual void showOverflowX(bool showOverflow);
229  virtual void showOverflowY(bool showOverflow);
230 
231  protected:
232  virtual void customize(MonitorElement *);
233 
234  typedef boost::unordered_map<uint32_t, MonitorElement *> MEMap;
235  MEMap _mes;
239  };
240 } // namespace hcaldqm
241 
242 #endif
virtual double getBinEntries(HcalTrigTowerDetId const &tid, int x, int)
Definition: Container1D.h:155
virtual double getBinEntries(HcalElectronicsId const &eid, int x, double)
Definition: Container1D.h:117
virtual double getBinEntries(HcalElectronicsId const &eid, double x, double)
Definition: Container1D.h:118
virtual void setBinContent(HcalElectronicsId const &id, double x, double y, int)
Definition: Container1D.h:138
virtual void customize(MonitorElement *)
Definition: Container1D.cc:737
virtual void initialize(std::string const &folder, std::string const &qname, int debug=0)
Definition: Container.h:27
virtual void initialize(std::string const &folder, hashfunctions::HashType, quantity::Quantity *, quantity::Quantity *qy=new quantity::ValueQuantity(quantity::fN), int debug=0)
Definition: Container1D.cc:33
virtual double getBinEntries(HcalTrigTowerDetId const &tid, int x, double)
Definition: Container1D.h:156
virtual double getRMS(HcalDetId const &, int axix=1)
Definition: Container1D.cc:193
virtual void setBinContent(HcalElectronicsId const &id, int x, double y, double)
Definition: Container1D.h:140
virtual void setBinContent(HcalElectronicsId const &id, double x, int y, int)
Definition: Container1D.h:137
virtual double getBinEntries(HcalDetId const &did, double x, double)
Definition: Container1D.h:79
virtual void setBinContent(HcalElectronicsId const &id, double x, double y, double)
Definition: Container1D.h:142
virtual void setBinContent(HcalTrigTowerDetId const &id, int x, int y, double)
Definition: Container1D.h:178
virtual double getBinContent(HcalDetId const &did, double x, double)
Definition: Container1D.h:86
virtual void setBinContent(HcalTrigTowerDetId const &id, double x, double y, int)
Definition: Container1D.h:177
virtual double getBinContent(HcalElectronicsId const &eid, int x, int)
Definition: Container1D.h:123
virtual void setBinContent(HcalTrigTowerDetId const &id, double x, double y, double)
Definition: Container1D.h:181
boost::unordered_map< uint32_t, MonitorElement * > MEMap
Definition: Container1D.h:234
virtual double getBinContent(HcalTrigTowerDetId const &tid, int x, double)
Definition: Container1D.h:163
virtual void setBinContent(HcalElectronicsId const &id, int x, double y, int)
Definition: Container1D.h:136
virtual void setBinContent(HcalTrigTowerDetId const &id, double x, int y, double)
Definition: Container1D.h:180
virtual double getBinEntries(HcalElectronicsId const &eid, int x, int)
Definition: Container1D.h:116
virtual void setBinContent(HcalTrigTowerDetId const &id, int x, double y, int)
Definition: Container1D.h:175
virtual void setBinContent(HcalTrigTowerDetId const &id, double x, int y, int)
Definition: Container1D.h:176
~Container1D() override
Definition: Container1D.cc:16
virtual void setBinContent(HcalDetId const &id, double x, int y, int)
Definition: Container1D.h:98
virtual void setBinContent(HcalDetId const &id, int x, double y, int)
Definition: Container1D.h:97
virtual void fill(uint32_t)
Definition: Container1D.cc:73
virtual void reset()
Definition: Container1D.cc:60
quantity::Quantity * _qx
Definition: Container1D.h:237
virtual double getBinContent(HcalElectronicsId const &eid, double x, double)
Definition: Container1D.h:125
virtual void setBinContent(HcalDetId const &id, int x, double y, double)
Definition: Container1D.h:101
virtual double getBinEntries(HcalTrigTowerDetId const &tid, double x, double)
Definition: Container1D.h:157
virtual void showOverflowX(bool showOverflow)
Definition: Container1D.cc:775
virtual void setBinContent(HcalDetId const &id, int x, int y, double)
Definition: Container1D.h:100
virtual void setBinContent(HcalElectronicsId const &id, int x, int y, double)
Definition: Container1D.h:139
virtual void showOverflowY(bool showOverflow)
Definition: Container1D.cc:777
virtual void setBinContent(HcalElectronicsId const &id, int x, int y, int)
Definition: Container1D.h:135
virtual double getMean(HcalDetId const &, int axis=1)
Definition: Container1D.cc:189
virtual double getBinEntries(HcalDetId const &did, int x, int)
Definition: Container1D.h:77
virtual double getBinContent(HcalTrigTowerDetId const &tid, int x, int)
Definition: Container1D.h:162
virtual void setBinContent(HcalTrigTowerDetId const &id, int x, double y, double)
Definition: Container1D.h:179
virtual void setBinContent(HcalDetId const &id, double x, double y, int)
Definition: Container1D.h:99
virtual double getBinContent(HcalElectronicsId const &eid, int x, double)
Definition: Container1D.h:124
virtual void setBinContent(HcalElectronicsId const &id, double x, int y, double)
Definition: Container1D.h:141
#define debug
Definition: HDRShower.cc:19
virtual void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="")
Definition: Container1D.cc:592
virtual void setBinContent(HcalDetId const &, int)
Definition: Container1D.cc:198
mapper::HashMapper _hashmap
Definition: Container1D.h:236
virtual void print()
Definition: Container1D.cc:66
virtual void setBinContent(HcalDetId const &id, double x, double y, double)
Definition: Container1D.h:103
virtual double getBinContent(HcalTrigTowerDetId const &tid, double x, double)
Definition: Container1D.h:164
virtual double getBinEntries(HcalDetId const &did, int x, double)
Definition: Container1D.h:78
virtual void setLumiFlag()
Definition: Container1D.cc:769
virtual double getBinContent(HcalDetId const &)
Definition: Container1D.cc:177
virtual void setBinContent(HcalDetId const &id, double x, int y, double)
Definition: Container1D.h:102
virtual void setBinContent(HcalDetId const &id, int x, int y, int)
Definition: Container1D.h:96
virtual void load(DQMStore::IGetter &, HcalElectronicsMap const *, std::string const &subsystem="Hcal", std::string const &aux="")
Definition: Container1D.cc:450
virtual double getBinContent(HcalDetId const &did, int x, int)
Definition: Container1D.h:84
virtual void setBinContent(HcalTrigTowerDetId const &id, int x, int y, int)
Definition: Container1D.h:174
virtual double getBinEntries(HcalDetId const &)
Definition: Container1D.cc:165
quantity::Quantity * _qy
Definition: Container1D.h:238
virtual double getBinContent(HcalDetId const &did, int x, double)
Definition: Container1D.h:85
Readout chain identification for Hcal.
virtual void extendAxisRange(int)
Definition: Container1D.cc:754