CMS 3D CMS Logo

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 bool exists (HcalDetId const &)
 
virtual bool exists (HcalElectronicsId const &)
 
virtual bool exists (HcalTrigTowerDetId const &)
 
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 21 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 67 of file ContainerXXX.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file ContainerXXX.h.

Referenced by hcaldqm::ContainerXXX< int >::ContainerXXX().

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

Definition at line 25 of file ContainerXXX.h.

25  : _hashmap(ht)
26  {}
mapper::HashMapper _hashmap
Definition: ContainerXXX.h:69
template<typename STDTYPE >
hcaldqm::ContainerXXX< STDTYPE >::ContainerXXX ( ContainerXXX< STDTYPE > const &  x)

Definition at line 80 of file ContainerXXX.h.

References hcaldqm::ContainerXXX< STDTYPE >::_cmap, and AlCaHLTBitMon_ParallelJobs::p.

81  {
82  BOOST_FOREACH(typename CompactMap::value_type &p, _cmap)
83  {
84  _cmap.insert(std::make_pair(p.first, p.second));
85  }
86  }
template<typename STDTYPE>
virtual hcaldqm::ContainerXXX< STDTYPE >::~ContainerXXX ( )
inlinevirtual

Definition at line 28 of file ContainerXXX.h.

28 {_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 97 of file ContainerXXX.h.

References hcaldqm::ContainerXXX< STDTYPE >::_cmap, hcaldqm::ContainerXXX< STDTYPE >::_hashmap, hcaldqm::ContainerXXX< STDTYPE >::_logger, HcalElectronicsMap::allElectronicsIdPrecision(), HcalElectronicsMap::allPrecisionId(), HcalElectronicsMap::allTriggerId(), Logger::debug(), runTauDisplay::eid, hcaldqm::mapper::HashMapper::getHash(), hcaldqm::mapper::HashMapper::getName(), cond::hash, hcaldqm::mapper::HashMapper::isDHash(), hcaldqm::mapper::HashMapper::isEHash(), and hcaldqm::mapper::HashMapper::isTHash().

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

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

Definition at line 158 of file ContainerXXX.h.

References hcaldqm::ContainerXXX< STDTYPE >::_cmap, hcaldqm::ContainerXXX< STDTYPE >::_hashmap, hcaldqm::ContainerXXX< STDTYPE >::_logger, HcalElectronicsMap::allElectronicsIdPrecision(), HcalElectronicsMap::allPrecisionId(), HcalElectronicsMap::allTriggerId(), Logger::debug(), runTauDisplay::eid, hcaldqm::filter::HashFilter::filter(), hcaldqm::mapper::HashMapper::getHash(), hcaldqm::mapper::HashMapper::getName(), cond::hash, hcaldqm::mapper::HashMapper::isDHash(), hcaldqm::mapper::HashMapper::isEHash(), and hcaldqm::mapper::HashMapper::isTHash().

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

Definition at line 322 of file ContainerXXX.h.

References hcaldqm::ContainerXXX< STDTYPE >::_cmap, hcaldqm::Container1D::fill(), cond::hash, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by hcaldqm::ContainerXXX< int >::~ContainerXXX().

323  {
324  BOOST_FOREACH(typename CompactMap::value_type &p, _cmap)
325  {
326  STDTYPE &x = p.second;
327  uint32_t hash = p.first;
328  c->fill(hash, (double)x);
329  }
330  }
template<typename STDTYPE >
void hcaldqm::ContainerXXX< STDTYPE >::dump ( std::vector< Container1D * > const &  vc)
virtual

Definition at line 333 of file ContainerXXX.h.

References hcaldqm::ContainerXXX< STDTYPE >::_cmap, cond::hash, and AlCaHLTBitMon_ParallelJobs::p.

334  {
335  BOOST_FOREACH(typename CompactMap::value_type &p, _cmap)
336  {
337  STDTYPE &x = p.second;
338  uint32_t hash = p.first;
339 
340  for (std::vector<Container1D*>::const_iterator it=vc.begin();
341  it!=vc.end(); ++it)
342  (*it)->fill(hash, (double)x);
343  }
344  }
template<typename STDTYPE>
virtual CompactMap::const_iterator hcaldqm::ContainerXXX< STDTYPE >::end ( void  )
inlinevirtual
template<typename STDTYPE >
bool hcaldqm::ContainerXXX< STDTYPE >::exists ( HcalDetId const &  id)
virtual
template<typename STDTYPE >
bool hcaldqm::ContainerXXX< STDTYPE >::exists ( HcalElectronicsId const &  id)
virtual

Definition at line 271 of file ContainerXXX.h.

References hcaldqm::ContainerXXX< STDTYPE >::_cmap.

272  {
273  return _cmap.find(id.rawId())!=_cmap.end();
274  }
template<typename STDTYPE >
bool hcaldqm::ContainerXXX< STDTYPE >::exists ( HcalTrigTowerDetId const &  id)
virtual

Definition at line 277 of file ContainerXXX.h.

References hcaldqm::ContainerXXX< STDTYPE >::_cmap.

278  {
279  return _cmap.find(id.rawId())!=_cmap.end();
280  }
template<typename STDTYPE >
STDTYPE & hcaldqm::ContainerXXX< STDTYPE >::get ( HcalDetId const &  did)
virtual

Definition at line 247 of file ContainerXXX.h.

References hcaldqm::ContainerXXX< STDTYPE >::_cmap, hcaldqm::ContainerXXX< STDTYPE >::_hashmap, and hcaldqm::mapper::HashMapper::getHash().

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), PedestalTask::_dump(), LEDTask::_dump(), LaserTask::_dump(), TPTask::_process(), PedestalTask::_process(), RawTask::_process(), RecHitTask::_process(), LEDTask::_process(), DigiPhase1Task::_process(), DigiTask::_process(), LaserTask::_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::RecoRunSummary::endJob(), hcaldqm::TPRunSummary::endJob(), hcaldqm::DigiRunSummary::endJob(), hcaldqm::RawRunSummary::endLuminosityBlock(), hcaldqm::DigiRunSummary::endLuminosityBlock(), TPTask::endLuminosityBlock(), RawTask::endLuminosityBlock(), RecHitTask::endLuminosityBlock(), DigiTask::endLuminosityBlock(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getResultingSection(), util.rrapi.RRApi::report(), rrapi.RRApi::report(), util.rrapi.RRApi::reports(), rrapi.RRApi::reports(), rrapi.RRApi::tables(), util.rrapi.RRApi::tables(), util.rrapi.RRApi::tags(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), util.rrapi.RRApi::workspaces(), and rrapi.RRApi::workspaces().

248  {
249  return _cmap[_hashmap.getHash(did)];
250  }
mapper::HashMapper _hashmap
Definition: ContainerXXX.h:69
uint32_t getHash(HcalDetId const &did) const override
Definition: HashMapper.h:33
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 373 of file ContainerXXX.h.

References hcaldqm::ContainerXXX< STDTYPE >::_cmap, hcaldqm::ContainerXXX< STDTYPE >::_hashmap, hcaldqm::Container1D::getBinContent(), cond::hash, hcaldqm::mapper::HashMapper::isDHash(), hcaldqm::mapper::HashMapper::isEHash(), hcaldqm::mapper::HashMapper::isTHash(), and AlCaHLTBitMon_ParallelJobs::p.

Referenced by hcaldqm::ContainerXXX< int >::~ContainerXXX().

374  {
375  BOOST_FOREACH(typename CompactMap::value_type &p, _cmap)
376  {
377  STDTYPE &x = p.second;
378  uint32_t hash = p.first;
379 
380  if (_hashmap.isDHash())
381  x = cont->getBinContent(HcalDetId(hash));
382  else if (_hashmap.isEHash())
383  x = cont->getBinContent(HcalElectronicsId(hash));
384  else if (_hashmap.isTHash())
385  x = cont->getBinContent(HcalTrigTowerDetId(hash));
386  }
387  }
virtual bool isTHash() const
Definition: HashMapper.h:63
mapper::HashMapper _hashmap
Definition: ContainerXXX.h:69
virtual bool isDHash() const
Definition: HashMapper.h:56
virtual bool isEHash() const
Definition: HashMapper.h:58
Readout chain identification for Hcal.
template<typename STDTYPE >
void hcaldqm::ContainerXXX< STDTYPE >::print ( void  )
virtual

Definition at line 347 of file ContainerXXX.h.

References hcaldqm::ContainerXXX< STDTYPE >::_cmap, hcaldqm::ContainerXXX< STDTYPE >::_hashmap, gather_cfg::cout, hcaldqm::mapper::HashMapper::getHashTypeName(), hcaldqm::mapper::HashMapper::isDHash(), hcaldqm::mapper::HashMapper::isEHash(), hcaldqm::mapper::HashMapper::isTHash(), and AlCaHLTBitMon_ParallelJobs::p.

Referenced by hcaldqm::ContainerXXX< int >::~ContainerXXX().

348  {
349  std::cout << "Container by " << _hashmap.getHashTypeName() << std::endl;
350  BOOST_FOREACH(typename CompactMap::value_type &p, _cmap)
351  {
352  if (_hashmap.isDHash())
353  std::cout << HcalDetId(p.first) << p.second << std::endl;
354  else if (_hashmap.isEHash())
355  std::cout << HcalElectronicsId(p.first) << p.second
356  << std::endl;
357  else if (_hashmap.isTHash())
358  std::cout << HcalTrigTowerDetId(p.first) << p.second
359  << std::endl;
360  }
361  }
virtual bool isTHash() const
Definition: HashMapper.h:63
mapper::HashMapper _hashmap
Definition: ContainerXXX.h:69
virtual std::string getHashTypeName() const
Definition: HashMapper.h:50
virtual bool isDHash() const
Definition: HashMapper.h:56
virtual bool isEHash() const
Definition: HashMapper.h:58
Readout chain identification for Hcal.
template<typename STDTYPE>
void hcaldqm::ContainerXXX< STDTYPE >::push ( HcalDetId const &  did,
STDTYPE  x 
)
virtual

Definition at line 283 of file ContainerXXX.h.

References hcaldqm::ContainerXXX< STDTYPE >::_cmap, cond::hash, and DetId::rawId().

Referenced by hcaldqm::DQHarvester::beginRun(), hcaldqm::DQClient::beginRun(), hcaldqm::DQTask::bookHistograms(), esMonitoring.LineHistoryEnd::write(), esMonitoring.LineHistoryStart::write(), and hcaldqm::ContainerXXX< int >::~ContainerXXX().

284  {
285  uint32_t hash = did.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 >::push ( HcalElectronicsId const &  eid,
STDTYPE  x 
)
virtual

Definition at line 294 of file ContainerXXX.h.

References hcaldqm::ContainerXXX< STDTYPE >::_cmap, cond::hash, and HcalElectronicsId::rawId().

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

295  {
296  uint32_t hash = eid.rawId();
297  typename CompactMap::iterator mit=_cmap.find(hash);
298  if (mit!=_cmap.end())
299  return;
300  _cmap.insert(
301  std::make_pair(hash, x));
302  }
template<typename STDTYPE>
void hcaldqm::ContainerXXX< STDTYPE >::push ( HcalTrigTowerDetId const &  tid,
STDTYPE  x 
)
virtual

Definition at line 305 of file ContainerXXX.h.

References hcaldqm::ContainerXXX< STDTYPE >::_cmap, cond::hash, and DetId::rawId().

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

306  {
307  uint32_t hash = tid.rawId();
308  typename CompactMap::iterator mit=_cmap.find(hash);
309  if (mit!=_cmap.end())
310  return;
311  _cmap.insert(
312  std::make_pair(hash, x));
313  }
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 227 of file ContainerXXX.h.

References hcaldqm::ContainerXXX< STDTYPE >::_cmap, hcaldqm::ContainerXXX< STDTYPE >::_hashmap, and hcaldqm::mapper::HashMapper::getHash().

Referenced by PedestalTask::bookHistograms().

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

Definition at line 233 of file ContainerXXX.h.

References hcaldqm::ContainerXXX< STDTYPE >::_cmap, hcaldqm::ContainerXXX< STDTYPE >::_hashmap, and hcaldqm::mapper::HashMapper::getHash().

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

Definition at line 240 of file ContainerXXX.h.

References hcaldqm::ContainerXXX< STDTYPE >::_cmap, hcaldqm::ContainerXXX< STDTYPE >::_hashmap, and hcaldqm::mapper::HashMapper::getHash().

242  {
243  _cmap[_hashmap.getHash(did)] = x;
244  }
mapper::HashMapper _hashmap
Definition: ContainerXXX.h:69
uint32_t getHash(HcalDetId const &did) const override
Definition: HashMapper.h:33
template<typename STDTYPE >
uint32_t hcaldqm::ContainerXXX< STDTYPE >::size ( void  )
virtual

Member Data Documentation

template<typename STDTYPE>
CompactMap hcaldqm::ContainerXXX< STDTYPE >::_cmap
protected
template<typename STDTYPE>
mapper::HashMapper hcaldqm::ContainerXXX< STDTYPE >::_hashmap
protected
template<typename STDTYPE>
Logger hcaldqm::ContainerXXX< STDTYPE >::_logger
protected