CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Types | Private Attributes
MuonDigiCollection< IndexType, DigiType > Class Template Reference

A container for a generic type of digis indexed by some index, implemented with a map<IndexType, vector<DigiType> > More...

#include "/MuonDigiCollection.h"

Public Types

typedef std::vector< DigiType >::const_iterator const_iterator
 
typedef DigiContainerIterator< IndexType, DigiType > DigiRangeIterator
 
typedef std::pair< const_iterator, const_iteratorRange
 

Public Member Functions

DigiRangeIterator begin () const
 
DigiRangeIterator end () const
 
Range get (const IndexType &index) const
 return the digis for a given DetUnit More...
 
void insertDigi (const IndexType &index, const DigiType &digi)
 insert a digi for a given DetUnit More...
 
 MuonDigiCollection ()
 
void put (Range range, const IndexType &index)
 insert a range of digis for a given DetUnit More...
 
void swap (MuonDigiCollection &rh)
 

Private Types

typedef std::map< IndexType, std::vector< DigiType > > container
 

Private Attributes

container data_
 

Detailed Description

template<typename IndexType, typename DigiType>
class MuonDigiCollection< IndexType, DigiType >

A container for a generic type of digis indexed by some index, implemented with a map<IndexType, vector<DigiType> >

Example:

Note
: Requirements
  • IndexType must provide operator <
Author
Stefano ARGIRO
Date
05 Aug 2005

Definition at line 88 of file MuonDigiCollection.h.

Member Typedef Documentation

template<typename IndexType, typename DigiType>
typedef std::vector<DigiType>::const_iterator MuonDigiCollection< IndexType, DigiType >::const_iterator

Definition at line 95 of file MuonDigiCollection.h.

template<typename IndexType, typename DigiType>
typedef std::map<IndexType, std::vector<DigiType> > MuonDigiCollection< IndexType, DigiType >::container
private

Definition at line 140 of file MuonDigiCollection.h.

template<typename IndexType, typename DigiType>
typedef DigiContainerIterator<IndexType, DigiType> MuonDigiCollection< IndexType, DigiType >::DigiRangeIterator

Definition at line 133 of file MuonDigiCollection.h.

template<typename IndexType, typename DigiType>
typedef std::pair<const_iterator, const_iterator> MuonDigiCollection< IndexType, DigiType >::Range

Definition at line 96 of file MuonDigiCollection.h.

Constructor & Destructor Documentation

template<typename IndexType, typename DigiType>
MuonDigiCollection< IndexType, DigiType >::MuonDigiCollection ( )
inline

Definition at line 90 of file MuonDigiCollection.h.

90 {}

Member Function Documentation

template<typename IndexType, typename DigiType>
DigiRangeIterator MuonDigiCollection< IndexType, DigiType >::begin ( void  ) const
inline

Definition at line 135 of file MuonDigiCollection.h.

Referenced by GEMDQMStatusDigi::analyze(), and DTHitAssociator::initEvent().

135 { return data_.begin(); }
template<typename IndexType, typename DigiType>
DigiRangeIterator MuonDigiCollection< IndexType, DigiType >::end ( void  ) const
inline
template<typename IndexType, typename DigiType>
Range MuonDigiCollection< IndexType, DigiType >::get ( const IndexType &  index) const
inline

return the digis for a given DetUnit

Definition at line 122 of file MuonDigiCollection.h.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), CSCTriggerPrimitivesReader::compareCLCTs(), util.rrapi.RRApi::count(), rrapi.RRApi::count(), rrapi.RRApi::data(), util.rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), rrapi.RRApi::report(), util.rrapi.RRApi::report(), util.rrapi.RRApi::reports(), rrapi.RRApi::reports(), util.rrapi.RRApi::tables(), 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().

122  {
123  typename container::const_iterator it = data_.find(index);
124  if (it == data_.end()) {
125  // if data_ is empty there is no other way to get an empty range
126  static const std::vector<DigiType> empty;
127  return std::make_pair(empty.end(), empty.end());
128  }
129  const std::vector<DigiType>& digis = (*it).second;
130  return std::make_pair(digis.begin(), digis.end());
131  }
template<typename IndexType, typename DigiType>
void MuonDigiCollection< IndexType, DigiType >::insertDigi ( const IndexType &  index,
const DigiType &  digi 
)
inline

insert a digi for a given DetUnit

Definition at line 99 of file MuonDigiCollection.h.

Referenced by ME0ReDigiProducer::buildDigis(), and DTDigitizer::storeDigis().

99  {
100  std::vector<DigiType>& digis = data_[index];
101  digis.push_back(digi);
102  }
template<typename IndexType, typename DigiType>
void MuonDigiCollection< IndexType, DigiType >::put ( Range  range,
const IndexType &  index 
)
inline

insert a range of digis for a given DetUnit

Definition at line 105 of file MuonDigiCollection.h.

105  {
106  std::vector<DigiType>& digis = data_[index];
107  digis.reserve(digis.size() + (range.second - range.first));
108  std::copy(range.first, range.second, std::back_inserter(digis));
109  }
template<typename IndexType, typename DigiType>
void MuonDigiCollection< IndexType, DigiType >::swap ( MuonDigiCollection< IndexType, DigiType > &  rh)
inline

Definition at line 93 of file MuonDigiCollection.h.

Referenced by swap().

93 { std::swap(data_, rh.data_); }
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)

Member Data Documentation

template<typename IndexType, typename DigiType>
container MuonDigiCollection< IndexType, DigiType >::data_
private

Definition at line 141 of file MuonDigiCollection.h.

Referenced by MuonDigiCollection< RPCDetId, RPCDigi >::swap().