CMS 3D CMS Logo

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, ContainerIteratorRange
 
typedef std::map< unsigned int, std::vector< RecoFP420 > > RecoFP420Container
 
typedef std::map< unsigned int, IndexRangeRegistry
 
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 11 of file RecoCollectionFP420.h.

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

Definition at line 13 of file RecoCollectionFP420.h.

Definition at line 12 of file RecoCollectionFP420.h.

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

Definition at line 16 of file RecoCollectionFP420.h.

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

Definition at line 14 of file RecoCollectionFP420.h.

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

Definition at line 15 of file RecoCollectionFP420.h.

Constructor & Destructor Documentation

RecoCollectionFP420::RecoCollectionFP420 ( )
inline

Definition at line 18 of file RecoCollectionFP420.h.

References clear(), input, put(), putclear(), and stationIDs().

18 {}

Member Function Documentation

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

Definition at line 70 of file RecoCollectionFP420.cc.

References gather_cfg::cout.

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(), FP420RecoMain::run(), util.rrapi.RRApi::tables(), rrapi.RRApi::tables(), util.rrapi.RRApi::tags(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), util.rrapi.RRApi::workspaces(), and rrapi.RRApi::workspaces().

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

Definition at line 13 of file RecoCollectionFP420.cc.

References begin, gather_cfg::cout, end, dqmdumpme::first, and pileupCalc::inputRange.

Referenced by RecoCollectionFP420(), and FP420RecoMain::run().

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_.empty()) {
51  inputRange.second = container_.size() - 1;
52  } else {
53  inputRange.first = container_.size();
54  inputRange.second = container_.size();
55  }
56 
57  // inputRange.second = container_.size()-1;
58  // //inputRange.second = container_.size();
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 }
std::vector< RecoFP420 > container_
static std::string const input
Definition: EdmProvDump.cc:48
std::vector< RecoFP420 >::const_iterator ContainerIterator
#define end
Definition: vmac.h:39
std::pair< unsigned int, unsigned int > IndexRange
#define begin
Definition: vmac.h:32
void RecoCollectionFP420::putclear ( RecoCollectionFP420::Range  input,
unsigned int  stationID 
)

Definition at line 99 of file RecoCollectionFP420.cc.

References begin, gather_cfg::cout, end, and pileupCalc::inputRange.

Referenced by RecoCollectionFP420().

99  {
101 
102  std::vector<RecoFP420> temporary;
105  for (; sort_begin != sort_end; ++sort_begin) {
106  temporary.push_back(*sort_begin);
107  }
108  std::sort(temporary.begin(), temporary.end());
109 
110  // temporary.clear();
111  RecoCollectionFP420::ContainerIterator begin = temporary.begin();
113  for (; begin != end; ++begin) {
114  container_.push_back(*begin);
115  }
116  //container_.clear();
117  inputRange.first = container_.size() - container_.size();
118  inputRange.second = container_.size() - container_.size();
119 
120 #ifdef mydigidebug
121  std::cout << "putclear: container_.size() = " << container_.size() << std::endl;
122  std::cout << "putclear: inputRange.first = " << inputRange.first << std::endl;
123  std::cout << "putclear: inputRange.second = " << inputRange.second << std::endl;
124 #endif
125 
126  map_[stationID] = inputRange;
127 }
std::vector< RecoFP420 > container_
static std::string const input
Definition: EdmProvDump.cc:48
std::vector< RecoFP420 >::const_iterator ContainerIterator
#define end
Definition: vmac.h:39
std::pair< unsigned int, unsigned int > IndexRange
#define begin
Definition: vmac.h:32
const std::vector< unsigned int > RecoCollectionFP420::stationIDs ( ) const

Definition at line 129 of file RecoCollectionFP420.cc.

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

Referenced by RecoCollectionFP420().

129  {
130  // returns vector of stationIDs in map
131 
132 #ifdef mydigidebug
133  std::cout << "RecoCollectionFP420::stationIDs:start " << std::endl;
134 #endif
137 
138  std::vector<unsigned int> output;
139 
140  for (; begin != end; ++begin) {
141  output.push_back(begin->first);
142  }
143 
144  return output;
145 }
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
std::map< unsigned int, IndexRange >::const_iterator RegistryIterator

Member Data Documentation

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

Definition at line 35 of file RecoCollectionFP420.h.

Registry RecoCollectionFP420::map_
private

Definition at line 36 of file RecoCollectionFP420.h.

RecoFP420Container RecoCollectionFP420::trackMap_
private

Definition at line 38 of file RecoCollectionFP420.h.