CMS 3D CMS Logo

GeometricSorting.h
Go to the documentation of this file.
1 #ifndef Surface_GeometricSorting_h
2 #define Surface_GeometricSorting_h
3 
4 #include <functional>
6 
7 namespace geomsort{
8 
21  template <class T, class Scalar = typename T::Scalar>
22  struct ExtractR {
24  Scalar operator()(const T* p) const {return p->position().perp();}
25  Scalar operator()(const T& p) const {return p.position().perp();}
26  };
27 
28 
45  template <class T, class Scalar = typename T::Scalar>
46  struct ExtractPhi {
48  Geom::Phi<Scalar> operator()(const T* p) const {return p->position().phi();}
49  Geom::Phi<Scalar> operator()(const T& p) const {return p.position().phi();}
50  };
51 
52 
53 
66  template <class T, class Scalar = typename T::Scalar>
67  struct ExtractZ {
69  Scalar operator()(const T* p) const {return p->position().z();}
70  Scalar operator()(const T& p) const {return p.position().z();}
71  };
72 
85  template <class T, class Scalar = typename T::Scalar>
86  struct ExtractAbsZ {
88  Scalar operator()(const T* p) const {return fabs(p->position().z());}
89  Scalar operator()(const T& p) const {return fabs(p.position().z());}
90  };
91 
92 
93 }
94 #endif
95 
Geom::Phi< Scalar > operator()(const T *p) const
double Scalar
Definition: Definitions.h:27
Scalar operator()(const T *p) const
Geom::Phi< Scalar > operator()(const T &p) const
Scalar operator()(const T *p) const
Geom::Phi< Scalar > result_type
Scalar operator()(const T &p) const
Scalar operator()(const T &p) const
Scalar operator()(const T &p) const
Scalar operator()(const T *p) const
long double T
Definition: Phi.h:20