LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
trkf::TrackState Class Reference

Class for track parameters (and errors) defined on a recob::tracking::Plane. More...

#include "TrackState.h"

Public Member Functions

 TrackState (const SVector5 &trackStatePar, const SMatrixSym55 &trackStateCov, const Plane &plane, bool trackAlongPlaneDir, int pid)
 
const SVector5parameters () const
 track parameters defined on the plane More...
 
const SMatrixSym55covariance () const
 track parameter covariance matrix on the plane More...
 
const Planeplane () const
 plane where the parameters are defined More...
 
const Point_tposition () const
 position of the track More...
 
const Vector_tmomentum () const
 momentum of the track More...
 
int pID () const
 particle id hypthesis of the track More...
 
double mass () const
 mass hypthesis of the track More...
 
SVector6 parameters6D () const
 track parameters in global cartesian coordinates More...
 
SMatrixSym66 covariance6D () const
 track parameter covariance matrix in global cartesian coordinates More...
 
bool isTrackAlongPlaneDir () const
 is the track momentum along the plane direction? More...
 
std::ostream & dump (std::ostream &out=std::cout) const
 Printout information. More...
 
double residual (const HitState &hitstate) const
 Residual of the TrackState with respect to a HitState. The two states must be on the same plane; it is responsibility of the user to enforce this. More...
 
double combinedError2 (const HitState &hitstate) const
 Combined squared error of the TrackState with respect to a HitState. The two states must be on the same plane; it is responsibility of the user to enforce this. More...
 
double combinedError (const HitState &hitstate) const
 Combined error of the TrackState with respect to a HitState. The two states must be on the same plane; it is responsibility of the user to enforce this. More...
 
double chi2 (const HitState &hitstate) const
 Chi2 of the TrackState with respect to a HitState. The two states must be on the same plane; it is responsibility of the user to enforce this. More...
 
void setCovariance (const SMatrixSym55 &trackStateCov)
 Set the covariance matrix of the TrackState. More...
 
void setParameters (const SVector5 &trackStatePar)
 Set the parameters of the TrackState; also update the global position and momentum accordingly. More...
 

Private Attributes

SVector5 fTrackStatePar
 track parameters defined on the plane More...
 
SMatrixSym55 fTrackStateCov
 track parameter covariance matrix on the plane More...
 
Plane fPlane
 plane where the parameters are defined More...
 
int fPid
 particle id hypthesis of the track More...
 
Point_t fPos
 position of the track (cached) More...
 
Vector_t fMom
 momentum of the track (cached) More...
 

Detailed Description

Class for track parameters (and errors) defined on a recob::tracking::Plane.

Author
G. Cerati (FNAL, MicroBooNE)
Date
2017
Version
1.0

This class collects the track parameters (and errors) defined on a recob::tracking::Plane. It stores the 5d parameters and covariance, plus the global position and momentum. Given a HitState on the same plane, it provides easy access to functionalities like chi2 and residual.

Definition at line 79 of file TrackState.h.

Constructor & Destructor Documentation

trkf::TrackState::TrackState ( const SVector5 trackStatePar,
const SMatrixSym55 trackStateCov,
const Plane plane,
bool  trackAlongPlaneDir,
int  pid 
)
inline

Definition at line 81 of file TrackState.h.

References trkf::HitState::fPlane, and recob::tracking::Plane::Local5DToGlobal6DParameters().

82  :fTrackStatePar(trackStatePar), fTrackStateCov(trackStateCov), fPlane(plane), fPid(pid)
83  {
84  SVector6 par6d = fPlane.Local5DToGlobal6DParameters(fTrackStatePar,trackAlongPlaneDir);
85  fPos = Point_t(par6d[0],par6d[1],par6d[2]);
86  fMom = Point_t(par6d[3],par6d[4],par6d[5]);
87  }
int fPid
particle id hypthesis of the track
Definition: TrackState.h:154
Plane fPlane
plane where the parameters are defined
Definition: TrackState.h:153
recob::tracking::Point_t Point_t
Definition: TrackState.h:18
Vector_t fMom
momentum of the track (cached)
Definition: TrackState.h:156
SMatrixSym55 fTrackStateCov
track parameter covariance matrix on the plane
Definition: TrackState.h:152
SVector6 Local5DToGlobal6DParameters(const SVector5 &par5d, bool trackAlongPlaneDir=true) const
Function to convert parameters from local to global coordinates. Local coordinates are on the plane w...
Definition: TrackingPlane.h:80
recob::tracking::SVector6 SVector6
Definition: TrackState.h:13
Point_t fPos
position of the track (cached)
Definition: TrackState.h:155
const Plane & plane() const
plane where the parameters are defined
Definition: TrackState.h:94
SVector5 fTrackStatePar
track parameters defined on the plane
Definition: TrackState.h:151

Member Function Documentation

double trkf::TrackState::chi2 ( const HitState hitstate) const
inline

Chi2 of the TrackState with respect to a HitState. The two states must be on the same plane; it is responsibility of the user to enforce this.

Definition at line 137 of file TrackState.h.

Referenced by trkf::KFTrackState::chi2().

137 { return residual(hitstate)*residual(hitstate)/combinedError2(hitstate); }
double residual(const HitState &hitstate) const
Residual of the TrackState with respect to a HitState. The two states must be on the same plane; it i...
Definition: TrackState.h:128
double combinedError2(const HitState &hitstate) const
Combined squared error of the TrackState with respect to a HitState. The two states must be on the sa...
Definition: TrackState.h:131
double trkf::TrackState::combinedError ( const HitState hitstate) const
inline

Combined error of the TrackState with respect to a HitState. The two states must be on the same plane; it is responsibility of the user to enforce this.

Definition at line 134 of file TrackState.h.

Referenced by trkf::KFTrackState::combinedError().

134 { return sqrt(combinedError2(hitstate)); }
double combinedError2(const HitState &hitstate) const
Combined squared error of the TrackState with respect to a HitState. The two states must be on the sa...
Definition: TrackState.h:131
double trkf::TrackState::combinedError2 ( const HitState hitstate) const
inline

Combined squared error of the TrackState with respect to a HitState. The two states must be on the same plane; it is responsibility of the user to enforce this.

Definition at line 131 of file TrackState.h.

References trkf::HitState::hitMeasErr2().

Referenced by trkf::KFTrackState::combinedError2().

131 { return hitstate.hitMeasErr2()+fTrackStateCov(0,0); }
SMatrixSym55 fTrackStateCov
track parameter covariance matrix on the plane
Definition: TrackState.h:152
const SMatrixSym55& trkf::TrackState::covariance ( ) const
inline

track parameter covariance matrix on the plane

Definition at line 92 of file TrackState.h.

Referenced by trkf::KFTrackState::combineWithTrackState(), trkf::KFTrackState::covariance(), trkf::TrackStatePropagator::propagateToPlane(), trkf::TrackStatePropagator::rotateToPlane(), and trkf::KFTrackState::updateWithHitState().

92 { return fTrackStateCov; }
SMatrixSym55 fTrackStateCov
track parameter covariance matrix on the plane
Definition: TrackState.h:152
SMatrixSym66 trkf::TrackState::covariance6D ( ) const
inline

track parameter covariance matrix in global cartesian coordinates

Definition at line 113 of file TrackState.h.

References trkf::HitState::fPlane, and recob::tracking::Plane::Local5DToGlobal6DCovariance().

Plane fPlane
plane where the parameters are defined
Definition: TrackState.h:153
Vector_t fMom
momentum of the track (cached)
Definition: TrackState.h:156
SMatrixSym66 Local5DToGlobal6DCovariance(SMatrixSym55 cov5d, bool hasMomentum, const Vector_t &trackMomOrDir) const
Translate track covariance from local to global coordinates. The track momentum (or direction) is nee...
Definition: TrackingPlane.h:97
SMatrixSym55 fTrackStateCov
track parameter covariance matrix on the plane
Definition: TrackState.h:152
std::ostream& trkf::TrackState::dump ( std::ostream &  out = std::cout) const
inline

Printout information.

Definition at line 119 of file TrackState.h.

References recob::tracking::Plane::direction(), trkf::HitState::plane(), and recob::tracking::Plane::position().

Referenced by trkf::TrackKalmanFitter::doFitWork().

119  {
120  out << "TrackState with pID=" << pID() << " mass=" << mass()
121  << "\npars=" << parameters() << " position=" << position() << " momentum=" << momentum()
122  << "\ncov=\n" << covariance()
123  << "\non plane with pos=" << plane().position() << " and dir=" << plane().direction() << " along=" << isTrackAlongPlaneDir() << "\n";
124  return out;
125  }
Vector_t const & direction() const
Reference direction orthogonal to the plane.
Definition: TrackingPlane.h:70
const Vector_t & momentum() const
momentum of the track
Definition: TrackState.h:98
const SVector5 & parameters() const
track parameters defined on the plane
Definition: TrackState.h:90
double mass() const
mass hypthesis of the track
Definition: TrackState.h:102
const Point_t & position() const
position of the track
Definition: TrackState.h:96
bool isTrackAlongPlaneDir() const
is the track momentum along the plane direction?
Definition: TrackState.h:116
int pID() const
particle id hypthesis of the track
Definition: TrackState.h:100
Point_t const & position() const
Reference position on the plane.
Definition: TrackingPlane.h:66
const SMatrixSym55 & covariance() const
track parameter covariance matrix on the plane
Definition: TrackState.h:92
const Plane & plane() const
plane where the parameters are defined
Definition: TrackState.h:94
bool trkf::TrackState::isTrackAlongPlaneDir ( ) const
inline

is the track momentum along the plane direction?

Definition at line 116 of file TrackState.h.

References recob::tracking::Plane::direction(), and trkf::HitState::fPlane.

Referenced by trkf::KFTrackState::isTrackAlongPlaneDir(), and trkf::TrackStatePropagator::propagateToPlane().

116 { return fMom.Dot(fPlane.direction())>0; }
Plane fPlane
plane where the parameters are defined
Definition: TrackState.h:153
Vector_t const & direction() const
Reference direction orthogonal to the plane.
Definition: TrackingPlane.h:70
Vector_t fMom
momentum of the track (cached)
Definition: TrackState.h:156
double trkf::TrackState::mass ( ) const
inline

mass hypthesis of the track

Definition at line 102 of file TrackState.h.

References util::kBogusD.

Referenced by trkf::KFTrackState::mass(), and trkf::TrackStatePropagator::propagateToPlane().

102  {
103  if (abs(fPid)==11) { return elmass; }
104  if (abs(fPid)==13) { return mumass; }
105  if (abs(fPid)==211) { return pimass; }
106  if (abs(fPid)==321) { return kmass; }
107  if (abs(fPid)==2212) { return pmass; }
108  return util::kBogusD;
109  }
int fPid
particle id hypthesis of the track
Definition: TrackState.h:154
constexpr double kBogusD
obviously bogus double value
const Vector_t& trkf::TrackState::momentum ( ) const
inline
const SVector5& trkf::TrackState::parameters ( ) const
inline
SVector6 trkf::TrackState::parameters6D ( ) const
inline

track parameters in global cartesian coordinates

Definition at line 111 of file TrackState.h.

Referenced by trkf::KFTrackState::parameters6D().

111 { return SVector6(fPos.X(),fPos.Y(),fPos.Z(),fMom.X(),fMom.Y(),fMom.Z()); }
Vector_t fMom
momentum of the track (cached)
Definition: TrackState.h:156
recob::tracking::SVector6 SVector6
Definition: TrackState.h:13
Point_t fPos
position of the track (cached)
Definition: TrackState.h:155
int trkf::TrackState::pID ( ) const
inline

particle id hypthesis of the track

Definition at line 100 of file TrackState.h.

Referenced by trkf::KFTrackState::pID(), trkf::TrackStatePropagator::propagateToPlane(), and trkf::TrackStatePropagator::rotateToPlane().

100 { return fPid; }
int fPid
particle id hypthesis of the track
Definition: TrackState.h:154
const Plane& trkf::TrackState::plane ( ) const
inline
double trkf::TrackState::residual ( const HitState hitstate) const
inline

Residual of the TrackState with respect to a HitState. The two states must be on the same plane; it is responsibility of the user to enforce this.

Definition at line 128 of file TrackState.h.

References trkf::HitState::hitMeas().

Referenced by trkf::KFTrackState::residual().

128 { return hitstate.hitMeas()-fTrackStatePar(0); }
SVector5 fTrackStatePar
track parameters defined on the plane
Definition: TrackState.h:151
void trkf::TrackState::setCovariance ( const SMatrixSym55 trackStateCov)
inline

Set the covariance matrix of the TrackState.

Definition at line 140 of file TrackState.h.

Referenced by trkf::KFTrackState::combineWithTrackState(), trkf::KFTrackState::setCovariance(), and trkf::KFTrackState::updateWithHitState().

140 { fTrackStateCov = trackStateCov; }
SMatrixSym55 fTrackStateCov
track parameter covariance matrix on the plane
Definition: TrackState.h:152
void trkf::TrackState::setParameters ( const SVector5 trackStatePar)
inline

Set the parameters of the TrackState; also update the global position and momentum accordingly.

Definition at line 143 of file TrackState.h.

References trkf::HitState::fPlane, and recob::tracking::Plane::Local5DToGlobal6DParameters().

Referenced by trkf::KFTrackState::combineWithTrackState(), trkf::KFTrackState::setParameters(), and trkf::KFTrackState::updateWithHitState().

143  {
144  fTrackStatePar = trackStatePar;
146  fPos = Point_t(par6d[0],par6d[1],par6d[2]);
147  fMom = Vector_t(par6d[3],par6d[4],par6d[5]);
148  }
Plane fPlane
plane where the parameters are defined
Definition: TrackState.h:153
recob::tracking::Point_t Point_t
Definition: TrackState.h:18
recob::tracking::Vector_t Vector_t
Definition: TrackState.h:19
bool isTrackAlongPlaneDir() const
is the track momentum along the plane direction?
Definition: TrackState.h:116
Vector_t fMom
momentum of the track (cached)
Definition: TrackState.h:156
SVector6 Local5DToGlobal6DParameters(const SVector5 &par5d, bool trackAlongPlaneDir=true) const
Function to convert parameters from local to global coordinates. Local coordinates are on the plane w...
Definition: TrackingPlane.h:80
recob::tracking::SVector6 SVector6
Definition: TrackState.h:13
Point_t fPos
position of the track (cached)
Definition: TrackState.h:155
SVector5 fTrackStatePar
track parameters defined on the plane
Definition: TrackState.h:151

Member Data Documentation

Vector_t trkf::TrackState::fMom
private

momentum of the track (cached)

Definition at line 156 of file TrackState.h.

int trkf::TrackState::fPid
private

particle id hypthesis of the track

Definition at line 154 of file TrackState.h.

Plane trkf::TrackState::fPlane
private

plane where the parameters are defined

Definition at line 153 of file TrackState.h.

Point_t trkf::TrackState::fPos
private

position of the track (cached)

Definition at line 155 of file TrackState.h.

SMatrixSym55 trkf::TrackState::fTrackStateCov
private

track parameter covariance matrix on the plane

Definition at line 152 of file TrackState.h.

SVector5 trkf::TrackState::fTrackStatePar
private

track parameters defined on the plane

Definition at line 151 of file TrackState.h.


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