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 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 69 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:71
template<typename STDTYPE >
hcaldqm::ContainerXXX< STDTYPE >::ContainerXXX ( ContainerXXX< STDTYPE > const &  x)

Definition at line 82 of file ContainerXXX.h.

References AlCaHLTBitMon_ParallelJobs::p.

83  {
84  BOOST_FOREACH(typename CompactMap::value_type &p, _cmap)
85  {
86  _cmap.insert(std::make_pair(p.first, p.second));
87  }
88  }
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 99 of file ContainerXXX.h.

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

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

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

Definition at line 160 of file ContainerXXX.h.

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

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

Definition at line 324 of file ContainerXXX.h.

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

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

Definition at line 335 of file ContainerXXX.h.

References cond::hash, and AlCaHLTBitMon_ParallelJobs::p.

336  {
337  BOOST_FOREACH(typename CompactMap::value_type &p, _cmap)
338  {
339  STDTYPE &x = p.second;
340  uint32_t hash = p.first;
341 
342  for (std::vector<Container1D*>::const_iterator it=vc.begin();
343  it!=vc.end(); ++it)
344  (*it)->fill(hash, (double)x);
345  }
346  }
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

Definition at line 267 of file ContainerXXX.h.

Referenced by PedestalTask::_dump(), RawTask::_process(), DigiTask::_process(), DigiPhase1Task::_process(), and DigiTask::bookHistograms().

268  {
269  return _cmap.find(id.rawId())!=_cmap.end();
270  }
template<typename STDTYPE >
bool hcaldqm::ContainerXXX< STDTYPE >::exists ( HcalElectronicsId const &  id)
virtual

Definition at line 273 of file ContainerXXX.h.

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

Definition at line 279 of file ContainerXXX.h.

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

Definition at line 249 of file ContainerXXX.h.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), PedestalTask::_dump(), LEDTask::_dump(), LaserTask::_dump(), TPTask::_process(), RawTask::_process(), PedestalTask::_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::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), util.rrapi.RRApi::report(), rrapi.RRApi::report(), rrapi.RRApi::reports(), util.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().

250  {
251  return _cmap[_hashmap.getHash(did)];
252  }
mapper::HashMapper _hashmap
Definition: ContainerXXX.h:71
uint32_t getHash(HcalDetId const &did) const override
Definition: HashMapper.h:34
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 375 of file ContainerXXX.h.

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

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

Definition at line 349 of file ContainerXXX.h.

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

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

Definition at line 285 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().

286  {
287  uint32_t hash = did.rawId();
288  typename CompactMap::iterator mit=_cmap.find(hash);
289  if (mit!=_cmap.end())
290  return;
291  _cmap.insert(
292  std::make_pair(hash, x));
293  }
template<typename STDTYPE>
void hcaldqm::ContainerXXX< STDTYPE >::push ( HcalElectronicsId const &  eid,
STDTYPE  x 
)
virtual

Definition at line 296 of file ContainerXXX.h.

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

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

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

Definition at line 307 of file ContainerXXX.h.

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

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

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

Referenced by PedestalTask::bookHistograms().

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

Definition at line 235 of file ContainerXXX.h.

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

Definition at line 242 of file ContainerXXX.h.

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

Definition at line 318 of file ContainerXXX.h.

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

319  {
320  return (uint32_t)(_cmap.size());
321  }

Member Data Documentation

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

Definition at line 70 of file ContainerXXX.h.

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

Definition at line 71 of file ContainerXXX.h.

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

Definition at line 72 of file ContainerXXX.h.