24#ifndef genfit_RKTrackRep_h
25#define genfit_RKTrackRep_h
44 memset(
state7_, 0x00, 7*
sizeof(
double));
84 bool stopAtBoundary =
false,
85 bool calcJacobianNoise =
false)
const;
90 const TVector3& linePoint,
91 const TVector3& lineDirection,
92 bool stopAtBoundary =
false,
93 bool calcJacobianNoise =
false)
const;
96 const TVector3& point,
97 bool stopAtBoundary =
false,
98 bool calcJacobianNoise =
false)
const {
99 return extrapToPoint(state, point, NULL, stopAtBoundary, calcJacobianNoise);
103 const TVector3& point,
104 const TMatrixDSym& G,
105 bool stopAtBoundary =
false,
106 bool calcJacobianNoise =
false)
const {
107 return extrapToPoint(state, point, &G, stopAtBoundary, calcJacobianNoise);
112 const TVector3& linePoint = TVector3(0.,0.,0.),
113 const TVector3& lineDirection = TVector3(0.,0.,1.),
114 bool stopAtBoundary =
false,
115 bool calcJacobianNoise =
false)
const;
119 const TVector3& point = TVector3(0.,0.,0.),
120 bool stopAtBoundary =
false,
121 bool calcJacobianNoise =
false)
const;
125 bool stopAtBoundary =
false,
126 bool calcJacobianNoise =
false)
const;
149 std::vector<genfit::MatStep>
getSteps()
const;
153 virtual double getTOF()
const;
179 bool varField =
true,
180 bool calcOnlyLastRowOfJ =
false)
const;
190 const TVector3& point,
191 const TMatrixDSym* G = NULL,
192 bool stopAtBoundary =
false,
193 bool calcJacobianNoise =
false)
const;
201 void calcJ_pM_5x7(
M5x7& J_pM,
const TVector3& U,
const TVector3& V,
const M1x3& pTilde,
double spu)
const;
210 void calcJ_Mp_7x5(
M7x5& J_Mp,
const TVector3& U,
const TVector3& V,
const TVector3& W,
const M1x3& A)
const;
213 const M1x7& destState7,
const DetPlane& destPlane)
const;
234 double& coveredDistance,
236 M7x7& noiseProjection,
238 bool onlyOneStep =
false,
239 bool calcOnlyLastRowOfJ =
false)
const;
244 const double& charge,
248 TVector3
pocaOnLine(
const TVector3& linePoint,
249 const TVector3& lineDirection,
250 const TVector3& point)
const;
266 bool fillExtrapSteps,
267 TMatrixDSym* cov =
nullptr,
268 bool onlyOneStep =
false,
269 bool stopAtBoundary =
false,
270 double maxStep = 1.E99)
const;
Abstract base class for a track representation.
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,...
StateOnPlane with additional covariance matrix.
AbsTrackRep with 5D track parameterization in plane coordinates: (q/p, u', v', u, v)
virtual TVector3 getMom(const StateOnPlane &state) const
Get the cartesian momentum vector of a state.
std::vector< RKStep > RKSteps_
state where the last extrapolation has ended
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.
void calcJ_Mp_7x5(M7x5 &J_Mp, const TVector3 &U, const TVector3 &V, const TVector3 &W, const M1x3 &A) const
std::vector< ExtrapStep > ExtrapSteps_
double getSpu(const StateOnPlane &state) const
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 di...
virtual void setQop(StateOnPlane &state, double qop) const
Set charge/momentum.
M7x7 noiseProjection_
noise matrix of the last extrapolation
virtual void setChargeSign(StateOnPlane &state, double charge) const
Set the sign of the charge according to charge.
int RKStepsFXStart_
RungeKutta steps made in the last extrapolation.
double estimateStep(const M1x7 &state7, const M1x4 &SU, const DetPlane &plane, const double &charge, double &relMomLoss, StepLimits &limits) const
virtual double getQop(const StateOnPlane &state) const
Get charge over momentum.
void setSpu(StateOnPlane &state, double spu) const
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 ...
virtual void getPosMom(const StateOnPlane &state, TVector3 &pos, TVector3 &mom) const
Get cartesian position and momentum vector of a state.
void calcForwardJacobianAndNoise(const M1x7 &startState7, const DetPlane &startPlane, const M1x7 &destState7, const DetPlane &destPlane) const
double Extrap(const DetPlane &startPlane, const DetPlane &destPlane, double charge, bool &isAtBoundary, M1x7 &state7, bool fillExtrapSteps, TMatrixDSym *cov=nullptr, bool onlyOneStep=false, bool stopAtBoundary=false, double maxStep=1.E99) const
Handles propagation and material effects.
bool RKutta(const M1x4 &SU, const DetPlane &plane, double charge, M1x7 &state7, M7x7 *jacobianT, double &coveredDistance, bool &checkJacProj, M7x7 &noiseProjection, StepLimits &limits, bool onlyOneStep=false, bool calcOnlyLastRowOfJ=false) const
Propagates the particle through the magnetic field.
double momMag(const M1x7 &state7) const
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,...
void transformPM7(const MeasuredStateOnPlane &state, M7x7 &out7x7) const
virtual TMatrixDSym get6DCov(const MeasuredStateOnPlane &state) const
Get the 6D covariance.
void getState7(const StateOnPlane &state, M1x7 &state7) const
void transformM7P(const M7x7 &in7x7, const M1x7 &state7, MeasuredStateOnPlane &state) const
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,...
std::vector< genfit::MatStep > getSteps() const
Get stepsizes and material properties of crossed materials of the last extrapolation.
virtual double extrapToPoint(StateOnPlane &state, const TVector3 &point, const TMatrixDSym *G=NULL, bool stopAtBoundary=false, bool calcJacobianNoise=false) const
virtual void setPosMom(StateOnPlane &state, const TVector3 &pos, const TVector3 &mom) const
Set position and momentum of state.
virtual double getTOF() const
Get the time of flight [ns] of the last extrapolation.
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,...
void transformPM6(const MeasuredStateOnPlane &state, M6x6 &out6x6) const
void checkCache(const StateOnPlane &state, const SharedPlanePtr *plane) const
virtual void setPosMomCov(MeasuredStateOnPlane &state, const TVector3 &pos, const TVector3 &mom, const TMatrixDSym &cov6x6) const
Set position, momentum and covariance of state.
StateOnPlane lastStartState_
unsigned int getDim() const
Get the dimension of the state vector used by the track representation.
virtual bool isSame(const AbsTrackRep *other)
check if other is of same type (e.g. RKTrackRep) and has same pdg code.
virtual void getForwardJacobianAndNoise(TMatrixD &jacobian, TMatrixDSym &noise, TVectorD &deltaState) const
Get the jacobian and noise matrix of the last extrapolation.
virtual double getRadiationLenght() const
Get the accumulated X/X0 (path / radiation length) of the material crossed in the last extrapolation.
TMatrixD fJacobian_
steps made in Extrap during last extrapolation
virtual double getMomVar(const MeasuredStateOnPlane &state) const
get the variance of the absolute value of the momentum .
unsigned int cachePos_
use cached RKSteps_ for extrapolation
void calcJ_pM_5x7(M5x7 &J_pM, const TVector3 &U, const TVector3 &V, const M1x3 &pTilde, double spu) const
virtual double getMomMag(const StateOnPlane &state) const
get the magnitude of the momentum in GeV.
void getState5(StateOnPlane &state, const M1x7 &state7) const
virtual AbsTrackRep * clone() const
Clone the trackRep.
virtual void getPosMomCov(const MeasuredStateOnPlane &state, TVector3 &pos, TVector3 &mom, TMatrixDSym &cov) const
Translates MeasuredStateOnPlane into 3D position, momentum and 6x6 covariance.
TVector3 pocaOnLine(const TVector3 &linePoint, const TVector3 &lineDirection, const TVector3 &point) const
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 lengt...
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,...
virtual TVector3 getPos(const StateOnPlane &state) const
Get the cartesian position of a state.
void transformM6P(const M6x6 &in6x6, const M1x7 &state7, MeasuredStateOnPlane &state) const
StateOnPlane lastEndState_
state where the last extrapolation has started
virtual bool isSameType(const AbsTrackRep *other)
check if other is of same type (e.g. RKTrackRep).
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,...
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,...
double RKPropagate(M1x7 &state7, M7x7 *jacobian, M1x3 &SA, double S, bool varField=true, bool calcOnlyLastRowOfJ=false) const
The actual Runge Kutta propagation.
A state with arbitrary dimension defined in a DetPlane.
const TVectorD & getState() const
Helper to store different limits on the stepsize for the RKTRackRep.
boost::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.
Simple struct containing MaterialProperties and stepsize in the material.