1 #ifndef DataFormats_MuonDigiCollection_h 2 #define DataFormats_MuonDigiCollection_h 32 template <
typename IndexType,
typename DigiType>
39 typedef std::pair<IndexType,
57 { ++
base_;
return *
this; }
67 return std::make_pair(
base_->first,
68 std::make_pair(
base_->second.begin(),
69 base_->second.end()));
99 template <
typename IndexType,
111 typedef typename std::pair<const_iterator,const_iterator>
Range;
116 std::vector<DigiType> &digis = data_[
index];
117 digis.push_back(digi);
122 std::vector<DigiType> &digis = data_[
index];
123 digis.reserve (digis.size () + (range.second - range.first));
124 std::copy (range.first, range.second, std::back_inserter (digis));
129 template<
typename IRange>
131 void move(IRange range,
const IndexType&
index){
132 std::vector<DigiType> &digis = data_[
index];
133 digis.reserve (digis.size () + (range.second - range.first));
134 digis.insert(digis.end(),std::make_move_iterator(range.first), std::make_move_iterator(range.second));
140 Range
get(
const IndexType&
index)
const{
141 typename container::const_iterator it = data_.find(index);
142 if (it==data_.end()) {
144 static const std::vector<DigiType>
empty;
145 return std::make_pair(empty.end(),empty.end());
147 const std::vector<DigiType>& digis = (*it).second;
148 return std::make_pair(digis.begin(),digis.end());
154 return data_.begin();}
156 DigiRangeIterator
end()
const {
162 typedef std::map<IndexType,std::vector<DigiType> >
container;
168 template <
typename IndexType,
DigiContainerIterator< IndexType, DigiType > DigiRangeIterator
std::vector< DigiType >::const_iterator DigiRangeIterator
void swap(MuonDigiCollection &rh)
void swap(MuonDigiCollection< IndexType, DigiType > &rh, MuonDigiCollection< IndexType, DigiType > &lh)
std::map< IndexType, std::vector< DigiType > > BaseContainer
DigiContainerIterator(void)
void insertDigi(const IndexType &index, const DigiType &digi)
insert a digi for a given DetUnit
value_type operator*(void) const
DigiRangeIterator::iterator_category iterator_category
DigiRangeIterator::difference_type difference_type
std::map< IndexType, std::vector< DigiType > > container
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
bool operator==(const DigiContainerIterator &x) const
bool operator!=(const DigiContainerIterator &x) const
std::pair< IndexType, std::pair< DigiRangeIterator, DigiRangeIterator > > value_type
std::vector< DigiType >::const_iterator const_iterator
std::pair< const_iterator, const_iterator > Range
DigiContainerIterator(BaseIterator i)
DigiRangeIterator end() const
BaseContainer::const_iterator BaseIterator
void put(Range range, const IndexType &index)
insert a range of digis for a given DetUnit
DigiContainerIterator & operator++(void)
DigiRangeIterator begin() const
A container for a generic type of digis indexed by some index, implemented with a map<IndexType...