4 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
11 TimedHitCollection<HIT>::insert(const PileUpTimeEventIndex& timeEventIndex,
12 const AtlasHitsVector<HIT>* inputCollection) {
13 if (!inputCollection){
14 throw("Empty input collection!");
16 typename AtlasHitsVector<HIT>::const_iterator i(inputCollection->begin());
17 typename AtlasHitsVector<HIT>::const_iterator e(inputCollection->end());
18 while (i!=e) m_hits.push_back(TimedHitPtr<HIT>(timeEventIndex.time(), timeEventIndex.index(), &(*i++), timeEventIndex.type() ));
21 throw SortedException();
27 TimedHitCollection<HIT>::insert(float evtTime,
28 const AtlasHitsVector<HIT>* inputCollection) {
29 if (!inputCollection){
30 throw("Empty input collection!");
32 typename AtlasHitsVector<HIT>::const_iterator i(inputCollection->begin());
33 typename AtlasHitsVector<HIT>::const_iterator e(inputCollection->end());
34 while (i!=e) m_hits.push_back(TimedHitPtr<HIT>(evtTime, &(*i++)));
37 throw SortedException();
43 TimedHitCollection<HIT>::reserve(unsigned int numberOfHits) {
44 m_hits.reserve(numberOfHits);
48 ///returns an iterator range with the hits of current detector element
51 TimedHitCollection<HIT>::nextDetectorElement(const_iterator& b, const_iterator& e) {
52 if (!m_sorted) sortVector();
54 while (m_currentHit != m_hits.end() && !(*b < *m_currentHit)) ++m_currentHit;
61 TimedHitCollection<HIT>::sortVector() {
62 std::stable_sort(m_hits.begin(), m_hits.end());
63 m_currentHit = m_hits.begin();