LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
|
Fit tracks using Kalman Filter fit+smooth. More...
#include "TrackKalmanFitter.h"
Classes | |
struct | Config |
Public Types | |
using | Parameters = fhicl::Table< Config > |
Public Member Functions | |
TrackKalmanFitter (const TrackStatePropagator *prop, bool useRMS, bool sortHitsByPlane, bool sortOutputHitsMinLength, bool skipNegProp, bool cleanZigzag, bool rejectHighMultHits, bool rejectHitsNegativeGOF, float hitErr2ScaleFact, bool tryNoSkipWhenFails, int dumpLevel) | |
Constructor from TrackStatePropagator and values of configuration parameters. More... | |
TrackKalmanFitter (const TrackStatePropagator *prop, Parameters const &p) | |
Constructor from TrackStatePropagator and Parameters table. More... | |
bool | fitTrack (const recob::TrackTrajectory &traj, int tkID, const SMatrixSym55 &covVtx, const SMatrixSym55 &covEnd, const std::vector< art::Ptr< recob::Hit > > &hits, const double pval, const int pdgid, const bool flipDirection, recob::Track &outTrack, std::vector< art::Ptr< recob::Hit > > &outHits, trkmkr::OptionalOutputs &optionals) const |
Fit track starting from TrackTrajectory. More... | |
bool | fitTrack (const Point_t &position, const Vector_t &direction, SMatrixSym55 &trackStateCov, const std::vector< art::Ptr< recob::Hit > > &hits, const std::vector< recob::TrajectoryPointFlags > &flags, const int tkID, const double pval, const int pdgid, recob::Track &outTrack, std::vector< art::Ptr< recob::Hit > > &outHits, trkmkr::OptionalOutputs &optionals) const |
Fit track starting from intial position, direction, and flags. More... | |
bool | doFitWork (KFTrackState &trackState, std::vector< HitState > &hitstatev, std::vector< recob::TrajectoryPointFlags::Mask_t > &hitflagsv, std::vector< KFTrackState > &fwdPrdTkState, std::vector< KFTrackState > &fwdUpdTkState, std::vector< unsigned int > &hitstateidx, std::vector< unsigned int > &rejectedhsidx, std::vector< unsigned int > &sortedtksidx, bool applySkipClean=true) const |
Function where the core of the fit is performed. More... | |
Private Member Functions | |
KFTrackState | setupInitialTrackState (const Point_t &position, const Vector_t &direction, SMatrixSym55 &trackStateCov, const double pval, const int pdgid) const |
Return track state from intial position, direction, and covariance. More... | |
bool | setupInputStates (const std::vector< art::Ptr< recob::Hit > > &hits, const std::vector< recob::TrajectoryPointFlags > &flags, const KFTrackState &trackState, bool &reverseHits, std::vector< HitState > &hitstatev, std::vector< recob::TrajectoryPointFlags::Mask_t > &hitflagsv) const |
Setup vectors of HitState and Masks to be used during the fit. More... | |
void | sortOutput (std::vector< HitState > &hitstatev, std::vector< KFTrackState > &fwdUpdTkState, std::vector< unsigned int > &hitstateidx, std::vector< unsigned int > &rejectedhsidx, std::vector< unsigned int > &sortedtksidx, bool applySkipClean=true) const |
Sort the output states. More... | |
bool | fillResult (const std::vector< art::Ptr< recob::Hit > > &inHits, const int tkID, const int pdgid, const bool reverseHits, std::vector< HitState > &hitstatev, std::vector< recob::TrajectoryPointFlags::Mask_t > &hitflagsv, std::vector< KFTrackState > &fwdPrdTkState, std::vector< KFTrackState > &fwdUpdTkState, std::vector< unsigned int > &hitstateidx, std::vector< unsigned int > &rejectedhsidx, std::vector< unsigned int > &sortedtksidx, recob::Track &outTrack, std::vector< art::Ptr< recob::Hit > > &outHits, trkmkr::OptionalOutputs &optionals) const |
Fill the output objects. More... | |
Private Attributes | |
art::ServiceHandle< geo::Geometry > | geom |
const detinfo::DetectorProperties * | detprop |
const TrackStatePropagator * | propagator |
bool | useRMS_ |
bool | sortHitsByPlane_ |
bool | sortOutputHitsMinLength_ |
bool | skipNegProp_ |
bool | cleanZigzag_ |
bool | rejectHighMultHits_ |
bool | rejectHitsNegativeGOF_ |
float | hitErr2ScaleFact_ |
bool | tryNoSkipWhenFails_ |
int | dumpLevel_ |
Fit tracks using Kalman Filter fit+smooth.
This algorithm fits tracks using a Kalman Filter forward fit followed by a backward smoothing. The resulting track will feature covariance matrices at start and end positions. Fundamental components of the fit are trkf::KFTrackState and trkf::TrackStatePropagator.
Inputs are: recob::TrackTrajectory, initial covariance, associated hits, momentum estimate, particle id hypothesis. Alternatively, instead of a TrackTrajectory the fit can be input with initial position and direction, and vector of recob::TrajectoryPointFlags.
Outputs are: resulting recob::Track, associated hits, and trkmkr::OptionalOutputs.
For configuration options see TrackKalmanFitter::Config
Definition at line 46 of file TrackKalmanFitter.h.
Definition at line 104 of file TrackKalmanFitter.h.
|
inline |
Constructor from TrackStatePropagator and values of configuration parameters.
Definition at line 107 of file TrackKalmanFitter.h.
|
inlineexplicit |
Constructor from TrackStatePropagator and Parameters table.
Definition at line 124 of file TrackKalmanFitter.h.
References hits(), and lar::dump::vector().
bool trkf::TrackKalmanFitter::doFitWork | ( | KFTrackState & | trackState, |
std::vector< HitState > & | hitstatev, | ||
std::vector< recob::TrajectoryPointFlags::Mask_t > & | hitflagsv, | ||
std::vector< KFTrackState > & | fwdPrdTkState, | ||
std::vector< KFTrackState > & | fwdUpdTkState, | ||
std::vector< unsigned int > & | hitstateidx, | ||
std::vector< unsigned int > & | rejectedhsidx, | ||
std::vector< unsigned int > & | sortedtksidx, | ||
bool | applySkipClean = true |
||
) | const |
Function where the core of the fit is performed.
Definition at line 135 of file TrackKalmanFitter.cxx.
References trkf::TrackStatePropagator::BACKWARD, trkf::KFTrackState::covariance(), recob::TrajectoryPointFlagTraits::DeltaRay, recob::TrajectoryPointFlagTraits::DetectorIssue, trkf::TrackStatePropagator::distanceToPlane(), trkf::KFTrackState::dump(), trkf::TrackState::dump(), dumpLevel_, recob::TrajectoryPointFlagTraits::ExcludedFromFit, trkf::TrackStatePropagator::FORWARD, geom, recob::TrajectoryPointFlagTraits::HitIgnored, geo::GeometryCore::MaxPlanes(), recob::TrajectoryPointFlagTraits::Merged, min, recob::TrajectoryPointFlagTraits::NoPoint, trkf::TrackState::plane(), trkf::KFTrackState::position(), trkf::TrackStatePropagator::propagateToPlane(), propagator, recob::TrajectoryPointFlagTraits::Rejected, trkf::KFTrackState::setCovariance(), recob::TrajectoryPointFlagTraits::Shared, skipNegProp_, sortHitsByPlane_, sortOutput(), recob::TrajectoryPointFlagTraits::Suspicious, trkf::KFTrackState::trackState(), and trkf::KFTrackState::updateWithHitState().
Referenced by fitTrack().
|
private |
Fill the output objects.
Definition at line 477 of file TrackKalmanFitter.cxx.
References trkmkr::TrackCreationBookKeeper::addPoint(), trkf::KFTrackState::covariance(), dumpLevel_, e, recob::TrajectoryPointFlagTraits::ExcludedFromFit, trkmkr::TrackCreationBookKeeper::finalizeTrack(), recob::Track::HasValidPoint(), recob::TrajectoryPointFlagTraits::HitIgnored, trkmkr::OptionalOutputs::isTrackFitInfosInit(), util::kBogusD, recob::Track::Length(), recob::Track::MomentumAtPoint(), recob::Track::NextValidPoint(), recob::TrajectoryPointFlagTraits::NoPoint, propagator, recob::TrajectoryPointFlagTraits::Rejected, trkf::TrackStatePropagator::rotateToPlane(), trkmkr::OptionalPointElement::setTrackFitHitInfo(), recob::Track::Start(), recob::Track::StartCovariance(), and recob::Track::StartDirection().
Referenced by fitTrack().
bool trkf::TrackKalmanFitter::fitTrack | ( | const recob::TrackTrajectory & | traj, |
int | tkID, | ||
const SMatrixSym55 & | covVtx, | ||
const SMatrixSym55 & | covEnd, | ||
const std::vector< art::Ptr< recob::Hit > > & | hits, | ||
const double | pval, | ||
const int | pdgid, | ||
const bool | flipDirection, | ||
recob::Track & | outTrack, | ||
std::vector< art::Ptr< recob::Hit > > & | outHits, | ||
trkmkr::OptionalOutputs & | optionals | ||
) | const |
Fit track starting from TrackTrajectory.
Definition at line 9 of file TrackKalmanFitter.cxx.
References recob::TrackTrajectory::End(), recob::TrackTrajectory::EndDirection(), recob::TrackTrajectory::Flags(), hits(), recob::TrackTrajectory::Vertex(), and recob::TrackTrajectory::VertexDirection().
Referenced by trkmkr::KalmanFilterFitTrackMaker::makeTrackImpl(), trkf::KalmanFilterTrajectoryFitter::produce(), and trkf::KalmanFilterFinalTrackFitter::produce().
bool trkf::TrackKalmanFitter::fitTrack | ( | const Point_t & | position, |
const Vector_t & | direction, | ||
SMatrixSym55 & | trackStateCov, | ||
const std::vector< art::Ptr< recob::Hit > > & | hits, | ||
const std::vector< recob::TrajectoryPointFlags > & | flags, | ||
const int | tkID, | ||
const double | pval, | ||
const int | pdgid, | ||
recob::Track & | outTrack, | ||
std::vector< art::Ptr< recob::Hit > > & | outHits, | ||
trkmkr::OptionalOutputs & | optionals | ||
) | const |
Fit track starting from intial position, direction, and flags.
Definition at line 25 of file TrackKalmanFitter.cxx.
References cleanZigzag_, doFitWork(), fillResult(), hits(), setupInitialTrackState(), setupInputStates(), skipNegProp_, and tryNoSkipWhenFails_.
|
private |
Return track state from intial position, direction, and covariance.
Definition at line 68 of file TrackKalmanFitter.cxx.
Referenced by fitTrack().
|
private |
Setup vectors of HitState and Masks to be used during the fit.
Definition at line 83 of file TrackKalmanFitter.cxx.
References detinfo::DetectorProperties::ConvertTicksToX(), recob::TrajectoryPointFlags::DefaultFlagsMask(), detprop, trkf::TrackStatePropagator::distanceToPlane(), dumpLevel_, evd::details::end(), recob::TrajectoryPointFlagTraits::ExcludedFromFit, geom, detinfo::DetectorProperties::GetXTicksCoefficient(), hitErr2ScaleFact_, hits(), recob::tracking::makePlane(), recob::TrajectoryPointFlagTraits::Merged, propagator, rejectHighMultHits_, rejectHitsNegativeGOF_, recob::TrajectoryPointFlagTraits::Suspicious, trkf::KFTrackState::trackState(), useRMS_, geo::GeometryCore::WireIDToWireGeo(), and x.
Referenced by fitTrack().
|
private |
Sort the output states.
Definition at line 394 of file TrackKalmanFitter.cxx.
References cleanZigzag_, dir, evd::details::end(), geom, geo::GeometryCore::MaxPlanes(), skipNegProp_, and sortOutputHitsMinLength_.
Referenced by doFitWork().
|
private |
Definition at line 173 of file TrackKalmanFitter.h.
Referenced by fitTrack(), and sortOutput().
|
private |
Definition at line 167 of file TrackKalmanFitter.h.
Referenced by setupInputStates().
|
private |
Definition at line 178 of file TrackKalmanFitter.h.
Referenced by doFitWork(), fillResult(), and setupInputStates().
|
private |
Definition at line 166 of file TrackKalmanFitter.h.
Referenced by doFitWork(), setupInputStates(), and sortOutput().
|
private |
Definition at line 176 of file TrackKalmanFitter.h.
Referenced by setupInputStates().
|
private |
Definition at line 168 of file TrackKalmanFitter.h.
Referenced by doFitWork(), fillResult(), and setupInputStates().
|
private |
Definition at line 174 of file TrackKalmanFitter.h.
Referenced by setupInputStates().
|
private |
Definition at line 175 of file TrackKalmanFitter.h.
Referenced by setupInputStates().
|
private |
Definition at line 172 of file TrackKalmanFitter.h.
Referenced by doFitWork(), fitTrack(), and sortOutput().
|
private |
Definition at line 170 of file TrackKalmanFitter.h.
Referenced by doFitWork().
|
private |
Definition at line 171 of file TrackKalmanFitter.h.
Referenced by sortOutput().
|
private |
Definition at line 177 of file TrackKalmanFitter.h.
Referenced by fitTrack().
|
private |
Definition at line 169 of file TrackKalmanFitter.h.
Referenced by setupInputStates().