23 #ifndef genfit_AbsTrackRep_h
24 #define genfit_AbsTrackRep_h
26 #include "SharedPlanePtr.h"
34 #include <TMatrixDSym.h>
90 bool stopAtBoundary =
false,
91 bool calcJacobianNoise =
false)
const = 0;
103 const TVector3& linePoint,
104 const TVector3& lineDirection,
105 bool stopAtBoundary =
false,
106 bool calcJacobianNoise =
false)
const = 0;
121 const TVector3& point1,
122 const TVector3& point2,
125 TVector3& poca_onwire,
126 bool stopAtBoundary =
false,
127 bool calcJacobianNoise =
false)
const {
128 TVector3 wireDir(point2 - point1);
129 wireDir = wireDir.Unit();
130 double retval = this->
extrapolateToLine(state, point1, wireDir, stopAtBoundary, calcJacobianNoise);
131 poca = this->
getPos(state);
132 dirInPoca = this->
getMom(state);
133 dirInPoca = dirInPoca.Unit();
135 poca_onwire = point1 + wireDir*((poca - point1)*wireDir);
150 const TVector3& point,
151 bool stopAtBoundary =
false,
152 bool calcJacobianNoise =
false)
const = 0;
164 const TVector3& point,
165 const TMatrixDSym& G,
166 bool stopAtBoundary =
false,
167 bool calcJacobianNoise =
false)
const = 0;
180 const TVector3& linePoint = TVector3(0.,0.,0.),
181 const TVector3& lineDirection = TVector3(0.,0.,1.),
182 bool stopAtBoundary =
false,
183 bool calcJacobianNoise =
false)
const = 0;
196 const TVector3& linePoint = TVector3(0.,0.,0.),
197 const TVector3& lineDirection = TVector3(0.,0.,1.),
198 bool stopAtBoundary =
false,
199 bool calcJacobianNoise =
false)
const = 0;
212 const TVector3& point = TVector3(0.,0.,0.),
213 bool stopAtBoundary =
false,
214 bool calcJacobianNoise =
false)
const = 0;
227 bool stopAtBoundary =
false,
228 bool calcJacobianNoise =
false)
const = 0;
233 bool stopAtBoundary =
false,
234 bool calcJacobianNoise =
false)
const;
297 virtual std::vector<genfit::MatStep>
getSteps()
const = 0;
312 TMatrixD& jacobian)
const;
351 virtual void setDebugLvl(
unsigned int lvl = 1) {debugLvl_ = lvl;}
353 virtual void Print(
const Option_t* =
"")
const;
368 unsigned int debugLvl_;
Contains the measurement and covariance in raw detector coordinates.
Abstract base class for a track representation.
virtual void setTime(StateOnPlane &state, double time) const =0
Set time at which the state was defined.
double extrapolateToMeasurement(StateOnPlane &state, const AbsMeasurement *measurement, bool stopAtBoundary=false, bool calcJacobianNoise=false) const
extrapolate to an AbsMeasurement
virtual unsigned int getDim() const =0
Get the dimension of the state vector used by the track representation.
virtual void setPosMomCov(MeasuredStateOnPlane &state, const TVector3 &pos, const TVector3 &mom, const TMatrixDSym &cov6x6) const =0
Set position, momentum and covariance of state.
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,...
virtual TVectorD get6DState(const StateOnPlane &state) const
Get the 6D state vector (x, y, z, p_x, p_y, p_z).
virtual bool isSameType(const AbsTrackRep *other)=0
check if other is of same type (e.g. RKTrackRep).
virtual double getTime(const StateOnPlane &) const =0
Get the time corresponding to the StateOnPlane. Extrapolation.
bool switchPDGSign()
try to multiply pdg code with -1. (Switch from particle to anti-particle and vice versa).
virtual double extrapolateToPoint(StateOnPlane &state, const TVector3 &point, bool stopAtBoundary=false, bool calcJacobianNoise=false) const =0
Extrapolates the state to the POCA to a point, and returns the extrapolation length and,...
char getPropDir() const
Get propagation direction. (-1, 0, 1) -> (backward, auto, forward).
virtual TVector3 getMom(const StateOnPlane &state) const =0
Get the cartesian momentum vector of a state.
virtual double extrapolateToPoint(StateOnPlane &state, const TVector3 &point, const TMatrixDSym &G, bool stopAtBoundary=false, bool calcJacobianNoise=false) const =0
Extrapolates the state to the POCA to a point in the metric of G, and returns the extrapolation lengt...
AbsTrackRep & operator=(const AbsTrackRep &)
protect from calling assignment operator from outside the class. Use clone() instead!
double getPDGCharge() const
Get the charge of the particle of the pdg code.
double getMass(const StateOnPlane &state) const
Get tha particle mass in GeV/c^2.
virtual double getMomMag(const StateOnPlane &state) const =0
get the magnitude of the momentum in GeV.
virtual double getCharge(const StateOnPlane &state) const =0
Get the (fitted) charge of a state.
virtual double getQop(const StateOnPlane &state) const =0
Get charge over momentum.
void getPosDir(const StateOnPlane &state, TVector3 &pos, TVector3 &dir) const
Get cartesian position and direction vector of a state.
char propDir_
propagation direction (-1, 0, 1) -> (backward, auto, forward)
virtual void setPosMom(StateOnPlane &state, const TVectorD &state6) const =0
Set position and momentum of state.
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.
virtual void setChargeSign(StateOnPlane &state, double charge) const =0
Set the sign of the charge according to charge.
virtual void setQop(StateOnPlane &state, double qop) const =0
Set charge/momentum.
virtual void setPosMom(StateOnPlane &state, const TVector3 &pos, const TVector3 &mom) const =0
Set position and momentum of state.
int pdgCode_
Particle code.
virtual double extrapolateToSphere(StateOnPlane &state, double radius, const TVector3 &point=TVector3(0., 0., 0.), bool stopAtBoundary=false, bool calcJacobianNoise=false) const =0
Extrapolates the state to the sphere surface, and returns the extrapolation length and,...
virtual double getMomVar(const MeasuredStateOnPlane &state) const =0
get the variance of the absolute value of the momentum .
virtual void getForwardJacobianAndNoise(TMatrixD &jacobian, TMatrixDSym &noise, TVectorD &deltaState) const =0
Get the jacobian and noise matrix of the last extrapolation.
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 =0
Extrapolates the state to the cone surface, and returns the extrapolation length and,...
virtual bool isSame(const AbsTrackRep *other)=0
check if other is of same type (e.g. RKTrackRep) and has same pdg code.
virtual double extrapolateBy(StateOnPlane &state, double step, bool stopAtBoundary=false, bool calcJacobianNoise=false) const =0
Extrapolates the state by step (cm) and returns the extrapolation length and, via reference,...
virtual double extrapolateToPlane(StateOnPlane &state, const genfit::SharedPlanePtr &plane, bool stopAtBoundary=false, bool calcJacobianNoise=false) const =0
Extrapolates the state to plane, and returns the extrapolation length and, via reference,...
void switchPropDir()
Switch propagation direction. Has no effect if propDir_ is set to 0.
int getPDG() const
Get the pdg code.
TVector3 getDir(const StateOnPlane &state) const
Get the direction vector of a state.
virtual double getRadiationLenght() const =0
Get the accumulated X/X0 (path / radiation length) of the material crossed in the last extrapolation.
void setPropDir(int dir)
Set propagation direction. (-1, 0, 1) -> (backward, auto, forward).
virtual void setPosMomErr(MeasuredStateOnPlane &state, const TVector3 &pos, const TVector3 &mom, const TVector3 &posErr, const TVector3 &momErr) const =0
Set position and momentum and error of state.
virtual TVector3 getPos(const StateOnPlane &state) const =0
Get the cartesian position of a state.
virtual void getBackwardJacobianAndNoise(TMatrixD &jacobian, TMatrixDSym &noise, TVectorD &deltaState) const =0
Get the jacobian and noise matrix of the last extrapolation if it would have been done in opposite di...
void calcJacobianNumerically(const genfit::StateOnPlane &origState, const genfit::SharedPlanePtr destPlane, TMatrixD &jacobian) const
Calculate Jacobian of transportation numerically.
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 =0
Extrapolates the state to the cylinder surface, and returns the extrapolation length and,...
virtual void setPosMomCov(MeasuredStateOnPlane &state, const TVectorD &state6, const TMatrixDSym &cov6x6) const =0
Set position, momentum and covariance of state.
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.
virtual TMatrixDSym get6DCov(const MeasuredStateOnPlane &state) const =0
Get the 6D covariance.
virtual void getPosMomCov(const MeasuredStateOnPlane &state, TVector3 &pos, TVector3 &mom, TMatrixDSym &cov) const =0
Translates MeasuredStateOnPlane into 3D position, momentum and 6x6 covariance.
virtual std::vector< genfit::MatStep > getSteps() const =0
Get stepsizes and material properties of crossed materials of the last extrapolation.
virtual AbsTrackRep * clone() const =0
Clone the trackRep.
virtual void getPosMom(const StateOnPlane &state, TVector3 &pos, TVector3 &mom) const =0
Get cartesian position and momentum vector of a state.
#StateOnPlane with additional covariance matrix.
A state with arbitrary dimension defined in a DetPlane.
Defines for I/O streams used for error and debug printing.
std::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.
Simple struct containing MaterialProperties and stepsize in the material.