CMS 3D CMS Logo

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, ContainerIteratorRange
 
typedef std::map< unsigned int, IndexRangeRegistry
 
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

◆ ContainerIterator

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

Definition at line 11 of file TrackCollectionFP420.h.

◆ IndexRange

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

Definition at line 13 of file TrackCollectionFP420.h.

◆ Range

Definition at line 12 of file TrackCollectionFP420.h.

◆ Registry

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

Definition at line 14 of file TrackCollectionFP420.h.

◆ RegistryIterator

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

Definition at line 15 of file TrackCollectionFP420.h.

◆ TrackFP420Container

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

Definition at line 16 of file TrackCollectionFP420.h.

Constructor & Destructor Documentation

◆ TrackCollectionFP420()

TrackCollectionFP420::TrackCollectionFP420 ( )
inline

Definition at line 18 of file TrackCollectionFP420.h.

18 {}

Member Function Documentation

◆ clear()

void TrackCollectionFP420::clear ( void  )

Definition at line 97 of file TrackCollectionFP420.cc.

Referenced by BeautifulSoup.Tag::setString().

97 { container_.clear(); }
std::vector< TrackFP420 > container_

◆ get()

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

Definition at line 69 of file TrackCollectionFP420.cc.

References gather_cfg::cout.

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

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

◆ put()

void TrackCollectionFP420::put ( TrackCollectionFP420::Range  input,
unsigned int  stationID 
)

Definition at line 13 of file TrackCollectionFP420.cc.

References gather_cfg::cout, mps_fire::end, first, input, pileupCalc::inputRange, and jetUpdater_cfi::sort.

Referenced by FP420TrackMain::run().

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
38  TrackCollectionFP420::ContainerIterator begin = temporary.begin();
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  //inputRange.second = container_.size()-1;
58 
59 #ifdef mydigidebug
60  std::cout << "put: container_.size() = " << container_.size() << std::endl;
61  std::cout << "put: inputRange.first = " << inputRange.first << std::endl;
62  std::cout << "put: inputRange.second = " << inputRange.second << std::endl;
63 #endif
64 
65  // fill map
66  map_[stationID] = inputRange;
67 }
std::pair< unsigned int, unsigned int > IndexRange
std::vector< TrackFP420 > container_
static std::string const input
Definition: EdmProvDump.cc:47
std::vector< TrackFP420 >::const_iterator ContainerIterator

◆ putclear()

void TrackCollectionFP420::putclear ( TrackCollectionFP420::Range  input,
unsigned int  stationID 
)

Definition at line 98 of file TrackCollectionFP420.cc.

References gather_cfg::cout, mps_fire::end, input, pileupCalc::inputRange, and jetUpdater_cfi::sort.

98  {
100 
101  std::vector<TrackFP420> temporary;
104  for (; sort_begin != sort_end; ++sort_begin) {
105  temporary.push_back(*sort_begin);
106  }
107  std::sort(temporary.begin(), temporary.end());
108 
109  // temporary.clear();
110  TrackCollectionFP420::ContainerIterator begin = temporary.begin();
112  for (; begin != end; ++begin) {
113  container_.push_back(*begin);
114  }
115  //container_.clear();
116  inputRange.first = container_.size() - container_.size();
117  inputRange.second = container_.size() - container_.size();
118 
119 #ifdef mydigidebug
120  std::cout << "putclear: container_.size() = " << container_.size() << std::endl;
121  std::cout << "putclear: inputRange.first = " << inputRange.first << std::endl;
122  std::cout << "putclear: inputRange.second = " << inputRange.second << std::endl;
123 #endif
124 
125  map_[stationID] = inputRange;
126 }
std::pair< unsigned int, unsigned int > IndexRange
std::vector< TrackFP420 > container_
static std::string const input
Definition: EdmProvDump.cc:47
std::vector< TrackFP420 >::const_iterator ContainerIterator

◆ stationIDs()

const std::vector< unsigned int > TrackCollectionFP420::stationIDs ( ) const

Definition at line 128 of file TrackCollectionFP420.cc.

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

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

Member Data Documentation

◆ container_

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

Definition at line 35 of file TrackCollectionFP420.h.

◆ map_

Registry TrackCollectionFP420::map_
private

Definition at line 36 of file TrackCollectionFP420.h.

◆ trackMap_

TrackFP420Container TrackCollectionFP420::trackMap_
private

Definition at line 38 of file TrackCollectionFP420.h.