LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
|
#include "KFitTrack.h"
Public Types | |
enum | FitStatus { INVALID, UNKNOWN, FORWARD, FORWARD_PREDICTED, BACKWARD, BACKWARD_PREDICTED, OPTIMAL, OPTIMAL_PREDICTED } |
Fit status enum. More... | |
Public Member Functions | |
KFitTrack () | |
Default constructor. More... | |
KFitTrack (const KETrack &tre, double s=0., double chisq=0., FitStatus stat=INVALID) | |
Initializing constructor. More... | |
virtual | ~KFitTrack () |
Destructor. 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... | |
virtual std::ostream & | Print (std::ostream &out, bool doTitle=true) const |
Printout. 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... | |
boost::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 | |
double | fPath |
Propagation distance. More... | |
double | fChisq |
Fit chisquare. More... | |
FitStatus | fStat |
Fit status. More... | |
Definition at line 36 of file KFitTrack.h.
Fit status enum.
Enumerator | |
---|---|
INVALID | |
UNKNOWN | |
FORWARD | |
FORWARD_PREDICTED | |
BACKWARD | |
BACKWARD_PREDICTED | |
OPTIMAL | |
OPTIMAL_PREDICTED |
Definition at line 41 of file KFitTrack.h.
trkf::KFitTrack::KFitTrack | ( | ) |
trkf::KFitTrack::KFitTrack | ( | const KETrack & | tre, |
double | s = 0. , |
||
double | chisq = 0. , |
||
FitStatus | stat = INVALID |
||
) |
Initializing constructor.
Initializing constructor.
Arguments:
tre - KETrack. s - Path distance. chisq - Fit chisquare. stat - Fit status.
Definition at line 32 of file KFitTrack.cxx.
|
virtual |
bool trkf::KFitTrack::combineFit | ( | const KFitTrack & | trf | ) |
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 76 of file KFitTrack.cxx.
References BACKWARD, BACKWARD_PREDICTED, trkf::KETrack::combineTrack(), fChisq, FORWARD, FORWARD_PREDICTED, fStat, getChisq(), getStat(), trkf::KTrack::getSurface(), OPTIMAL, OPTIMAL_PREDICTED, and UNKNOWN.
Referenced by 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 95 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 combineFit(), and trkf::KETrack::setError().
|
inline |
Fit chisquare.
Definition at line 67 of file KFitTrack.h.
References fChisq.
Referenced by trkf::KalmanFilterAlg::buildTrack(), 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 72 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::PropYZPlane::origin_vec_prop(), trkf::PropXYZPlane::origin_vec_prop(), trkf::PropYZLine::origin_vec_prop(), trkf::PropYZPlane::short_vec_prop(), and trkf::PropXYZPlane::short_vec_prop().
|
inlineinherited |
Track error matrix.
Definition at line 54 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 |
|
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 217 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().
|
inline |
Propagation distance.
Definition at line 66 of file KFitTrack.h.
References 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 170 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::PropYZPlane::origin_vec_prop(), trkf::PropXYZPlane::origin_vec_prop(), trkf::KTrack::Print(), trkf::KGTrack::Print(), trkf::KTrack::setPdgCode(), trkf::PropXYZPlane::short_vec_prop(), trkf::PropYZPlane::short_vec_prop(), trkf::PropYZLine::short_vec_prop(), and trkf::Propagator::vec_prop().
|
inline |
Fit status.
Definition at line 68 of file KFitTrack.h.
References fStat.
Referenced by combineFit(), trkf::KalmanFilterAlg::extendTrack(), trkf::KalmanFilterAlg::fitMomentumMS(), trkf::KalmanFilterAlg::fitMomentumRange(), trkf::KalmanFilterAlg::smoothTrack(), and trkf::KalmanFilterAlg::updateMomentum().
|
inlineinherited |
Definition at line 55 of file KTrack.h.
References trkf::KTrack::fSurf.
Referenced by trkf::KalmanFilterAlg::buildTrack(), combineFit(), trkf::KETrack::combineTrack(), trkf::KalmanFilterAlg::extendTrack(), trkf::KalmanFilterAlg::fitMomentumMS(), trkf::Propagator::lin_prop(), trkf::InteractPlane::noise(), trkf::PropXYZPlane::origin_vec_prop(), trkf::PropYZLine::origin_vec_prop(), trkf::PropYZPlane::origin_vec_prop(), trkf::KETrack::PointingError(), trkf::KHitMulti::predict(), trkf::KHit< N >::predict(), trkf::KalmanFilterAlg::smoothTrack(), trkf::KHitWireX::subpredict(), trkf::KHitWireLine::subpredict(), trkf::KHitMulti::update(), trkf::KHit< N >::update(), and trkf::KalmanFilterAlg::updateMomentum().
|
inlineinherited |
Track state vector.
Definition at line 56 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::PropYZPlane::origin_vec_prop(), trkf::PropXYZPlane::origin_vec_prop(), trkf::PropYZLine::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::KHitWireX::subpredict(), trkf::KHitWireLine::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 90 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 128 of file KTrack.cxx.
References trkf::KTrack::fPdgCode.
Referenced by trkf::KalmanFilterAlg::fitMomentumMS(), trkf::InteractPlane::noise(), trkf::KTrack::PdgCode(), trkf::PropXYZPlane::short_vec_prop(), trkf::PropYZLine::short_vec_prop(), trkf::PropYZPlane::short_vec_prop(), and trkf::Propagator::vec_prop().
|
inlineinherited |
Pdg code.
Definition at line 58 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 74 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::KETrack.
Reimplemented in trkf::KHitsTrack, and trkf::KHitTrack.
Definition at line 124 of file KFitTrack.cxx.
References BACKWARD, BACKWARD_PREDICTED, fChisq, FORWARD, FORWARD_PREDICTED, fPath, fStat, INVALID, OPTIMAL, trkf::KETrack::Print(), and UNKNOWN.
Referenced by trkf::KHitTrack::Print(), trkf::KHitsTrack::Print(), and setStat().
|
inline |
Set chisquare.
Definition at line 73 of file KFitTrack.h.
References fChisq.
Referenced by trkf::KalmanFilterAlg::buildTrack(), trkf::KalmanFilterAlg::extendTrack(), and trkf::KalmanFilterAlg::smoothTrack().
|
inlineinherited |
Set direction.
Definition at line 68 of file KTrack.h.
References dir, and trkf::KTrack::fDir.
Referenced by trkf::Propagator::lin_prop(), trkf::PropXYZPlane::origin_vec_prop(), trkf::PropYZLine::origin_vec_prop(), and trkf::PropYZPlane::origin_vec_prop().
|
inlineinherited |
Set error matrix.
Definition at line 60 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().
|
inline |
Set propagation distance.
Definition at line 72 of file KFitTrack.h.
References fPath.
Referenced by trkf::KalmanFilterAlg::buildTrack(), trkf::KalmanFilterAlg::extendTrack(), trkf::KGTrack::recalibrate(), and trkf::KalmanFilterAlg::smoothTrack().
|
inlineinherited |
Set pdg code.
Definition at line 69 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().
|
inline |
Set fit status.
Definition at line 74 of file KFitTrack.h.
References combineFit(), fStat, and Print().
Referenced by trkf::KalmanFilterAlg::buildTrack(), trkf::KalmanFilterAlg::extendTrack(), and trkf::KalmanFilterAlg::smoothTrack().
|
inlineinherited |
Set surface.
Definition at line 66 of file KTrack.h.
References trkf::KTrack::fSurf.
Referenced by trkf::Propagator::lin_prop(), trkf::PropYZPlane::origin_vec_prop(), trkf::PropXYZPlane::origin_vec_prop(), trkf::PropYZLine::origin_vec_prop(), trkf::PropYZPlane::short_vec_prop(), trkf::PropYZLine::short_vec_prop(), and trkf::PropXYZPlane::short_vec_prop().
|
inlineinherited |
Set state vector.
Definition at line 67 of file KTrack.h.
References trkf::KTrack::fVec.
Referenced by trkf::KETrack::combineTrack(), trkf::Propagator::lin_prop(), trkf::PropYZPlane::origin_vec_prop(), trkf::PropXYZPlane::origin_vec_prop(), trkf::PropYZLine::origin_vec_prop(), trkf::PropXYZPlane::short_vec_prop(), trkf::PropYZLine::short_vec_prop(), trkf::PropYZPlane::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 183 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 200 of file KTrack.cxx.
References trkf::KTrack::getMomentum().
Referenced by trkf::KTrack::Print(), and trkf::KTrack::setPdgCode().
|
private |
Fit chisquare.
Definition at line 87 of file KFitTrack.h.
Referenced by combineFit(), getChisq(), Print(), and setChisq().
|
private |
Propagation distance.
Definition at line 86 of file KFitTrack.h.
|
private |
Fit status.
Definition at line 88 of file KFitTrack.h.
Referenced by combineFit(), getStat(), Print(), and setStat().