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