CMS 3D CMS Logo

PixelRecoUtilities.h
Go to the documentation of this file.
1 #ifndef PixelRecoUtilities_H
2 #define PixelRecoUtilities_H
6 #include <string>
7 
12 namespace PixelRecoUtilities {
13 
16  struct FieldAt0 {
17  FieldAt0(const edm::EventSetup& es);
19  };
20 
25  inline float fieldInInvGev(const edm::EventSetup& iSetup) {
26  static const FieldAt0 fieldAt0(iSetup);
27  return fieldAt0.fieldInInvGev;
28  }
29  // void MaginTesla(const edm::EventSetup& c);
33  template <typename T>
34  T bendingRadius(T pt, const edm::EventSetup& iSetup) {
35  return pt * fieldInInvGev(iSetup);
36  }
37 
41  template <typename T>
42  T curvature(T InversePt, const edm::EventSetup& iSetup) {
43  return InversePt / fieldInInvGev(iSetup);
44  }
45 
47  template <typename T>
49  return curvature * fieldInInvGev(iSetup);
50  }
51 
55  inline double longitudinalBendingCorrection(double radius, double pt, const edm::EventSetup& iSetup) {
56  double invCurv = bendingRadius(pt, iSetup);
57  if (invCurv == 0.)
58  return 0.;
59  return radius / 6. * radius * radius / (2. * invCurv * 2. * invCurv);
60  }
61 
62 } // namespace PixelRecoUtilities
63 
64 #endif
T inversePt(T curvature, const edm::EventSetup &iSetup)
T curvature(T InversePt, const edm::EventSetup &iSetup)
double longitudinalBendingCorrection(double radius, double pt, const edm::EventSetup &iSetup)
T bendingRadius(T pt, const edm::EventSetup &iSetup)
FieldAt0(const edm::EventSetup &es)
long double T