test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TempMeasurements.h
Go to the documentation of this file.
1 #ifndef Tracking_TempMeasurements_H
2 #define Tracking_TempMeasurements_H
5 
6 #include<vector>
7 #include<algorithm>
8 
9 namespace tracking {
10  // the return type from a MeasurementDet
14  typedef std::vector<float> Distances;
15 
16  void clear() { hits.clear(); distances.clear();}
17  bool empty() const {return hits.empty();}
18  std::size_t size() const { return hits.size();}
19 
20  inline void sortIndex(int * index) const {
21  float const * d = &distances.front(); // do not trust capture
22  for (std::size_t i=0; i!=size(); ++i) {
23  index[i]=i;
24  std::push_heap(index,index+i+1,[d](int j,int k){return d[j]<d[k];});
25  }
26  std::make_heap(index,index+size(),[d](int j,int k){return d[j]<d[k];});
27  }
28 
29  void add(ConstRecHitPointer const & h, float d) {
30  hits.push_back(h); distances.push_back(d);
31  }
32  void add(ConstRecHitPointer && h, float d) {
33  hits.push_back(std::move(h)); distances.push_back(d);
34  }
35 
36 
39 
40  };
41 }
42 
43 
44 #endif // Tracking_TempMeas_H
45 
46 
47 
48 
int i
Definition: DBlmapReader.cc:9
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
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:510
int j
Definition: DBlmapReader.cc:9
std::vector< ConstRecHitPointer > ConstRecHitContainer
std::vector< float > Distances
void sortIndex(int *index) const