CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
std::size_t size() const
void add(ConstRecHitPointer &&h, float d)
tuple d
Definition: ztail.py:151
TrackingRecHit::ConstRecHitPointer ConstRecHitPointer
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
TrackingRecHit::ConstRecHitContainer RecHitContainer
void add(ConstRecHitPointer const &h, float d)
def move
Definition: eostools.py:511
std::vector< ConstRecHitPointer > ConstRecHitContainer
std::vector< float > Distances
void sortIndex(int *index) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4