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
SiStripClusterCollection Class Reference

#include <SiStripClusterCollection.h>

Public Types

typedef std::vector
< SiStripCluster
container
 
typedef container::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
 
typedef container::value_type value_type
 

Public Member Functions

const std::vector< unsigned int > detIDs () const
 
const Range get (unsigned int detID) const
 
void put (Range input, unsigned int detID)
 
 SiStripClusterCollection ()
 
size_t size () const
 

Private Attributes

container container_
 
Registry map_
 

Detailed Description

Definition at line 9 of file SiStripClusterCollection.h.

Member Typedef Documentation

Definition at line 12 of file SiStripClusterCollection.h.

typedef container::const_iterator SiStripClusterCollection::ContainerIterator

Definition at line 14 of file SiStripClusterCollection.h.

typedef std::pair<unsigned int, unsigned int> SiStripClusterCollection::IndexRange

Definition at line 16 of file SiStripClusterCollection.h.

Definition at line 15 of file SiStripClusterCollection.h.

typedef std::map<unsigned int, IndexRange> SiStripClusterCollection::Registry

Definition at line 17 of file SiStripClusterCollection.h.

typedef std::map<unsigned int, IndexRange>::const_iterator SiStripClusterCollection::RegistryIterator

Definition at line 18 of file SiStripClusterCollection.h.

typedef container::value_type SiStripClusterCollection::value_type

Definition at line 13 of file SiStripClusterCollection.h.

Constructor & Destructor Documentation

SiStripClusterCollection::SiStripClusterCollection ( )
inline

Definition at line 20 of file SiStripClusterCollection.h.

20 {}

Member Function Documentation

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

Definition at line 59 of file SiStripClusterCollection.cc.

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

59  {
60  // returns vector of detIDs in map
61 
64 
65  std::vector<unsigned int> output;
66 
67  for (; begin != end; ++begin) {
68  output.push_back(begin->first);
69  }
70 
71  return output;
72 
73 }
std::map< unsigned int, IndexRange >::const_iterator RegistryIterator
#define end
Definition: vmac.h:38
#define begin
Definition: vmac.h:31
const SiStripClusterCollection::Range SiStripClusterCollection::get ( unsigned int  detID) const

Definition at line 41 of file SiStripClusterCollection.cc.

References container_, and map_.

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

41  {
42  // get RecHits of detID
43 
44  SiStripClusterCollection::RegistryIterator returnIndex = map_.find(detID);
45 
46  if (returnIndex == map_.end()){
47  return Range (container_.end(), container_.end());
48  }
49 
50  SiStripClusterCollection::IndexRange returnIndexRange = returnIndex->second;
51 
53  returnRange.first = container_.begin()+returnIndexRange.first;
54  returnRange.second = container_.begin()+returnIndexRange.second+1;
55 
56  return returnRange;
57 }
std::pair< unsigned int, unsigned int > IndexRange
std::map< unsigned int, IndexRange >::const_iterator RegistryIterator
std::pair< ContainerIterator, ContainerIterator > Range
void SiStripClusterCollection::put ( SiStripClusterCollection::Range  input,
unsigned int  detID 
)

Definition at line 5 of file SiStripClusterCollection.cc.

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

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

Definition at line 25 of file SiStripClusterCollection.h.

References container_.

25 { return container_.size(); }

Member Data Documentation

container SiStripClusterCollection::container_
mutableprivate

Definition at line 28 of file SiStripClusterCollection.h.

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

Registry SiStripClusterCollection::map_
mutableprivate

Definition at line 29 of file SiStripClusterCollection.h.

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