CMS 3D CMS Logo

GlobalTrajectoryParameters.h
Go to the documentation of this file.
1 #ifndef _TRACKER_GLOBALTRAJECTORYPARAMETERS_H_
2 #define _TRACKER_GLOBALTRAJECTORYPARAMETERS_H_
3 
8 
9 class MagneticField;
16 public:
17 // construct
19  theField(nullptr),
20  theX(), theP(),
21  theCharge(0)
22  {} // we must initialize cache to non-NAN to avoid FPE
23 
28  const GlobalPoint& aX,
29  const GlobalVector& aP,
30  TrackCharge aCharge,
31  const MagneticField* fieldProvider) :
32  theField(fieldProvider),
33  theX(aX), theP(aP),
34  theCharge(aCharge)
35  {setCache();}
36 
38  const GlobalVector& aP,
39  TrackCharge aCharge,
40  const MagneticField* fieldProvider,
41  GlobalVector fieldValue):
42  theField(fieldProvider),
43  theX(aX), theP(aP),
44  cachedMagneticField(fieldValue),
45  theCharge(aCharge)
46  {}
47 
48 
49 
56  const GlobalVector& direction,
57  float transverseCurvature, int,
58  const MagneticField* fieldProvider);
59 
60 
62  const GlobalVector& direction,
63  float transverseCurvature, int,
64  const MagneticField* fieldProvider,
65  GlobalVector fieldValue);
66 
67 
72  return theX;
73  }
74 
79  return theP;
80  }
81 
83  return theP.unit();
84  }
85 
89  TrackCharge charge() const {
90  return theCharge;
91  }
92 
96  float signedInverseMomentum() const {
97  return theCharge/theP.mag();
98  }
99 
104  return theCharge/theP.perp();
105  }
106 
112  float transverseCurvature() const {
113  return -2.99792458e-3f * signedInverseTransverseMomentum() * cachedMagneticField.z();
114  }
115 
121  return AlgebraicVector6(theX.x(),theX.y(),theX.z(),theP.x(),theP.y(),theP.z());
122  }
123 
124 
127  return 2.99792458e-3f * cachedMagneticField;
128  }
129 
131  return cachedMagneticField;
132  }
133 
134  const MagneticField& magneticField() const {return *theField;}
135 
136 private:
137  void setCache();
138 
139 private:
144  signed char theCharge;
145 
146 };
147 
148 #endif
T perp() const
Definition: PV3DBase.h:72
#define nullptr
T y() const
Definition: PV3DBase.h:63
GlobalTrajectoryParameters(const GlobalPoint &aX, const GlobalVector &aP, TrackCharge aCharge, const MagneticField *fieldProvider, GlobalVector fieldValue)
ROOT::Math::SVector< double, 6 > AlgebraicVector6
int TrackCharge
Definition: TrackCharge.h:4
T mag() const
Definition: PV3DBase.h:67
GlobalVector magneticFieldInTesla() const
T z() const
Definition: PV3DBase.h:64
GlobalVector magneticFieldInInverseGeV() const
double f[11][100]
Vector3DBase unit() const
Definition: Vector3DBase.h:57
GlobalTrajectoryParameters(const GlobalPoint &aX, const GlobalVector &aP, TrackCharge aCharge, const MagneticField *fieldProvider)
const MagneticField & magneticField() const
T x() const
Definition: PV3DBase.h:62
AlgebraicVector6 vector() const