CMS 3D CMS Logo

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

#include <DigiCollectionFP420.h>

Public Types

typedef std::vector< HDigiFP420 >::const_iterator ContainerIterator
 
typedef std::map< unsigned int, std::vector< HDigiFP420 > > HDigiFP420Container
 
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 add (unsigned int &det_id, std::vector< HDigiFP420 > &digis)
 
void clear ()
 
const std::vector< unsigned int > detIDs () const
 
void detIDs (std::vector< unsigned int > &det_ids) const
 
 DigiCollectionFP420 ()
 
void digis (unsigned int &det_id, std::vector< HDigiFP420 > &digis) const
 
const Range get (unsigned int detID) const
 
const Range get1 (unsigned int detID) const
 
void put (Range input, unsigned int detID)
 
void putclear (Range input, unsigned int detID)
 

Private Attributes

std::vector< HDigiFP420container_
 
HDigiFP420Container digiMap_
 
Registry map_
 

Detailed Description

Definition at line 14 of file DigiCollectionFP420.h.

Member Typedef Documentation

◆ ContainerIterator

typedef std::vector<HDigiFP420>::const_iterator DigiCollectionFP420::ContainerIterator

Definition at line 16 of file DigiCollectionFP420.h.

◆ HDigiFP420Container

typedef std::map<unsigned int, std::vector<HDigiFP420> > DigiCollectionFP420::HDigiFP420Container

Definition at line 21 of file DigiCollectionFP420.h.

◆ IndexRange

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

Definition at line 18 of file DigiCollectionFP420.h.

◆ Range

Definition at line 17 of file DigiCollectionFP420.h.

◆ Registry

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

Definition at line 19 of file DigiCollectionFP420.h.

◆ RegistryIterator

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

Definition at line 20 of file DigiCollectionFP420.h.

Constructor & Destructor Documentation

◆ DigiCollectionFP420()

DigiCollectionFP420::DigiCollectionFP420 ( )
inline

Definition at line 23 of file DigiCollectionFP420.h.

23 {}

Member Function Documentation

◆ add()

void DigiCollectionFP420::add ( unsigned int &  det_id,
std::vector< HDigiFP420 > &  digis 
)

Definition at line 179 of file DigiCollectionFP420.cc.

179  {
180 #ifdef mydigidebug
181  std::cout << "DigiCollectionFP420::add: det_id= " << det_id << std::endl;
182 #endif
183  digiMap_[det_id].reserve(digiMap_[det_id].size() + digis.size());
184  if (digiMap_[det_id].empty()) {
185  digiMap_[det_id] = digis;
186  } else {
187  copy(digis.begin(), digis.end(), back_inserter(digiMap_[det_id]));
188  }
189 }

References filterCSVwithJSON::copy, gather_cfg::cout, digiMap_, digis(), relativeConstraints::empty, and findQualityFiles::size.

Referenced by counter.Counter::register(), SequenceTypes.Task::remove(), and SequenceTypes.Task::replace().

◆ clear()

void DigiCollectionFP420::clear ( void  )

Definition at line 71 of file DigiCollectionFP420.cc.

71 { container_.clear(); }

References container_.

Referenced by BeautifulSoup.Tag::setString().

◆ detIDs() [1/2]

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

Definition at line 159 of file DigiCollectionFP420.cc.

159  {
160  // returns vector of detIDs in map
161 
164 
165 #ifdef mydigidebug
166  std::cout << "DigiCollectionFP420::detIDs:start " << std::endl;
167 #endif
168  std::vector<unsigned int> output;
169 
170  for (; begin != end; ++begin) {
171  output.push_back(begin->first);
172  }
173 
174  return output;
175 }

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

◆ detIDs() [2/2]

void DigiCollectionFP420::detIDs ( std::vector< unsigned int > &  det_ids) const

Definition at line 207 of file DigiCollectionFP420.cc.

207  {
208  det_ids.clear();
209  det_ids.reserve(static_cast<unsigned int>(digiMap_.size()));
210 #ifdef mydigidebug
211  std::cout << "DigiCollectionFP420:: detIDs: digiMap size= " << digiMap_.size() << std::endl;
212 #endif
213  HDigiFP420Container::const_iterator iter;
214  for (iter = digiMap_.begin(); iter != digiMap_.end(); iter++) {
215  det_ids.push_back(iter->first);
216  }
217 }

References gather_cfg::cout, and digiMap_.

◆ digis()

void DigiCollectionFP420::digis ( unsigned int &  det_id,
std::vector< HDigiFP420 > &  digis 
) const

Definition at line 193 of file DigiCollectionFP420.cc.

193  {
194 #ifdef mydigidebug
195  std::cout << "DigiCollectionFP420::digis:det_id= " << det_id << std::endl;
196 #endif
197  auto found = digiMap_.find(det_id);
198  if (found != digiMap_.end()) {
199  digis = found->second;
200  } else {
201  digis = std::vector<HDigiFP420>();
202  }
203 }

References gather_cfg::cout, digiMap_, and newFWLiteAna::found.

Referenced by add().

◆ get()

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

Definition at line 102 of file DigiCollectionFP420.cc.

102  {
103  // get Digis of detID
104 
105 #ifdef mydigidebug
106  std::cout << "DigiCollectionFP420::get1:detID= " << detID << std::endl;
107 #endif
108  auto found = map_.find(detID);
109  if (found == map_.end()) {
110  return DigiCollectionFP420::Range{container_.begin(), container_.begin()};
111  }
112 
113  DigiCollectionFP420::IndexRange returnIndexRange = found->second;
114  //
115  DigiCollectionFP420::Range returnRange;
116  returnRange.first = container_.begin() + returnIndexRange.first;
117  if (returnIndexRange.second != 0) {
118  returnRange.second = container_.begin() + returnIndexRange.second + 1;
119  } else {
120  returnRange.second = container_.begin() + returnIndexRange.second;
121  }
122 
123 #ifdef mydigidebug
124  std::cout << "digi get1: container_.size() = " << container_.size() << std::endl;
125  std::cout << "digi get1: returnIndexRange.first= " << returnIndexRange.first << std::endl;
126  std::cout << "digi get1: returnIndexRange.second= " << returnIndexRange.second << std::endl;
127 #endif
128  return returnRange;
129 }

References container_, gather_cfg::cout, newFWLiteAna::found, and map_.

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(), rrapi.RRApi::tables(), util.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().

◆ get1()

const DigiCollectionFP420::Range DigiCollectionFP420::get1 ( unsigned int  detID) const

Definition at line 131 of file DigiCollectionFP420.cc.

131  {
132  // get Digis of detID
133 
134 #ifdef mydigidebug
135  std::cout << "DigiCollectionFP420::get :detID= " << detID << std::endl;
136 #endif
137  DigiCollectionFP420::RegistryIterator returnIndex = map_.find(detID);
138  DigiCollectionFP420::IndexRange returnIndexRange = returnIndex->second;
139 #ifdef mydigidebug
140  std::cout << "DigiCollectionFP420::get : returnIndexRange.first= " << returnIndexRange.first << std::endl;
141  std::cout << "DigiCollectionFP420::get : returnIndexRange.second= " << returnIndexRange.second << std::endl;
142 #endif
143 
144  DigiCollectionFP420::Range returnRange;
145  returnRange.first = container_.begin() + returnIndexRange.first;
146  if (returnIndexRange.second != 0) {
147  returnRange.second = container_.begin() + returnIndexRange.second + 1;
148  } else {
149  returnRange.second = container_.begin() + returnIndexRange.second;
150  }
151 #ifdef mydigidebug
152  std::cout << "DigiCollectionFP420::get : container_.size() = " << container_.size() << std::endl;
153  std::cout << "DigiCollectionFP420::get : returnIndexRange.first= " << returnIndexRange.first << std::endl;
154  std::cout << "DigiCollectionFP420::get : returnIndexRange.second= " << returnIndexRange.second << std::endl;
155 #endif
156  return returnRange;
157 }

References container_, gather_cfg::cout, and map_.

◆ put()

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

Definition at line 15 of file DigiCollectionFP420.cc.

15  {
16  // put in Digis of detID
17 
18  // store size of vector before put
20 
21  // put in HDigiFP420s from input
22  bool first = true;
23 
24  // fill input in temporary vector for sorting
25  std::vector<HDigiFP420> temporary;
28 #ifdef mydigidebug
29  std::cout << " !!!!!!!!!!!!!!!! DigiCollectionFP420:: !!!! put !!!! start detID=" << detID << std::endl;
30 #endif
31  for (; sort_begin != sort_end; ++sort_begin) {
32  temporary.push_back(*sort_begin);
33 #ifdef mydigidebug
34  std::cout << "digi put: temporary.push_back " << std::endl;
35 #endif
36  } // for
37  std::sort(temporary.begin(), temporary.end());
38 
39  // iterators over input
40  DigiCollectionFP420::ContainerIterator begin = temporary.begin();
42  for (; begin != end; ++begin) {
43  container_.push_back(*begin);
44  if (first) {
45  inputRange.first = container_.size() - 1;
46 #ifdef mydigidebug
47  std::cout << "digi put:first container_.size() = " << container_.size() << std::endl;
48  std::cout << "digi put:first inputRange.first = " << inputRange.first << std::endl;
49 #endif
50  first = false;
51  } // if
52  } //for
53 
54  // since we start from 0, then the last element will be size-1
55  if (!container_.empty()) {
56  inputRange.second = container_.size() - 1;
57  } else {
58  inputRange.first = container_.size();
59  inputRange.second = container_.size();
60  }
61 #ifdef mydigidebug
62  std::cout << "digi put: container_.size() = " << container_.size() << std::endl;
63  std::cout << "digi put: inputRange.first = " << inputRange.first << std::endl;
64  std::cout << "digi put: inputRange.second = " << inputRange.second << std::endl;
65 #endif
66 
67  // fill map
68  map_[detID] = inputRange;
69 }

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

◆ putclear()

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

Definition at line 72 of file DigiCollectionFP420.cc.

72  {
74 
75  std::vector<HDigiFP420> temporary;
78  for (; sort_begin != sort_end; ++sort_begin) {
79  temporary.push_back(*sort_begin);
80  }
81  std::sort(temporary.begin(), temporary.end());
82 
83  // temporary.clear();
84  DigiCollectionFP420::ContainerIterator begin = temporary.begin();
86  for (; begin != end; ++begin) {
87  container_.push_back(*begin);
88  }
89  //container_.clear();
90  inputRange.first = container_.size() - container_.size();
91  inputRange.second = container_.size() - container_.size();
92 
93 #ifdef mydigidebug
94  std::cout << "digi putclear: container_.size() = " << container_.size() << std::endl;
95  std::cout << "digi putclear: inputRange.first = " << inputRange.first << std::endl;
96  std::cout << "digi putclear: inputRange.second = " << inputRange.second << std::endl;
97 #endif
98 
99  map_[detID] = inputRange;
100 }

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

Member Data Documentation

◆ container_

std::vector<HDigiFP420> DigiCollectionFP420::container_
private

Definition at line 38 of file DigiCollectionFP420.h.

Referenced by clear(), get(), get1(), put(), and putclear().

◆ digiMap_

HDigiFP420Container DigiCollectionFP420::digiMap_
private

Definition at line 41 of file DigiCollectionFP420.h.

Referenced by add(), detIDs(), and digis().

◆ map_

Registry DigiCollectionFP420::map_
private

Definition at line 39 of file DigiCollectionFP420.h.

Referenced by detIDs(), get(), get1(), put(), and putclear().

DigiCollectionFP420::container_
std::vector< HDigiFP420 > container_
Definition: DigiCollectionFP420.h:38
input
static const std::string input
Definition: EdmProvDump.cc:48
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DigiCollectionFP420::IndexRange
std::pair< unsigned int, unsigned int > IndexRange
Definition: DigiCollectionFP420.h:18
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
pileupCalc.inputRange
inputRange
Definition: pileupCalc.py:218
DigiCollectionFP420::ContainerIterator
std::vector< HDigiFP420 >::const_iterator ContainerIterator
Definition: DigiCollectionFP420.h:16
DigiCollectionFP420::digiMap_
HDigiFP420Container digiMap_
Definition: DigiCollectionFP420.h:41
mps_fire.end
end
Definition: mps_fire.py:242
DigiCollectionFP420::digis
void digis(unsigned int &det_id, std::vector< HDigiFP420 > &digis) const
Definition: DigiCollectionFP420.cc:193
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:112
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
DigiCollectionFP420::map_
Registry map_
Definition: DigiCollectionFP420.h:39
DigiCollectionFP420::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: DigiCollectionFP420.h:17
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
DigiCollectionFP420::RegistryIterator
std::map< unsigned int, IndexRange >::const_iterator RegistryIterator
Definition: DigiCollectionFP420.h:20
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443