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 <vector>
21 //#include <unordered_map>
22 //#include "boost/ptr_container/ptr_map.hpp"
23 #include "boost/unordered_map.hpp"
24 #include "boost/foreach.hpp"
25 #include <string>
26 
27 namespace hcaldqm
28 {
29  class Container1D : public Container
30  {
31  public:
32  Container1D();
33  // Initialize Container
34  // @folder - folder name where to start saving - root.
35  // By default it will be the Task's name.
36  //
41  ~Container1D() override;
42 
43  // Initialize Container
44  // @folder - folder name where to save. Should already include the
45  // Tasks's name
46  // @nametitle - namebase of the name and of the title
47  //
48  virtual void initialize(std::string const& folder,
51  int debug=0);
52 
53  // @qname - to replace the QyvsQx naming
54  virtual void initialize(std::string const& folder,
55  std::string const &qname,
58  int debug=0);
60 
61  // filling by hash
62  virtual void fill(uint32_t);
63  virtual void fill(uint32_t, int);
64  virtual void fill(uint32_t, double);
65  virtual void fill(uint32_t, int, double);
66  virtual void fill(uint32_t, int, int);
67  virtual void fill(uint32_t, double, double);
68 
69  // using DetId as mapper
70  virtual void fill(HcalDetId const&);
71  virtual void fill(HcalDetId const&, int);
72  virtual void fill(HcalDetId const&, double);
73  virtual void fill(HcalDetId const&, int, double);
74  virtual void fill(HcalDetId const&, int, int);
75  virtual void fill(HcalDetId const&, double, double);
76 
77  virtual double getBinEntries(HcalDetId const&);
78  virtual double getBinEntries(HcalDetId const&, int);
79  virtual double getBinEntries(HcalDetId const&, double);
80  virtual double getBinEntries(HcalDetId const& did, int x, int)
81  {return getBinEntries(did, x);}
82  virtual double getBinEntries(HcalDetId const& did, int x, double)
83  {return getBinEntries(did, x);}
84  virtual double getBinEntries(HcalDetId const& did, double x, double)
85  {return getBinEntries(did, x);}
86 
87  virtual double getBinContent(HcalDetId const&);
88  virtual double getBinContent(HcalDetId const&, int);
89  virtual double getBinContent(HcalDetId const&, double);
90  virtual double getBinContent(HcalDetId const& did, int x, int)
91  {return getBinContent(did, x);}
92  virtual double getBinContent(HcalDetId const& did, int x, double)
93  {return getBinContent(did, x);}
94  virtual double getBinContent(HcalDetId const& did, double x, double)
95  {return getBinContent(did, x);}
96  virtual double getMean(HcalDetId const&, int axis=1);
97  virtual double getRMS(HcalDetId const&, int axix=1);
98 
99  virtual void setBinContent(HcalDetId const&, int);
100  virtual void setBinContent(HcalDetId const&, double);
101  virtual void setBinContent(HcalDetId const&, int, int);
102  virtual void setBinContent(HcalDetId const&, int, double);
103  virtual void setBinContent(HcalDetId const&, double, double);
104  virtual void setBinContent(HcalDetId const&, double, int);
105  virtual void setBinContent(HcalDetId const& id, int x, int y, int)
106  {setBinContent(id, x, y);}
107  virtual void setBinContent(HcalDetId const& id, int x, double y,
108  int)
109  {setBinContent(id, x, y);}
110  virtual void setBinContent(HcalDetId const& id, double x, int y,
111  int)
112  {setBinContent(id, x, y);}
113  virtual void setBinContent(HcalDetId const& id, double x, double y,
114  int)
115  {setBinContent(id, x, y);}
116  virtual void setBinContent(HcalDetId const& id, int x, int y,
117  double)
118  {setBinContent(id, x, y);}
119  virtual void setBinContent(HcalDetId const& id, int x, double y,
120  double)
121  {setBinContent(id, x, y);}
122  virtual void setBinContent(HcalDetId const& id, double x, int y,
123  double)
124  {setBinContent(id, x, y);}
125  virtual void setBinContent(HcalDetId const& id, double x, double y,
126  double)
127  {setBinContent(id, x, y);}
128 
129  // using ElectronicsId
130  virtual void fill(HcalElectronicsId const&);
131  virtual void fill(HcalElectronicsId const&, int);
132  virtual void fill(HcalElectronicsId const&, double);
133  virtual void fill(HcalElectronicsId const&, int, double);
134  virtual void fill(HcalElectronicsId const&, int, int);
135  virtual void fill(HcalElectronicsId const&, double, double);
136 
137  virtual double getBinEntries(HcalElectronicsId const&);
138  virtual double getBinEntries(HcalElectronicsId const&, int);
139  virtual double getBinEntries(HcalElectronicsId const&, double);
140  virtual double getBinEntries(HcalElectronicsId const& eid, int x,
141  int)
142  {return getBinEntries(eid, x);}
143  virtual double getBinEntries(HcalElectronicsId const& eid, int x,
144  double)
145  {return getBinEntries(eid, x);}
146  virtual double getBinEntries(HcalElectronicsId const& eid,
147  double x, double)
148  {return getBinEntries(eid, x);}
149 
150  virtual double getBinContent(HcalElectronicsId const&);
151  virtual double getBinContent(HcalElectronicsId const&, int);
152  virtual double getBinContent(HcalElectronicsId const&, double);
153  virtual double getBinContent(HcalElectronicsId const& eid,
154  int x, int)
155  {return getBinContent(eid, x);}
156  virtual double getBinContent(HcalElectronicsId const& eid,
157  int x, double)
158  {return getBinContent(eid, x);}
159  virtual double getBinContent(HcalElectronicsId const& eid,
160  double x, double)
161  {return getBinContent(eid, x);}
162  virtual double getMean(HcalElectronicsId const&, int axis=1);
163  virtual double getRMS(HcalElectronicsId const&, int axis=1);
164 
165  virtual void setBinContent(HcalElectronicsId const&, int);
166  virtual void setBinContent(HcalElectronicsId const&, double);
167  virtual void setBinContent(HcalElectronicsId const&, int, int);
168  virtual void setBinContent(HcalElectronicsId const&, int, double);
169  virtual void setBinContent(HcalElectronicsId const&, double, double);
170  virtual void setBinContent(HcalElectronicsId const&, double, int);
171  virtual void setBinContent(HcalElectronicsId const& id, int x, int y
172  , int)
173  {setBinContent(id, x, y);}
174  virtual void setBinContent(HcalElectronicsId const& id, int x,
175  double y, int)
176  {setBinContent(id, x, y);}
177  virtual void setBinContent(HcalElectronicsId const& id, double x,
178  int y, int)
179  {setBinContent(id, x, y);}
180  virtual void setBinContent(HcalElectronicsId const& id, double x,
181  double y, int)
182  {setBinContent(id, x, y);}
183  virtual void setBinContent(HcalElectronicsId const& id, int x,
184  int y, double)
185  {setBinContent(id, x, y);}
186  virtual void setBinContent(HcalElectronicsId const& id, int x,
187  double y, double)
188  {setBinContent(id, x, y);}
189  virtual void setBinContent(HcalElectronicsId const& id, double x,
190  int y, double)
191  {setBinContent(id, x, y);}
192  virtual void setBinContent(HcalElectronicsId const& id, double x,
193  double y, double)
194  {setBinContent(id, x, y);}
195 
196  // using DetId as mapper
197  virtual void fill(HcalTrigTowerDetId const&);
198  virtual void fill(HcalTrigTowerDetId const&, int);
199  virtual void fill(HcalTrigTowerDetId const&, double);
200  virtual void fill(HcalTrigTowerDetId const&, int, double);
201  virtual void fill(HcalTrigTowerDetId const&, int, int);
202  virtual void fill(HcalTrigTowerDetId const&, double, double);
203 
204  virtual double getBinEntries(HcalTrigTowerDetId const&);
205  virtual double getBinEntries(HcalTrigTowerDetId const&, int);
206  virtual double getBinEntries(HcalTrigTowerDetId const&, double);
207  virtual double getBinEntries(HcalTrigTowerDetId const& tid, int x,
208  int)
209  {return getBinEntries(tid, x);}
210  virtual double getBinEntries(HcalTrigTowerDetId const& tid, int x,
211  double)
212  {return getBinEntries(tid, x);}
213  virtual double getBinEntries(HcalTrigTowerDetId const& tid,
214  double x, double)
215  {return getBinEntries(tid, x);}
216 
217  virtual double getBinContent(HcalTrigTowerDetId const&);
218  virtual double getBinContent(HcalTrigTowerDetId const&, int);
219  virtual double getBinContent(HcalTrigTowerDetId const&, double);
220  virtual double getBinContent(HcalTrigTowerDetId const& tid,
221  int x, int)
222  {return getBinContent(tid, x);}
223  virtual double getBinContent(HcalTrigTowerDetId const& tid,
224  int x, double)
225  {return getBinContent(tid, x);}
226  virtual double getBinContent(HcalTrigTowerDetId const& tid,
227  double x, double)
228  {return getBinContent(tid, x);}
229  virtual double getMean(HcalTrigTowerDetId const&, int axis=1);
230  virtual double getRMS(HcalTrigTowerDetId const&, int axis=1);
231 
232  virtual void setBinContent(HcalTrigTowerDetId const&, int);
233  virtual void setBinContent(HcalTrigTowerDetId const&, double);
234  virtual void setBinContent(HcalTrigTowerDetId const&, int, int);
235  virtual void setBinContent(HcalTrigTowerDetId const&, int, double);
236  virtual void setBinContent(HcalTrigTowerDetId const&, double,
237  double);
238  virtual void setBinContent(HcalTrigTowerDetId const&, double, int);
239  virtual void setBinContent(HcalTrigTowerDetId const& id, int x,
240  int y, int)
241  {setBinContent(id, x, y);}
242  virtual void setBinContent(HcalTrigTowerDetId const& id, int x,
243  double y, int)
244  {setBinContent(id, x, y);}
245  virtual void setBinContent(HcalTrigTowerDetId const& id, double x,
246  int y, int)
247  {setBinContent(id, x, y);}
248  virtual void setBinContent(HcalTrigTowerDetId const& id, double x,
249  double y, int)
250  {setBinContent(id, x, y);}
251  virtual void setBinContent(HcalTrigTowerDetId const& id, int x,
252  int y, double)
253  {setBinContent(id, x, y);}
254  virtual void setBinContent(HcalTrigTowerDetId const& id, int x,
255  double y, double)
256  {setBinContent(id, x, y);}
257  virtual void setBinContent(HcalTrigTowerDetId const& id, double x,
258  int y, double)
259  {setBinContent(id, x, y);}
260  virtual void setBinContent(HcalTrigTowerDetId const& id, double x,
261  double y, double)
262  {setBinContent(id, x, y);}
263 
264  // booking using IBooker
265  // @aux - typically a cut or anything else
266  // @subsystem - subsystem under which to save
267  //
268  virtual void book(DQMStore::IBooker&, HcalElectronicsMap const*,
269  std::string subsystem="Hcal",
270  std::string aux="");
271  virtual void book(DQMStore::IBooker&, HcalElectronicsMap const*,
272  filter::HashFilter const&, std::string subsystem="Hcal",
273  std::string aux="");
274  virtual void book(DQMStore*, HcalElectronicsMap const*,
275  std::string subsystem="Hcal",
276  std::string aux="");
277  virtual void book(DQMStore*, HcalElectronicsMap const*,
278  filter::HashFilter const&, std::string subsystem="Hcal",
279  std::string aux="");
280 
281  // loading using DQMStore
282  // @DQMStore
283  // @emap
284  // @prepend - name to prepend to /<subsystem> - used when load
285  // a file to DQMStore without stripping and in case a name is
286  // appended
287  // @mode - if StripRunDirs - then there will be no Run Summary
288  // otherwise there is Run Summary folde. Used for retrieving
289  // MEs which were loaded into the DQM store from a file
290  virtual void load(DQMStore*, HcalElectronicsMap const*,
291  std::string const& subsystem="Hcal",
292  std::string const& aux="",
293  std::string const& prepend="", DQMStore::OpenRunDirs
295  virtual void load(DQMStore*, HcalElectronicsMap const*,
296  filter::HashFilter const&,
297  std::string const& subsystem="Hcal",
298  std::string const& aux="",
299  std::string const& prepend="", DQMStore::OpenRunDirs
301 
302  // loading using DQMStore::IGetter
303  virtual void load(DQMStore::IGetter&, HcalElectronicsMap const*,
304  std::string const& subsystem="Hcal",
305  std::string const& aux="");
306  virtual void load(DQMStore::IGetter&, HcalElectronicsMap const*,
307  filter::HashFilter const&,
308  std::string const& subsystem="Hcal",
309  std::string const& aux="");
310 
311  // reset all the elements
312  virtual void reset();
313 
314  // print all the elements
315  virtual void print();
316 
317  // TO BE USED IN THE FUTURE!
318  virtual void extendAxisRange(int);
319 
320  // set lumi flags for all mes
321  virtual void setLumiFlag();
322 
323  virtual void showOverflowX(bool showOverflow);
324  virtual void showOverflowY(bool showOverflow);
325 
326  protected:
327  virtual void customize(MonitorElement*);
328 
329  typedef boost::unordered_map<uint32_t, MonitorElement*> MEMap;
330  MEMap _mes;
334  };
335 }
336 
337 #endif
338 
339 
340 
341 
342 
343 
344 
345 
virtual double getBinEntries(HcalTrigTowerDetId const &tid, int x, int)
Definition: Container1D.h:207
virtual double getBinEntries(HcalElectronicsId const &eid, int x, double)
Definition: Container1D.h:143
virtual double getBinEntries(HcalElectronicsId const &eid, double x, double)
Definition: Container1D.h:146
virtual void setBinContent(HcalElectronicsId const &id, double x, double y, int)
Definition: Container1D.h:180
virtual void customize(MonitorElement *)
virtual void initialize(std::string const &folder, std::string const &qname, int debug=0)
Definition: Container.h:33
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:41
virtual double getBinEntries(HcalTrigTowerDetId const &tid, int x, double)
Definition: Container1D.h:210
virtual double getRMS(HcalDetId const &, int axix=1)
Definition: Container1D.cc:238
virtual void setBinContent(HcalElectronicsId const &id, int x, double y, double)
Definition: Container1D.h:186
virtual void setBinContent(HcalElectronicsId const &id, double x, int y, int)
Definition: Container1D.h:177
virtual double getBinEntries(HcalDetId const &did, double x, double)
Definition: Container1D.h:84
virtual void setBinContent(HcalElectronicsId const &id, double x, double y, double)
Definition: Container1D.h:192
virtual void setBinContent(HcalTrigTowerDetId const &id, int x, int y, double)
Definition: Container1D.h:251
virtual double getBinContent(HcalDetId const &did, double x, double)
Definition: Container1D.h:94
virtual void setBinContent(HcalTrigTowerDetId const &id, double x, double y, int)
Definition: Container1D.h:248
virtual double getBinContent(HcalElectronicsId const &eid, int x, int)
Definition: Container1D.h:153
virtual void setBinContent(HcalTrigTowerDetId const &id, double x, double y, double)
Definition: Container1D.h:260
OpenRunDirs
Definition: DQMStore.h:87
virtual double getBinContent(HcalTrigTowerDetId const &tid, int x, double)
Definition: Container1D.h:223
virtual void setBinContent(HcalElectronicsId const &id, int x, double y, int)
Definition: Container1D.h:174
virtual void setBinContent(HcalTrigTowerDetId const &id, double x, int y, double)
Definition: Container1D.h:257
virtual double getBinEntries(HcalElectronicsId const &eid, int x, int)
Definition: Container1D.h:140
virtual void setBinContent(HcalTrigTowerDetId const &id, int x, double y, int)
Definition: Container1D.h:242
virtual void setBinContent(HcalTrigTowerDetId const &id, double x, int y, int)
Definition: Container1D.h:245
~Container1D() override
Definition: Container1D.cc:23
virtual void setBinContent(HcalDetId const &id, double x, int y, int)
Definition: Container1D.h:110
virtual void setBinContent(HcalDetId const &id, int x, double y, int)
Definition: Container1D.h:107
virtual void fill(uint32_t)
Definition: Container1D.cc:83
virtual void reset()
Definition: Container1D.cc:66
quantity::Quantity * _qx
Definition: Container1D.h:332
virtual double getBinContent(HcalElectronicsId const &eid, double x, double)
Definition: Container1D.h:159
virtual void setBinContent(HcalDetId const &id, int x, double y, double)
Definition: Container1D.h:119
virtual double getBinEntries(HcalTrigTowerDetId const &tid, double x, double)
Definition: Container1D.h:213
virtual void showOverflowX(bool showOverflow)
virtual void setBinContent(HcalDetId const &id, int x, int y, double)
Definition: Container1D.h:116
virtual void setBinContent(HcalElectronicsId const &id, int x, int y, double)
Definition: Container1D.h:183
virtual void showOverflowY(bool showOverflow)
virtual void setBinContent(HcalElectronicsId const &id, int x, int y, int)
Definition: Container1D.h:171
virtual double getMean(HcalDetId const &, int axis=1)
Definition: Container1D.cc:233
virtual double getBinEntries(HcalDetId const &did, int x, int)
Definition: Container1D.h:80
virtual double getBinContent(HcalTrigTowerDetId const &tid, int x, int)
Definition: Container1D.h:220
virtual void setBinContent(HcalTrigTowerDetId const &id, int x, double y, double)
Definition: Container1D.h:254
virtual void setBinContent(HcalDetId const &id, double x, double y, int)
Definition: Container1D.h:113
virtual double getBinContent(HcalElectronicsId const &eid, int x, double)
Definition: Container1D.h:156
virtual void setBinContent(HcalElectronicsId const &id, double x, int y, double)
Definition: Container1D.h:189
#define debug
Definition: HDRShower.cc:19
virtual void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="")
Definition: Container1D.cc:958
virtual void load(DQMStore *, HcalElectronicsMap const *, std::string const &subsystem="Hcal", std::string const &aux="", std::string const &prepend="", DQMStore::OpenRunDirs mode=DQMStore::StripRunDirs)
Definition: Container1D.cc:597
virtual void setBinContent(HcalDetId const &, int)
Definition: Container1D.cc:244
mapper::HashMapper _hashmap
Definition: Container1D.h:331
virtual void print()
Definition: Container1D.cc:74
boost::unordered_map< uint32_t, MonitorElement * > MEMap
Definition: Container1D.h:329
virtual void setBinContent(HcalDetId const &id, double x, double y, double)
Definition: Container1D.h:125
virtual double getBinContent(HcalTrigTowerDetId const &tid, double x, double)
Definition: Container1D.h:226
virtual double getBinEntries(HcalDetId const &did, int x, double)
Definition: Container1D.h:82
virtual void setLumiFlag()
virtual double getBinContent(HcalDetId const &)
Definition: Container1D.cc:215
virtual void setBinContent(HcalDetId const &id, double x, int y, double)
Definition: Container1D.h:122
virtual void setBinContent(HcalDetId const &id, int x, int y, int)
Definition: Container1D.h:105
virtual double getBinContent(HcalDetId const &did, int x, int)
Definition: Container1D.h:90
virtual void setBinContent(HcalTrigTowerDetId const &id, int x, int y, int)
Definition: Container1D.h:239
virtual double getBinEntries(HcalDetId const &)
Definition: Container1D.cc:198
quantity::Quantity * _qy
Definition: Container1D.h:333
virtual double getBinContent(HcalDetId const &did, int x, double)
Definition: Container1D.h:92
Readout chain identification for Hcal.
virtual void extendAxisRange(int)