test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  virtual ~Container1D();
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);
62 
63  // filling by hash
64  virtual void fill(uint32_t);
65  virtual void fill(uint32_t, int);
66  virtual void fill(uint32_t, double);
67  virtual void fill(uint32_t, int, double);
68  virtual void fill(uint32_t, int, int);
69  virtual void fill(uint32_t, double, double);
70 
71  // using DetId as mapper
72  virtual void fill(HcalDetId const&);
73  virtual void fill(HcalDetId const&, int);
74  virtual void fill(HcalDetId const&, double);
75  virtual void fill(HcalDetId const&, int, double);
76  virtual void fill(HcalDetId const&, int, int);
77  virtual void fill(HcalDetId const&, double, double);
78 
79  virtual double getBinEntries(HcalDetId const&);
80  virtual double getBinEntries(HcalDetId const&, int);
81  virtual double getBinEntries(HcalDetId const&, double);
82  virtual double getBinEntries(HcalDetId const& did, int x, int)
83  {return getBinEntries(did, x);}
84  virtual double getBinEntries(HcalDetId const& did, int x, double)
85  {return getBinEntries(did, x);}
86  virtual double getBinEntries(HcalDetId const& did, double x, double)
87  {return getBinEntries(did, x);}
88 
89  virtual double getBinContent(HcalDetId const&);
90  virtual double getBinContent(HcalDetId const&, int);
91  virtual double getBinContent(HcalDetId const&, double);
92  virtual double getBinContent(HcalDetId const& did, int x, int)
93  {return getBinContent(did, x);}
94  virtual double getBinContent(HcalDetId const& did, int x, double)
95  {return getBinContent(did, x);}
96  virtual double getBinContent(HcalDetId const& did, double x, double)
97  {return getBinContent(did, x);}
98  virtual double getMean(HcalDetId const&, int axis=1);
99  virtual double getRMS(HcalDetId const&, int axix=1);
100 
101  virtual void setBinContent(HcalDetId const&, int);
102  virtual void setBinContent(HcalDetId const&, double);
103  virtual void setBinContent(HcalDetId const&, int, int);
104  virtual void setBinContent(HcalDetId const&, int, double);
105  virtual void setBinContent(HcalDetId const&, double, double);
106  virtual void setBinContent(HcalDetId const&, double, int);
107  virtual void setBinContent(HcalDetId const& id, int x, int y, int)
108  {setBinContent(id, x, y);}
109  virtual void setBinContent(HcalDetId const& id, int x, double y,
110  int)
111  {setBinContent(id, x, y);}
112  virtual void setBinContent(HcalDetId const& id, double x, int y,
113  int)
114  {setBinContent(id, x, y);}
115  virtual void setBinContent(HcalDetId const& id, double x, double y,
116  int)
117  {setBinContent(id, x, y);}
118  virtual void setBinContent(HcalDetId const& id, int x, int y,
119  double)
120  {setBinContent(id, x, y);}
121  virtual void setBinContent(HcalDetId const& id, int x, double y,
122  double)
123  {setBinContent(id, x, y);}
124  virtual void setBinContent(HcalDetId const& id, double x, int y,
125  double)
126  {setBinContent(id, x, y);}
127  virtual void setBinContent(HcalDetId const& id, double x, double y,
128  double)
129  {setBinContent(id, x, y);}
130 
131  // using ElectronicsId
132  virtual void fill(HcalElectronicsId const&);
133  virtual void fill(HcalElectronicsId const&, int);
134  virtual void fill(HcalElectronicsId const&, double);
135  virtual void fill(HcalElectronicsId const&, int, double);
136  virtual void fill(HcalElectronicsId const&, int, int);
137  virtual void fill(HcalElectronicsId const&, double, double);
138 
139  virtual double getBinEntries(HcalElectronicsId const&);
140  virtual double getBinEntries(HcalElectronicsId const&, int);
141  virtual double getBinEntries(HcalElectronicsId const&, double);
142  virtual double getBinEntries(HcalElectronicsId const& eid, int x,
143  int)
144  {return getBinEntries(eid, x);}
145  virtual double getBinEntries(HcalElectronicsId const& eid, int x,
146  double)
147  {return getBinEntries(eid, x);}
148  virtual double getBinEntries(HcalElectronicsId const& eid,
149  double x, double)
150  {return getBinEntries(eid, x);}
151 
152  virtual double getBinContent(HcalElectronicsId const&);
153  virtual double getBinContent(HcalElectronicsId const&, int);
154  virtual double getBinContent(HcalElectronicsId const&, double);
155  virtual double getBinContent(HcalElectronicsId const& eid,
156  int x, int)
157  {return getBinContent(eid, x);}
158  virtual double getBinContent(HcalElectronicsId const& eid,
159  int x, double)
160  {return getBinContent(eid, x);}
161  virtual double getBinContent(HcalElectronicsId const& eid,
162  double x, double)
163  {return getBinContent(eid, x);}
164  virtual double getMean(HcalElectronicsId const&, int axis=1);
165  virtual double getRMS(HcalElectronicsId const&, int axis=1);
166 
167  virtual void setBinContent(HcalElectronicsId const&, int);
168  virtual void setBinContent(HcalElectronicsId const&, double);
169  virtual void setBinContent(HcalElectronicsId const&, int, int);
170  virtual void setBinContent(HcalElectronicsId const&, int, double);
171  virtual void setBinContent(HcalElectronicsId const&, double, double);
172  virtual void setBinContent(HcalElectronicsId const&, double, int);
173  virtual void setBinContent(HcalElectronicsId const& id, int x, int y
174  , int)
175  {setBinContent(id, x, y);}
176  virtual void setBinContent(HcalElectronicsId const& id, int x,
177  double y, int)
178  {setBinContent(id, x, y);}
179  virtual void setBinContent(HcalElectronicsId const& id, double x,
180  int y, int)
181  {setBinContent(id, x, y);}
182  virtual void setBinContent(HcalElectronicsId const& id, double x,
183  double y, int)
184  {setBinContent(id, x, y);}
185  virtual void setBinContent(HcalElectronicsId const& id, int x,
186  int y, double)
187  {setBinContent(id, x, y);}
188  virtual void setBinContent(HcalElectronicsId const& id, int x,
189  double y, double)
190  {setBinContent(id, x, y);}
191  virtual void setBinContent(HcalElectronicsId const& id, double x,
192  int y, double)
193  {setBinContent(id, x, y);}
194  virtual void setBinContent(HcalElectronicsId const& id, double x,
195  double y, double)
196  {setBinContent(id, x, y);}
197 
198  // using DetId as mapper
199  virtual void fill(HcalTrigTowerDetId const&);
200  virtual void fill(HcalTrigTowerDetId const&, int);
201  virtual void fill(HcalTrigTowerDetId const&, double);
202  virtual void fill(HcalTrigTowerDetId const&, int, double);
203  virtual void fill(HcalTrigTowerDetId const&, int, int);
204  virtual void fill(HcalTrigTowerDetId const&, double, double);
205 
206  virtual double getBinEntries(HcalTrigTowerDetId const&);
207  virtual double getBinEntries(HcalTrigTowerDetId const&, int);
208  virtual double getBinEntries(HcalTrigTowerDetId const&, double);
209  virtual double getBinEntries(HcalTrigTowerDetId const& tid, int x,
210  int)
211  {return getBinEntries(tid, x);}
212  virtual double getBinEntries(HcalTrigTowerDetId const& tid, int x,
213  double)
214  {return getBinEntries(tid, x);}
215  virtual double getBinEntries(HcalTrigTowerDetId const& tid,
216  double x, double)
217  {return getBinEntries(tid, x);}
218 
219  virtual double getBinContent(HcalTrigTowerDetId const&);
220  virtual double getBinContent(HcalTrigTowerDetId const&, int);
221  virtual double getBinContent(HcalTrigTowerDetId const&, double);
222  virtual double getBinContent(HcalTrigTowerDetId const& tid,
223  int x, int)
224  {return getBinContent(tid, x);}
225  virtual double getBinContent(HcalTrigTowerDetId const& tid,
226  int x, double)
227  {return getBinContent(tid, x);}
228  virtual double getBinContent(HcalTrigTowerDetId const& tid,
229  double x, double)
230  {return getBinContent(tid, x);}
231  virtual double getMean(HcalTrigTowerDetId const&, int axis=1);
232  virtual double getRMS(HcalTrigTowerDetId const&, int axis=1);
233 
234  virtual void setBinContent(HcalTrigTowerDetId const&, int);
235  virtual void setBinContent(HcalTrigTowerDetId const&, double);
236  virtual void setBinContent(HcalTrigTowerDetId const&, int, int);
237  virtual void setBinContent(HcalTrigTowerDetId const&, int, double);
238  virtual void setBinContent(HcalTrigTowerDetId const&, double,
239  double);
240  virtual void setBinContent(HcalTrigTowerDetId const&, double, int);
241  virtual void setBinContent(HcalTrigTowerDetId const& id, int x,
242  int y, int)
243  {setBinContent(id, x, y);}
244  virtual void setBinContent(HcalTrigTowerDetId const& id, int x,
245  double y, int)
246  {setBinContent(id, x, y);}
247  virtual void setBinContent(HcalTrigTowerDetId const& id, double x,
248  int y, int)
249  {setBinContent(id, x, y);}
250  virtual void setBinContent(HcalTrigTowerDetId const& id, double x,
251  double y, int)
252  {setBinContent(id, x, y);}
253  virtual void setBinContent(HcalTrigTowerDetId const& id, int x,
254  int y, double)
255  {setBinContent(id, x, y);}
256  virtual void setBinContent(HcalTrigTowerDetId const& id, int x,
257  double y, double)
258  {setBinContent(id, x, y);}
259  virtual void setBinContent(HcalTrigTowerDetId const& id, double x,
260  int y, double)
261  {setBinContent(id, x, y);}
262  virtual void setBinContent(HcalTrigTowerDetId const& id, double x,
263  double y, double)
264  {setBinContent(id, x, y);}
265 
266  // booking using IBooker
267  // @aux - typically a cut or anything else
268  // @subsystem - subsystem under which to save
269  //
270  virtual void book(DQMStore::IBooker&, HcalElectronicsMap const*,
271  std::string subsystem="Hcal",
272  std::string aux="");
273  virtual void book(DQMStore::IBooker&, HcalElectronicsMap const*,
275  std::string aux="");
276  virtual void book(DQMStore*, HcalElectronicsMap const*,
277  std::string subsystem="Hcal",
278  std::string aux="");
279  virtual void book(DQMStore*, HcalElectronicsMap const*,
281  std::string aux="");
282 
283  // loading using DQMStore
284  // @DQMStore
285  // @emap
286  // @prepend - name to prepend to /<subsystem> - used when load
287  // a file to DQMStore without stripping and in case a name is
288  // appended
289  // @mode - if StripRunDirs - then there will be no Run Summary
290  // otherwise there is Run Summary folde. Used for retrieving
291  // MEs which were loaded into the DQM store from a file
292  virtual void load(DQMStore*, HcalElectronicsMap const*,
293  std::string const& subsystem="Hcal",
294  std::string const& aux="",
295  std::string const& prepend="", DQMStore::OpenRunDirs
297  virtual void load(DQMStore*, HcalElectronicsMap const*,
298  filter::HashFilter const&,
299  std::string const& subsystem="Hcal",
300  std::string const& aux="",
301  std::string const& prepend="", DQMStore::OpenRunDirs
303 
304  // loading using DQMStore::IGetter
305  virtual void load(DQMStore::IGetter&, HcalElectronicsMap const*,
306  std::string const& subsystem="Hcal",
307  std::string const& aux="");
308  virtual void load(DQMStore::IGetter&, HcalElectronicsMap const*,
309  filter::HashFilter const&,
310  std::string const& subsystem="Hcal",
311  std::string const& aux="");
312 
313  // reset all the elements
314  virtual void reset();
315 
316  // print all the elements
317  virtual void print();
318 
319  // TO BE USED IN THE FUTURE!
320  virtual void extendAxisRange(int);
321 
322  // set lumi flags for all mes
323  virtual void setLumiFlag();
324 
325  protected:
326  virtual void customize(MonitorElement*);
327 
328  typedef boost::unordered_map<uint32_t, MonitorElement*> MEMap;
333  };
334 }
335 
336 #endif
337 
338 
339 
340 
341 
342 
343 
344 
virtual double getBinEntries(HcalTrigTowerDetId const &tid, int x, int)
Definition: Container1D.h:209
static AlgebraicMatrix initialize()
virtual double getBinEntries(HcalElectronicsId const &eid, int x, double)
Definition: Container1D.h:145
virtual double getBinEntries(HcalElectronicsId const &eid, double x, double)
Definition: Container1D.h:148
virtual void setBinContent(HcalElectronicsId const &id, double x, double y, int)
Definition: Container1D.h:182
string fill
Definition: lumiContext.py:319
virtual double getBinEntries(HcalTrigTowerDetId const &tid, int x, double)
Definition: Container1D.h:212
virtual void setBinContent(HcalElectronicsId const &id, int x, double y, double)
Definition: Container1D.h:188
virtual void setBinContent(HcalElectronicsId const &id, double x, int y, int)
Definition: Container1D.h:179
virtual double getBinEntries(HcalDetId const &did, double x, double)
Definition: Container1D.h:86
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
Definition: print.cc:10
virtual void setBinContent(HcalElectronicsId const &id, double x, double y, double)
Definition: Container1D.h:194
virtual void setBinContent(HcalTrigTowerDetId const &id, int x, int y, double)
Definition: Container1D.h:253
virtual double getBinContent(HcalDetId const &did, double x, double)
Definition: Container1D.h:96
virtual void setBinContent(HcalTrigTowerDetId const &id, double x, double y, int)
Definition: Container1D.h:250
virtual double getBinContent(HcalElectronicsId const &eid, int x, int)
Definition: Container1D.h:155
virtual void setBinContent(HcalTrigTowerDetId const &id, double x, double y, double)
Definition: Container1D.h:262
OpenRunDirs
Definition: DQMStore.h:84
virtual double getBinContent(HcalTrigTowerDetId const &tid, int x, double)
Definition: Container1D.h:225
virtual void setBinContent(HcalElectronicsId const &id, int x, double y, int)
Definition: Container1D.h:176
virtual void setBinContent(HcalTrigTowerDetId const &id, double x, int y, double)
Definition: Container1D.h:259
virtual double getBinEntries(HcalElectronicsId const &eid, int x, int)
Definition: Container1D.h:142
virtual void setBinContent(HcalTrigTowerDetId const &id, int x, double y, int)
Definition: Container1D.h:244
virtual void setBinContent(HcalTrigTowerDetId const &id, double x, int y, int)
Definition: Container1D.h:247
virtual void setBinContent(HcalDetId const &id, double x, int y, int)
Definition: Container1D.h:112
virtual void setBinContent(HcalDetId const &id, int x, double y, int)
Definition: Container1D.h:109
virtual double getBinContent(HcalElectronicsId const &eid, double x, double)
Definition: Container1D.h:161
virtual void setBinContent(HcalDetId const &id, int x, double y, double)
Definition: Container1D.h:121
virtual double getBinEntries(HcalTrigTowerDetId const &tid, double x, double)
Definition: Container1D.h:215
def load
Definition: svgfig.py:546
virtual void setBinContent(HcalDetId const &id, int x, int y, double)
Definition: Container1D.h:118
virtual void setBinContent(HcalElectronicsId const &id, int x, int y, double)
Definition: Container1D.h:185
virtual void setBinContent(HcalElectronicsId const &id, int x, int y, int)
Definition: Container1D.h:173
virtual double getBinEntries(HcalDetId const &did, int x, int)
Definition: Container1D.h:82
virtual double getBinContent(HcalTrigTowerDetId const &tid, int x, int)
Definition: Container1D.h:222
virtual void setBinContent(HcalTrigTowerDetId const &id, int x, double y, double)
Definition: Container1D.h:256
virtual void setBinContent(HcalDetId const &id, double x, double y, int)
Definition: Container1D.h:115
virtual double getBinContent(HcalElectronicsId const &eid, int x, double)
Definition: Container1D.h:158
virtual void setBinContent(HcalElectronicsId const &id, double x, int y, double)
Definition: Container1D.h:191
#define debug
Definition: HDRShower.cc:19
mapper::HashMapper _hashmap
Definition: Container1D.h:330
boost::unordered_map< uint32_t, MonitorElement * > MEMap
Definition: Container1D.h:328
virtual void setBinContent(HcalDetId const &id, double x, double y, double)
Definition: Container1D.h:127
virtual double getBinContent(HcalTrigTowerDetId const &tid, double x, double)
Definition: Container1D.h:228
virtual double getBinEntries(HcalDetId const &did, int x, double)
Definition: Container1D.h:84
virtual void setBinContent(HcalDetId const &id, double x, int y, double)
Definition: Container1D.h:124
virtual void setBinContent(HcalDetId const &id, int x, int y, int)
Definition: Container1D.h:107
virtual double getBinContent(HcalDetId const &did, int x, int)
Definition: Container1D.h:92
virtual void setBinContent(HcalTrigTowerDetId const &id, int x, int y, int)
Definition: Container1D.h:241
void reset(double vett[256])
Definition: TPedValues.cc:11
virtual double getBinContent(HcalDetId const &did, int x, double)
Definition: Container1D.h:94
Readout chain identification for Hcal.
tuple folder
Histograms Source for live online DQM in P5