EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GFTools Namespace Reference

Namespace for various tools, mainly smoothing. More...

Functions

TMatrixT< double > getSmoothedPos (const GFTrack *trk, unsigned int irep, unsigned int ihit)
 Get smoothed track position in plane coordinates.
 
TVector3 getSmoothedPosXYZ (const GFTrack *trk, unsigned int irep, unsigned int ihit, bool *ret=0)
 Get smoothed track position in global coordinates.
 
TVector3 getBiasedSmoothedPosXYZ (const GFTrack *trk, unsigned int irep, unsigned int ihit, bool *ret=0)
 
TVector3 getBiasedSmoothedMomXYZ (const GFTrack *trk, unsigned int irep, unsigned int ihit, bool *ret=0)
 Get smoothed momentum in global coordinates.
 
TMatrixT< double > getSmoothedCov (const GFTrack *trk, unsigned int irep, unsigned int ihit)
 Get smoothed track covariance in plane coordinates.
 
bool getSmoothedData (const GFTrack *trk, unsigned int irep, unsigned int ihit, TMatrixT< double > &smoothed_state, TMatrixT< double > &smoothed_cov)
 Get smoothed state vector and state covariance.
 
bool getSmoothedData (const GFTrack *trk, unsigned int irep, unsigned int ihit, TMatrixT< double > &smoothed_state, TMatrixT< double > &smoothed_cov, GFDetPlane &smoothing_plane)
 Get smoothed state vector, state covariance and smoothing plane.
 
bool getSmoothedData (const GFTrack *trk, unsigned int irep, unsigned int ihit, TMatrixT< double > &smoothed_state, TMatrixT< double > &smoothed_cov, GFDetPlane &smoothing_plane, TMatrixT< double > &auxInfo)
 Get smoothed state vector, state covariance and smoothing plane.
 
GFDetPlane getSmoothingPlane (const GFTrack *trk, unsigned int irep, unsigned int ihit)
 Get smoothing plane.
 
bool getBiasedSmoothedData (const GFTrack *trk, unsigned int irep, unsigned int ihit, TMatrixT< double > &smoothed_state, TMatrixT< double > &smoothed_cov)
 Get biased smoothed state vector and state covariance.
 
bool getBiasedSmoothedData (const GFTrack *trk, unsigned int irep, unsigned int ihit, TMatrixT< double > &smoothed_state, TMatrixT< double > &smoothed_cov, GFDetPlane &smoothing_plane, bool extrapolation_allowed=true)
 Get biased smoothed state vector, state covariance and smoothing plane.
 
bool getBiasedSmoothedData (const GFTrack *trk, unsigned int irep, unsigned int ihit, TMatrixT< double > &smoothed_state, TMatrixT< double > &smoothed_cov, GFDetPlane &smoothing_plane, TMatrixT< double > &auxInfo, bool extrapolation_allowed=true)
 Get biased smoothed state vector, state covariance and smoothing plane.
 
TMatrixT< double > getBiasedSmoothedPos (const GFTrack *trk, unsigned int irep, unsigned int ihit)
 Get biased smoothed track position in plane coordinates.
 
TMatrixT< double > getBiasedSmoothedCov (const GFTrack *trk, unsigned int irep, unsigned int ihit)
 Get biased smoothed track covariance in plane coordinates.
 
double getTrackLength (const GFTrack *trk, unsigned int irep, unsigned int startHit=0, unsigned int endHit=0)
 
void invertMatrix (const TMatrixT< double > &mat, TMatrixT< double > &inv)
 Invert a matrix, throwing GFException when inversion fails.
 
double getSmoothedChiSqu (const GFTrack *trk, unsigned int irep, unsigned int ihit)
 Get smoothed chi2 for a specific hit (ihit).
 
void updateRepSmoothed (GFTrack *trk, unsigned int irep, unsigned int ihit)
 Set smoothed data at hit nr. ihit to trackrep nr. irep.
 
unsigned int getClosestHit (const GFTrack *trk, unsigned int irep, const TVector3 &pos, double &distance, bool checkEveryHit=false)
 

Detailed Description

Namespace for various tools, mainly smoothing.

The GFTools namespace contains various functions, most of which er intended to be used with the smoothing feature of the Kalman filter. These functions allow to extract the smoothed information for any track which was fitted with smoothing enabled.

Function Documentation

TMatrixT< double > GFTools::getBiasedSmoothedCov ( const GFTrack trk,
unsigned int  irep,
unsigned int  ihit 
)

Get biased smoothed track covariance in plane coordinates.

Definition at line 170 of file GFTools.cxx.

View newest version in sPHENIX GitHub at line 170 of file GFTools.cxx

References Acts::Test::cov, getBiasedSmoothedData(), GFTrack::getHit(), GFAbsRecoHit::getHMatrix(), GFTrack::getTrackRep(), and H.

+ Here is the call graph for this function:

bool GFTools::getBiasedSmoothedData ( const GFTrack trk,
unsigned int  irep,
unsigned int  ihit,
TMatrixT< double > &  smoothed_state,
TMatrixT< double > &  smoothed_cov 
)

Get biased smoothed state vector and state covariance.

Definition at line 194 of file GFTools.cxx.

View newest version in sPHENIX GitHub at line 194 of file GFTools.cxx

Referenced by GFDaf::calcWeights(), getBiasedSmoothedCov(), getBiasedSmoothedData(), getBiasedSmoothedMomXYZ(), getBiasedSmoothedPos(), getBiasedSmoothedPosXYZ(), getSmoothedChiSqu(), and updateRepSmoothed().

+ Here is the caller graph for this function:

bool GFTools::getBiasedSmoothedData ( const GFTrack trk,
unsigned int  irep,
unsigned int  ihit,
TMatrixT< double > &  smoothed_state,
TMatrixT< double > &  smoothed_cov,
GFDetPlane smoothing_plane,
bool  extrapolation_allowed = true 
)

Get biased smoothed state vector, state covariance and smoothing plane.

The smoothed data returned by this function includes the detector plane in which the data is calculated.

Definition at line 209 of file GFTools.cxx.

View newest version in sPHENIX GitHub at line 209 of file GFTools.cxx

References getBiasedSmoothedData().

+ Here is the call graph for this function:

bool GFTools::getBiasedSmoothedData ( const GFTrack trk,
unsigned int  irep,
unsigned int  ihit,
TMatrixT< double > &  smoothed_state,
TMatrixT< double > &  smoothed_cov,
GFDetPlane smoothing_plane,
TMatrixT< double > &  auxInfo,
bool  extrapolation_allowed = true 
)

Get biased smoothed state vector, state covariance and smoothing plane.

The smoothed data returned by this function includes the detector plane in which the data is calculated as well as the auxillary information for this plane.

Definition at line 388 of file GFTools.cxx.

View newest version in sPHENIX GitHub at line 388 of file GFTools.cxx

References GFAbsTrackRep::clone(), GeaneTrackRep::extrapolate(), GFTrack::getBK(), GFBookkeeping::getDetPlane(), GFBookkeeping::getMatrix(), GFTrack::getNumHits(), GFTrack::getSmoothing(), GFTrack::getSmoothingFast(), GFTrack::getTrackRep(), GFAbsTrackRep::hasAuxInfo(), invertMatrix(), GFAbsTrackRep::setData(), and GeaneTrackRep::setPropDir().

+ Here is the call graph for this function:

TVector3 GFTools::getBiasedSmoothedMomXYZ ( const GFTrack trk,
unsigned int  irep,
unsigned int  ihit,
bool *  ret = 0 
)

Get smoothed momentum in global coordinates.

Definition at line 111 of file GFTools.cxx.

View newest version in sPHENIX GitHub at line 111 of file GFTools.cxx

References GFAbsTrackRep::clone(), getBiasedSmoothedData(), and GFTrack::getTrackRep().

Referenced by PndRecoKalmanFit::Fit().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TMatrixT< double > GFTools::getBiasedSmoothedPos ( const GFTrack trk,
unsigned int  irep,
unsigned int  ihit 
)

Get biased smoothed track position in plane coordinates.

Definition at line 135 of file GFTools.cxx.

View newest version in sPHENIX GitHub at line 135 of file GFTools.cxx

References getBiasedSmoothedData(), GFTrack::getHit(), GFAbsRecoHit::getHMatrix(), GFTrack::getTrackRep(), H, and pos().

Referenced by GFDaf::calcWeights().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TVector3 GFTools::getBiasedSmoothedPosXYZ ( const GFTrack trk,
unsigned int  irep,
unsigned int  ihit,
bool *  ret = 0 
)

Definition at line 60 of file GFTools.cxx.

View newest version in sPHENIX GitHub at line 60 of file GFTools.cxx

References getBiasedSmoothedData(), GFTrack::getHit(), GFAbsRecoHit::getHMatrix(), GFDetPlane::getO(), GFTrack::getTrackRep(), GFDetPlane::getU(), GFDetPlane::getV(), H, Acts::PrimitivesView3DTest::plane, and pos().

Referenced by PndRecoKalmanFit::Fit().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned int GFTools::getClosestHit ( const GFTrack trk,
unsigned int  irep,
const TVector3 &  pos,
double &  distance,
bool  checkEveryHit = false 
)

Get the ID of the hit whose smoothed position is closest to pos. A simple hill climbing algorithm is employed: Starting at either first or last hit (the one with smaller distance to pos), the algorithms goes along the hits as long as the distance to pos decreases. This might not find the global minimum if the hits are not well sorted along the track or if the track is curling. But is is much faster, especially for tracks where the closest hit is the first or last hit of the track.

If checkEveryHit is set to true, the position of every hit is checked against pos. This of course needs more computing time, but it is guaranteed to find the global minimum.

Definition at line 639 of file GFTools.cxx.

View newest version in sPHENIX GitHub at line 639 of file GFTools.cxx

References GFTrack::getNumHits(), getSmoothedPosXYZ(), and GFTrack::getSmoothing().

+ Here is the call graph for this function:

double GFTools::getSmoothedChiSqu ( const GFTrack trk,
unsigned int  irep,
unsigned int  ihit 
)

Get smoothed chi2 for a specific hit (ihit).

This function calculates a smoothed chi2 value for a specific hit from the the so called "biased" smoothed state vector and covariance matrix. If many values from different tracks in the same layer are calculated they should be chi2 distributed with dim(m) degree of freedom, where m is the measurement vector of the hit. So for a pixel detector that measures x and y dim(m) will be 2.

Definition at line 621 of file GFTools.cxx.

View newest version in sPHENIX GitHub at line 621 of file GFTools.cxx

References getBiasedSmoothedData(), GFTrack::getHit(), GFAbsRecoHit::getHMatrix(), GFAbsRecoHit::getRawHitCoord(), GFAbsRecoHit::getRawHitCov(), GFTrack::getTrackRep(), H, invertMatrix(), Acts::UnitConstants::m, pos(), and Acts::IntegrationTest::R.

+ Here is the call graph for this function:

TMatrixT< double > GFTools::getSmoothedCov ( const GFTrack trk,
unsigned int  irep,
unsigned int  ihit 
)

Get smoothed track covariance in plane coordinates.

Definition at line 154 of file GFTools.cxx.

View newest version in sPHENIX GitHub at line 154 of file GFTools.cxx

References Acts::Test::cov, GFTrack::getHit(), GFAbsRecoHit::getHMatrix(), getSmoothedData(), GFTrack::getTrackRep(), and H.

+ Here is the call graph for this function:

bool GFTools::getSmoothedData ( const GFTrack trk,
unsigned int  irep,
unsigned int  ihit,
TMatrixT< double > &  smoothed_state,
TMatrixT< double > &  smoothed_cov 
)

Get smoothed state vector and state covariance.

Definition at line 186 of file GFTools.cxx.

View newest version in sPHENIX GitHub at line 186 of file GFTools.cxx

Referenced by getSmoothedCov(), getSmoothedData(), getSmoothedPos(), and getSmoothedPosXYZ().

+ Here is the caller graph for this function:

bool GFTools::getSmoothedData ( const GFTrack trk,
unsigned int  irep,
unsigned int  ihit,
TMatrixT< double > &  smoothed_state,
TMatrixT< double > &  smoothed_cov,
GFDetPlane smoothing_plane 
)

Get smoothed state vector, state covariance and smoothing plane.

The smoothed data returned by this function includes the detector plane in which the data is calculated.

Definition at line 202 of file GFTools.cxx.

View newest version in sPHENIX GitHub at line 202 of file GFTools.cxx

References getSmoothedData().

+ Here is the call graph for this function:

bool GFTools::getSmoothedData ( const GFTrack trk,
unsigned int  irep,
unsigned int  ihit,
TMatrixT< double > &  smoothed_state,
TMatrixT< double > &  smoothed_cov,
GFDetPlane smoothing_plane,
TMatrixT< double > &  auxInfo 
)

Get smoothed state vector, state covariance and smoothing plane.

The smoothed data returned by this function includes the detector plane in which the data is calculated as well as the auxillary information for this plane. The smoothed covariance matrix at hit i is:

\[ C_{k,\mbox{smooth}} = (C_{k,k-1,\rightarrow}^{-1}+C_{k,k+1,\leftarrow}^{-1})^{-1}. \\ \]

The smoothed state vector at hit i is:

\[ x_{k,\mbox{smooth}} = C_{k,\mbox{smooth}} \cdot ((C_{k,k-1,\rightarrow}^{-1}\cdot x_{k,k-1,\rightarrow} + C_{k,k+1,\leftarrow}^{-1}\cdot x_{k,k+1,\leftarrow}) \]

The index k,k-1 denotes that the state vector or covariance matrix contains the information of all hits 1,2,....,k-1 and is extrapolated to hit k. The arrow pointing to the right indicates that the information is saved during the forward fit. The index k,k+1 indicates the the state vector or covariance matrix contains the information of all hits N,N-1,...,k+1 and is extrapolated to hit k. The left-poiting arrow indicates that the information is saved during the backward fit.

Definition at line 217 of file GFTools.cxx.

View newest version in sPHENIX GitHub at line 217 of file GFTools.cxx

References GFAbsTrackRep::clone(), GeaneTrackRep::extrapolate(), GFTrack::getBK(), GFBookkeeping::getDetPlane(), GFBookkeeping::getMatrix(), GFTrack::getNumHits(), GFTrack::getSmoothing(), GFTrack::getSmoothingFast(), GFTrack::getTrackRep(), GFAbsTrackRep::hasAuxInfo(), invertMatrix(), printf(), GFAbsTrackRep::setData(), and GeaneTrackRep::setPropDir().

+ Here is the call graph for this function:

TMatrixT< double > GFTools::getSmoothedPos ( const GFTrack trk,
unsigned int  irep,
unsigned int  ihit 
)

Get smoothed track position in plane coordinates.

Definition at line 8 of file GFTools.cxx.

View newest version in sPHENIX GitHub at line 8 of file GFTools.cxx

References GFTrack::getHit(), GFAbsRecoHit::getHMatrix(), getSmoothedData(), GFTrack::getTrackRep(), H, and pos().

+ Here is the call graph for this function:

TVector3 GFTools::getSmoothedPosXYZ ( const GFTrack trk,
unsigned int  irep,
unsigned int  ihit,
bool *  ret = 0 
)

Get smoothed track position in global coordinates.

Definition at line 27 of file GFTools.cxx.

View newest version in sPHENIX GitHub at line 27 of file GFTools.cxx

References GFTrack::getHit(), GFAbsRecoHit::getHMatrix(), GFDetPlane::getO(), getSmoothedData(), GFTrack::getTrackRep(), GFDetPlane::getU(), GFDetPlane::getV(), H, Acts::PrimitivesView3DTest::plane, and pos().

Referenced by getClosestHit().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GFDetPlane GFTools::getSmoothingPlane ( const GFTrack trk,
unsigned int  irep,
unsigned int  ihit 
)

Get smoothing plane.

Definition at line 518 of file GFTools.cxx.

View newest version in sPHENIX GitHub at line 518 of file GFTools.cxx

References GFTrack::getBK(), and GFBookkeeping::getDetPlane().

+ Here is the call graph for this function:

double GFTools::getTrackLength ( const GFTrack trk,
unsigned int  irep,
unsigned int  startHit = 0,
unsigned int  endHit = 0 
)

Get signed tracklength between two hits If no arguments are given, the tracklength between first and last hit will be returned. The lengths are calculated as mean value between forward and backward extrapolation steps.

Definition at line 526 of file GFTools.cxx.

View newest version in sPHENIX GitHub at line 526 of file GFTools.cxx

References GFTrack::getBK(), GFBookkeeping::getNumber(), GFTrack::getNumHits(), and GFTrack::getSmoothing().

+ Here is the call graph for this function:

void GFTools::invertMatrix ( const TMatrixT< double > &  mat,
TMatrixT< double > &  inv 
)

Invert a matrix, throwing GFException when inversion fails.

Definition at line 562 of file GFTools.cxx.

View newest version in sPHENIX GitHub at line 562 of file GFTools.cxx

References Acts::UnitConstants::e, and GFException::setFatal().

Referenced by GFKalman::calcGain(), GFDaf::calcWeights(), GFKalman::chi2Increment(), getBiasedSmoothedData(), GFDafHit::getMeasurement(), getSmoothedChiSqu(), and getSmoothedData().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void GFTools::updateRepSmoothed ( GFTrack trk,
unsigned int  irep,
unsigned int  ihit 
)

Set smoothed data at hit nr. ihit to trackrep nr. irep.

Definition at line 604 of file GFTools.cxx.

View newest version in sPHENIX GitHub at line 604 of file GFTools.cxx

References getBiasedSmoothedData(), GFTrack::getTrackRep(), GFAbsTrackRep::hasAuxInfo(), GFAbsTrackRep::setData(), and GFTrack::setRepAtHit().

+ Here is the call graph for this function: