CMS 3D CMS Logo

TempMeasurements.h
Go to the documentation of this file.
1 #ifndef Tracking_TempMeasurements_H
2 #define Tracking_TempMeasurements_H
4 
5 #include <vector>
6 #include <algorithm>
7 
8 namespace tracking {
9  // the return type from a MeasurementDet
13  typedef std::vector<float> Distances;
14 
15  void clear() {
16  hits.clear();
17  distances.clear();
18  }
19  bool empty() const { return hits.empty(); }
20  std::size_t size() const { return hits.size(); }
21 
22  inline void sortIndex(int* index) const {
23  float const* d = &distances.front(); // do not trust capture
24  for (std::size_t i = 0; i != size(); ++i) {
25  index[i] = i;
26  std::push_heap(index, index + i + 1, [d](int j, int k) { return d[j] < d[k]; });
27  }
28  std::make_heap(index, index + size(), [d](int j, int k) { return d[j] < d[k]; });
29  }
30 
31  void add(ConstRecHitPointer const& h, float d) {
32  hits.push_back(h);
33  distances.push_back(d);
34  }
35  void add(ConstRecHitPointer&& h, float d) {
36  hits.push_back(std::move(h));
37  distances.push_back(d);
38  }
39 
42  };
43 } // namespace tracking
44 
45 #endif // Tracking_TempMeas_H
void add(ConstRecHitPointer &&h, float d)
void sortIndex(int *index) const
TrackingRecHit::ConstRecHitPointer ConstRecHitPointer
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
TrackingRecHit::ConstRecHitContainer RecHitContainer
void add(ConstRecHitPointer const &h, float d)
d
Definition: ztail.py:151
std::vector< ConstRecHitPointer > ConstRecHitContainer
std::vector< float > Distances
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
std::size_t size() const
def move(src, dest)
Definition: eostools.py:511