CMS 3D CMS Logo

ContainerProf1D.cc
Go to the documentation of this file.
2 
3 
4 namespace hcaldqm
5 {
6  using namespace mapper;
7  using namespace quantity;
8  using namespace constants;
9 
11  {
12  _qx = nullptr;
13  _qy = nullptr;
14  }
15 
17  hashfunctions::HashType hashtype,
18  Quantity* qx, Quantity* qy) :
19  Container1D(folder, hashtype, qx, qy)
20  {
23  }
24 
25  /* virtual */ void ContainerProf1D::initialize(std::string const& folder,
26  hashfunctions::HashType hashtype,
27  Quantity *qx, Quantity *qy,
28  int debug/*=0*/)
29  {
30  Container1D::initialize(folder, hashtype, qx, qy, debug);
33  }
34 
35  /* virtual */ void ContainerProf1D::initialize(std::string const& folder,
36  std::string const& qname,
37  hashfunctions::HashType hashtype,
38  Quantity *qx, Quantity *qy,
39  int debug/*=0*/)
40  {
41  Container1D::initialize(folder, qname, hashtype, qx, qy, debug);
44  }
45 
47  HcalElectronicsMap const *emap,
48  std::string subsystem, std::string aux)
49  {
50  // check Container1D.cc for the format
51  //
52  ib.setCurrentFolder(subsystem+"/"+_folder+"/"+_qname
53  +(aux.empty()?aux:"_"+aux)+"/"+_hashmap.getHashTypeName());
54  if (_hashmap.isDHash())
55  {
56  std::vector<HcalGenericDetId> dids = emap->allPrecisionId();
57  for (std::vector<HcalGenericDetId>::const_iterator it=
58  dids.begin(); it!=dids.end(); ++it)
59  {
60  // skip trigger towers and calibration
61  if (!it->isHcalDetId())
62  continue;
63 
64  HcalDetId did = HcalDetId(it->rawId());
65  uint32_t hash = _hashmap.getHash(did);
66  MEMap::iterator mit = _mes.find(hash);
67  if (mit!=_mes.end())
68  continue;
69 
71  _mes.insert(
72  std::make_pair(hash, ib.bookProfile(_hashmap.getName(did),
73  _hashmap.getName(did), _qx->nbins(), _qx->min(),
74  _qx->max(), _qy->min(), _qy->max())));
75  customize(_mes[hash]);
76  }
77  }
78  else if (_hashmap.isEHash())
79  {
80  std::vector<HcalElectronicsId> eids =
82  for (std::vector<HcalElectronicsId>::const_iterator it=
83  eids.begin(); it!=eids.end(); ++it)
84  {
86  uint32_t hash = _hashmap.getHash(eid);
87  MEMap::iterator mit = _mes.find(hash);
88  if (mit!=_mes.end())
89  continue;
90 
92  _mes.insert(
93  std::make_pair(hash, ib.bookProfile(_hashmap.getName(eid),
94  _hashmap.getName(eid), _qx->nbins(), _qx->min(),
95  _qx->max(), _qy->min(), _qy->max())));
96  customize(_mes[hash]);
97  }
98  }
99  else if (_hashmap.isTHash())
100  {
101  std::vector<HcalTrigTowerDetId> tids =
102  emap->allTriggerId();
103  for (std::vector<HcalTrigTowerDetId>::const_iterator it=
104  tids.begin(); it!=tids.end(); ++it)
105  {
106  HcalTrigTowerDetId tid = HcalTrigTowerDetId(it->rawId());
107  uint32_t hash = _hashmap.getHash(tid);
108  MEMap::iterator mit = _mes.find(hash);
109  if (mit!=_mes.end())
110  continue;
111 
113  _mes.insert(
114  std::make_pair(hash, ib.bookProfile(_hashmap.getName(tid),
115  _hashmap.getName(tid), _qx->nbins(), _qx->min(),
116  _qx->max(), _qy->min(), _qy->max())));
117  customize(_mes[hash]);
118  }
119  }
120  }
121 
123  HcalElectronicsMap const *emap, filter::HashFilter const& filter,
124  std::string subsystem, std::string aux)
125  {
126  // check Container1D.cc for the format
127  //
128  ib.setCurrentFolder(subsystem+"/"+_folder+"/"+_qname
129  +(aux.empty()?aux:"_"+aux)+"/"+_hashmap.getHashTypeName());
130  if (_hashmap.isDHash())
131  {
132  std::vector<HcalGenericDetId> dids = emap->allPrecisionId();
133  for (std::vector<HcalGenericDetId>::const_iterator it=
134  dids.begin(); it!=dids.end(); ++it)
135  {
136  // skip trigger towers and calibration
137  if (!it->isHcalDetId())
138  continue;
139 
140  HcalDetId did = HcalDetId(it->rawId());
141  uint32_t hash = _hashmap.getHash(did);
142  MEMap::iterator mit = _mes.find(hash);
143  if (mit!=_mes.end())
144  continue;
145  if (filter.filter(did))
146  continue;
147 
149  _mes.insert(
150  std::make_pair(hash, ib.bookProfile(_hashmap.getName(did),
151  _hashmap.getName(did), _qx->nbins(), _qx->min(),
152  _qx->max(), _qy->min(), _qy->max())));
153  customize(_mes[hash]);
154  }
155  }
156  else if (_hashmap.isEHash())
157  {
158  std::vector<HcalElectronicsId> eids =
160  for (std::vector<HcalElectronicsId>::const_iterator it=
161  eids.begin(); it!=eids.end(); ++it)
162  {
163  HcalElectronicsId eid = HcalElectronicsId(it->rawId());
164  uint32_t hash = _hashmap.getHash(eid);
165  MEMap::iterator mit = _mes.find(hash);
166  if (mit!=_mes.end())
167  continue;
168  if (filter.filter(eid))
169  continue;
170 
172  _mes.insert(
173  std::make_pair(hash, ib.bookProfile(_hashmap.getName(eid),
174  _hashmap.getName(eid), _qx->nbins(), _qx->min(),
175  _qx->max(), _qy->min(), _qy->max())));
176  customize(_mes[hash]);
177  }
178  }
179  else if (_hashmap.isTHash())
180  {
181  std::vector<HcalTrigTowerDetId> tids =
182  emap->allTriggerId();
183  for (std::vector<HcalTrigTowerDetId>::const_iterator it=
184  tids.begin(); it!=tids.end(); ++it)
185  {
186  HcalTrigTowerDetId tid = HcalTrigTowerDetId(it->rawId());
187  uint32_t hash = _hashmap.getHash(tid);
188  MEMap::iterator mit = _mes.find(hash);
189  if (mit!=_mes.end())
190  continue;
191  if (filter.filter(tid))
192  continue;
193 
195  _mes.insert(
196  std::make_pair(hash, ib.bookProfile(_hashmap.getName(tid),
197  _hashmap.getName(tid), _qx->nbins(), _qx->min(),
198  _qx->max(), _qy->min(), _qy->max())));
199  customize(_mes[hash]);
200  }
201  }
202  }
203 }
void initialize(std::string const &folder, hashfunctions::HashType, quantity::Quantity *, quantity::Quantity *, int debug=0) override
virtual void customize(MonitorElement *)
Definition: Container1D.cc:962
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:40
virtual void setAxisType(AxisType at)
Definition: Quantity.h:49
std::vector< HcalElectronicsId > allElectronicsIdPrecision() const
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:113
virtual bool isTHash() const
Definition: HashMapper.h:63
virtual double max()
Definition: Quantity.h:76
void debug(STDTYPE const &msg) const
Definition: Logger.h:31
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
virtual std::string getHashTypeName() const
Definition: HashMapper.h:50
quantity::Quantity * _qx
Definition: Container1D.h:310
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
std::vector< HcalGenericDetId > allPrecisionId() const
std::string _folder
Definition: Container.h:42
uint32_t getHash(HcalDetId const &did) const override
Definition: HashMapper.h:33
#define debug
Definition: HDRShower.cc:19
mapper::HashMapper _hashmap
Definition: Container1D.h:309
virtual double min()
Definition: Quantity.h:75
virtual bool isDHash() const
Definition: HashMapper.h:56
std::string _qname
Definition: Container.h:43
virtual bool filter(HcalDetId const &) const
Definition: HashFilter.cc:38
virtual bool isEHash() const
Definition: HashMapper.h:58
quantity::Quantity * _qy
Definition: Container1D.h:311
Readout chain identification for Hcal.
std::vector< HcalTrigTowerDetId > allTriggerId() const
std::string getName(HcalDetId const &did) const override
Definition: HashMapper.h:42
ib
Definition: cuy.py:662