PandaRoot
genfit::RKTrackRep Class Reference

AbsTrackRep with 5D track parameterization in plane coordinates: (q/p, u', v', u, v) More...

#include <RKTrackRep.h>

Inheritance diagram for genfit::RKTrackRep:
genfit::AbsTrackRep

Public Member Functions

 RKTrackRep ()
 
 RKTrackRep (int pdgCode, char propDir=0)
 
virtual ~RKTrackRep ()
 
virtual AbsTrackRepclone () const
 Clone the trackRep. More...
 
virtual double extrapolateToPlane (StateOnPlane &state, const SharedPlanePtr &plane, bool stopAtBoundary=false, bool calcJacobianNoise=false) const
 Extrapolates the state to plane, and returns the extrapolation length and, via reference, the extrapolated state. More...
 
virtual double extrapolateToLine (StateOnPlane &state, const TVector3 &linePoint, const TVector3 &lineDirection, bool stopAtBoundary=false, bool calcJacobianNoise=false) const
 Extrapolates the state to the POCA to a line, and returns the extrapolation length and, via reference, the extrapolated state. More...
 
virtual double extrapolateToPoint (StateOnPlane &state, const TVector3 &point, bool stopAtBoundary=false, bool calcJacobianNoise=false) const
 Extrapolates the state to the POCA to a point, and returns the extrapolation length and, via reference, the extrapolated state. More...
 
virtual double extrapolateToPoint (StateOnPlane &state, const TVector3 &point, const TMatrixDSym &G, bool stopAtBoundary=false, bool calcJacobianNoise=false) const
 Extrapolates the state to the POCA to a point in the metric of G, and returns the extrapolation length and, via reference, the extrapolated state. More...
 
virtual double extrapolateToCylinder (StateOnPlane &state, double radius, const TVector3 &linePoint=TVector3(0., 0., 0.), const TVector3 &lineDirection=TVector3(0., 0., 1.), bool stopAtBoundary=false, bool calcJacobianNoise=false) const
 Extrapolates the state to the cylinder surface, and returns the extrapolation length and, via reference, the extrapolated state. More...
 
virtual double extrapolateToSphere (StateOnPlane &state, double radius, const TVector3 &point=TVector3(0., 0., 0.), bool stopAtBoundary=false, bool calcJacobianNoise=false) const
 Extrapolates the state to the sphere surface, and returns the extrapolation length and, via reference, the extrapolated state. More...
 
virtual double extrapolateBy (StateOnPlane &state, double step, bool stopAtBoundary=false, bool calcJacobianNoise=false) const
 Extrapolates the state by step (cm) and returns the extrapolation length and, via reference, the extrapolated state. More...
 
unsigned int getDim () const
 Get the dimension of the state vector used by the track representation. More...
 
virtual TVector3 getPos (const StateOnPlane &state) const
 Get the cartesian position of a state. More...
 
virtual TVector3 getMom (const StateOnPlane &state) const
 Get the cartesian momentum vector of a state. More...
 
virtual void getPosMom (const StateOnPlane &state, TVector3 &pos, TVector3 &mom) const
 Get cartesian position and momentum vector of a state. More...
 
virtual double getMomMag (const StateOnPlane &state) const
 get the magnitude of the momentum in GeV. More...
 
virtual double getMomVar (const MeasuredStateOnPlane &state) const
 get the variance of the absolute value of the momentum . More...
 
virtual TMatrixDSym get6DCov (const MeasuredStateOnPlane &state) const
 Get the 6D covariance. More...
 
virtual void getPosMomCov (const MeasuredStateOnPlane &state, TVector3 &pos, TVector3 &mom, TMatrixDSym &cov) const
 Translates MeasuredStateOnPlane into 3D position, momentum and 6x6 covariance. More...
 
virtual double getCharge (const StateOnPlane &state) const
 Get the (fitted) charge of a state. This is not always equal the pdg charge (e.g. if the charge sign was flipped during the fit). More...
 
virtual double getQop (const StateOnPlane &state) const
 Get charge over momentum. More...
 
double getSpu (const StateOnPlane &state) const
 
double getTime (const StateOnPlane &state) const
 Get the time corresponding to the StateOnPlane. Extrapolation. More...
 
virtual void getForwardJacobianAndNoise (TMatrixD &jacobian, TMatrixDSym &noise, TVectorD &deltaState) const
 Get the jacobian and noise matrix of the last extrapolation. More...
 
virtual void getBackwardJacobianAndNoise (TMatrixD &jacobian, TMatrixDSym &noise, TVectorD &deltaState) const
 Get the jacobian and noise matrix of the last extrapolation if it would have been done in opposite direction. More...
 
std::vector< genfit::MatStepgetSteps () const
 Get stepsizes and material properties of crossed materials of the last extrapolation. More...
 
virtual double getRadiationLenght () const
 Get the accumulated X/X0 (path / radiation length) of the material crossed in the last extrapolation. More...
 
virtual void setPosMom (StateOnPlane &state, const TVector3 &pos, const TVector3 &mom) const
 Set position and momentum of state. More...
 
virtual void setPosMom (StateOnPlane &state, const TVectorD &state6) const
 Set position and momentum of state. More...
 
virtual void setPosMomErr (MeasuredStateOnPlane &state, const TVector3 &pos, const TVector3 &mom, const TVector3 &posErr, const TVector3 &momErr) const
 Set position and momentum and error of state. More...
 
virtual void setPosMomCov (MeasuredStateOnPlane &state, const TVector3 &pos, const TVector3 &mom, const TMatrixDSym &cov6x6) const
 Set position, momentum and covariance of state. More...
 
virtual void setPosMomCov (MeasuredStateOnPlane &state, const TVectorD &state6, const TMatrixDSym &cov6x6) const
 Set position, momentum and covariance of state. More...
 
virtual void setChargeSign (StateOnPlane &state, double charge) const
 Set the sign of the charge according to charge. More...
 
virtual void setQop (StateOnPlane &state, double qop) const
 Set charge/momentum. More...
 
void setSpu (StateOnPlane &state, double spu) const
 
void setTime (StateOnPlane &state, double time) const
 Set time at which the state was defined. More...
 
double RKPropagate (M1x7 &state7, M7x7 *jacobian, M1x3 &SA, double S, bool varField=true, bool calcOnlyLastRowOfJ=false) const
 The actual Runge Kutta propagation. More...
 
virtual bool isSameType (const AbsTrackRep *other)
 check if other is of same type (e.g. RKTrackRep). More...
 
virtual bool isSame (const AbsTrackRep *other)
 check if other is of same type (e.g. RKTrackRep) and has same pdg code. More...
 
- Public Member Functions inherited from genfit::AbsTrackRep
 AbsTrackRep ()
 
 AbsTrackRep (int pdgCode, char propDir=0)
 
virtual ~AbsTrackRep ()
 
virtual double extrapolateToLine (StateOnPlane &state, const TVector3 &point1, const TVector3 &point2, TVector3 &poca, TVector3 &dirInPoca, TVector3 &poca_onwire, bool stopAtBoundary=false, bool calcJacobianNoise=false) const
 Resembles the interface of GFAbsTrackRep in old versions of genfit. More...
 
double extrapolateToMeasurement (StateOnPlane &state, const AbsMeasurement *measurement, bool stopAtBoundary=false, bool calcJacobianNoise=false) const
 extrapolate to an AbsMeasurement More...
 
TVector3 getDir (const StateOnPlane &state) const
 Get the direction vector of a state. More...
 
void getPosDir (const StateOnPlane &state, TVector3 &pos, TVector3 &dir) const
 Get cartesian position and direction vector of a state. More...
 
virtual TVectorD get6DState (const StateOnPlane &state) const
 Get the 6D state vector (x, y, z, p_x, p_y, p_z). More...
 
virtual void get6DStateCov (const MeasuredStateOnPlane &state, TVectorD &stateVec, TMatrixDSym &cov) const
 Translates MeasuredStateOnPlane into 6D state vector (x, y, z, p_x, p_y, p_z) and 6x6 covariance. More...
 
int getPDG () const
 Get the pdg code. More...
 
double getPDGCharge () const
 Get the charge of the particle of the pdg code. More...
 
double getMass (const StateOnPlane &state) const
 Get tha particle mass in GeV/c^2. More...
 
char getPropDir () const
 Get propagation direction. (-1, 0, 1) -> (backward, auto, forward). More...
 
void calcJacobianNumerically (const genfit::StateOnPlane &origState, const genfit::SharedPlanePtr destPlane, TMatrixD &jacobian) const
 Calculate Jacobian of transportation numerically. Slow but accurate. Can be used to validate (semi)analytic calculations. More...
 
bool switchPDGSign ()
 try to multiply pdg code with -1. (Switch from particle to anti-particle and vice versa). More...
 
void setPropDir (int dir)
 Set propagation direction. (-1, 0, 1) -> (backward, auto, forward). More...
 
void switchPropDir ()
 Switch propagation direction. Has no effect if propDir_ is set to 0. More...
 
virtual void setDebugLvl (unsigned int lvl=1)
 
virtual void Print (const Option_t *="") const
 

Additional Inherited Members

- Protected Member Functions inherited from genfit::AbsTrackRep
 AbsTrackRep (const AbsTrackRep &)
 protect from calling copy c'tor from outside the class. Use clone() if you want a copy! More...
 
AbsTrackRepoperator= (const AbsTrackRep &)
 protect from calling assignment operator from outside the class. Use clone() instead! More...
 
- Protected Attributes inherited from genfit::AbsTrackRep
int pdgCode_
 Particle code. More...
 
char propDir_
 propagation direction (-1, 0, 1) -> (backward, auto, forward) More...
 
unsigned int debugLvl_
 

Detailed Description

AbsTrackRep with 5D track parameterization in plane coordinates: (q/p, u', v', u, v)

q/p is charge over momentum. u' and v' are direction tangents. u and v are positions on a DetPlane.

Definition at line 66 of file genfit2/trackReps/include/RKTrackRep.h.

Constructor & Destructor Documentation

◆ RKTrackRep() [1/2]

genfit::RKTrackRep::RKTrackRep ( )

◆ RKTrackRep() [2/2]

genfit::RKTrackRep::RKTrackRep ( int  pdgCode,
char  propDir = 0 
)

◆ ~RKTrackRep()

virtual genfit::RKTrackRep::~RKTrackRep ( )
virtual

Member Function Documentation

◆ clone()

virtual AbsTrackRep* genfit::RKTrackRep::clone ( ) const
inlinevirtual

Clone the trackRep.

Implements genfit::AbsTrackRep.

Definition at line 74 of file genfit2/trackReps/include/RKTrackRep.h.

References genfit::AbsTrackRep::extrapolateToLine().

74 { return new RKTrackRep(*this); }

◆ extrapolateBy()

virtual double genfit::RKTrackRep::extrapolateBy ( StateOnPlane state,
double  step,
bool  stopAtBoundary = false,
bool  calcJacobianNoise = false 
) const
virtual

Extrapolates the state by step (cm) and returns the extrapolation length and, via reference, the extrapolated state.

If stopAtBoundary is true, the extrapolation stops as soon as a material boundary is encountered.

If state has a covariance, jacobian and noise matrices will be calculated and the covariance will be propagated. If state has no covariance, jacobian and noise will only be calculated if calcJacobianNoise == true.

Implements genfit::AbsTrackRep.

◆ extrapolateToCylinder()

virtual double genfit::RKTrackRep::extrapolateToCylinder ( StateOnPlane state,
double  radius,
const TVector3 &  linePoint = TVector3(0., 0., 0.),
const TVector3 &  lineDirection = TVector3(0., 0., 1.),
bool  stopAtBoundary = false,
bool  calcJacobianNoise = false 
) const
virtual

Extrapolates the state to the cylinder surface, and returns the extrapolation length and, via reference, the extrapolated state.

If stopAtBoundary is true, the extrapolation stops as soon as a material boundary is encountered.

If state has a covariance, jacobian and noise matrices will be calculated and the covariance will be propagated. If state has no covariance, jacobian and noise will only be calculated if calcJacobianNoise == true.

Implements genfit::AbsTrackRep.

◆ extrapolateToLine()

virtual double genfit::RKTrackRep::extrapolateToLine ( StateOnPlane state,
const TVector3 &  linePoint,
const TVector3 &  lineDirection,
bool  stopAtBoundary = false,
bool  calcJacobianNoise = false 
) const
virtual

Extrapolates the state to the POCA to a line, and returns the extrapolation length and, via reference, the extrapolated state.

If stopAtBoundary is true, the extrapolation stops as soon as a material boundary is encountered.

If state has a covariance, jacobian and noise matrices will be calculated and the covariance will be propagated. If state has no covariance, jacobian and noise will only be calculated if calcJacobianNoise == true.

Implements genfit::AbsTrackRep.

◆ extrapolateToPlane()

virtual double genfit::RKTrackRep::extrapolateToPlane ( StateOnPlane state,
const SharedPlanePtr plane,
bool  stopAtBoundary = false,
bool  calcJacobianNoise = false 
) const
virtual

Extrapolates the state to plane, and returns the extrapolation length and, via reference, the extrapolated state.

If stopAtBoundary is true, the extrapolation stops as soon as a material boundary is encountered.

If state has a covariance, jacobian and noise matrices will be calculated and the covariance will be propagated. If state has no covariance, jacobian and noise will only be calculated if calcJacobianNoise == true.

Implements genfit::AbsTrackRep.

◆ extrapolateToPoint() [1/2]

virtual double genfit::RKTrackRep::extrapolateToPoint ( StateOnPlane state,
const TVector3 &  point,
bool  stopAtBoundary = false,
bool  calcJacobianNoise = false 
) const
inlinevirtual

Extrapolates the state to the POCA to a point, and returns the extrapolation length and, via reference, the extrapolated state.

If stopAtBoundary is true, the extrapolation stops as soon as a material boundary is encountered.

If state has a covariance, jacobian and noise matrices will be calculated and the covariance will be propagated. If state has no covariance, jacobian and noise will only be calculated if calcJacobianNoise == true.

Implements genfit::AbsTrackRep.

Definition at line 83 of file genfit2/trackReps/include/RKTrackRep.h.

84  {
85  return extrapToPoint(state, point, nullptr, stopAtBoundary, calcJacobianNoise);
86  }

◆ extrapolateToPoint() [2/2]

virtual double genfit::RKTrackRep::extrapolateToPoint ( StateOnPlane state,
const TVector3 &  point,
const TMatrixDSym &  G,
bool  stopAtBoundary = false,
bool  calcJacobianNoise = false 
) const
inlinevirtual

Extrapolates the state to the POCA to a point in the metric of G, and returns the extrapolation length and, via reference, the extrapolated state.

If stopAtBoundary is true, the extrapolation stops as soon as a material boundary is encountered.

If state has a covariance, jacobian and noise matrices will be calculated and the covariance will be propagated. If state has no covariance, jacobian and noise will only be calculated if calcJacobianNoise == true.

Implements genfit::AbsTrackRep.

Definition at line 88 of file genfit2/trackReps/include/RKTrackRep.h.

91  {
92  return extrapToPoint(state, point, &G, stopAtBoundary, calcJacobianNoise);
93  }

◆ extrapolateToSphere()

virtual double genfit::RKTrackRep::extrapolateToSphere ( StateOnPlane state,
double  radius,
const TVector3 &  point = TVector3(0., 0., 0.),
bool  stopAtBoundary = false,
bool  calcJacobianNoise = false 
) const
virtual

Extrapolates the state to the sphere surface, and returns the extrapolation length and, via reference, the extrapolated state.

If stopAtBoundary is true, the extrapolation stops as soon as a material boundary is encountered.

If state has a covariance, jacobian and noise matrices will be calculated and the covariance will be propagated. If state has no covariance, jacobian and noise will only be calculated if calcJacobianNoise == true.

Implements genfit::AbsTrackRep.

◆ get6DCov()

virtual TMatrixDSym genfit::RKTrackRep::get6DCov ( const MeasuredStateOnPlane state) const
virtual

Get the 6D covariance.

Implements genfit::AbsTrackRep.

◆ getBackwardJacobianAndNoise()

virtual void genfit::RKTrackRep::getBackwardJacobianAndNoise ( TMatrixD jacobian,
TMatrixDSym &  noise,
TVectorD &  deltaState 
) const
virtual

Get the jacobian and noise matrix of the last extrapolation if it would have been done in opposite direction.

Implements genfit::AbsTrackRep.

◆ getCharge()

virtual double genfit::RKTrackRep::getCharge ( const StateOnPlane state) const
virtual

Get the (fitted) charge of a state. This is not always equal the pdg charge (e.g. if the charge sign was flipped during the fit).

Implements genfit::AbsTrackRep.

◆ getDim()

unsigned int genfit::RKTrackRep::getDim ( ) const
inlinevirtual

Get the dimension of the state vector used by the track representation.

Implements genfit::AbsTrackRep.

Definition at line 103 of file genfit2/trackReps/include/RKTrackRep.h.

103 { return 5; }

◆ getForwardJacobianAndNoise()

virtual void genfit::RKTrackRep::getForwardJacobianAndNoise ( TMatrixD jacobian,
TMatrixDSym &  noise,
TVectorD &  deltaState 
) const
virtual

Get the jacobian and noise matrix of the last extrapolation.

Implements genfit::AbsTrackRep.

◆ getMom()

virtual TVector3 genfit::RKTrackRep::getMom ( const StateOnPlane state) const
virtual

Get the cartesian momentum vector of a state.

Implements genfit::AbsTrackRep.

◆ getMomMag()

virtual double genfit::RKTrackRep::getMomMag ( const StateOnPlane state) const
virtual

get the magnitude of the momentum in GeV.

Implements genfit::AbsTrackRep.

◆ getMomVar()

virtual double genfit::RKTrackRep::getMomVar ( const MeasuredStateOnPlane state) const
virtual

get the variance of the absolute value of the momentum .

Implements genfit::AbsTrackRep.

◆ getPos()

virtual TVector3 genfit::RKTrackRep::getPos ( const StateOnPlane state) const
virtual

Get the cartesian position of a state.

Implements genfit::AbsTrackRep.

◆ getPosMom()

virtual void genfit::RKTrackRep::getPosMom ( const StateOnPlane state,
TVector3 &  pos,
TVector3 &  mom 
) const
virtual

Get cartesian position and momentum vector of a state.

Implements genfit::AbsTrackRep.

◆ getPosMomCov()

virtual void genfit::RKTrackRep::getPosMomCov ( const MeasuredStateOnPlane state,
TVector3 &  pos,
TVector3 &  mom,
TMatrixDSym &  cov 
) const
virtual

Translates MeasuredStateOnPlane into 3D position, momentum and 6x6 covariance.

Implements genfit::AbsTrackRep.

◆ getQop()

virtual double genfit::RKTrackRep::getQop ( const StateOnPlane state) const
inlinevirtual

Get charge over momentum.

Implements genfit::AbsTrackRep.

Definition at line 116 of file genfit2/trackReps/include/RKTrackRep.h.

References genfit::StateOnPlane::getState().

116 { return state.getState()(0); }

◆ getRadiationLenght()

virtual double genfit::RKTrackRep::getRadiationLenght ( ) const
virtual

Get the accumulated X/X0 (path / radiation length) of the material crossed in the last extrapolation.

Implements genfit::AbsTrackRep.

◆ getSpu()

double genfit::RKTrackRep::getSpu ( const StateOnPlane state) const

◆ getSteps()

std::vector<genfit::MatStep> genfit::RKTrackRep::getSteps ( ) const
virtual

Get stepsizes and material properties of crossed materials of the last extrapolation.

Implements genfit::AbsTrackRep.

◆ getTime()

double genfit::RKTrackRep::getTime ( const StateOnPlane ) const
virtual

Get the time corresponding to the StateOnPlane. Extrapolation.

Implements genfit::AbsTrackRep.

◆ isSame()

virtual bool genfit::RKTrackRep::isSame ( const AbsTrackRep other)
virtual

check if other is of same type (e.g. RKTrackRep) and has same pdg code.

Implements genfit::AbsTrackRep.

◆ isSameType()

virtual bool genfit::RKTrackRep::isSameType ( const AbsTrackRep other)
virtual

check if other is of same type (e.g. RKTrackRep).

Implements genfit::AbsTrackRep.

◆ RKPropagate()

double genfit::RKTrackRep::RKPropagate ( M1x7 state7,
M7x7 jacobian,
M1x3 SA,
double  S,
bool  varField = true,
bool  calcOnlyLastRowOfJ = false 
) const

The actual Runge Kutta propagation.

propagate state7 with step S. Fills SA (Start directions derivatives dA/S). If jacobian is nullptr, only the state is propagated, otherwise also the 7x7 jacobian is calculated. If varField is false, the magnetic field will only be evaluated at the starting position. The return value is an estimation on how good the extrapolation is, and it is usually fine if it is > 1. It gives a suggestion how you must scale S so that the quality will be sufficient.

◆ setChargeSign()

virtual void genfit::RKTrackRep::setChargeSign ( StateOnPlane state,
double  charge 
) const
virtual

Set the sign of the charge according to charge.

Implements genfit::AbsTrackRep.

◆ setPosMom() [1/2]

virtual void genfit::RKTrackRep::setPosMom ( StateOnPlane state,
const TVector3 &  pos,
const TVector3 &  mom 
) const
virtual

Set position and momentum of state.

Implements genfit::AbsTrackRep.

◆ setPosMom() [2/2]

virtual void genfit::RKTrackRep::setPosMom ( StateOnPlane state,
const TVectorD &  state6 
) const
virtual

Set position and momentum of state.

Implements genfit::AbsTrackRep.

◆ setPosMomCov() [1/2]

virtual void genfit::RKTrackRep::setPosMomCov ( MeasuredStateOnPlane state,
const TVector3 &  pos,
const TVector3 &  mom,
const TMatrixDSym &  cov6x6 
) const
virtual

Set position, momentum and covariance of state.

Implements genfit::AbsTrackRep.

◆ setPosMomCov() [2/2]

virtual void genfit::RKTrackRep::setPosMomCov ( MeasuredStateOnPlane state,
const TVectorD &  state6,
const TMatrixDSym &  cov6x6 
) const
virtual

Set position, momentum and covariance of state.

Implements genfit::AbsTrackRep.

◆ setPosMomErr()

virtual void genfit::RKTrackRep::setPosMomErr ( MeasuredStateOnPlane state,
const TVector3 &  pos,
const TVector3 &  mom,
const TVector3 &  posErr,
const TVector3 &  momErr 
) const
virtual

Set position and momentum and error of state.

Implements genfit::AbsTrackRep.

◆ setQop()

virtual void genfit::RKTrackRep::setQop ( StateOnPlane state,
double  qop 
) const
inlinevirtual

Set charge/momentum.

Implements genfit::AbsTrackRep.

Definition at line 135 of file genfit2/trackReps/include/RKTrackRep.h.

References genfit::StateOnPlane::getState(), and genfit::RKStep::limits_.

135 { state.getState()(0) = qop; }

◆ setSpu()

void genfit::RKTrackRep::setSpu ( StateOnPlane state,
double  spu 
) const

◆ setTime()

void genfit::RKTrackRep::setTime ( StateOnPlane state,
double  time 
) const
virtual

Set time at which the state was defined.

Implements genfit::AbsTrackRep.


The documentation for this class was generated from the following file: