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
Vector3DBase
Definition: Vector3DBase.h:8
GlobalTrajectoryParameters::theField
const MagneticField * theField
Definition: GlobalTrajectoryParameters.h:112
GlobalTrajectoryParameters::theX
GlobalPoint theX
Definition: GlobalTrajectoryParameters.h:113
TrackCharge
int TrackCharge
Definition: TrackCharge.h:4
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
GlobalTrajectoryParameters::position
GlobalPoint position() const
Definition: GlobalTrajectoryParameters.h:60
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
GlobalTrajectoryParameters::magneticFieldInTesla
GlobalVector magneticFieldInTesla() const
Definition: GlobalTrajectoryParameters.h:104
GlobalTrajectoryParameters::magneticFieldInInverseGeV
GlobalVector magneticFieldInInverseGeV() const
Definition: GlobalTrajectoryParameters.h:102
GlobalTrajectoryParameters::signedInverseTransverseMomentum
float signedInverseTransverseMomentum() const
Definition: GlobalTrajectoryParameters.h:82
GlobalTrajectoryParameters::GlobalTrajectoryParameters
GlobalTrajectoryParameters()
Definition: GlobalTrajectoryParameters.h:18
GlobalTrajectoryParameters::charge
TrackCharge charge() const
Definition: GlobalTrajectoryParameters.h:72
GlobalTrajectoryParameters::GlobalTrajectoryParameters
GlobalTrajectoryParameters(const GlobalPoint &aX, const GlobalVector &aP, TrackCharge aCharge, const MagneticField *fieldProvider, GlobalVector fieldValue)
Definition: GlobalTrajectoryParameters.h:32
DDAxes::x
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
Vector3DBase::unit
Vector3DBase unit() const
Definition: Vector3DBase.h:54
TrackCharge.h
GlobalTrajectoryParameters::direction
GlobalVector direction() const
Definition: GlobalTrajectoryParameters.h:67
GlobalTrajectoryParameters::vector
AlgebraicVector6 vector() const
Definition: GlobalTrajectoryParameters.h:97
GlobalTrajectoryParameters
Definition: GlobalTrajectoryParameters.h:15
Point3DBase< float, GlobalTag >
GlobalTrajectoryParameters::momentum
GlobalVector momentum() const
Definition: GlobalTrajectoryParameters.h:65
GlobalTrajectoryParameters::transverseCurvature
float transverseCurvature() const
Definition: GlobalTrajectoryParameters.h:89
GlobalTrajectoryParameters::theCharge
signed char theCharge
Definition: GlobalTrajectoryParameters.h:116
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
GlobalTrajectoryParameters::cachedMagneticField
GlobalVector cachedMagneticField
Definition: GlobalTrajectoryParameters.h:115
GlobalTrajectoryParameters::setCache
void setCache()
Definition: GlobalTrajectoryParameters.cc:31
AlgebraicVector6
ROOT::Math::SVector< double, 6 > AlgebraicVector6
Definition: AlgebraicROOTObjects.h:15
PV3DBase::mag
T mag() const
Definition: PV3DBase.h:64
GlobalTrajectoryParameters::GlobalTrajectoryParameters
GlobalTrajectoryParameters(const GlobalPoint &aX, const GlobalVector &aP, TrackCharge aCharge, const MagneticField *fieldProvider)
Definition: GlobalTrajectoryParameters.h:24
GlobalVector.h
GlobalTrajectoryParameters::magneticField
const MagneticField & magneticField() const
Definition: GlobalTrajectoryParameters.h:106
GlobalTrajectoryParameters::theP
GlobalVector theP
Definition: GlobalTrajectoryParameters.h:114
GlobalTrajectoryParameters::signedInverseMomentum
float signedInverseMomentum() const
Definition: GlobalTrajectoryParameters.h:77
MagneticField
Definition: MagneticField.h:19
GlobalPoint.h
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
AlgebraicROOTObjects.h