CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ContainerProf1D.cc
Go to the documentation of this file.
2 
3 namespace hcaldqm {
4  using namespace mapper;
5  using namespace quantity;
6  using namespace constants;
7 
9  _qx = nullptr;
10  _qy = nullptr;
11  }
12 
14  hashfunctions::HashType hashtype,
15  Quantity *qx,
16  Quantity *qy)
17  : Container1D(folder, hashtype, qx, qy) {
20  }
21 
22  /* virtual */ void ContainerProf1D::initialize(
23  std::string const &folder, hashfunctions::HashType hashtype, Quantity *qx, Quantity *qy, int debug /*=0*/) {
24  Container1D::initialize(folder, hashtype, qx, qy, debug);
27  }
28 
29  /* virtual */ void ContainerProf1D::initialize(std::string const &folder,
30  std::string const &qname,
31  hashfunctions::HashType hashtype,
32  Quantity *qx,
33  Quantity *qy,
34  int debug /*=0*/) {
35  Container1D::initialize(folder, qname, hashtype, qx, qy, debug);
38  }
39 
41  HcalElectronicsMap const *emap,
43  std::string aux) {
44  // check Container1D.cc for the format
45  //
46  ib.setCurrentFolder(subsystem + "/" + _folder + "/" + _qname + (aux.empty() ? aux : "_" + aux) + "/" +
48  if (_hashmap.isDHash()) {
49  std::vector<HcalGenericDetId> dids = emap->allPrecisionId();
50  for (std::vector<HcalGenericDetId>::const_iterator it = dids.begin(); it != dids.end(); ++it) {
51  // skip trigger towers and calibration
52  if (!it->isHcalDetId())
53  continue;
54 
55  HcalDetId did = HcalDetId(it->rawId());
56  uint32_t hash = _hashmap.getHash(did);
57  MEMap::iterator mit = _mes.find(hash);
58  if (mit != _mes.end())
59  continue;
60 
62  _mes.insert(std::make_pair(hash,
64  _hashmap.getName(did),
65  _qx->nbins(),
66  _qx->min(),
67  _qx->max(),
68  _qy->min(),
69  _qy->max())));
70  customize(_mes[hash]);
71  }
72  } else if (_hashmap.isEHash()) {
73  std::vector<HcalElectronicsId> eids = emap->allElectronicsIdPrecision();
74  for (std::vector<HcalElectronicsId>::const_iterator it = eids.begin(); it != eids.end(); ++it) {
76  uint32_t hash = _hashmap.getHash(eid);
77  MEMap::iterator mit = _mes.find(hash);
78  if (mit != _mes.end())
79  continue;
80 
82  _mes.insert(std::make_pair(hash,
84  _hashmap.getName(eid),
85  _qx->nbins(),
86  _qx->min(),
87  _qx->max(),
88  _qy->min(),
89  _qy->max())));
90  customize(_mes[hash]);
91  }
92  } else if (_hashmap.isTHash()) {
93  std::vector<HcalTrigTowerDetId> tids = emap->allTriggerId();
94  for (std::vector<HcalTrigTowerDetId>::const_iterator it = tids.begin(); it != tids.end(); ++it) {
95  HcalTrigTowerDetId tid = HcalTrigTowerDetId(it->rawId());
96  uint32_t hash = _hashmap.getHash(tid);
97  MEMap::iterator mit = _mes.find(hash);
98  if (mit != _mes.end())
99  continue;
100 
102  _mes.insert(std::make_pair(hash,
103  ib.bookProfile(_hashmap.getName(tid),
104  _hashmap.getName(tid),
105  _qx->nbins(),
106  _qx->min(),
107  _qx->max(),
108  _qy->min(),
109  _qy->max())));
110  customize(_mes[hash]);
111  }
112  }
113  }
114 
116  HcalElectronicsMap const *emap,
117  filter::HashFilter const &filter,
119  std::string aux) {
120  // check Container1D.cc for the format
121  //
122  ib.setCurrentFolder(subsystem + "/" + _folder + "/" + _qname + (aux.empty() ? aux : "_" + aux) + "/" +
124  if (_hashmap.isDHash()) {
125  std::vector<HcalGenericDetId> dids = emap->allPrecisionId();
126  for (std::vector<HcalGenericDetId>::const_iterator it = dids.begin(); it != dids.end(); ++it) {
127  // skip trigger towers and calibration
128  if (!it->isHcalDetId())
129  continue;
130 
131  HcalDetId did = HcalDetId(it->rawId());
132  uint32_t hash = _hashmap.getHash(did);
133  MEMap::iterator mit = _mes.find(hash);
134  if (mit != _mes.end())
135  continue;
136  if (filter.filter(did))
137  continue;
138 
140  _mes.insert(std::make_pair(hash,
141  ib.bookProfile(_hashmap.getName(did),
142  _hashmap.getName(did),
143  _qx->nbins(),
144  _qx->min(),
145  _qx->max(),
146  _qy->min(),
147  _qy->max())));
148  customize(_mes[hash]);
149  }
150  } else if (_hashmap.isEHash()) {
151  std::vector<HcalElectronicsId> eids = emap->allElectronicsIdPrecision();
152  for (std::vector<HcalElectronicsId>::const_iterator it = eids.begin(); it != eids.end(); ++it) {
153  HcalElectronicsId eid = HcalElectronicsId(it->rawId());
154  uint32_t hash = _hashmap.getHash(eid);
155  MEMap::iterator mit = _mes.find(hash);
156  if (mit != _mes.end())
157  continue;
158  if (filter.filter(eid))
159  continue;
160 
162  _mes.insert(std::make_pair(hash,
163  ib.bookProfile(_hashmap.getName(eid),
164  _hashmap.getName(eid),
165  _qx->nbins(),
166  _qx->min(),
167  _qx->max(),
168  _qy->min(),
169  _qy->max())));
170  customize(_mes[hash]);
171  }
172  } else if (_hashmap.isTHash()) {
173  std::vector<HcalTrigTowerDetId> tids = emap->allTriggerId();
174  for (std::vector<HcalTrigTowerDetId>::const_iterator it = tids.begin(); it != tids.end(); ++it) {
175  HcalTrigTowerDetId tid = HcalTrigTowerDetId(it->rawId());
176  uint32_t hash = _hashmap.getHash(tid);
177  MEMap::iterator mit = _mes.find(hash);
178  if (mit != _mes.end())
179  continue;
180  if (filter.filter(tid))
181  continue;
182 
184  _mes.insert(std::make_pair(hash,
185  ib.bookProfile(_hashmap.getName(tid),
186  _hashmap.getName(tid),
187  _qx->nbins(),
188  _qx->min(),
189  _qx->max(),
190  _qy->min(),
191  _qy->max())));
192  customize(_mes[hash]);
193  }
194  }
195  }
196 } // namespace hcaldqm
void initialize(std::string const &folder, hashfunctions::HashType, quantity::Quantity *, quantity::Quantity *, int debug=0) override
virtual void customize(MonitorElement *)
Definition: Container1D.cc:737
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 void setAxisType(AxisType at)
Definition: Quantity.h:36
int ib
Definition: cuy.py:661
std::vector< HcalElectronicsId > allElectronicsIdPrecision() const
uint32_t getHash(HcalDetId const &did) const override
Definition: HashMapper.h:29
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
virtual bool isTHash() const
Definition: HashMapper.h:62
virtual double max()
Definition: Quantity.h:60
void debug(STDTYPE const &msg) const
Definition: Logger.h:20
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
virtual std::string getHashTypeName() const
Definition: HashMapper.h:54
quantity::Quantity * _qx
Definition: Container1D.h:234
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:322
std::vector< HcalGenericDetId > allPrecisionId() const
std::string _folder
Definition: Container.h:37
#define debug
Definition: HDRShower.cc:19
mapper::HashMapper _hashmap
Definition: Container1D.h:233
virtual double min()
Definition: Quantity.h:59
virtual bool isDHash() const
Definition: HashMapper.h:58
std::string getName(HcalDetId const &did) const override
Definition: HashMapper.h:42
std::string _qname
Definition: Container.h:38
virtual bool filter(HcalDetId const &) const
Definition: HashFilter.cc:24
virtual bool isEHash() const
Definition: HashMapper.h:59
quantity::Quantity * _qy
Definition: Container1D.h:235
Readout chain identification for Hcal.
std::vector< HcalTrigTowerDetId > allTriggerId() const