CMS 3D CMS Logo

CTPPSPixelDigiCollection.cc
Go to the documentation of this file.
2 
3 #include <algorithm>
4 
5 void CTPPSPixelDigiCollection::put(Range input, unsigned int detID) {
7 
10 
12  std::vector<CTPPSPixelDigi> temporary;
13 
14  auto sort_begin = input.first;
15  auto sort_end = input.second;
16 
17  temporary.insert(std::end(temporary), sort_begin, sort_end);
18 
19  std::sort(temporary.begin(), temporary.end());
20 
21  inputRange.first = container_.size();
22  container_.insert(std::end(container_), std::begin(temporary), std::end(temporary));
23  inputRange.second = container_.size() - 1;
24 
26  map_[detID] = inputRange;
27 }
28 
31 
32  auto found = map_.find(detID);
33  CTPPSPixelDigiCollection::IndexRange returnIndexRange{};
34  if (found != map_.end()) {
35  returnIndexRange = found->second;
36  }
37 
39  returnRange.first = container_.begin() + returnIndexRange.first;
40  returnRange.second = container_.begin() + returnIndexRange.second + 1;
41 
42  return returnRange;
43 }
44 
45 const std::vector<unsigned int> CTPPSPixelDigiCollection::detIDs() const {
47 
48  auto begin = map_.begin();
49  auto end = map_.end();
50 
51  std::vector<unsigned int> output;
52  output.reserve(12);
53 
54  for (; begin != end; ++begin) {
55  output.push_back(begin->first);
56  }
57 
58  return output;
59 }
CTPPSPixelDigiCollection::IndexRange
std::pair< unsigned int, unsigned int > IndexRange
Definition: CTPPSPixelDigiCollection.h:13
CTPPSPixelDigiCollection::container_
std::vector< CTPPSPixelDigi > container_
Definition: CTPPSPixelDigiCollection.h:24
input
static const std::string input
Definition: EdmProvDump.cc:48
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
pileupCalc.inputRange
inputRange
Definition: pileupCalc.py:218
mps_fire.end
end
Definition: mps_fire.py:242
CTPPSPixelDigiCollection::map_
Registry map_
Definition: CTPPSPixelDigiCollection.h:25
CTPPSPixelDigiCollection::detIDs
const std::vector< unsigned int > detIDs() const
Definition: CTPPSPixelDigiCollection.cc:45
CTPPSPixelDigiCollection::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: CTPPSPixelDigiCollection.h:12
CTPPSPixelDigiCollection::get
const Range get(unsigned int detID) const
Definition: CTPPSPixelDigiCollection.cc:29
CTPPSPixelDigiCollection::put
void put(Range input, unsigned int detID)
Definition: CTPPSPixelDigiCollection.cc:5
CTPPSPixelDigiCollection.h