#include <DataFormats/SiPixelDigi/interface/PixelDigiCollection.h>
Public Types | |
typedef std::vector< PixelDigi > ::const_iterator | ContainerIterator |
typedef std::pair< unsigned int, unsigned int > | IndexRange |
typedef std::pair < ContainerIterator, ContainerIterator > | Range |
typedef std::map< unsigned int, IndexRange > | Registry |
typedef std::map< unsigned int, IndexRange >::const_iterator | RegistryIterator |
Public Member Functions | |
const std::vector< unsigned int > | detIDs () const |
const Range | get (unsigned int detID) const |
PixelDigiCollection () | |
void | put (Range input, unsigned int detID) |
Private Attributes | |
std::vector< PixelDigi > | container_ |
Registry | map_ |
Definition at line 9 of file PixelDigiCollection.h.
typedef std::vector<PixelDigi>::const_iterator PixelDigiCollection::ContainerIterator |
Definition at line 13 of file PixelDigiCollection.h.
typedef std::pair<unsigned int, unsigned int> PixelDigiCollection::IndexRange |
Definition at line 15 of file PixelDigiCollection.h.
typedef std::pair<ContainerIterator, ContainerIterator> PixelDigiCollection::Range |
Definition at line 14 of file PixelDigiCollection.h.
typedef std::map<unsigned int, IndexRange> PixelDigiCollection::Registry |
Definition at line 16 of file PixelDigiCollection.h.
typedef std::map<unsigned int, IndexRange>::const_iterator PixelDigiCollection::RegistryIterator |
Definition at line 17 of file PixelDigiCollection.h.
PixelDigiCollection::PixelDigiCollection | ( | ) | [inline] |
const std::vector< unsigned int > PixelDigiCollection::detIDs | ( | ) | const |
Definition at line 51 of file PixelDigiCollection.cc.
References begin, end, map_, and output().
00051 { 00052 // returns vector of detIDs in map 00053 00054 PixelDigiCollection::RegistryIterator begin = map_.begin(); 00055 PixelDigiCollection::RegistryIterator end = map_.end(); 00056 00057 std::vector<unsigned int> output; 00058 00059 for (; begin != end; ++begin) { 00060 output.push_back(begin->first); 00061 } 00062 00063 return output; 00064 00065 }
const PixelDigiCollection::Range PixelDigiCollection::get | ( | unsigned int | detID | ) | const |
Definition at line 39 of file PixelDigiCollection.cc.
References container_, and map_.
00039 { 00040 // get Digis of detID 00041 00042 PixelDigiCollection::IndexRange returnIndexRange = map_[detID]; 00043 00044 PixelDigiCollection::Range returnRange; 00045 returnRange.first = container_.begin()+returnIndexRange.first; 00046 returnRange.second = container_.begin()+returnIndexRange.second+1; 00047 00048 return returnRange; 00049 }
Definition at line 4 of file PixelDigiCollection.cc.
References begin, container_, end, first, map_, and python::multivaluedict::sort().
00004 { 00005 // put in Digis of detID 00006 00007 // store size of vector before put 00008 IndexRange inputRange; 00009 00010 // put in PixelDigis from input 00011 bool first = true; 00012 00013 // fill input in temporary vector for sorting 00014 std::vector<PixelDigi> temporary; 00015 PixelDigiCollection::ContainerIterator sort_begin = input.first; 00016 PixelDigiCollection::ContainerIterator sort_end = input.second; 00017 for ( ;sort_begin != sort_end; ++sort_begin ) { 00018 temporary.push_back(*sort_begin); 00019 } 00020 std::sort(temporary.begin(),temporary.end()); 00021 00022 // iterators over input 00023 PixelDigiCollection::ContainerIterator begin = temporary.begin(); 00024 PixelDigiCollection::ContainerIterator end = temporary.end(); 00025 for ( ;begin != end; ++begin ) { 00026 container_.push_back(*begin); 00027 if ( first ) { 00028 inputRange.first = container_.size()-1; 00029 first = false; 00030 } 00031 } 00032 inputRange.second = container_.size()-1; 00033 00034 // fill map 00035 map_[detID] = inputRange; 00036 00037 }
std::vector<PixelDigi> PixelDigiCollection::container_ [mutable, private] |
Registry PixelDigiCollection::map_ [mutable, private] |