36 #ifndef genfit_RKTrackRep_h 37 #define genfit_RKTrackRep_h 54 RKStep() { memset(state7_, 0x00, 7 *
sizeof(
double)); }
66 memset(jac7_, 0,
sizeof(
M7x7));
67 memset(noise7_, 0,
sizeof(
M7x7));
88 virtual double extrapolateToPlane(
StateOnPlane &state,
const SharedPlanePtr &plane,
bool stopAtBoundary =
false,
bool calcJacobianNoise =
false)
const;
93 extrapolateToLine(
StateOnPlane &state,
const TVector3 &linePoint,
const TVector3 &lineDirection,
bool stopAtBoundary =
false,
bool calcJacobianNoise =
false)
const;
97 return extrapToPoint(state, point,
nullptr, stopAtBoundary, calcJacobianNoise);
101 const TMatrixDSym &G,
102 bool stopAtBoundary =
false,
bool calcJacobianNoise =
false)
const 104 return extrapToPoint(state, point, &G, stopAtBoundary, calcJacobianNoise);
107 virtual double extrapolateToCylinder(
StateOnPlane &state,
double radius,
const TVector3 &linePoint = TVector3(0., 0., 0.),
const TVector3 &lineDirection = TVector3(0., 0., 1.),
108 bool stopAtBoundary =
false,
bool calcJacobianNoise =
false)
const;
111 extrapolateToSphere(
StateOnPlane &state,
double radius,
const TVector3 &point = TVector3(0., 0., 0.),
bool stopAtBoundary =
false,
bool calcJacobianNoise =
false)
const;
113 virtual double extrapolateBy(
StateOnPlane &state,
double step,
bool stopAtBoundary =
false,
bool calcJacobianNoise =
false)
const;
115 unsigned int getDim()
const {
return 5; }
117 virtual TVector3 getPos(
const StateOnPlane &state)
const;
119 virtual TVector3 getMom(
const StateOnPlane &state)
const;
120 virtual void getPosMom(
const StateOnPlane &state, TVector3 &pos, TVector3 &mom)
const;
122 virtual double getMomMag(
const StateOnPlane &state)
const;
126 virtual void getPosMomCov(
const MeasuredStateOnPlane &state, TVector3 &pos, TVector3 &mom, TMatrixDSym &cov)
const;
127 virtual double getCharge(
const StateOnPlane &state)
const;
132 virtual void getForwardJacobianAndNoise(
TMatrixD &jacobian, TMatrixDSym &noise, TVectorD &deltaState)
const;
134 virtual void getBackwardJacobianAndNoise(
TMatrixD &jacobian, TMatrixDSym &noise, TVectorD &deltaState)
const;
136 std::vector<genfit::MatStep> getSteps()
const;
138 virtual double getRadiationLenght()
const;
140 virtual void setPosMom(
StateOnPlane &state,
const TVector3 &pos,
const TVector3 &mom)
const;
141 virtual void setPosMom(
StateOnPlane &state,
const TVectorD &state6)
const;
142 virtual void setPosMomErr(
MeasuredStateOnPlane &state,
const TVector3 &pos,
const TVector3 &mom,
const TVector3 &posErr,
const TVector3 &momErr)
const;
143 virtual void setPosMomCov(
MeasuredStateOnPlane &state,
const TVector3 &pos,
const TVector3 &mom,
const TMatrixDSym &cov6x6)
const;
144 virtual void setPosMomCov(
MeasuredStateOnPlane &state,
const TVectorD &state6,
const TMatrixDSym &cov6x6)
const;
146 virtual void setChargeSign(
StateOnPlane &state,
double charge)
const;
160 double RKPropagate(
M1x7 &state7,
M7x7 *jacobian,
M1x3 &SA,
double S,
bool varField =
true,
bool calcOnlyLastRowOfJ =
false)
const;
166 void initArrays()
const;
168 virtual double extrapToPoint(
StateOnPlane &state,
const TVector3 &point,
169 const TMatrixDSym *G =
nullptr,
170 bool stopAtBoundary =
false,
bool calcJacobianNoise =
false)
const;
177 void calcJ_pM_5x7(
M5x7 &J_pM,
const TVector3 &U,
const TVector3 &V,
const M1x3 &pTilde,
double spu)
const;
181 void transformM7P(
const M7x7 &in7x7,
const M1x7 &state7,
184 void calcJ_Mp_7x5(
M7x5 &J_Mp,
const TVector3 &U,
const TVector3 &V,
const TVector3 &W,
const M1x3 &A)
const;
186 void calcForwardJacobianAndNoise(
const M1x7 &startState7,
const DetPlane &startPlane,
const M1x7 &destState7,
const DetPlane &destPlane)
const;
188 void transformM6P(
const M6x6 &in6x6,
const M1x7 &state7,
201 bool RKutta(
const M1x4 &SU,
const DetPlane &plane,
double charge,
double mass,
M1x7 &state7,
M7x7 *jacobianT,
M1x7 *J_MMT_unprojected_lastRow,
202 double &coveredDistance,
203 double &flightTime,
bool &checkJacProj,
M7x7 &noiseProjection,
StepLimits &limits,
bool onlyOneStep =
false,
bool calcOnlyLastRowOfJ =
false)
const;
205 double estimateStep(
const M1x7 &state7,
const M1x4 &SU,
const DetPlane &plane,
const double &charge,
double &relMomLoss,
StepLimits &limits)
const;
207 TVector3 pocaOnLine(
const TVector3 &linePoint,
const TVector3 &lineDirection,
const TVector3 &point)
const;
218 double Extrap(
const DetPlane &startPlane,
220 double charge,
double mass,
bool &isAtBoundary,
M1x7 &state7,
double &flightTime,
bool fillExtrapSteps, TMatrixDSym *cov =
nullptr,
bool onlyOneStep =
false,
221 bool stopAtBoundary =
false,
double maxStep = 1.E99)
const;
225 double momMag(
const M1x7 &state7)
const;
229 mutable std::vector<RKStep> RKSteps_;
230 mutable int RKStepsFXStart_;
231 mutable int RKStepsFXStop_;
232 mutable std::vector<ExtrapStep> ExtrapSteps_;
235 mutable TMatrixDSym fNoise_;
237 mutable bool useCache_;
238 mutable unsigned int cachePos_;
243 mutable M7x7 noiseArray_;
244 mutable M7x7 noiseProjection_;
254 #endif // genfit_RKTrackRep_h const TVectorD & getState() const
Simple struct containing MaterialProperties and stepsize in the material.
Helper to store different limits on the stepsize for the RKTRackRep.
Abstract base class for a track representation.
StateOnPlane with additional covariance matrix.
virtual AbsTrackRep * clone() const
Clone the trackRep.
A state with arbitrary dimension defined in a DetPlane.
virtual void setQop(StateOnPlane &state, double qop) const
Set charge/momentum.
boost::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.
virtual double getQop(const StateOnPlane &state) const
Get charge over momentum.
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 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...
AbsTrackRep with 5D track parameterization in plane coordinates: (q/p, u', v', u, v) ...
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...
TMatrixT< double > TMatrixD
unsigned int getDim() const
Get the dimension of the state vector used by the track representation.