CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PixelRecoUtilities.h
Go to the documentation of this file.
1 #ifndef PixelRecoUtilities_H
2 #define PixelRecoUtilities_H
5 
10 namespace PixelRecoUtilities {
14  template <typename T>
15  T bendingRadius(T pt, const MagneticField& field) {
16  return pt * field.inverseBzAtOriginInGeV();
17  }
18 
22  template <typename T>
23  T curvature(T InversePt, const MagneticField& field) {
24  return InversePt / field.inverseBzAtOriginInGeV();
25  }
26 
28  template <typename T>
29  T inversePt(T curvature, const MagneticField& field) {
30  return curvature * field.inverseBzAtOriginInGeV();
31  }
32 
36  inline double longitudinalBendingCorrection(double radius, double pt, const MagneticField& field) {
37  double invCurv = bendingRadius(pt, field);
38  if (invCurv == 0.)
39  return 0.;
40  return radius / 6. * radius * radius / (2. * invCurv * 2. * invCurv);
41  }
42 
43 } // namespace PixelRecoUtilities
44 
45 #endif
T curvature(T InversePt, const MagneticField &field)
float inverseBzAtOriginInGeV() const
The inverse of field z component for this map in GeV.
Definition: MagneticField.h:52
T inversePt(T curvature, const MagneticField &field)
double longitudinalBendingCorrection(double radius, double pt, const MagneticField &field)
long double T
T bendingRadius(T pt, const MagneticField &field)