GENFIT  Rev:NoNumberAvailable
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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:
Inheritance graph
Collaboration diagram for genfit::RKTrackRep:
Collaboration graph

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 extrapolateToCone (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 cone 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...
 
virtual double extrapolateToLine (StateOnPlane &state, const TVector3 &linePoint, const TVector3 &lineDirection, bool stopAtBoundary=false, bool calcJacobianNoise=false) const=0
 Extrapolates the state to the POCA to a line, and returns the extrapolation length and, via reference, the extrapolated state. More...
 
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...
 
- 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
 

Private Member Functions

void initArrays () const
 
virtual double extrapToPoint (StateOnPlane &state, const TVector3 &point, const TMatrixDSym *G=NULL, bool stopAtBoundary=false, bool calcJacobianNoise=false) const
 
void getState7 (const StateOnPlane &state, M1x7 &state7) const
 
void getState5 (StateOnPlane &state, const M1x7 &state7) const
 
void transformPM7 (const MeasuredStateOnPlane &state, M7x7 &out7x7) const
 
void calcJ_pM_5x7 (M5x7 &J_pM, const TVector3 &U, const TVector3 &V, const M1x3 &pTilde, double spu) const
 
void transformPM6 (const MeasuredStateOnPlane &state, M6x6 &out6x6) const
 
void transformM7P (const M7x7 &in7x7, const M1x7 &state7, MeasuredStateOnPlane &state) const
 
void calcJ_Mp_7x5 (M7x5 &J_Mp, const TVector3 &U, const TVector3 &V, const TVector3 &W, const M1x3 &A) const
 
void calcForwardJacobianAndNoise (const M1x7 &startState7, const DetPlane &startPlane, const M1x7 &destState7, const DetPlane &destPlane) const
 
void transformM6P (const M6x6 &in6x6, const M1x7 &state7, MeasuredStateOnPlane &state) const
 
bool RKutta (const M1x4 &SU, const DetPlane &plane, double charge, double mass, M1x7 &state7, M7x7 *jacobianT, M1x7 *J_MMT_unprojected_lastRow, double &coveredDistance, double &flightTime, bool &checkJacProj, M7x7 &noiseProjection, StepLimits &limits, bool onlyOneStep=false, bool calcOnlyLastRowOfJ=false) const
 Propagates the particle through the magnetic field. More...
 
double estimateStep (const M1x7 &state7, const M1x4 &SU, const DetPlane &plane, const double &charge, double &relMomLoss, StepLimits &limits) const
 
TVector3 pocaOnLine (const TVector3 &linePoint, const TVector3 &lineDirection, const TVector3 &point) const
 
double Extrap (const DetPlane &startPlane, const DetPlane &destPlane, double charge, double mass, bool &isAtBoundary, M1x7 &state7, double &flightTime, bool fillExtrapSteps, TMatrixDSym *cov=nullptr, bool onlyOneStep=false, bool stopAtBoundary=false, double maxStep=1.E99) const
 Handles propagation and material effects. More...
 
void checkCache (const StateOnPlane &state, const SharedPlanePtr *plane) const
 
double momMag (const M1x7 &state7) const
 

Private Attributes

StateOnPlane lastStartState_
 
StateOnPlane lastEndState_
 state where the last extrapolation has started More...
 
std::vector< RKStepRKSteps_
 state where the last extrapolation has ended More...
 
int RKStepsFXStart_
 RungeKutta steps made in the last extrapolation. More...
 
int RKStepsFXStop_
 
std::vector< ExtrapStepExtrapSteps_
 
TMatrixD fJacobian_
 steps made in Extrap during last extrapolation More...
 
TMatrixDSym fNoise_
 
bool useCache_
 
unsigned int cachePos_
 use cached RKSteps_ for extrapolation More...
 
StepLimits limits_
 
M7x7 noiseArray_
 
M7x7 noiseProjection_
 noise matrix of the last extrapolation More...
 
M7x7 J_MMT_
 

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 71 of file RKTrackRep.h.

Constructor & Destructor Documentation

◆ RKTrackRep() [1/2]

genfit::RKTrackRep::RKTrackRep ( )

Definition at line 45 of file RKTrackRep.cc.

References initArrays().

Referenced by clone().

◆ RKTrackRep() [2/2]

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

Definition at line 60 of file RKTrackRep.cc.

References initArrays().

◆ ~RKTrackRep()

genfit::RKTrackRep::~RKTrackRep ( )
virtual

Definition at line 75 of file RKTrackRep.cc.

Member Function Documentation

◆ calcForwardJacobianAndNoise()

void genfit::RKTrackRep::calcForwardJacobianAndNoise ( const M1x7 startState7,
const DetPlane startPlane,
const M1x7 destState7,
const DetPlane destPlane 
) const
private

◆ calcJ_Mp_7x5()

void genfit::RKTrackRep::calcJ_Mp_7x5 ( M7x5 J_Mp,
const TVector3 &  U,
const TVector3 &  V,
const TVector3 &  W,
const M1x3 A 
) const
private

◆ calcJ_pM_5x7()

void genfit::RKTrackRep::calcJ_pM_5x7 ( M5x7 J_pM,
const TVector3 &  U,
const TVector3 &  V,
const M1x3 pTilde,
double  spu 
) const
private

◆ checkCache()

void genfit::RKTrackRep::checkCache ( const StateOnPlane state,
const SharedPlanePtr plane 
) const
private

◆ clone()

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

Clone the trackRep.

Implements genfit::AbsTrackRep.

Definition at line 81 of file RKTrackRep.h.

References RKTrackRep().

◆ estimateStep()

double genfit::RKTrackRep::estimateStep ( const M1x7 state7,
const M1x4 SU,
const DetPlane plane,
const double &  charge,
double &  relMomLoss,
StepLimits limits 
) const
private

◆ Extrap()

double genfit::RKTrackRep::Extrap ( const DetPlane startPlane,
const DetPlane destPlane,
double  charge,
double  mass,
bool &  isAtBoundary,
M1x7 state7,
double &  flightTime,
bool  fillExtrapSteps,
TMatrixDSym *  cov = nullptr,
bool  onlyOneStep = false,
bool  stopAtBoundary = false,
double  maxStep = 1.E99 
) const
private

Handles propagation and material effects.

extrapolateToPlane(), extrapolateToPoint() and extrapolateToLine() etc. call this function. Extrap() needs a plane as an argument, hence extrapolateToPoint() and extrapolateToLine() create virtual detector planes. In this function, RKutta() is called and the resulting points and point paths are filtered so that the direction doesn't change and tiny steps are filtered out. After the propagation the material effects are called via the MaterialEffects singleton. Extrap() will loop until the plane is reached, unless the propagation fails or the maximum number of iterations is exceeded.

fNoMaterial &&

Definition at line 2360 of file RKTrackRep.cc.

References genfit::RKMatrix< nRows, nCols >::begin(), calcForwardJacobianAndNoise(), genfit::AbsTrackRep::debugLvl_, genfit::debugOut, genfit::DetPlane::distance(), genfit::MaterialEffects::effects(), ExtrapSteps_, fJacobian_, fNoise_, genfit::MaterialEffects::getInstance(), genfit::StepLimits::getLowestLimit(), genfit::DetPlane::getNormal(), genfit::DetPlane::getO(), genfit::DetPlane::isInActive(), J_MMT_, limits_, MINSTEP, noiseArray_, noiseProjection_, genfit::RKTools::Np_N_NpT(), genfit::AbsTrackRep::pdgCode_, genfit::DetPlane::Print(), genfit::RKTools::printDim(), genfit::StepLimits::reset(), RKSteps_, RKStepsFXStart_, RKStepsFXStop_, RKutta(), genfit::Exception::setFatal(), genfit::StepLimits::setLimit(), genfit::stp_boundary, genfit::stp_plane, and genfit::stp_sMaxArg.

Referenced by extrapolateBy(), extrapolateToCone(), extrapolateToCylinder(), extrapolateToLine(), extrapolateToPlane(), extrapolateToSphere(), and extrapToPoint().

◆ extrapolateBy()

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.

Definition at line 721 of file RKTrackRep.cc.

References checkCache(), genfit::AbsTrackRep::debugLvl_, genfit::debugOut, Extrap(), extrapolateToPlane(), genfit::StateOnPlane::getAuxInfo(), getCharge(), genfit::AbsTrackRep::getMass(), genfit::StateOnPlane::getPlane(), getState5(), getState7(), lastEndState_, MINSTEP, genfit::Exception::setFatal(), and genfit::StateOnPlane::setPlane().

◆ extrapolateToCone()

double genfit::RKTrackRep::extrapolateToCone ( 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 cone 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.

Definition at line 476 of file RKTrackRep.cc.

References checkCache(), genfit::AbsTrackRep::debugLvl_, genfit::debugOut, Extrap(), extrapolateToPlane(), genfit::StateOnPlane::getAuxInfo(), getCharge(), genfit::AbsTrackRep::getMass(), genfit::StateOnPlane::getPlane(), getState5(), getState7(), lastEndState_, MINSTEP, genfit::Exception::setFatal(), and genfit::StateOnPlane::setPlane().

◆ extrapolateToCylinder()

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.

Definition at line 351 of file RKTrackRep.cc.

References checkCache(), genfit::AbsTrackRep::debugLvl_, genfit::debugOut, Extrap(), extrapolateToPlane(), genfit::StateOnPlane::getAuxInfo(), getCharge(), genfit::AbsTrackRep::getMass(), genfit::StateOnPlane::getPlane(), getState5(), getState7(), lastEndState_, MINSTEP, genfit::Exception::setFatal(), and genfit::StateOnPlane::setPlane().

◆ extrapolateToLine() [1/3]

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.

Definition at line 135 of file RKTrackRep.cc.

References checkCache(), genfit::AbsTrackRep::debugLvl_, genfit::debugOut, Extrap(), extrapolateToPlane(), genfit::StateOnPlane::getAuxInfo(), getCharge(), genfit::AbsTrackRep::getMass(), genfit::StateOnPlane::getPlane(), getState5(), getState7(), lastEndState_, MINSTEP, pocaOnLine(), genfit::Exception::setFatal(), genfit::StateOnPlane::setPlane(), and genfit::DetPlane::setU().

◆ extrapolateToLine() [2/3]

virtual double genfit::AbsTrackRep::extrapolateToLine

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.

◆ extrapolateToLine() [3/3]

virtual double genfit::AbsTrackRep::extrapolateToLine
inline

Resembles the interface of GFAbsTrackRep in old versions of genfit.

This interface to extrapolateToLine is intended to resemble the interface of GFAbsTrackRep in old versions of genfit and is implemented by default via the preceding function.

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.

Definition at line 120 of file AbsTrackRep.h.

◆ extrapolateToPlane()

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.

Definition at line 80 of file RKTrackRep.cc.

References checkCache(), genfit::AbsTrackRep::debugLvl_, genfit::debugOut, Extrap(), getCharge(), genfit::AbsTrackRep::getMass(), genfit::StateOnPlane::getPlane(), getState5(), getState7(), getTime(), lastEndState_, genfit::StateOnPlane::setPlane(), and setTime().

Referenced by extrapolateBy(), extrapolateToCone(), extrapolateToCylinder(), extrapolateToLine(), extrapolateToSphere(), and extrapToPoint().

◆ 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 96 of file RKTrackRep.h.

References extrapToPoint().

◆ 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 103 of file RKTrackRep.h.

References extrapToPoint().

◆ extrapolateToSphere()

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.

Definition at line 610 of file RKTrackRep.cc.

References checkCache(), genfit::AbsTrackRep::debugLvl_, genfit::debugOut, Extrap(), extrapolateToPlane(), genfit::StateOnPlane::getAuxInfo(), getCharge(), genfit::AbsTrackRep::getMass(), genfit::StateOnPlane::getPlane(), getState5(), getState7(), lastEndState_, MINSTEP, genfit::Exception::setFatal(), and genfit::StateOnPlane::setPlane().

◆ extrapToPoint()

double genfit::RKTrackRep::extrapToPoint ( StateOnPlane state,
const TVector3 &  point,
const TMatrixDSym *  G = NULL,
bool  stopAtBoundary = false,
bool  calcJacobianNoise = false 
) const
privatevirtual

◆ get6DCov()

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

Get the 6D covariance.

Implements genfit::AbsTrackRep.

Definition at line 851 of file RKTrackRep.cc.

References transformPM6().

◆ getBackwardJacobianAndNoise()

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.

Definition at line 1001 of file RKTrackRep.cc.

References genfit::AbsTrackRep::debugLvl_, genfit::debugOut, ExtrapSteps_, fJacobian_, fNoise_, genfit::StateOnPlane::getState(), lastEndState_, lastStartState_, and genfit::Exception::setFatal().

◆ getCharge()

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.

Definition at line 859 of file RKTrackRep.cc.

References genfit::AbsTrackRep::getPDGCharge(), genfit::StateOnPlane::getState(), and genfit::Exception::setFatal().

Referenced by extrapolateBy(), extrapolateToCone(), extrapolateToCylinder(), extrapolateToLine(), extrapolateToPlane(), extrapolateToSphere(), extrapToPoint(), getMom(), getMomMag(), getMomVar(), getPosMom(), setPosMom(), setPosMomErr(), transformM6P(), and transformPM6().

◆ 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 138 of file RKTrackRep.h.

◆ getForwardJacobianAndNoise()

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.

Definition at line 977 of file RKTrackRep.cc.

References genfit::AbsTrackRep::debugLvl_, genfit::debugOut, fJacobian_, fNoise_, genfit::StateOnPlane::getState(), lastEndState_, and lastStartState_.

◆ getMom()

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

Get the cartesian momentum vector of a state.

Implements genfit::AbsTrackRep.

Definition at line 824 of file RKTrackRep.cc.

References getCharge(), and getState7().

◆ getMomMag()

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

get the magnitude of the momentum in GeV.

Implements genfit::AbsTrackRep.

Definition at line 877 of file RKTrackRep.cc.

References getCharge(), and genfit::StateOnPlane::getState().

◆ getMomVar()

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

get the variance of the absolute value of the momentum .

Implements genfit::AbsTrackRep.

Definition at line 885 of file RKTrackRep.cc.

References getCharge(), genfit::MeasuredStateOnPlane::getCov(), genfit::StateOnPlane::getState(), and genfit::Exception::setFatal().

◆ getPos()

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

Get the cartesian position of a state.

Implements genfit::AbsTrackRep.

Definition at line 816 of file RKTrackRep.cc.

References getState7().

Referenced by checkCache().

◆ getPosMom()

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.

Definition at line 834 of file RKTrackRep.cc.

References getCharge(), and getState7().

Referenced by getPosMomCov().

◆ getPosMomCov()

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.

Definition at line 844 of file RKTrackRep.cc.

References getPosMom(), and transformPM6().

◆ getQop()

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

Get charge over momentum.

Implements genfit::AbsTrackRep.

Definition at line 151 of file RKTrackRep.h.

References genfit::StateOnPlane::getState().

◆ getRadiationLenght()

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.

Definition at line 1061 of file RKTrackRep.cc.

References RKSteps_.

◆ getSpu()

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

◆ getState5()

void genfit::RKTrackRep::getState5 ( StateOnPlane state,
const M1x7 state7 
) const
private

◆ getState7()

void genfit::RKTrackRep::getState7 ( const StateOnPlane state,
M1x7 state7 
) const
private

◆ 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.

Definition at line 1041 of file RKTrackRep.cc.

References RKSteps_.

◆ getTime()

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

Get the time corresponding to the StateOnPlane. Extrapolation.

Implements genfit::AbsTrackRep.

Definition at line 921 of file RKTrackRep.cc.

References genfit::StateOnPlane::getAuxInfo().

Referenced by extrapolateToPlane().

◆ initArrays()

void genfit::RKTrackRep::initArrays ( ) const
private

◆ isSame()

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.

Definition at line 2720 of file RKTrackRep.cc.

References genfit::AbsTrackRep::getPDG(), and isSameType().

◆ isSameType()

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

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

Implements genfit::AbsTrackRep.

Definition at line 2712 of file RKTrackRep.cc.

Referenced by isSame().

◆ momMag()

double genfit::RKTrackRep::momMag ( const M1x7 state7) const
private

Definition at line 2706 of file RKTrackRep.cc.

◆ pocaOnLine()

TVector3 genfit::RKTrackRep::pocaOnLine ( const TVector3 &  linePoint,
const TVector3 &  lineDirection,
const TVector3 &  point 
) const
private

Definition at line 2348 of file RKTrackRep.cc.

Referenced by extrapolateToLine().

◆ 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). This is a single Runge-Kutta step. If jacobian is NULL, 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.

Definition at line 1272 of file RKTrackRep.cc.

References genfit::AbsTrackRep::debugLvl_, genfit::debugOut, genfit::FieldManager::getFieldVal(), and genfit::FieldManager::getInstance().

Referenced by estimateStep(), genfit::TGeoMaterialInterface::findNextBoundary(), RKutta(), and genfit::MaterialEffects::stepper().

◆ RKutta()

bool genfit::RKTrackRep::RKutta ( const M1x4 SU,
const DetPlane plane,
double  charge,
double  mass,
M1x7 state7,
M7x7 jacobianT,
M1x7 J_MMT_unprojected_lastRow,
double &  coveredDistance,
double &  flightTime,
bool &  checkJacProj,
M7x7 noiseProjection,
StepLimits limits,
bool  onlyOneStep = false,
bool  calcOnlyLastRowOfJ = false 
) const
private

Propagates the particle through the magnetic field.

If the propagation is successful and the plane is reached, the function returns true. Propagated state and the jacobian of the extrapolation are written to state7 and jacobianT. The jacobian is only calculated if jacobianT != NULL. In the main loop of the Runge Kutta algorithm, the estimateStep() is called and may reduce the estimated stepsize so that a maximum momentum loss will not be exceeded, and stop at material boundaries. If this is the case, RKutta() will only propagate the reduced distance and then return. This is to ensure that material effects, which are calculated after the propagation, are taken into account properly.

Definition at line 1852 of file RKTrackRep.cc.

References genfit::RKMatrix< nRows, nCols >::begin(), genfit::AbsTrackRep::debugLvl_, genfit::debugOut, estimateStep(), genfit::StepLimits::getLowestLimit(), MINSTEP, genfit::DetPlane::Print(), genfit::StepLimits::removeLimit(), RKPropagate(), RKSteps_, RKStepsFXStop_, genfit::Exception::setFatal(), genfit::stp_boundary, genfit::stp_fieldCurv, genfit::stp_momLoss, and genfit::stp_plane.

Referenced by Extrap().

◆ setChargeSign()

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

Set the sign of the charge according to charge.

Implements genfit::AbsTrackRep.

Definition at line 1246 of file RKTrackRep.cc.

References genfit::StateOnPlane::getState(), and genfit::Exception::setFatal().

◆ setPosMom() [1/2]

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

◆ setPosMom() [2/2]

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

Set position and momentum of state.

Implements genfit::AbsTrackRep.

Definition at line 1151 of file RKTrackRep.cc.

References setPosMom().

◆ setPosMomCov() [1/2]

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.

Definition at line 1202 of file RKTrackRep.cc.

References getState7(), setPosMom(), and transformM6P().

◆ setPosMomCov() [2/2]

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

Set position, momentum and covariance of state.

Implements genfit::AbsTrackRep.

Definition at line 1220 of file RKTrackRep.cc.

References getState7(), setPosMom(), and transformM6P().

◆ setPosMomErr()

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.

Definition at line 1160 of file RKTrackRep.cc.

References getCharge(), genfit::MeasuredStateOnPlane::getCov(), genfit::StateOnPlane::getPlane(), and setPosMom().

◆ setQop()

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

Set charge/momentum.

Implements genfit::AbsTrackRep.

Definition at line 170 of file RKTrackRep.h.

References genfit::StateOnPlane::getState().

◆ setSpu()

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

Definition at line 1260 of file RKTrackRep.cc.

References genfit::StateOnPlane::getAuxInfo().

Referenced by getState5(), and setPosMom().

◆ setTime()

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

Set time at which the state was defined.

Implements genfit::AbsTrackRep.

Definition at line 1265 of file RKTrackRep.cc.

References genfit::StateOnPlane::getAuxInfo().

Referenced by extrapolateToPlane().

◆ transformM6P()

void genfit::RKTrackRep::transformM6P ( const M6x6 in6x6,
const M1x7 state7,
MeasuredStateOnPlane state 
) const
private

◆ transformM7P()

void genfit::RKTrackRep::transformM7P ( const M7x7 in7x7,
const M1x7 state7,
MeasuredStateOnPlane state 
) const
private

◆ transformPM6()

void genfit::RKTrackRep::transformPM6 ( const MeasuredStateOnPlane state,
M6x6 out6x6 
) const
private

◆ transformPM7()

void genfit::RKTrackRep::transformPM7 ( const MeasuredStateOnPlane state,
M7x7 out7x7 
) const
private

Member Data Documentation

◆ cachePos_

unsigned int genfit::RKTrackRep::cachePos_
mutableprivate

use cached RKSteps_ for extrapolation

Definition at line 302 of file RKTrackRep.h.

Referenced by checkCache(), and estimateStep().

◆ ExtrapSteps_

std::vector<ExtrapStep> genfit::RKTrackRep::ExtrapSteps_
mutableprivate

◆ fJacobian_

TMatrixD genfit::RKTrackRep::fJacobian_
mutableprivate

steps made in Extrap during last extrapolation

Definition at line 298 of file RKTrackRep.h.

Referenced by calcForwardJacobianAndNoise(), Extrap(), getBackwardJacobianAndNoise(), getForwardJacobianAndNoise(), and initArrays().

◆ fNoise_

TMatrixDSym genfit::RKTrackRep::fNoise_
mutableprivate

◆ J_MMT_

M7x7 genfit::RKTrackRep::J_MMT_
mutableprivate

Definition at line 309 of file RKTrackRep.h.

Referenced by Extrap(), and initArrays().

◆ lastEndState_

StateOnPlane genfit::RKTrackRep::lastEndState_
mutableprivate

◆ lastStartState_

StateOnPlane genfit::RKTrackRep::lastStartState_
mutableprivate

◆ limits_

StepLimits genfit::RKTrackRep::limits_
mutableprivate

Definition at line 306 of file RKTrackRep.h.

Referenced by Extrap(), and initArrays().

◆ noiseArray_

M7x7 genfit::RKTrackRep::noiseArray_
mutableprivate

Definition at line 307 of file RKTrackRep.h.

Referenced by Extrap(), and initArrays().

◆ noiseProjection_

M7x7 genfit::RKTrackRep::noiseProjection_
mutableprivate

noise matrix of the last extrapolation

Definition at line 308 of file RKTrackRep.h.

Referenced by Extrap(), and initArrays().

◆ RKSteps_

std::vector<RKStep> genfit::RKTrackRep::RKSteps_
mutableprivate

state where the last extrapolation has ended

Definition at line 293 of file RKTrackRep.h.

Referenced by checkCache(), estimateStep(), Extrap(), getRadiationLenght(), getSteps(), initArrays(), and RKutta().

◆ RKStepsFXStart_

int genfit::RKTrackRep::RKStepsFXStart_
mutableprivate

RungeKutta steps made in the last extrapolation.

Definition at line 294 of file RKTrackRep.h.

Referenced by checkCache(), and Extrap().

◆ RKStepsFXStop_

int genfit::RKTrackRep::RKStepsFXStop_
mutableprivate

Definition at line 295 of file RKTrackRep.h.

Referenced by checkCache(), estimateStep(), Extrap(), and RKutta().

◆ useCache_

bool genfit::RKTrackRep::useCache_
mutableprivate

Definition at line 301 of file RKTrackRep.h.

Referenced by checkCache(), and estimateStep().


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