LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "KHitsTrack.h"
Public Types | |
enum | FitStatus { INVALID, UNKNOWN, FORWARD, FORWARD_PREDICTED, BACKWARD, BACKWARD_PREDICTED, OPTIMAL, OPTIMAL_PREDICTED } |
Fit status enum. More... | |
Public Member Functions | |
KHitsTrack () | |
Default constructor. More... | |
KHitsTrack (const KFitTrack &trf) | |
Initializing constructor - KFitTrack. More... | |
KHitsTrack (const KETrack &tre) | |
Initializing constructor - KETrack. More... | |
virtual | ~KHitsTrack () |
Destructor. More... | |
const std::vector< std::shared_ptr< const KHitBase > > & | getHits () |
Measurement collection. More... | |
void | addHit (const std::shared_ptr< const KHitBase > &hit) |
Add a measurement. More... | |
virtual std::ostream & | Print (std::ostream &out, bool doTitle=true) const |
Printout. More... | |
double | getPath () const |
Propagation distance. More... | |
double | getChisq () const |
Fit chisquare. More... | |
FitStatus | getStat () const |
Fit status. More... | |
void | setPath (double path) |
Set propagation distance. More... | |
void | setChisq (double chisq) |
Set chisquare. More... | |
void | setStat (FitStatus stat) |
Set fit status. More... | |
bool | combineFit (const KFitTrack &trf) |
Combine two tracks. More... | |
const TrackError & | getError () const |
Track error matrix. More... | |
TrackError & | getError () |
Modifiable error matrix. More... | |
double | PointingError () const |
Pointing error (radians). More... | |
void | setError (const TrackError &err) |
Set error matrix. More... | |
std::optional< double > | combineTrack (const KETrack &tre) |
Combine two tracks. 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 | |
std::vector< std::shared_ptr< const KHitBase > > | fHits |
Measurement collection. More... | |
Definition at line 35 of file KHitsTrack.h.
|
inherited |
Fit status enum.
Enumerator | |
---|---|
INVALID | |
UNKNOWN | |
FORWARD | |
FORWARD_PREDICTED | |
BACKWARD | |
BACKWARD_PREDICTED | |
OPTIMAL | |
OPTIMAL_PREDICTED |
Definition at line 39 of file KFitTrack.h.
trkf::KHitsTrack::KHitsTrack | ( | ) |
trkf::KHitsTrack::KHitsTrack | ( | const KFitTrack & | trf | ) |
Initializing constructor - KFitTrack.
Initializing constructor - KFitTrack.
Arguments:
trf - KFitTrack.
Definition at line 24 of file KHitsTrack.cxx.
trkf::KHitsTrack::KHitsTrack | ( | const KETrack & | tre | ) |
Initializing constructor - KETrack.
Initializing constructor - KETrack.
Arguments:
tre - KETrack.
Definition at line 32 of file KHitsTrack.cxx.
|
virtual |
|
inline |
Add a measurement.
Definition at line 57 of file KHitsTrack.h.
References fHits, and Print().
|
inherited |
Combine two tracks.
Combine two tracks.
Arguments:
trf - Another track.
Returns: True if success.
This method updates the current track to be the weighted average of itself and another track. Track parameters and error matrix are updated by method KETrack::combineTrack. The updated chissquare is the sum of the original chisquare, the chisquare from the other track, and the chisquare of the combination. The path distance is not updated.
The updated status is derived from the input status according to the following table.
FORWARD + BACKWARD_PREDICTED = OPTIMAL FORWARD_PREDICTED + BACKWARD = OPTIMAL FORWARD_PREDICTED + BACKWARD_PREDICTED = OPTIMAL_PREDICTED
Any other combination of input statuses will cause this method to return failure. This method can also return failure because of singular error matrices. In case of failure, the original track is not updated.
The two tracks being combined should be on the same surface (throw exception if not).
Definition at line 65 of file KFitTrack.cxx.
References trkf::KFitTrack::BACKWARD, trkf::KFitTrack::BACKWARD_PREDICTED, trkf::KETrack::combineTrack(), trkf::KFitTrack::fChisq, trkf::KFitTrack::FORWARD, trkf::KFitTrack::FORWARD_PREDICTED, trkf::KFitTrack::fStat, trkf::KFitTrack::getChisq(), trkf::KFitTrack::getStat(), trkf::KTrack::getSurface(), trkf::KFitTrack::OPTIMAL, trkf::KFitTrack::OPTIMAL_PREDICTED, and trkf::KFitTrack::UNKNOWN.
Referenced by trkf::KFitTrack::setStat(), and trkf::KalmanFilterAlg::smoothTrack().
|
inherited |
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 trkf::KETrack::getError(), trkf::KTrack::getSurface(), trkf::KTrack::getVector(), trkf::KTrack::isValid(), trkf::KETrack::setError(), trkf::KTrack::setVector(), and trkf::syminvert().
Referenced by trkf::KFitTrack::combineFit(), and trkf::KETrack::setError().
|
inlineinherited |
Fit chisquare.
Definition at line 62 of file KFitTrack.h.
References trkf::KFitTrack::fChisq.
Referenced by trkf::KalmanFilterAlg::buildTrack(), trkf::KFitTrack::combineFit(), trkf::KalmanFilterAlg::extendTrack(), trkf::KGTrack::fillTrack(), trkf::Track3DKalmanHitAlg::smoothandextendTrack(), and trkf::KalmanFilterAlg::smoothTrack().
|
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().
|
inlineinherited |
Track error matrix.
Definition at line 52 of file KETrack.h.
References trkf::KETrack::fErr, and trkf::KETrack::PointingError().
Referenced by trkf::KETrack::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().
|
inlineinherited |
|
inline |
Measurement collection.
Definition at line 52 of file KHitsTrack.h.
References fHits.
|
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().
|
inlineinherited |
Propagation distance.
Definition at line 61 of file KFitTrack.h.
References trkf::KFitTrack::fPath.
Referenced by trkf::KGTrack::addTrack(), trkf::KalmanFilterAlg::buildTrack(), trkf::KalmanFilterAlg::extendTrack(), trkf::KGTrack::recalibrate(), and trkf::KalmanFilterAlg::smoothTrack().
|
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 |
Fit status.
Definition at line 63 of file KFitTrack.h.
References trkf::KFitTrack::fStat.
Referenced by trkf::KFitTrack::combineFit(), trkf::KalmanFilterAlg::extendTrack(), trkf::KalmanFilterAlg::fitMomentumMS(), trkf::KalmanFilterAlg::fitMomentumRange(), trkf::KalmanFilterAlg::smoothTrack(), and trkf::KalmanFilterAlg::updateMomentum().
|
inlineinherited |
Definition at line 53 of file KTrack.h.
References trkf::KTrack::fSurf.
Referenced by trkf::KalmanFilterAlg::buildTrack(), trkf::KFitTrack::combineFit(), trkf::KETrack::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(), trkf::KETrack::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 trkf::KETrack::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(), trkf::KETrack::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(), trkf::KETrack::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(), trkf::KETrack::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().
|
inherited |
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 trkf::KETrack::fErr, trkf::KTrack::getSurface(), trkf::KTrack::getVector(), and trkf::KTrack::isValid().
Referenced by trkf::KalmanFilterAlg::buildTrack(), trkf::KalmanFilterAlg::extendTrack(), trkf::KETrack::getError(), and trkf::KETrack::Print().
|
virtual |
Printout.
Reimplemented from trkf::KFitTrack.
Definition at line 38 of file KHitsTrack.cxx.
References fHits, and trkf::KFitTrack::Print().
Referenced by addHit().
|
inlineinherited |
Set chisquare.
Definition at line 68 of file KFitTrack.h.
References trkf::KFitTrack::fChisq.
Referenced by trkf::KalmanFilterAlg::buildTrack(), trkf::KalmanFilterAlg::extendTrack(), and trkf::KalmanFilterAlg::smoothTrack().
|
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().
|
inlineinherited |
Set error matrix.
Definition at line 58 of file KETrack.h.
References trkf::KETrack::combineTrack(), trkf::KETrack::fErr, and trkf::KETrack::Print().
Referenced by trkf::KETrack::combineTrack(), trkf::Propagator::err_prop(), trkf::Propagator::noise_prop(), trkf::KHitMulti::update(), and trkf::KHit< N >::update().
|
inlineinherited |
Set propagation distance.
Definition at line 67 of file KFitTrack.h.
References trkf::KFitTrack::fPath.
Referenced by trkf::KalmanFilterAlg::buildTrack(), trkf::KalmanFilterAlg::extendTrack(), trkf::KGTrack::recalibrate(), and trkf::KalmanFilterAlg::smoothTrack().
|
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 fit status.
Definition at line 69 of file KFitTrack.h.
References trkf::KFitTrack::combineFit(), trkf::KFitTrack::fStat, and trkf::KFitTrack::Print().
Referenced by trkf::KalmanFilterAlg::buildTrack(), trkf::KalmanFilterAlg::extendTrack(), and trkf::KalmanFilterAlg::smoothTrack().
|
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 trkf::KETrack::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 |
Measurement collection.
Definition at line 66 of file KHitsTrack.h.