CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
ClusterCollectionFP420 Class Reference

#include <ClusterCollectionFP420.h>

Public Types

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

Public Member Functions

void clear ()
 
 ClusterCollectionFP420 ()
 
const std::vector< unsigned int > detIDs () const
 
const Range get (unsigned int detID) const
 
void put (Range input, unsigned int detID)
 
void putclear (Range input, unsigned int detID)
 

Private Attributes

ClusterFP420Container clusterMap_
 
std::vector< ClusterFP420container_
 
Registry map_
 

Detailed Description

Definition at line 9 of file ClusterCollectionFP420.h.

Member Typedef Documentation

◆ ClusterFP420Container

typedef std::map<unsigned int, std::vector<ClusterFP420> > ClusterCollectionFP420::ClusterFP420Container

Definition at line 16 of file ClusterCollectionFP420.h.

◆ ContainerIterator

typedef std::vector<ClusterFP420>::const_iterator ClusterCollectionFP420::ContainerIterator

Definition at line 11 of file ClusterCollectionFP420.h.

◆ IndexRange

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

Definition at line 13 of file ClusterCollectionFP420.h.

◆ Range

Definition at line 12 of file ClusterCollectionFP420.h.

◆ Registry

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

Definition at line 14 of file ClusterCollectionFP420.h.

◆ RegistryIterator

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

Definition at line 15 of file ClusterCollectionFP420.h.

Constructor & Destructor Documentation

◆ ClusterCollectionFP420()

ClusterCollectionFP420::ClusterCollectionFP420 ( )
inline

Definition at line 18 of file ClusterCollectionFP420.h.

18 {}

Member Function Documentation

◆ clear()

void ClusterCollectionFP420::clear ( void  )

Definition at line 97 of file ClusterCollectionFP420.cc.

Referenced by BeautifulSoup.Tag::setString().

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

◆ detIDs()

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

Definition at line 128 of file ClusterCollectionFP420.cc.

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

128  {
129  // returns vector of detIDs in map
130 
131 #ifdef mydigidebug
132  std::cout << "ClusterCollectionFP420::detIDs: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

◆ get()

const ClusterCollectionFP420::Range ClusterCollectionFP420::get ( unsigned int  detID) const

Definition at line 69 of file ClusterCollectionFP420.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(), FP420ClusterMain::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 detID
71 
72 #ifdef mydigidebug
73  std::cout << "ClusterCollectionFP420::get:detID= " << detID << std::endl;
74 #endif
75  ClusterCollectionFP420::RegistryIterator returnIndex = map_.find(detID);
76  ClusterCollectionFP420::IndexRange returnIndexRange = returnIndex->second;
77 #ifdef mydigidebug
78  std::cout << "ClusterCollectionFP420::get1: returnIndexRange.first= " << returnIndexRange.first << std::endl;
79  std::cout << "ClusterCollectionFP420::get1: returnIndexRange.second= " << returnIndexRange.second << std::endl;
80 #endif
81 
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 << "ClusterCollectionFP420::get2: container_.size() = " << container_.size() << std::endl;
91  std::cout << "ClusterCollectionFP420::get2: returnIndexRange.first= " << returnIndexRange.first << std::endl;
92  std::cout << "ClusterCollectionFP420::get2: returnIndexRange.second= " << returnIndexRange.second << std::endl;
93 #endif
94  return returnRange;
95 }
std::pair< unsigned int, unsigned int > IndexRange
std::vector< ClusterFP420 > container_
std::map< unsigned int, IndexRange >::const_iterator RegistryIterator
std::pair< ContainerIterator, ContainerIterator > Range

◆ put()

void ClusterCollectionFP420::put ( ClusterCollectionFP420::Range  input,
unsigned int  detID 
)

Definition at line 13 of file ClusterCollectionFP420.cc.

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

Referenced by FP420ClusterMain::run().

13  {
14  // put in RecHits of detID
15 
16  // store size of vector before put
18 
19  // put in ClusterFP420s from input
20  bool first = true;
21 
22  // fill input in temporary vector for sorting
23  std::vector<ClusterFP420> temporary;
26 #ifdef mydigidebug
27  std::cout << " !!!!!!!!!!!!!!!! ClusterCollectionFP420:: !!!! 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  ClusterCollectionFP420::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_[detID] = inputRange;
67 }
std::pair< unsigned int, unsigned int > IndexRange
std::vector< ClusterFP420 > container_
std::vector< ClusterFP420 >::const_iterator ContainerIterator
static std::string const input
Definition: EdmProvDump.cc:47

◆ putclear()

void ClusterCollectionFP420::putclear ( ClusterCollectionFP420::Range  input,
unsigned int  detID 
)

Definition at line 98 of file ClusterCollectionFP420.cc.

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

98  {
100 
101  std::vector<ClusterFP420> 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  ClusterCollectionFP420::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_[detID] = inputRange;
126 }
std::pair< unsigned int, unsigned int > IndexRange
std::vector< ClusterFP420 > container_
std::vector< ClusterFP420 >::const_iterator ContainerIterator
static std::string const input
Definition: EdmProvDump.cc:47

Member Data Documentation

◆ clusterMap_

ClusterFP420Container ClusterCollectionFP420::clusterMap_
private

Definition at line 38 of file ClusterCollectionFP420.h.

◆ container_

std::vector<ClusterFP420> ClusterCollectionFP420::container_
private

Definition at line 35 of file ClusterCollectionFP420.h.

◆ map_

Registry ClusterCollectionFP420::map_
private

Definition at line 36 of file ClusterCollectionFP420.h.