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), theX(), theP(), theCharge(0) {} // we must initialize cache to non-NAN to avoid FPE
20 
25  const GlobalVector& aP,
26  TrackCharge aCharge,
27  const MagneticField* fieldProvider)
28  : theField(fieldProvider), theX(aX), theP(aP), theCharge(aCharge) {
29  setCache();
30  }
31 
33  const GlobalVector& aP,
34  TrackCharge aCharge,
35  const MagneticField* fieldProvider,
36  GlobalVector fieldValue)
37  : theField(fieldProvider), theX(aX), theP(aP), cachedMagneticField(fieldValue), theCharge(aCharge) {}
38 
45  const GlobalVector& direction,
46  float transverseCurvature,
47  int,
48  const MagneticField* fieldProvider);
49 
51  const GlobalVector& direction,
52  float transverseCurvature,
53  int,
54  const MagneticField* fieldProvider,
55  GlobalVector fieldValue);
56 
60  GlobalPoint position() const { return theX; }
61 
65  GlobalVector momentum() const { return theP; }
66 
67  GlobalVector direction() const { return theP.unit(); }
68 
72  TrackCharge charge() const { return theCharge; }
73 
77  float signedInverseMomentum() const { return theCharge / theP.mag(); }
78 
82  float signedInverseTransverseMomentum() const { return theCharge / theP.perp(); }
83 
89  float transverseCurvature() const {
90  return -2.99792458e-3f * signedInverseTransverseMomentum() * cachedMagneticField.z();
91  }
92 
98  return AlgebraicVector6(theX.x(), theX.y(), theX.z(), theP.x(), theP.y(), theP.z());
99  }
100 
102  GlobalVector magneticFieldInInverseGeV() const { return 2.99792458e-3f * cachedMagneticField; }
103 
105 
106  const MagneticField& magneticField() const { return *theField; }
107 
108 private:
109  void setCache();
110 
111 private:
116  signed char theCharge;
117 };
118 
119 #endif
T perp() const
Definition: PV3DBase.h:69
T z() const
Definition: PV3DBase.h:61
GlobalVector magneticFieldInInverseGeV() const
GlobalTrajectoryParameters(const GlobalPoint &aX, const GlobalVector &aP, TrackCharge aCharge, const MagneticField *fieldProvider, GlobalVector fieldValue)
int TrackCharge
Definition: TrackCharge.h:4
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
T mag() const
Definition: PV3DBase.h:64
double f[11][100]
const MagneticField & magneticField() const
ROOT::Math::SVector< double, 6 > AlgebraicVector6
GlobalTrajectoryParameters(const GlobalPoint &aX, const GlobalVector &aP, TrackCharge aCharge, const MagneticField *fieldProvider)
Vector3DBase unit() const
Definition: Vector3DBase.h:54