CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Types | Protected Attributes
hcaldqm::ContainerXXX< STDTYPE > Class Template Reference

#include <ContainerXXX.h>

Public Member Functions

virtual CompactMap::const_iterator begin ()
 
virtual void book (HcalElectronicsMap const *)
 
virtual void book (HcalElectronicsMap const *, filter::HashFilter const &)
 
 ContainerXXX ()
 
 ContainerXXX (hashfunctions::HashType ht)
 
 ContainerXXX (ContainerXXX const &x)
 
virtual void dump (Container1D *)
 
virtual void dump (std::vector< Container1D * > const &)
 
virtual CompactMap::const_iterator end ()
 
virtual STDTYPE & get (HcalDetId const &)
 
virtual STDTYPE & get (HcalElectronicsId const &)
 
virtual STDTYPE & get (HcalTrigTowerDetId const &)
 
virtual void initialize (hashfunctions::HashType, int debug=0)
 
virtual void load (Container1D *)
 
virtual void print ()
 
virtual void push (HcalDetId const &, STDTYPE)
 
virtual void push (HcalElectronicsId const &, STDTYPE)
 
virtual void push (HcalTrigTowerDetId const &, STDTYPE)
 
virtual void reset ()
 
virtual void set (HcalDetId const &, STDTYPE)
 
virtual void set (HcalElectronicsId const &, STDTYPE)
 
virtual void set (HcalTrigTowerDetId const &, STDTYPE)
 
virtual uint32_t size ()
 
virtual ~ContainerXXX ()
 

Protected Types

typedef boost::unordered_map
< uint32_t, STDTYPE > 
CompactMap
 

Protected Attributes

CompactMap _cmap
 
mapper::HashMapper _hashmap
 
Logger _logger
 

Detailed Description

template<typename STDTYPE>
class hcaldqm::ContainerXXX< STDTYPE >

Definition at line 23 of file ContainerXXX.h.

Member Typedef Documentation

template<typename STDTYPE>
typedef boost::unordered_map<uint32_t, STDTYPE> hcaldqm::ContainerXXX< STDTYPE >::CompactMap
protected

Definition at line 63 of file ContainerXXX.h.

Constructor & Destructor Documentation

template<typename STDTYPE>
hcaldqm::ContainerXXX< STDTYPE >::ContainerXXX ( )
inline

Definition at line 26 of file ContainerXXX.h.

26 {}
template<typename STDTYPE>
hcaldqm::ContainerXXX< STDTYPE >::ContainerXXX ( hashfunctions::HashType  ht)
inline

Definition at line 27 of file ContainerXXX.h.

27  : _hashmap(ht)
28  {}
mapper::HashMapper _hashmap
Definition: ContainerXXX.h:65
template<typename STDTYPE >
hcaldqm::ContainerXXX< STDTYPE >::ContainerXXX ( ContainerXXX< STDTYPE > const &  x)

Definition at line 76 of file ContainerXXX.h.

References AlCaHLTBitMon_ParallelJobs::p.

77  {
78  BOOST_FOREACH(typename CompactMap::value_type &p, _cmap)
79  {
80  _cmap.insert(std::make_pair(p.first, p.second));
81  }
82  }
template<typename STDTYPE>
virtual hcaldqm::ContainerXXX< STDTYPE >::~ContainerXXX ( )
inlinevirtual

Definition at line 30 of file ContainerXXX.h.

30 {_cmap.clear();}

Member Function Documentation

template<typename STDTYPE>
virtual CompactMap::const_iterator hcaldqm::ContainerXXX< STDTYPE >::begin ( void  )
inlinevirtual
template<typename STDTYPE >
void hcaldqm::ContainerXXX< STDTYPE >::book ( HcalElectronicsMap const *  emap)
virtual

Definition at line 93 of file ContainerXXX.h.

References HcalElectronicsMap::allElectronicsIdPrecision(), HcalElectronicsMap::allPrecisionId(), HcalElectronicsMap::allTriggerId(), and cond::hash.

Referenced by hcaldqm::DigiRunSummary::beginRun(), hcaldqm::RawRunSummary::beginRun(), LaserTask::bookHistograms(), LEDTask::bookHistograms(), PedestalTask::bookHistograms(), TPTask::bookHistograms(), RawTask::bookHistograms(), RecHitTask::bookHistograms(), DigiTask::bookHistograms(), hcaldqm::TPRunSummary::endJob(), and hcaldqm::RecoRunSummary::endJob().

94  {
95  if (_hashmap.isDHash())
96  {
97  std::vector<HcalGenericDetId> dids =
98  emap->allPrecisionId();
99  for (std::vector<HcalGenericDetId>::const_iterator it=
100  dids.begin(); it!=dids.end(); ++it)
101  {
102  if (!it->isHcalDetId())
103  continue;
104 
105  HcalDetId did = HcalDetId(it->rawId());
106  uint32_t hash = _hashmap.getHash(did);
108  typename CompactMap::iterator mit = _cmap.find(hash);
109  if (mit!=_cmap.end())
110  continue;
111 
112  _cmap.insert(
113  std::make_pair(hash, STDTYPE(0)));
114  }
115  }
116  else if (_hashmap.isEHash())
117  {
118  std::vector<HcalElectronicsId> eids =
119  emap->allElectronicsIdPrecision();
120  for (std::vector<HcalElectronicsId>::const_iterator it=
121  eids.begin(); it!=eids.end(); ++it)
122  {
123  HcalElectronicsId eid = HcalElectronicsId(it->rawId());
124  uint32_t hash = _hashmap.getHash(eid);
126  typename CompactMap::iterator mit = _cmap.find(hash);
127  if (mit!=_cmap.end())
128  continue;
129 
130  _cmap.insert(
131  std::make_pair(hash, STDTYPE(0)));
132  }
133  }
134  else if (_hashmap.isTHash())
135  {
136  std::vector<HcalTrigTowerDetId> tids = emap->allTriggerId();
137  for (std::vector<HcalTrigTowerDetId>::const_iterator it=
138  tids.begin(); it!=tids.end(); ++it)
139  {
140  HcalTrigTowerDetId tid = HcalTrigTowerDetId(it->rawId());
141  uint32_t hash = _hashmap.getHash(tid);
143  typename CompactMap::iterator mit = _cmap.find(hash);
144  if (mit!=_cmap.end())
145  continue;
146 
147  _cmap.insert(
148  std::make_pair(hash, STDTYPE(0)));
149  }
150  }
151  }
virtual uint32_t getHash(HcalDetId const &did) const
Definition: HashMapper.h:33
virtual bool isTHash() const
Definition: HashMapper.h:62
void debug(STDTYPE const &msg) const
Definition: Logger.h:31
mapper::HashMapper _hashmap
Definition: ContainerXXX.h:65
virtual bool isDHash() const
Definition: HashMapper.h:55
virtual bool isEHash() const
Definition: HashMapper.h:57
virtual std::string getName(HcalDetId const &did) const
Definition: HashMapper.h:41
Readout chain identification for Hcal.
template<typename STDTYPE >
void hcaldqm::ContainerXXX< STDTYPE >::book ( HcalElectronicsMap const *  emap,
filter::HashFilter const &  filter 
)
virtual

Definition at line 154 of file ContainerXXX.h.

References HcalElectronicsMap::allElectronicsIdPrecision(), HcalElectronicsMap::allPrecisionId(), HcalElectronicsMap::allTriggerId(), hcaldqm::filter::HashFilter::filter(), and cond::hash.

156  {
157  if (_hashmap.isDHash())
158  {
159  std::vector<HcalGenericDetId> dids =
160  emap->allPrecisionId();
161  for (std::vector<HcalGenericDetId>::const_iterator it=
162  dids.begin(); it!=dids.end(); ++it)
163  {
164  if (!it->isHcalDetId())
165  continue;
166 
167  HcalDetId did = HcalDetId(it->rawId());
168  uint32_t hash = _hashmap.getHash(did);
169  typename CompactMap::iterator mit = _cmap.find(hash);
170  if (mit!=_cmap.end())
171  continue;
172  if (filter.filter(did))
173  continue;
174 
176 
177  _cmap.insert(
178  std::make_pair(hash, STDTYPE(0)));
179  }
180  }
181  else if (_hashmap.isEHash())
182  {
183  std::vector<HcalElectronicsId> eids =
184  emap->allElectronicsIdPrecision();
185  for (std::vector<HcalElectronicsId>::const_iterator it=
186  eids.begin(); it!=eids.end(); ++it)
187  {
188  HcalElectronicsId eid = HcalElectronicsId(it->rawId());
189  uint32_t hash = _hashmap.getHash(eid);
190  typename CompactMap::iterator mit = _cmap.find(hash);
191  if (filter.filter(eid))
192  continue;
193  if (mit!=_cmap.end())
194  continue;
195  _logger.debug(eid);
196 
197  _cmap.insert(
198  std::make_pair(hash, STDTYPE(0)));
199  }
200  }
201  else if (_hashmap.isTHash())
202  {
203  std::vector<HcalTrigTowerDetId> tids = emap->allTriggerId();
204  for (std::vector<HcalTrigTowerDetId>::const_iterator it=
205  tids.begin(); it!=tids.end(); ++it)
206  {
207  HcalTrigTowerDetId tid = HcalTrigTowerDetId(it->rawId());
208  uint32_t hash = _hashmap.getHash(tid);
209  typename CompactMap::iterator mit = _cmap.find(hash);
210  if (mit!=_cmap.end())
211  continue;
212  if (filter.filter(tid))
213  continue;
215 
216  _cmap.insert(
217  std::make_pair(hash, STDTYPE(0)));
218  }
219  }
220  }
virtual uint32_t getHash(HcalDetId const &did) const
Definition: HashMapper.h:33
virtual bool isTHash() const
Definition: HashMapper.h:62
void debug(STDTYPE const &msg) const
Definition: Logger.h:31
mapper::HashMapper _hashmap
Definition: ContainerXXX.h:65
virtual bool isDHash() const
Definition: HashMapper.h:55
virtual bool isEHash() const
Definition: HashMapper.h:57
virtual std::string getName(HcalDetId const &did) const
Definition: HashMapper.h:41
Readout chain identification for Hcal.
template<typename STDTYPE >
void hcaldqm::ContainerXXX< STDTYPE >::dump ( Container1D c)
virtual

Definition at line 300 of file ContainerXXX.h.

References hcaldqm::Container1D::fill(), cond::hash, AlCaHLTBitMon_ParallelJobs::p, and x().

301  {
302  BOOST_FOREACH(typename CompactMap::value_type &p, _cmap)
303  {
304  STDTYPE &x = p.second;
305  uint32_t hash = p.first;
306  c->fill(hash, (double)x);
307  }
308  }
template<typename STDTYPE >
void hcaldqm::ContainerXXX< STDTYPE >::dump ( std::vector< Container1D * > const &  vc)
virtual

Definition at line 311 of file ContainerXXX.h.

References cond::hash, AlCaHLTBitMon_ParallelJobs::p, and x().

312  {
313  BOOST_FOREACH(typename CompactMap::value_type &p, _cmap)
314  {
315  STDTYPE &x = p.second;
316  uint32_t hash = p.first;
317 
318  for (std::vector<Container1D*>::const_iterator it=vc.begin();
319  it!=vc.end(); ++it)
320  (*it)->fill(hash, (double)x);
321  }
322  }
template<typename STDTYPE>
virtual CompactMap::const_iterator hcaldqm::ContainerXXX< STDTYPE >::end ( void  )
inlinevirtual
template<typename STDTYPE >
STDTYPE & hcaldqm::ContainerXXX< STDTYPE >::get ( HcalDetId const &  did)
virtual

Definition at line 243 of file ContainerXXX.h.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), PedestalTask::_dump(), LaserTask::_dump(), LEDTask::_dump(), PedestalTask::_process(), TPTask::_process(), RawTask::_process(), RecHitTask::_process(), LEDTask::_process(), LaserTask::_process(), DigiTask::_process(), hcaldqm::DigiRunSummary::beginRun(), DigiTask::bookHistograms(), rrapi.RRApi::columns(), util.rrapi.RRApi::columns(), util.rrapi.RRApi::count(), rrapi.RRApi::count(), util.rrapi.RRApi::data(), rrapi.RRApi::data(), hcaldqm::DigiRunSummary::endJob(), hcaldqm::RecoRunSummary::endJob(), hcaldqm::TPRunSummary::endJob(), hcaldqm::DigiRunSummary::endLuminosityBlock(), hcaldqm::RawRunSummary::endLuminosityBlock(), TPTask::endLuminosityBlock(), RawTask::endLuminosityBlock(), RecHitTask::endLuminosityBlock(), DigiTask::endLuminosityBlock(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), rrapi.RRApi::report(), util.rrapi.RRApi::report(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), util.rrapi.RRApi::tables(), rrapi.RRApi::tables(), util.rrapi.RRApi::tags(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), rrapi.RRApi::workspaces(), and util.rrapi.RRApi::workspaces().

244  {
245  return _cmap[_hashmap.getHash(did)];
246  }
virtual uint32_t getHash(HcalDetId const &did) const
Definition: HashMapper.h:33
mapper::HashMapper _hashmap
Definition: ContainerXXX.h:65
template<typename STDTYPE >
STDTYPE & hcaldqm::ContainerXXX< STDTYPE >::get ( HcalElectronicsId const &  eid)
virtual
template<typename STDTYPE >
STDTYPE & hcaldqm::ContainerXXX< STDTYPE >::get ( HcalTrigTowerDetId const &  tid)
virtual
template<typename STDTYPE >
void hcaldqm::ContainerXXX< STDTYPE >::initialize ( hashfunctions::HashType  ht,
int  debug = 0 
)
virtual
template<typename STDTYPE >
void hcaldqm::ContainerXXX< STDTYPE >::load ( Container1D cont)
virtual

Definition at line 351 of file ContainerXXX.h.

References hcaldqm::Container1D::getBinContent(), cond::hash, AlCaHLTBitMon_ParallelJobs::p, and x().

352  {
353  BOOST_FOREACH(typename CompactMap::value_type &p, _cmap)
354  {
355  STDTYPE &x = p.second;
356  uint32_t hash = p.first;
357 
358  if (_hashmap.isDHash())
359  x = cont->getBinContent(HcalDetId(hash));
360  else if (_hashmap.isEHash())
361  x = cont->getBinContent(HcalElectronicsId(hash));
362  else if (_hashmap.isTHash())
363  x = cont->getBinContent(HcalTrigTowerDetId(hash));
364  }
365  }
tuple cont
load Luminosity info ##
Definition: generateEDF.py:622
virtual bool isTHash() const
Definition: HashMapper.h:62
mapper::HashMapper _hashmap
Definition: ContainerXXX.h:65
virtual bool isDHash() const
Definition: HashMapper.h:55
virtual bool isEHash() const
Definition: HashMapper.h:57
Readout chain identification for Hcal.
template<typename STDTYPE >
void hcaldqm::ContainerXXX< STDTYPE >::print ( void  )
virtual

Definition at line 325 of file ContainerXXX.h.

References gather_cfg::cout, and AlCaHLTBitMon_ParallelJobs::p.

326  {
327  std::cout << "Container by " << _hashmap.getHashTypeName() << std::endl;
328  BOOST_FOREACH(typename CompactMap::value_type &p, _cmap)
329  {
330  if (_hashmap.isDHash())
331  std::cout << HcalDetId(p.first) << p.second << std::endl;
332  else if (_hashmap.isEHash())
333  std::cout << HcalElectronicsId(p.first) << p.second
334  << std::endl;
335  else if (_hashmap.isTHash())
336  std::cout << HcalTrigTowerDetId(p.first) << p.second
337  << std::endl;
338  }
339  }
virtual bool isTHash() const
Definition: HashMapper.h:62
mapper::HashMapper _hashmap
Definition: ContainerXXX.h:65
virtual std::string getHashTypeName() const
Definition: HashMapper.h:49
virtual bool isDHash() const
Definition: HashMapper.h:55
tuple cout
Definition: gather_cfg.py:145
virtual bool isEHash() const
Definition: HashMapper.h:57
Readout chain identification for Hcal.
template<typename STDTYPE>
void hcaldqm::ContainerXXX< STDTYPE >::push ( HcalDetId const &  did,
STDTYPE  x 
)
virtual

Definition at line 261 of file ContainerXXX.h.

References cond::hash, and DetId::rawId().

Referenced by hcaldqm::DQHarvester::beginRun(), hcaldqm::DQClient::beginRun(), hcaldqm::DQTask::bookHistograms(), esMonitoring.LineHistoryEnd::write(), and esMonitoring.LineHistoryStart::write().

262  {
263  uint32_t hash = did.rawId();
264  typename CompactMap::iterator mit=_cmap.find(hash);
265  if (mit!=_cmap.end())
266  return;
267  _cmap.insert(
268  std::make_pair(hash, x));
269  }
template<typename STDTYPE>
void hcaldqm::ContainerXXX< STDTYPE >::push ( HcalElectronicsId const &  eid,
STDTYPE  x 
)
virtual

Definition at line 272 of file ContainerXXX.h.

References cond::hash, and HcalElectronicsId::rawId().

Referenced by esMonitoring.LineHistoryEnd::write(), and esMonitoring.LineHistoryStart::write().

273  {
274  uint32_t hash = eid.rawId();
275  typename CompactMap::iterator mit=_cmap.find(hash);
276  if (mit!=_cmap.end())
277  return;
278  _cmap.insert(
279  std::make_pair(hash, x));
280  }
template<typename STDTYPE>
void hcaldqm::ContainerXXX< STDTYPE >::push ( HcalTrigTowerDetId const &  tid,
STDTYPE  x 
)
virtual

Definition at line 283 of file ContainerXXX.h.

References cond::hash, and DetId::rawId().

Referenced by esMonitoring.LineHistoryEnd::write(), and esMonitoring.LineHistoryStart::write().

284  {
285  uint32_t hash = tid.rawId();
286  typename CompactMap::iterator mit=_cmap.find(hash);
287  if (mit!=_cmap.end())
288  return;
289  _cmap.insert(
290  std::make_pair(hash, x));
291  }
template<typename STDTYPE >
void hcaldqm::ContainerXXX< STDTYPE >::reset ( void  )
virtual
template<typename STDTYPE>
void hcaldqm::ContainerXXX< STDTYPE >::set ( HcalDetId const &  did,
STDTYPE  x 
)
virtual

Definition at line 223 of file ContainerXXX.h.

Referenced by PedestalTask::bookHistograms(), and betterConfigParser.BetterConfigParser::getGeneral().

224  {
225  _cmap[_hashmap.getHash(did)] = x;
226  }
virtual uint32_t getHash(HcalDetId const &did) const
Definition: HashMapper.h:33
mapper::HashMapper _hashmap
Definition: ContainerXXX.h:65
template<typename STDTYPE>
void hcaldqm::ContainerXXX< STDTYPE >::set ( HcalElectronicsId const &  did,
STDTYPE  x 
)
virtual

Definition at line 229 of file ContainerXXX.h.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

231  {
232  _cmap[_hashmap.getHash(did)] = x;
233  }
virtual uint32_t getHash(HcalDetId const &did) const
Definition: HashMapper.h:33
mapper::HashMapper _hashmap
Definition: ContainerXXX.h:65
template<typename STDTYPE>
void hcaldqm::ContainerXXX< STDTYPE >::set ( HcalTrigTowerDetId const &  did,
STDTYPE  x 
)
virtual

Definition at line 236 of file ContainerXXX.h.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

238  {
239  _cmap[_hashmap.getHash(did)] = x;
240  }
virtual uint32_t getHash(HcalDetId const &did) const
Definition: HashMapper.h:33
mapper::HashMapper _hashmap
Definition: ContainerXXX.h:65
template<typename STDTYPE >
uint32_t hcaldqm::ContainerXXX< STDTYPE >::size ( void  )
virtual

Definition at line 294 of file ContainerXXX.h.

295  {
296  return (uint32_t)(_cmap.size());
297  }

Member Data Documentation

template<typename STDTYPE>
CompactMap hcaldqm::ContainerXXX< STDTYPE >::_cmap
protected

Definition at line 64 of file ContainerXXX.h.

template<typename STDTYPE>
mapper::HashMapper hcaldqm::ContainerXXX< STDTYPE >::_hashmap
protected

Definition at line 65 of file ContainerXXX.h.

template<typename STDTYPE>
Logger hcaldqm::ContainerXXX< STDTYPE >::_logger
protected

Definition at line 66 of file ContainerXXX.h.