LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "KETrack.h"
Public Member Functions | |
KETrack () | |
Default constructor. More... | |
KETrack (const std::shared_ptr< const Surface > &psurf) | |
Constructor - specify surface only. More... | |
KETrack (const std::shared_ptr< const Surface > &psurf, const TrackVector &vec, const TrackError &err, Surface::TrackDirection dir=Surface::UNKNOWN, int pdg=0) | |
Constructor - surface + track parameters + error matrix. More... | |
KETrack (const KTrack &trk, const TrackError &err) | |
Constructor - KTrack + error matrix. More... | |
virtual | ~KETrack () |
Destructor. More... | |
const TrackError & | getError () const |
Track error matrix. More... | |
double | PointingError () const |
Pointing error (radians). More... | |
TrackError & | getError () |
Modifiable error matrix. More... | |
void | setError (const TrackError &err) |
Set error matrix. More... | |
std::optional< double > | combineTrack (const KETrack &tre) |
Combine two tracks. More... | |
virtual std::ostream & | Print (std::ostream &out, bool doTitle=true) const |
Printout. More... | |
const std::shared_ptr< const Surface > & | getSurface () const |
Surface. More... | |
const TrackVector & | getVector () const |
Track state vector. More... | |
TrackVector & | getVector () |
Modifiable state vector. More... | |
Surface::TrackDirection | getDirection () const |
Track direction. More... | |
int | PdgCode () const |
Pdg code. More... | |
double | Mass () const |
Based on pdg code. More... | |
void | setSurface (const std::shared_ptr< const Surface > &psurf) |
Set surface. More... | |
void | setVector (const TrackVector &vec) |
Set state vector. More... | |
void | setDirection (Surface::TrackDirection dir) |
Set direction. More... | |
void | setPdgCode (int pdg) |
Set pdg code. More... | |
bool | isValid () const |
Test if track is valid. More... | |
void | getPosition (double xyz[3]) const |
Get position of track. More... | |
void | getMomentum (double mom[3]) const |
Get momentum vector of track. More... | |
double | XLatitude () const |
Get x-latitude. More... | |
double | XLongitude () const |
Get x-longitude. More... | |
Private Attributes | |
TrackError | fErr |
Track error matrix. More... | |
trkf::KETrack::KETrack | ( | ) |
trkf::KETrack::KETrack | ( | const std::shared_ptr< const Surface > & | psurf | ) |
Constructor - specify surface only.
Constructor - specify surface only.
Arguments:
psurf - Surface pointer.
Definition at line 26 of file KETrack.cxx.
trkf::KETrack::KETrack | ( | const std::shared_ptr< const Surface > & | psurf, |
const TrackVector & | vec, | ||
const TrackError & | err, | ||
Surface::TrackDirection | dir = Surface::UNKNOWN , |
||
int | pdg = 0 |
||
) |
trkf::KETrack::KETrack | ( | const KTrack & | trk, |
const TrackError & | err | ||
) |
Constructor - KTrack + error matrix.
Constructor - KTrack + error matrix.
Arguments:
trk - KTrack. err - Track error matrix.
Definition at line 53 of file KETrack.cxx.
|
virtual |
std::optional< double > trkf::KETrack::combineTrack | ( | const KETrack & | tre | ) |
Combine two tracks.
Combine two tracks.
Arguments:
tre - Another track.
Returns: Chisquare + success flag.
This method updates the current track to be the weighted average of itself and another track. The chisquare of the combination is returned as the result value. The combination can fail because the sum of the two error matrices is singular, in which case the success flag embedded in the return value is false.
Definition at line 87 of file KETrack.cxx.
References getError(), trkf::KTrack::getSurface(), trkf::KTrack::getVector(), trkf::KTrack::isValid(), setError(), trkf::KTrack::setVector(), and trkf::syminvert().
Referenced by trkf::KFitTrack::combineFit(), and setError().
|
inherited |
Track direction.
Track direction accessor. Track direction implied by track parameters has precedence over track direction attribute. If the surface pointer is null, return UNKNOWN.
Definition at line 64 of file KTrack.cxx.
References trkf::KTrack::fDir, trkf::KTrack::fSurf, trkf::KTrack::fVec, and trkf::Surface::UNKNOWN.
Referenced by trkf::KTrack::getMomentum(), trkf::KTrack::getVector(), trkf::KTrack::isValid(), trkf::Propagator::lin_prop(), trkf::InteractPlane::noise(), trkf::PropYZLine::origin_vec_prop(), trkf::PropYZPlane::origin_vec_prop(), trkf::PropXYZPlane::origin_vec_prop(), trkf::PropYZPlane::short_vec_prop(), and trkf::PropXYZPlane::short_vec_prop().
|
inline |
Track error matrix.
Definition at line 52 of file KETrack.h.
References fErr, and PointingError().
Referenced by combineTrack(), trkf::Propagator::err_prop(), trkf::KalmanFilterAlg::extendTrack(), trkf::KGTrack::fillTrack(), trkf::KalmanFilterAlg::fitMomentum(), trkf::KalmanFilterAlg::fitMomentumMS(), trkf::KalmanFilterAlg::fitMomentumRange(), trkf::Propagator::noise_prop(), trkf::KHitMulti::predict(), trkf::KHitWireLine::subpredict(), trkf::KHitWireX::subpredict(), trkf::KHitMulti::update(), trkf::KHit< N >::update(), and trkf::KalmanFilterAlg::updateMomentum().
|
inline |
|
inherited |
Get momentum vector of track.
Get momentum vector of track. Throw an exception if track is not valid.
Arguments:
mom - Momentum vector of track.
Definition at line 201 of file KTrack.cxx.
References dir, trkf::KTrack::fSurf, trkf::KTrack::fVec, trkf::KTrack::getDirection(), and trkf::KTrack::isValid().
Referenced by trkf::KGTrack::fillTrack(), trkf::InteractGeneral::noise(), trkf::KTrack::Print(), trkf::KGTrack::Print(), trkf::Track3DKalmanHitAlg::qualityCutsOnSeedTrack(), trkf::KTrack::setPdgCode(), trkf::Propagator::vec_prop(), trkf::KTrack::XLatitude(), and trkf::KTrack::XLongitude().
|
inherited |
Get position of track.
Get position of track. Throw an exception if track is not valid.
Arguments:
xyz - Position vector.
Definition at line 157 of file KTrack.cxx.
References trkf::KTrack::fSurf, trkf::KTrack::fVec, and trkf::KTrack::isValid().
Referenced by trkf::KGTrack::fillTrack(), trkf::InteractGeneral::noise(), trkf::PropYZLine::origin_vec_prop(), trkf::PropXYZPlane::origin_vec_prop(), trkf::PropYZPlane::origin_vec_prop(), trkf::KTrack::Print(), trkf::KGTrack::Print(), trkf::KTrack::setPdgCode(), trkf::PropYZLine::short_vec_prop(), trkf::PropYZPlane::short_vec_prop(), trkf::PropXYZPlane::short_vec_prop(), and trkf::Propagator::vec_prop().
|
inlineinherited |
Definition at line 53 of file KTrack.h.
References trkf::KTrack::fSurf.
Referenced by trkf::KalmanFilterAlg::buildTrack(), trkf::KFitTrack::combineFit(), combineTrack(), trkf::KalmanFilterAlg::extendTrack(), trkf::KalmanFilterAlg::fitMomentumMS(), trkf::Propagator::lin_prop(), trkf::InteractPlane::noise(), trkf::PropYZLine::origin_vec_prop(), trkf::PropXYZPlane::origin_vec_prop(), trkf::PropYZPlane::origin_vec_prop(), PointingError(), trkf::KHitMulti::predict(), trkf::KHit< N >::predict(), trkf::KalmanFilterAlg::smoothTrack(), trkf::KHitWireLine::subpredict(), trkf::KHitWireX::subpredict(), trkf::KHitMulti::update(), trkf::KHit< N >::update(), and trkf::KalmanFilterAlg::updateMomentum().
|
inlineinherited |
Track state vector.
Definition at line 54 of file KTrack.h.
References trkf::KTrack::fVec, and trkf::KTrack::getDirection().
Referenced by combineTrack(), trkf::KalmanFilterAlg::extendTrack(), trkf::KalmanFilterAlg::fitMomentum(), trkf::KalmanFilterAlg::fitMomentumMS(), trkf::KalmanFilterAlg::fitMomentumRange(), trkf::Propagator::lin_prop(), trkf::InteractPlane::noise(), trkf::PropYZLine::origin_vec_prop(), trkf::PropYZPlane::origin_vec_prop(), trkf::PropXYZPlane::origin_vec_prop(), PointingError(), trkf::KHitMulti::predict(), trkf::PropYZLine::short_vec_prop(), trkf::PropXYZPlane::short_vec_prop(), trkf::PropYZPlane::short_vec_prop(), trkf::KHitWireLine::subpredict(), trkf::KHitWireX::subpredict(), trkf::KHitMulti::update(), trkf::KHit< N >::update(), trkf::KalmanFilterAlg::updateMomentum(), and trkf::Propagator::vec_prop().
|
inlineinherited |
|
inherited |
Test if track is valid.
Test if track is valid.
A default-constructed or partially-constructed track, is invalid by virtue of having an unknown propagation direction or a null surface pointer.
Tracks can become invaliddynamically for other reasons. This method also does the following checks: a) Check for invalid floating point values (inf and nan). b) Surface-dependent checks via virtual method Surface::isTrackValid.
Definition at line 81 of file KTrack.cxx.
References trkf::KTrack::fSurf, trkf::KTrack::fVec, trkf::KTrack::getDirection(), geo::vect::isfinite(), and trkf::Surface::UNKNOWN.
Referenced by trkf::KGTrack::addTrack(), trkf::KalmanFilterAlg::buildTrack(), combineTrack(), trkf::KalmanFilterAlg::extendTrack(), trkf::KTrack::getMomentum(), trkf::KTrack::getPosition(), trkf::Propagator::lin_prop(), trkf::PropYZLine::origin_vec_prop(), trkf::PropXYZPlane::origin_vec_prop(), trkf::PropYZPlane::origin_vec_prop(), PointingError(), trkf::KTrack::setPdgCode(), and trkf::KalmanFilterAlg::smoothTrack().
|
inherited |
Based on pdg code.
Particle mass based on pdg code.
Definition at line 116 of file KTrack.cxx.
References util::abs(), and trkf::KTrack::fPdgCode.
Referenced by trkf::KalmanFilterAlg::fitMomentumMS(), trkf::InteractPlane::noise(), trkf::KTrack::PdgCode(), trkf::PropYZLine::short_vec_prop(), trkf::PropXYZPlane::short_vec_prop(), trkf::PropYZPlane::short_vec_prop(), and trkf::Propagator::vec_prop().
|
inlineinherited |
Pdg code.
Definition at line 56 of file KTrack.h.
References trkf::KTrack::fPdgCode, and trkf::KTrack::Mass().
double trkf::KETrack::PointingError | ( | ) | const |
Pointing error (radians).
Calculate track pointing error (sigma, in radians).
This method calculates a single pointing error (sigma, in radians) based on the track parameters and error matrix. The actual calculation is done by the similarly names method of the surface class, since this class doesn't know what the track parameters mean.
Definition at line 66 of file KETrack.cxx.
References fErr, trkf::KTrack::getSurface(), trkf::KTrack::getVector(), and trkf::KTrack::isValid().
Referenced by trkf::KalmanFilterAlg::buildTrack(), trkf::KalmanFilterAlg::extendTrack(), getError(), and Print().
|
virtual |
Printout.
Reimplemented from trkf::KTrack.
Reimplemented in trkf::KFitTrack, trkf::KHitsTrack, and trkf::KHitTrack.
Definition at line 179 of file KETrack.cxx.
References util::abs(), fErr, PointingError(), and trkf::KTrack::Print().
Referenced by trkf::KFitTrack::Print(), and setError().
|
inlineinherited |
Set direction.
Definition at line 66 of file KTrack.h.
References dir, and trkf::KTrack::fDir.
Referenced by trkf::Propagator::lin_prop(), trkf::PropYZLine::origin_vec_prop(), trkf::PropYZPlane::origin_vec_prop(), and trkf::PropXYZPlane::origin_vec_prop().
|
inline |
Set error matrix.
Definition at line 58 of file KETrack.h.
References combineTrack(), fErr, and Print().
Referenced by combineTrack(), trkf::Propagator::err_prop(), trkf::Propagator::noise_prop(), trkf::KHitMulti::update(), and trkf::KHit< N >::update().
|
inlineinherited |
Set pdg code.
Definition at line 67 of file KTrack.h.
References trkf::KTrack::fPdgCode, trkf::KTrack::getMomentum(), trkf::KTrack::getPosition(), trkf::KTrack::isValid(), trkf::KTrack::Print(), trkf::KTrack::XLatitude(), and trkf::KTrack::XLongitude().
|
inlineinherited |
Set surface.
Definition at line 64 of file KTrack.h.
References trkf::KTrack::fSurf.
Referenced by trkf::Propagator::lin_prop(), trkf::PropYZLine::origin_vec_prop(), trkf::PropYZPlane::origin_vec_prop(), trkf::PropXYZPlane::origin_vec_prop(), trkf::PropYZLine::short_vec_prop(), trkf::PropYZPlane::short_vec_prop(), and trkf::PropXYZPlane::short_vec_prop().
|
inlineinherited |
Set state vector.
Definition at line 65 of file KTrack.h.
References trkf::KTrack::fVec.
Referenced by combineTrack(), trkf::Propagator::lin_prop(), trkf::PropYZLine::origin_vec_prop(), trkf::PropYZPlane::origin_vec_prop(), trkf::PropXYZPlane::origin_vec_prop(), trkf::PropYZLine::short_vec_prop(), trkf::PropYZPlane::short_vec_prop(), trkf::PropXYZPlane::short_vec_prop(), trkf::KHitMulti::update(), and trkf::KHit< N >::update().
|
inherited |
Get x-latitude.
Get x-latitude.
The x-latitude is the latitude defined with respect to the x-axis. The x-latitude is zero of the track is traveling parallel to the wire planes.
Definition at line 169 of file KTrack.cxx.
References trkf::KTrack::getMomentum().
Referenced by trkf::KTrack::Print(), and trkf::KTrack::setPdgCode().
|
inherited |
Get x-longitude.
Get x-longitude.
The x-longitude is the longitude defined with respect to the y- and z-axes. The x-longitude is zero of the track is parallel to the z-axis in the yz-plane.
Definition at line 185 of file KTrack.cxx.
References trkf::KTrack::getMomentum().
Referenced by trkf::KTrack::Print(), and trkf::KTrack::setPdgCode().
|
private |
Track error matrix.
Definition at line 69 of file KETrack.h.
Referenced by getError(), PointingError(), Print(), and setError().