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

#include <RecoCollectionFP420.h>

Public Types

typedef std::vector< RecoFP420 >
::const_iterator 
ContainerIterator
 
typedef std::pair< unsigned
int, unsigned int > 
IndexRange
 
typedef std::pair
< ContainerIterator,
ContainerIterator
Range
 
typedef std::map< unsigned int,
std::vector< RecoFP420 > > 
RecoFP420Container
 
typedef std::map< unsigned int,
IndexRange
Registry
 
typedef std::map< unsigned int,
IndexRange >::const_iterator 
RegistryIterator
 

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)
 
 RecoCollectionFP420 ()
 
const std::vector< unsigned int > stationIDs () const
 

Private Attributes

std::vector< RecoFP420container_
 
Registry map_
 
RecoFP420Container trackMap_
 

Detailed Description

Definition at line 9 of file RecoCollectionFP420.h.

Member Typedef Documentation

typedef std::vector<RecoFP420>::const_iterator RecoCollectionFP420::ContainerIterator

Definition at line 13 of file RecoCollectionFP420.h.

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

Definition at line 15 of file RecoCollectionFP420.h.

Definition at line 14 of file RecoCollectionFP420.h.

typedef std::map< unsigned int, std::vector<RecoFP420> > RecoCollectionFP420::RecoFP420Container

Definition at line 18 of file RecoCollectionFP420.h.

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

Definition at line 16 of file RecoCollectionFP420.h.

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

Definition at line 17 of file RecoCollectionFP420.h.

Constructor & Destructor Documentation

RecoCollectionFP420::RecoCollectionFP420 ( )
inline

Definition at line 20 of file RecoCollectionFP420.h.

20 {}

Member Function Documentation

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

Definition at line 72 of file RecoCollectionFP420.cc.

References container_, gather_cfg::cout, and map_.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), rrapi.RRApi::columns(), rrapi.RRApi::count(), rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), rrapi.RRApi::report(), rrapi.RRApi::reports(), rrapi.RRApi::tables(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), and rrapi.RRApi::workspaces().

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

Definition at line 13 of file RecoCollectionFP420.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 RecoFP420s from input
20  bool first = true;
21 
22  // fill input in temporary vector for sorting
23  std::vector<RecoFP420> temporary;
26 #ifdef mydigidebug
27  std::cout <<" !!!!!!!!!!!!!!!! RecoCollectionFP420:: !!!! 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 
58 // inputRange.second = container_.size()-1;
59 // //inputRange.second = container_.size();
60 
61 #ifdef mydigidebug
62  std::cout <<"put: container_.size() = " << container_.size() << std::endl;
63  std::cout <<"put: inputRange.first = " << inputRange.first << std::endl;
64  std::cout <<"put: inputRange.second = " << inputRange.second << std::endl;
65 #endif
66 
67  // fill map
68  map_[stationID] = inputRange;
69 
70 }
inputRange
Get input source.
std::vector< RecoFP420 > container_
static std::string const input
Definition: EdmProvDump.cc:44
std::vector< RecoFP420 >::const_iterator ContainerIterator
#define end
Definition: vmac.h:37
std::pair< unsigned int, unsigned int > IndexRange
#define begin
Definition: vmac.h:30
tuple cout
Definition: gather_cfg.py:145
void RecoCollectionFP420::putclear ( RecoCollectionFP420::Range  input,
unsigned int  stationID 
)

Definition at line 105 of file RecoCollectionFP420.cc.

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

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

Definition at line 142 of file RecoCollectionFP420.cc.

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

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

Member Data Documentation

std::vector<RecoFP420> RecoCollectionFP420::container_
private

Definition at line 38 of file RecoCollectionFP420.h.

Registry RecoCollectionFP420::map_
private

Definition at line 39 of file RecoCollectionFP420.h.

RecoFP420Container RecoCollectionFP420::trackMap_
private

Definition at line 41 of file RecoCollectionFP420.h.