PandaRoot
RKTrackRep Class Reference

Track Representation module based on a Runge-Kutta algorithm including a full material model. More...

#include <RKTrackRep.h>

Inheritance diagram for RKTrackRep:
GFAbsTrackRep

Public Member Functions

 RKTrackRep ()
 
 RKTrackRep (const TVector3 &pos, const TVector3 &mom, const TVector3 &poserr, const TVector3 &momerr, const int &PDGCode)
 
 RKTrackRep (const GFTrackCand *aGFTrackCandPtr)
 
 RKTrackRep (const TVector3 &pos, const TVector3 &mom, const int &PDGCode)
 
 RKTrackRep (const GFDetPlane &pl, const TVector3 &mom, const int &PDGCode)
 
virtual ~RKTrackRep ()
 
virtual GFAbsTrackRepclone () const
 
virtual GFAbsTrackRepprototype () const
 
double extrapolate (const GFDetPlane &, TMatrixT< double > &statePred, TMatrixT< double > &covPred)
 returns the tracklength spanned in this extrapolation More...
 
double extrapolate (const GFDetPlane &, TMatrixT< double > &statePred)
 returns the tracklength spanned in this extrapolation More...
 
void extrapolateToPoint (const TVector3 &pos, TVector3 &poca, TVector3 &dirInPoca)
 This method is to extrapolate the track to point of closest approach to a point in space. More...
 
void extrapolateToLine (const TVector3 &point1, const TVector3 &point2, TVector3 &poca, TVector3 &dirInPoca, TVector3 &poca_onwire)
 This method extrapolates to the point of closest approach to a line. More...
 
double stepalong (double h, TVector3 &point, TVector3 &dir)
 make step of h cm along the track, returns the tracklength spanned in this extrapolation More...
 
TVector3 getPos (const GFDetPlane &)
 Returns position of the track in the plane. More...
 
TVector3 getMom (const GFDetPlane &)
 Returns momentum of the track in the plane. More...
 
void getPosMom (const GFDetPlane &, TVector3 &pos, TVector3 &mom)
 Gets position and momentum in the plane. More...
 
double getCharge () const
 Returns charge. More...
 
int getPDG ()
 
void switchDirection ()
 deprecated More...
 
void setPDG (int)
 Set PDG particle code. More...
 
void setData (const TMatrixT< double > &st, const GFDetPlane &pl, const TMatrixT< double > *cov=nullptr, const TMatrixT< double > *aux=nullptr)
 Sets state, plane and (optionally) covariance. More...
 
const TMatrixT< double > * getAuxInfo (const GFDetPlane &pl)
 Get auxillary information from the track representation. More...
 
bool hasAuxInfo ()
 See if the track representation has auxillary information stored. More...
 
void getPosMomCov (const GFDetPlane &pl, TVector3 &pos, TVector3 &mom, TMatrixT< double > &cov)
 method which gets position, momentum and 6x6 covariance matrix More...
 
- Public Member Functions inherited from GFAbsTrackRep
 GFAbsTrackRep ()
 
 GFAbsTrackRep (int)
 
virtual ~GFAbsTrackRep ()
 
double extrapolate (const GFDetPlane &plane)
 This changes the state and cov and plane of the rep. More...
 
unsigned int getDim () const
 returns dimension of state vector More...
 
virtual void Print () const
 
TMatrixT< double > getState () const
 
TMatrixT< double > getCov () const
 
double getStateElem (int i) const
 
double getCovElem (int i, int j) const
 
TVector3 getPos ()
 
TVector3 getMom ()
 
void getPosMomCov (TVector3 &pos, TVector3 &mom, TMatrixT< double > &c)
 
TMatrixT< double > getFirstState () const
 
TMatrixT< double > getFirstCov () const
 
GFDetPlane getFirstPlane () const
 
TMatrixT< double > getLastState () const
 
TMatrixT< double > getLastCov () const
 
GFDetPlane getLastPlane () const
 
double getChiSqu () const
 
double getRedChiSqu () const
 returns chi2/ndf More...
 
unsigned int getNDF () const
 
void setCov (const TMatrixT< double > &aCov)
 
void setFirstState (const TMatrixT< double > &aState)
 
void setFirstCov (const TMatrixT< double > &aCov)
 
void setFirstPlane (const GFDetPlane &aPlane)
 
void setLastState (const TMatrixT< double > &aState)
 
void setLastCov (const TMatrixT< double > &aCov)
 
void setLastPlane (const GFDetPlane &aPlane)
 
const GFDetPlanegetReferencePlane () const
 
void setChiSqu (double aChiSqu)
 
void setNDF (unsigned int n)
 
void addChiSqu (double aChiSqu)
 
void addNDF (unsigned int n)
 
void setStatusFlag (int _val)
 
bool setInverted (bool f=true)
 Deprecated. Should be removed soon. More...
 
bool getStatusFlag ()
 
virtual void reset ()
 

Additional Inherited Members

- Protected Attributes inherited from GFAbsTrackRep
unsigned int fDimension
 Dimensionality of track representation. More...
 
TMatrixT< double > fState
 The vector of track parameters. More...
 
TMatrixT< double > fCov
 The covariance matrix. More...
 
double fChiSqu
 chiSqu of the track fit More...
 
unsigned int fNdf
 
int fStatusFlag
 status of track representation: 0 means everything's OK More...
 
bool fInverted
 specifies the direction of flight of the particle More...
 
TMatrixT< double > fFirstState
 state, cov and plane for first and last point in fit More...
 
TMatrixT< double > fFirstCov
 
TMatrixT< double > fLastState
 
TMatrixT< double > fLastCov
 
GFDetPlane fFirstPlane
 
GFDetPlane fLastPlane
 
GFDetPlane fRefPlane
 

Detailed Description

Track Representation module based on a Runge-Kutta algorithm including a full material model.

Author
Christian Höppner (Technische Universität München, original author)
Johannes Rauch (Technische Universität München, author)

The Runge Kutta implementation stems from GEANT3 originally (R. Brun et al.). Porting to C goes back to Igor Gavrilenko @ CERN. The code was taken from the Phast analysis package of the COMPASS experiment (Sergei Gerrassimov @ CERN).

Definition at line 46 of file tracking/GenfitTools/trackrep/RKTrackRep/RKTrackRep.h.

Constructor & Destructor Documentation

◆ RKTrackRep() [1/5]

RKTrackRep::RKTrackRep ( )

Referenced by clone(), and prototype().

◆ RKTrackRep() [2/5]

RKTrackRep::RKTrackRep ( const TVector3 &  pos,
const TVector3 &  mom,
const TVector3 &  poserr,
const TVector3 &  momerr,
const int &  PDGCode 
)

◆ RKTrackRep() [3/5]

RKTrackRep::RKTrackRep ( const GFTrackCand aGFTrackCandPtr)

◆ RKTrackRep() [4/5]

RKTrackRep::RKTrackRep ( const TVector3 &  pos,
const TVector3 &  mom,
const int &  PDGCode 
)

◆ RKTrackRep() [5/5]

RKTrackRep::RKTrackRep ( const GFDetPlane pl,
const TVector3 &  mom,
const int &  PDGCode 
)

◆ ~RKTrackRep()

virtual RKTrackRep::~RKTrackRep ( )
virtual

Member Function Documentation

◆ clone()

virtual GFAbsTrackRep* RKTrackRep::clone ( ) const
inlinevirtual

Implements GFAbsTrackRep.

Definition at line 61 of file tracking/GenfitTools/trackrep/RKTrackRep/RKTrackRep.h.

References RKTrackRep().

61 { return new RKTrackRep(*this); }

◆ extrapolate() [1/2]

double RKTrackRep::extrapolate ( const GFDetPlane ,
TMatrixT< double > &  statePred,
TMatrixT< double > &  covPred 
)
virtual

returns the tracklength spanned in this extrapolation

The covariance matrix is transformed from the plane coordinate system to the master reference system (for the propagation) and, after propagation, back to the plane coordinate system.
Also the parameter spu (which is +1 or -1 and indicates the direction of the particle) is calculated and stored in #fCacheSpu. The plane is stored in #fCachePlane.
Master reference system (MARS):

\begin{eqnarray*}x & = & O_{x}+uU_{x}+vV_{x}\\y & = & O_{y}+uU_{y}+vV_{y}\\z & = & O_{z}+uU_{z}+vV_{z}\\a_{x} & = & \frac{\mbox{spu}}{\widetilde{p}}\left(N_{x}+u\prime U_{x}+v\prime V_{x}\right)\\a_{y} & = & \frac{\mbox{spu}}{\widetilde{p}}\left(N_{y}+u\prime U_{y}+v\prime V_{y}\right)\\a_{z} & = & \frac{\mbox{spu}}{\widetilde{p}}\left(N_{z}+u\prime U_{z}+v\prime V_{z}\right)\\\frac{q}{p} & = & \frac{q}{p}\end{eqnarray*}

Plane coordinate system:

\begin{eqnarray*}u & = & \left(x-O_{x}\right)U_{x}+\left(y-O_{y}\right)U_{y}+\left(z-O_{z}\right)U_{z}\\v & = & \left(x-O_{x}\right)U_{x}+\left(y-O_{y}\right)U_{y}+\left(z-O_{z}\right)U_{z}\\u\prime & = & \frac{a_{x}U_{x}+a_{y}U_{y}+a_{z}U_{z}}{a_{x}N_{x}+a_{y}N_{y}+a_{z}N_{z}}\\v\prime & = & \frac{a_{x}V_{x}+a_{y}V_{y}+a_{z}V_{z}}{a_{x}N_{x}+a_{y}N_{y}+a_{z}N_{z}}\\\frac{q}{p} & = & \frac{q}{p}\\\mbox{spu} & = & \frac{a_{x}N_{x}+a_{y}N_{y}+a_{z}N_{z}}{|a_{x}^{2}N_{x}^{2}+a_{y}^{2}N_{y}^{2}+a_{z}^{2}N_{z}^{2}|}=\pm1\end{eqnarray*}

Jacobians:
\(J_{p,M}=\left(\begin{array}{ccccc}\frac{\partial x}{\partial u} & \frac{\partial x}{\partial v} & \frac{\partial x}{\partial u\prime} & \frac{\partial x}{\partial v\prime} & \frac{\partial x}{\partial\frac{q}{p}}\\\frac{\partial y}{\partial u} & \frac{\partial y}{\partial v} & \frac{\partial y}{\partial u\prime} & \frac{\partial y}{\partial v\prime} & \frac{\partial y}{\partial\frac{q}{p}}\\\frac{\partial z}{\partial u} & \frac{\partial z}{\partial v} & \frac{\partial z}{\partial u\prime} & \frac{\partial z}{\partial v\prime} & \frac{\partial z}{\partial\frac{q}{p}}\\\frac{\partial a_{x}}{\partial u} & \frac{\partial a_{x}}{\partial v} & \frac{\partial a_{x}}{\partial u\prime} & \frac{\partial a_{x}}{\partial v\prime} & \frac{\partial a_{x}}{\partial\frac{q}{p}}\\\frac{\partial a_{y}}{\partial u} & \frac{\partial a_{y}}{\partial v} & \frac{\partial a_{y}}{\partial u\prime} & \frac{\partial a_{y}}{\partial v\prime} & \frac{\partial a_{y}}{\partial\frac{q}{p}}\\\frac{\partial a_{z}}{\partial u} & \frac{\partial a_{z}}{\partial v} & \frac{\partial a_{z}}{\partial u\prime} & \frac{\partial a_{z}}{\partial v\prime} & \frac{\partial a_{z}}{\partial\frac{q}{p}}\\\frac{\partial\frac{q}{p}}{\partial u} & \frac{\partial\frac{q}{p}}{\partial v} & \frac{\partial\frac{q}{p}}{\partial u\prime} & \frac{\partial\frac{q}{p}}{\partial v\prime} & \frac{\partial\frac{q}{p}}{\partial\frac{q}{p}}\end{array}\right)\)

\(J_{p,M}=\left(\begin{array}{cccccc}U_{x} & V_{x} & 0 & 0 & 0\\U_{y} & V_{y} & 0 & 0 & 0\\U_{z} & V_{z} & 0 & 0 & 0\\0 & 0 & \left\{ \frac{\textrm{spu}}{\widetilde{p}}U_{x}-\left[\frac{\textrm{spu}}{\widetilde{p}^{3}}\widetilde{p}_{x}\left(U_{x}\widetilde{p}_{x}+U_{y}\widetilde{p}_{y}+U_{z}\widetilde{p}_{z}\right)\right]\right\} & \left\{ \frac{\textrm{spu}}{\widetilde{p}}V_{x}-\left[\frac{\textrm{spu}}{\widetilde{p}^{3}}\widetilde{p}_{x}\left(V_{x}\widetilde{p}_{x}+V_{y}\widetilde{p}_{y}+V_{z}\widetilde{p}_{z}\right)\right]\right\} & 0\\0 & 0 & \left\{ \frac{\textrm{spu}}{\widetilde{p}}U_{y}-\left[\frac{\textrm{spu}}{\widetilde{p}^{3}}\widetilde{p}_{y}\left(U_{x}\widetilde{p}_{x}+U_{y}\widetilde{p}_{y}+U_{z}\widetilde{p}_{z}\right)\right]\right\} & \left\{ \frac{\textrm{spu}}{\widetilde{p}}V_{y}-\left[\frac{\textrm{spu}}{\widetilde{p}^{3}}\widetilde{p}_{y}\left(V_{x}\widetilde{p}_{x}+V_{y}\widetilde{p}_{y}+V_{z}\widetilde{p}_{z}\right)\right]\right\} & 0\\0 & 0 & \left\{ \frac{\textrm{spu}}{\widetilde{p}}U_{z}-\left[\frac{\textrm{spu}}{\widetilde{p}^{3}}\widetilde{p}_{z}\left(U_{x}\widetilde{p}_{x}+U_{y}\widetilde{p}_{y}+U_{z}\widetilde{p}_{z}\right)\right]\right\} & \left\{ \frac{\textrm{spu}}{\widetilde{p}}V_{z}-\left[\frac{\textrm{spu}}{\widetilde{p}^{3}}\widetilde{p}_{z}\left(V_{x}\widetilde{p}_{x}+V_{y}\widetilde{p}_{y}+V_{z}\widetilde{p}_{z}\right)\right]\right\} & 0\\0 & 0 & 0 & 0 & 1\end{array}\right)\)

with

\begin{eqnarray*}\widetilde{p} & = & \sqrt{\widetilde{p}_{x}^{2}+\widetilde{p}_{y}^{2}+\widetilde{p}_{z}^{2}}\\\widetilde{p}_{x} & = & \textrm{spu}\left(N_{x}+u\prime U_{x}+v\prime V_{x}\right)\\\widetilde{p}_{y} & = & \textrm{spu}\left(N_{y}+u\prime U_{y}+v\prime V_{y}\right)\\\widetilde{p}_{z} & = & \textrm{spu}\left(N_{z}+u\prime U_{z}+v\prime V_{z}\right)\end{eqnarray*}

\(J_{M,p}=\left(\begin{array}{ccccccc}\frac{\partial u}{\partial x} & \frac{\partial u}{\partial y} & \frac{\partial u}{\partial z} & \frac{\partial u}{\partial a_{x}} & \frac{\partial u}{\partial a_{y}} & \frac{\partial u}{\partial a_{z}} & \frac{\partial u}{\partial\frac{q}{p}}\\\frac{\partial v}{\partial x} & \frac{\partial v}{\partial y} & \frac{\partial v}{\partial z} & \frac{\partial v}{\partial a_{x}} & \frac{\partial v}{\partial a_{y}} & \frac{\partial v}{\partial a_{z}} & \frac{\partial v}{\partial\frac{q}{p}}\\\frac{\partial u\prime}{\partial x} & \frac{\partial u\prime}{\partial y} & \frac{\partial u\prime}{\partial z} & \frac{\partial u\prime}{\partial a_{x}} & \frac{\partial u\prime}{\partial a_{y}} & \frac{\partial u\prime}{\partial a_{z}} & \frac{\partial u\prime}{\partial\frac{q}{p}}\\\frac{\partial v\prime}{\partial x} & \frac{\partial v\prime}{\partial y} & \frac{\partial v\prime}{\partial z} & \frac{\partial v\prime}{\partial a_{x}} & \frac{\partial v\prime}{\partial a_{y}} & \frac{\partial v\prime}{\partial a_{z}} & \frac{\partial v\prime}{\partial\frac{q}{p}}\\ \frac{\partial\frac{q}{p}}{\partial x} & \frac{\partial\frac{q}{p}}{\partial y} & \frac{\partial\frac{q}{p}}{\partial z} & \frac{\partial\frac{q}{p}}{\partial a_{x}} & \frac{\partial\frac{q}{p}}{\partial a_{y}} & \frac{\partial\frac{q}{p}}{\partial a_{z}} & \frac{\partial\frac{q}{p}}{\partial\frac{q}{p}}\\ \\\end{array}\right)\)

\(J_{M,p}=\left(\begin{array}{ccccccc} U_{x} & U_{y} & U_{z} & 0 & 0 & 0 & 0\\ V_{x} & V_{y} & V_{z} & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & \frac{U_{x}\left(a_{y}N_{y}+a_{z}N_{z}\right)-N_{x}\left(a_{y}U_{y}+a_{z}U_{z}\right)}{\left(a_{x}N_{x}+a_{y}N_{y}+a_{z}N_{z}\right)^{2}} & \frac{U_{y}\left(a_{x}N_{x}+a_{z}N_{z}\right)-N_{y}\left(a_{x}U_{x}+a_{z}U_{z}\right)}{\left(a_{x}N_{x}+a_{y}N_{y}+a_{z}N_{z}\right)^{2}} & \frac{U_{z}\left(a_{x}N_{x}+a_{y}N_{y}\right)-N_{z}\left(a_{x}U_{x}+a_{y}U_{y}\right)}{\left(a_{x}N_{x}+a_{y}N_{y}+a_{z}N_{z}\right)^{2}} & 0\\ 0 & 0 & 0 & \frac{V_{x}\left(a_{y}N_{y}+a_{z}N_{z}\right)-N_{x}\left(a_{y}V_{y}+a_{z}V_{z}\right)}{\left(a_{x}N_{x}+a_{y}N_{y}+a_{z}N_{z}\right)^{2}} & \frac{V_{y}\left(a_{x}N_{x}+a_{z}N_{z}\right)-N_{y}\left(a_{x}V_{x}+a_{z}V_{z}\right)}{\left(a_{x}N_{x}+a_{y}N_{y}+a_{z}N_{z}\right)^{2}} & \frac{V_{z}\left(a_{x}N_{x}+a_{y}N_{y}\right)-N_{z}\left(a_{x}V_{x}+a_{y}V_{y}\right)}{\left(a_{x}N_{x}+a_{y}N_{y}+a_{z}N_{z}\right)^{2}} & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 1\\ \\\end{array}\right)\)

Implements GFAbsTrackRep.

Referenced by prototype().

◆ extrapolate() [2/2]

double RKTrackRep::extrapolate ( const GFDetPlane ,
TMatrixT< double > &  statePred 
)
virtual

returns the tracklength spanned in this extrapolation

Reimplemented from GFAbsTrackRep.

◆ extrapolateToLine()

void RKTrackRep::extrapolateToLine ( const TVector3 &  point1,
const TVector3 &  point2,
TVector3 &  poca,
TVector3 &  dirInPoca,
TVector3 &  poca_onwire 
)
virtual

This method extrapolates to the point of closest approach to a line.

Reimplemented from GFAbsTrackRep.

Referenced by prototype().

◆ extrapolateToPoint()

void RKTrackRep::extrapolateToPoint ( const TVector3 &  pos,
TVector3 &  poca,
TVector3 &  dirInPoca 
)
virtual

This method is to extrapolate the track to point of closest approach to a point in space.

Reimplemented from GFAbsTrackRep.

Referenced by prototype().

◆ getAuxInfo()

const TMatrixT<double>* RKTrackRep::getAuxInfo ( const GFDetPlane )
virtual

Get auxillary information from the track representation.

AuxInfo is a mechanism which allows creators of track repersentations to hand out any information they like (as long as it is compatible with a TMatrixT<double>). It should be used if setData requires additional information to update the representation, but it can also be used for debugging information if needed. See also the documentation of GFAbsTrackRep::setData().

Reimplemented from GFAbsTrackRep.

Referenced by switchDirection().

◆ getCharge()

double RKTrackRep::getCharge ( ) const
inlinevirtual

Returns charge.

Implements GFAbsTrackRep.

Definition at line 161 of file tracking/GenfitTools/trackrep/RKTrackRep/RKTrackRep.h.

161 { return fCharge; }

◆ getMom()

TVector3 RKTrackRep::getMom ( const GFDetPlane )
virtual

Returns momentum of the track in the plane.

If GFDetPlane equals the reference plane fRefPlane, returns current momentum; otherwise it extrapolates the track to the plane and returns the momentum.

Implements GFAbsTrackRep.

◆ getPDG()

int RKTrackRep::getPDG ( )
inline

Definition at line 163 of file tracking/GenfitTools/trackrep/RKTrackRep/RKTrackRep.h.

163 { return fPdg; };

◆ getPos()

TVector3 RKTrackRep::getPos ( const GFDetPlane )
virtual

Returns position of the track in the plane.

If GFDetPlane equals the reference plane fRefPlane, returns current position; otherwise it extrapolates the track to the plane and returns the position.

Implements GFAbsTrackRep.

◆ getPosMom()

void RKTrackRep::getPosMom ( const GFDetPlane ,
TVector3 &  pos,
TVector3 &  mom 
)
virtual

Gets position and momentum in the plane.

If GFDetPlane equals the reference plane fRefPlane, it gets current position and momentum; otherwise it extrapolates the track to the plane and gets the position and momentum.

Implements GFAbsTrackRep.

Referenced by prototype().

◆ getPosMomCov()

void RKTrackRep::getPosMomCov ( const GFDetPlane pl,
TVector3 &  pos,
TVector3 &  mom,
TMatrixT< double > &  cov 
)
virtual

method which gets position, momentum and 6x6 covariance matrix

default implementation in cxx file, if a ConcreteTrackRep can not implement this functionality

Reimplemented from GFAbsTrackRep.

Referenced by hasAuxInfo().

◆ hasAuxInfo()

bool RKTrackRep::hasAuxInfo ( )
inlinevirtual

See if the track representation has auxillary information stored.

See if auxillary information is stored in the track representation. See the documentation of GFAbsTrackRep::getAuxInfo() for details.

Reimplemented from GFAbsTrackRep.

Definition at line 179 of file tracking/GenfitTools/trackrep/RKTrackRep/RKTrackRep.h.

References getPosMomCov().

179 { return true; }

◆ prototype()

virtual GFAbsTrackRep* RKTrackRep::prototype ( ) const
inlinevirtual

◆ setData()

void RKTrackRep::setData ( const TMatrixT< double > &  st,
const GFDetPlane pl,
const TMatrixT< double > *  cov = nullptr,
const TMatrixT< double > *  aux = nullptr 
)
virtual

Sets state, plane and (optionally) covariance.

This function also sets the parameter #fSpu to the value stored in #fCacheSpu. Therefore it has to be ensured that the plane #pl is the same as the plane of the last extrapolation (i.e. #fCachePlane), where #fCacheSpu was calculated. Hence, if the argument #pl is not equal to #fCachePlane, an error message is shown an an exception is thrown.

Reimplemented from GFAbsTrackRep.

Referenced by switchDirection().

◆ setPDG()

void RKTrackRep::setPDG ( int  )

Set PDG particle code.

Referenced by switchDirection().

◆ stepalong()

double RKTrackRep::stepalong ( double  h,
TVector3 &  point,
TVector3 &  dir 
)
virtual

make step of h cm along the track, returns the tracklength spanned in this extrapolation

Also returns the position and direction by reference. It does NOT alter the state of the trackrep and starts extrapolating from fRefPlane.

Reimplemented from GFAbsTrackRep.

Referenced by prototype().

◆ switchDirection()

void RKTrackRep::switchDirection ( )
inlinevirtual

deprecated

Implements GFAbsTrackRep.

Definition at line 166 of file tracking/GenfitTools/trackrep/RKTrackRep/RKTrackRep.h.

References getAuxInfo(), setData(), and setPDG().

166 { fDirection = (!fDirection); }

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