CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
PixelDigiCollection Class Reference

#include <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< PixelDigicontainer_
 
Registry map_
 

Detailed Description

Definition at line 9 of file PixelDigiCollection.h.

Member Typedef Documentation

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.

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.

Constructor & Destructor Documentation

PixelDigiCollection::PixelDigiCollection ( )
inline

Definition at line 19 of file PixelDigiCollection.h.

19 {}

Member Function Documentation

const std::vector< unsigned int > PixelDigiCollection::detIDs ( ) const

Definition at line 52 of file PixelDigiCollection.cc.

References begin, end, map_, and convertSQLitetoXML_cfg::output.

52  {
53  // returns vector of detIDs in map
54 
57 
58  std::vector<unsigned int> output;
59 
60  for (; begin != end; ++begin) {
61  output.push_back(begin->first);
62  }
63 
64  return output;
65 
66 }
std::map< unsigned int, IndexRange >::const_iterator RegistryIterator
#define end
Definition: vmac.h:38
#define begin
Definition: vmac.h:31
const PixelDigiCollection::Range PixelDigiCollection::get ( unsigned int  detID) const

Definition at line 40 of file PixelDigiCollection.cc.

References container_, and map_.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), and betterConfigParser.BetterConfigParser::getResultingSection().

40  {
41  // get Digis of detID
42 
43  PixelDigiCollection::IndexRange returnIndexRange = map_[detID];
44 
45  PixelDigiCollection::Range returnRange;
46  returnRange.first = container_.begin()+returnIndexRange.first;
47  returnRange.second = container_.begin()+returnIndexRange.second+1;
48 
49  return returnRange;
50 }
std::vector< PixelDigi > container_
std::pair< ContainerIterator, ContainerIterator > Range
std::pair< unsigned int, unsigned int > IndexRange
void PixelDigiCollection::put ( Range  input,
unsigned int  detID 
)

Definition at line 5 of file PixelDigiCollection.cc.

References begin, container_, end, first, estimatePileup::inputRange, map_, and python.multivaluedict::sort().

5  {
6  // put in Digis of detID
7 
8  // store size of vector before put
10 
11  // put in PixelDigis from input
12  bool first = true;
13 
14  // fill input in temporary vector for sorting
15  std::vector<PixelDigi> temporary;
18  for ( ;sort_begin != sort_end; ++sort_begin ) {
19  temporary.push_back(*sort_begin);
20  }
21  std::sort(temporary.begin(),temporary.end());
22 
23  // iterators over input
26  for ( ;begin != end; ++begin ) {
27  container_.push_back(*begin);
28  if ( first ) {
29  inputRange.first = container_.size()-1;
30  first = false;
31  }
32  }
33  inputRange.second = container_.size()-1;
34 
35  // fill map
36  map_[detID] = inputRange;
37 
38 }
inputRange
Get input source.
std::vector< PixelDigi > container_
#define end
Definition: vmac.h:38
bool first
Definition: L1TdeRCT.cc:94
std::vector< PixelDigi >::const_iterator ContainerIterator
#define begin
Definition: vmac.h:31
std::pair< unsigned int, unsigned int > IndexRange

Member Data Documentation

std::vector<PixelDigi> PixelDigiCollection::container_
mutableprivate

Definition at line 26 of file PixelDigiCollection.h.

Referenced by get(), and put().

Registry PixelDigiCollection::map_
mutableprivate

Definition at line 27 of file PixelDigiCollection.h.

Referenced by detIDs(), get(), and put().