test
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
TrackCollectionFP420 Class Reference

#include <TrackCollectionFP420.h>

Public Types

typedef std::vector
< TrackFP420 >::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 std::map< unsigned int,
std::vector< TrackFP420 > > 
TrackFP420Container
 

Public Member Functions

void clear ()
 
const Range get (unsigned int stationID) const
 
void put (Range input, unsigned int stationID)
 
void putclear (Range input, unsigned int stationID)
 
const std::vector< unsigned int > stationIDs () const
 
 TrackCollectionFP420 ()
 

Private Attributes

std::vector< TrackFP420container_
 
Registry map_
 
TrackFP420Container trackMap_
 

Detailed Description

Definition at line 9 of file TrackCollectionFP420.h.

Member Typedef Documentation

typedef std::vector<TrackFP420>::const_iterator TrackCollectionFP420::ContainerIterator

Definition at line 13 of file TrackCollectionFP420.h.

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

Definition at line 15 of file TrackCollectionFP420.h.

Definition at line 14 of file TrackCollectionFP420.h.

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

Definition at line 16 of file TrackCollectionFP420.h.

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

Definition at line 17 of file TrackCollectionFP420.h.

typedef std::map< unsigned int, std::vector<TrackFP420> > TrackCollectionFP420::TrackFP420Container

Definition at line 18 of file TrackCollectionFP420.h.

Constructor & Destructor Documentation

TrackCollectionFP420::TrackCollectionFP420 ( )
inline

Definition at line 20 of file TrackCollectionFP420.h.

20 {}

Member Function Documentation

void TrackCollectionFP420::clear ( void  )
const TrackCollectionFP420::Range TrackCollectionFP420::get ( unsigned int  stationID) const

Definition at line 71 of file TrackCollectionFP420.cc.

References container_, gather_cfg::cout, and map_.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), 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(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), util.rrapi.RRApi::tables(), rrapi.RRApi::tables(), rrapi.RRApi::tags(), util.rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), util.rrapi.RRApi::workspaces(), and rrapi.RRApi::workspaces().

71  {
72  // get RecHits of stationID
73 
74 #ifdef mydigidebug
75 std::cout <<"TrackCollectionFP420::get:stationID= " << stationID << std::endl;
76 #endif
77  TrackCollectionFP420::RegistryIterator returnIndex = map_.find(stationID);
78  TrackCollectionFP420::IndexRange returnIndexRange = returnIndex->second;
79 #ifdef mydigidebug
80  std::cout <<"TrackCollectionFP420::get1: returnIndexRange.first= " << returnIndexRange.first << std::endl;
81  std::cout <<"TrackCollectionFP420::get1: returnIndexRange.second= " << returnIndexRange.second << std::endl;
82 #endif
83 
84  TrackCollectionFP420::Range returnRange;
85  returnRange.first = container_.begin()+returnIndexRange.first;
86  if(returnIndexRange.second != 0 ) {
87  returnRange.second = container_.begin()+returnIndexRange.second+1;
88  }else{
89  returnRange.second = container_.begin()+returnIndexRange.second;
90  }
91 #ifdef mydigidebug
92  std::cout <<"TrackCollectionFP420::get2: container_.size() = " << container_.size() << std::endl;
93  std::cout <<"TrackCollectionFP420::get2: returnIndexRange.first= " << returnIndexRange.first << std::endl;
94  std::cout <<"TrackCollectionFP420::get2: returnIndexRange.second= " << returnIndexRange.second << std::endl;
95 #endif
96  return returnRange;
97 }
std::pair< unsigned int, unsigned int > IndexRange
std::vector< TrackFP420 > container_
std::pair< ContainerIterator, ContainerIterator > Range
std::map< unsigned int, IndexRange >::const_iterator RegistryIterator
tuple cout
Definition: gather_cfg.py:145
void TrackCollectionFP420::put ( TrackCollectionFP420::Range  input,
unsigned int  stationID 
)

Definition at line 13 of file TrackCollectionFP420.cc.

References begin, container_, gather_cfg::cout, end, plotBeamSpotDB::first, estimatePileup::inputRange, and map_.

13  {
14  // put in RecHits of stationID
15 
16  // store size of vector before put
18 
19  // put in TrackFP420s from input
20  bool first = true;
21 
22  // fill input in temporary vector for sorting
23  std::vector<TrackFP420> temporary;
26 #ifdef mydigidebug
27  std::cout <<" !!!!!!!!!!!!!!!! TrackCollectionFP420:: !!!! put !!!! start " << std::endl;
28 #endif
29  for ( ;sort_begin != sort_end; ++sort_begin ) {
30 #ifdef mydigidebug
31  std::cout <<"put: temporary.push_back " << std::endl;
32 #endif
33  temporary.push_back(*sort_begin);
34  }
35  std::sort(temporary.begin(),temporary.end());
36 
37  // iterators over input
40  for ( ;begin != end; ++begin ) {
41  container_.push_back(*begin);
42  if ( first ) {
43  inputRange.first = container_.size()-1;
44  // inputRange.first = container_.size();
45  first = false;
46  }
47  }
48 
49  // since we start from 0, then the last element will be size-1
50  if(container_.size() != 0) {
51  inputRange.second = container_.size()-1;
52  }
53  else {
54  inputRange.first = container_.size();
55  inputRange.second = container_.size();
56  }
57  //inputRange.second = container_.size()-1;
59 
60 #ifdef mydigidebug
61  std::cout <<"put: container_.size() = " << container_.size() << std::endl;
62  std::cout <<"put: inputRange.first = " << inputRange.first << std::endl;
63  std::cout <<"put: inputRange.second = " << inputRange.second << std::endl;
64 #endif
65 
66  // fill map
67  map_[stationID] = inputRange;
68 
69 }
std::pair< unsigned int, unsigned int > IndexRange
inputRange
Get input source.
std::vector< TrackFP420 > container_
static std::string const input
Definition: EdmProvDump.cc:44
std::vector< TrackFP420 >::const_iterator ContainerIterator
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
tuple cout
Definition: gather_cfg.py:145
void TrackCollectionFP420::putclear ( TrackCollectionFP420::Range  input,
unsigned int  stationID 
)

Definition at line 104 of file TrackCollectionFP420.cc.

References begin, container_, gather_cfg::cout, end, estimatePileup::inputRange, and map_.

104  {
105 
107 
108  std::vector<TrackFP420> temporary;
111  for ( ;sort_begin != sort_end; ++sort_begin ) {
112  temporary.push_back(*sort_begin);
113  }
114  std::sort(temporary.begin(),temporary.end());
115 
116  // temporary.clear();
119  for ( ;begin != end; ++begin ) {
120  container_.push_back(*begin);
121  }
122  //container_.clear();
123  inputRange.first = container_.size()-container_.size();
124  inputRange.second = container_.size()-container_.size();
125 
126 #ifdef mydigidebug
127  std::cout <<"putclear: container_.size() = " << container_.size() << std::endl;
128  std::cout <<"putclear: inputRange.first = " << inputRange.first << std::endl;
129  std::cout <<"putclear: inputRange.second = " << inputRange.second << std::endl;
130 #endif
131 
132 
133  map_[stationID] = inputRange;
134 }
std::pair< unsigned int, unsigned int > IndexRange
inputRange
Get input source.
std::vector< TrackFP420 > container_
static std::string const input
Definition: EdmProvDump.cc:44
std::vector< TrackFP420 >::const_iterator ContainerIterator
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
tuple cout
Definition: gather_cfg.py:145
const std::vector< unsigned int > TrackCollectionFP420::stationIDs ( ) const

Definition at line 141 of file TrackCollectionFP420.cc.

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

141  {
142  // returns vector of stationIDs in map
143 
144 #ifdef mydigidebug
145 std::cout <<"TrackCollectionFP420::stationIDs:start " << std::endl;
146 #endif
149 
150  std::vector<unsigned int> output;
151 
152  for (; begin != end; ++begin) {
153  output.push_back(begin->first);
154  }
155 
156  return output;
157 
158 }
std::map< unsigned int, IndexRange >::const_iterator RegistryIterator
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
tuple cout
Definition: gather_cfg.py:145

Member Data Documentation

std::vector<TrackFP420> TrackCollectionFP420::container_
private

Definition at line 38 of file TrackCollectionFP420.h.

Registry TrackCollectionFP420::map_
private

Definition at line 39 of file TrackCollectionFP420.h.

TrackFP420Container TrackCollectionFP420::trackMap_
private

Definition at line 41 of file TrackCollectionFP420.h.