2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
9 TimedHitPtrCollection<HIT>::insert(const PileUpTimeEventIndex& timeEventIndex,
10 const AthenaHitsVector<HIT>* inputCollection) {
11 assert(inputCollection);
12 typename AthenaHitsVector<HIT>::const_iterator i(inputCollection->begin());
13 typename AthenaHitsVector<HIT>::const_iterator e(inputCollection->end());
14 while (i!=e) m_hits.push_back(TimedHitPtr<HIT>(timeEventIndex.time(), timeEventIndex.index(),*i++, timeEventIndex.type()));
17 throw SortedException();
23 TimedHitPtrCollection<HIT>::insert(float evtTime,
24 const AthenaHitsVector<HIT>* inputCollection) {
25 assert(inputCollection);
26 typename AthenaHitsVector<HIT>::const_iterator i(inputCollection->begin());
27 typename AthenaHitsVector<HIT>::const_iterator e(inputCollection->end());
28 while (i!=e) m_hits.push_back(TimedHitPtr<HIT>(evtTime, *i++));
31 throw SortedException();
36 ///returns an iterator range with the hits of current detector element
39 TimedHitPtrCollection<HIT>::nextDetectorElement(const_iterator& b, const_iterator& e) {
40 if (!m_sorted) sortVector();
42 while (m_currentHit != m_hits.end() && !(*b < *m_currentHit)) ++m_currentHit;
49 TimedHitPtrCollection<HIT>::sortVector() {
50 std::stable_sort(m_hits.begin(), m_hits.end());
51 m_currentHit = m_hits.begin();