LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Concrete implementation of a tool to fit tracks with TrackKalmanFitter. More...
Classes | |
struct | Config |
struct | Options |
Public Types | |
using | Parameters = art::ToolConfigTable< Config > |
Public Member Functions | |
KalmanFilterFitTrackMaker (Parameters const &p) | |
Constructor from Parameters. More... | |
void | initEvent (const art::Event &e) override |
initialize event: get collection of recob::MCSFitResult More... | |
bool | makeTrackImpl (const detinfo::DetectorPropertiesData &detProp, const recob::TrackTrajectory &traj, const int tkID, const std::vector< art::Ptr< recob::Hit >> &inHits, const recob::tracking::SMatrixSym55 &covVtx, const recob::tracking::SMatrixSym55 &covEnd, recob::Track &outTrack, std::vector< art::Ptr< recob::Hit >> &outHits, OptionalOutputs &optionals) const |
function that actually calls the fitter More... | |
bool | makeTrack (const detinfo::DetectorPropertiesData &detProp, const recob::TrackTrajectory &traj, const int tkID, const std::vector< art::Ptr< recob::Hit >> &inHits, recob::Track &outTrack, std::vector< art::Ptr< recob::Hit >> &outHits, OptionalOutputs &optionals) const override |
int | getParticleID (const recob::TrackTrajectory &traj, const int tkID) const |
set the particle ID hypothesis More... | |
double | getMomentum (const recob::TrackTrajectory &traj, const int pid, const bool isFlip, const int tkID) const |
set the initial momentum estimate More... | |
bool | isFlipDirection (const recob::TrackTrajectory &traj, const int tkID) const |
decide whether to flip the direction or not More... | |
void | restoreInputPoints (const recob::TrackTrajectory &traj, const std::vector< art::Ptr< recob::Hit >> &inHits, recob::Track &outTrack, std::vector< art::Ptr< recob::Hit >> &outHits, OptionalOutputs &optionals) const |
bool | makeTrack (const detinfo::DetectorPropertiesData &detProp, const art::Ptr< recob::TrackTrajectory > ttraj, const std::vector< art::Ptr< recob::Hit >> &inHits, recob::Track &outTrack, std::vector< art::Ptr< recob::Hit >> &outHits, OptionalOutputs &optionals) const |
makeTrack functions with art::Ptr<recob::TrackTrajectory>; calls the purely virtual version with const recob::TrackTrajectory reference as argument. More... | |
bool | makeTrack (const detinfo::DetectorPropertiesData &detProp, const art::Ptr< recob::Track > track, const std::vector< art::Ptr< recob::Hit >> &inHits, recob::Track &outTrack, std::vector< art::Ptr< recob::Hit >> &outHits, OptionalOutputs &optionals) const |
Private Attributes | |
Parameters | p_ |
const trkf::TrackStatePropagator | prop |
const trkf::TrackKalmanFitter | kalmanFitter |
const trkf::TrajectoryMCSFitter | mcsfitter |
double | mom_def_ |
bool | momFromMCSColl_ |
art::InputTag | mcsInputTag_ |
bool | momFromCombAndPid_ |
art::InputTag | contInputTag_ |
bool | pidFromColl_ |
art::InputTag | pidInputTag_ |
double | mom_len_cut_ |
int | pid_def_ |
bool | alwaysFlip_ |
bool | dirFromVec_ |
recob::tracking::Vector_t | dirVec |
const std::vector< recob::MCSFitResult > * | mcs = nullptr |
const std::vector< anab::CosmicTag > * | cont = nullptr |
const std::vector< anab::ParticleID > * | pid = nullptr |
trkf::TrackMomentumCalculator | tmc |
Concrete implementation of a tool to fit tracks with TrackKalmanFitter.
Concrete implementation of a tool to fit tracks with trkf::TrackKalmanFitter; inherits from abstract class TrackMaker. It prepares the input needed by the fitter (momentum, particleId, direction), and returns a track with all outputs filled. If the flag keepInputTrajectoryPoints is set to true, the tracjetory points from the input track are copied into the output, so that only the covariance matrices, the chi2 and the ndof in the output track are resulting from the fit.
For configuration options see KalmanFilterFitTrackMaker::Options and KalmanFilterFitTrackMaker::Config.
Definition at line 47 of file KalmanFilterFitTrackMaker_tool.cc.
Definition at line 125 of file KalmanFilterFitTrackMaker_tool.cc.
|
inlineexplicit |
Constructor from Parameters.
Definition at line 128 of file KalmanFilterFitTrackMaker_tool.cc.
References alwaysFlip_, contInputTag_, d, dirFromVec_, trkmkr::KalmanFilterFitTrackMaker::Options::dirVec, kalmanFitter, trkmkr::KalmanFilterFitTrackMaker::Options::keepInputTrajectoryPoints, mcsfitter, mcsInputTag_, mom_def_, mom_len_cut_, momFromCombAndPid_, momFromMCSColl_, p_, pid_def_, pidFromColl_, pidInputTag_, and prop.
double trkmkr::KalmanFilterFitTrackMaker::getMomentum | ( | const recob::TrackTrajectory & | traj, |
const int | pid, | ||
const bool | isFlip, | ||
const int | tkID | ||
) | const |
set the initial momentum estimate
Definition at line 301 of file KalmanFilterFitTrackMaker_tool.cc.
References cont, trkf::TrajectoryMCSFitter::fitMcs(), trkf::TrackMomentumCalculator::GetTrackMomentum(), anab::kNotTagged, recob::TrackTrajectory::Length(), mcs, mcsfitter, mom_def_, momFromCombAndPid_, momFromMCSColl_, pid, recob::TrackTrajectory::StartMomentum(), and tmc.
Referenced by makeTrack(), and makeTrackImpl().
int trkmkr::KalmanFilterFitTrackMaker::getParticleID | ( | const recob::TrackTrajectory & | traj, |
const int | tkID | ||
) | const |
set the particle ID hypothesis
Definition at line 333 of file KalmanFilterFitTrackMaker_tool.cc.
References recob::TrackTrajectory::Length(), mom_len_cut_, pid_def_, and pidFromColl_.
Referenced by makeTrack(), and makeTrackImpl().
|
inlineoverridevirtual |
initialize event: get collection of recob::MCSFitResult
Reimplemented from trkmkr::TrackMaker.
Definition at line 182 of file KalmanFilterFitTrackMaker_tool.cc.
References cont, contInputTag_, art::ProductRetriever::getValidHandle(), makeTrackImpl(), mcs, mcsInputTag_, momFromCombAndPid_, momFromMCSColl_, pidFromColl_, pidInputTag_, and lar::dump::vector().
bool trkmkr::KalmanFilterFitTrackMaker::isFlipDirection | ( | const recob::TrackTrajectory & | traj, |
const int | tkID | ||
) | const |
decide whether to flip the direction or not
Definition at line 343 of file KalmanFilterFitTrackMaker_tool.cc.
References alwaysFlip_, dirFromVec_, trkmkr::KalmanFilterFitTrackMaker::Options::dirVec, and recob::TrackTrajectory::VertexDirection().
Referenced by makeTrack(), and makeTrackImpl().
|
inlineinherited |
makeTrack functions with art::Ptr<recob::TrackTrajectory>; calls the purely virtual version with const recob::TrackTrajectory reference as argument.
Definition at line 207 of file TrackMaker.h.
References art::Ptr< T >::key(), track, recob::Track::Trajectory(), and lar::dump::vector().
|
inlineoverridevirtual |
override of TrackMaker purely virtual function with recob::TrackTrajectory as argument
Implements trkmkr::TrackMaker.
Definition at line 207 of file KalmanFilterFitTrackMaker_tool.cc.
References getMomentum(), getParticleID(), isFlipDirection(), makeTrackImpl(), restoreInputPoints(), and lar::dump::vector().
|
inlineinherited |
makeTrack functions with recob::Track as argument; calls the version with recob::TrackTrajectory.
Definition at line 230 of file TrackMaker.h.
bool trkmkr::KalmanFilterFitTrackMaker::makeTrackImpl | ( | const detinfo::DetectorPropertiesData & | detProp, |
const recob::TrackTrajectory & | traj, | ||
const int | tkID, | ||
const std::vector< art::Ptr< recob::Hit >> & | inHits, | ||
const recob::tracking::SMatrixSym55 & | covVtx, | ||
const recob::tracking::SMatrixSym55 & | covEnd, | ||
recob::Track & | outTrack, | ||
std::vector< art::Ptr< recob::Hit >> & | outHits, | ||
OptionalOutputs & | optionals | ||
) | const |
function that actually calls the fitter
Definition at line 268 of file KalmanFilterFitTrackMaker_tool.cc.
References trkf::TrackKalmanFitter::fitTrack(), getMomentum(), getParticleID(), isFlipDirection(), kalmanFitter, trkmkr::KalmanFilterFitTrackMaker::Options::keepInputTrajectoryPoints, p_, and restoreInputPoints().
Referenced by initEvent(), and makeTrack().
void trkmkr::KalmanFilterFitTrackMaker::restoreInputPoints | ( | const recob::TrackTrajectory & | traj, |
const std::vector< art::Ptr< recob::Hit >> & | inHits, | ||
recob::Track & | outTrack, | ||
std::vector< art::Ptr< recob::Hit >> & | outHits, | ||
OptionalOutputs & | optionals | ||
) | const |
restore the TrajectoryPoints in the Track to be the same as those in the input TrackTrajectory (but keep covariance matrices and chi2 from fit).
Definition at line 354 of file KalmanFilterFitTrackMaker_tool.cc.
References recob::Track::Chi2(), recob::Track::Covariances(), DEFINE_ART_CLASS_TOOL, recob::Track::FlagsAtPoint(), recob::TrajectoryPointFlags::fromHit(), recob::Trajectory::HasMomentum(), recob::Track::ID(), trkmkr::OptionalOutputs::isTrackFitInfosInit(), recob::TrackTrajectory::LocationAtPoint(), recob::TrajectoryPointFlags::mask(), recob::TrackTrajectory::MomentumVectorAtPoint(), recob::TrajectoryPointFlagTraits::NoPoint, recob::Track::NumberTrajectoryPoints(), recob::Track::ParticleId(), and util::flags::BitMask< Storage >::unset().
Referenced by makeTrack(), and makeTrackImpl().
|
private |
Definition at line 258 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by isFlipDirection(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 262 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by getMomentum(), and initEvent().
|
private |
Definition at line 253 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by initEvent(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 259 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by isFlipDirection(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 260 of file KalmanFilterFitTrackMaker_tool.cc.
|
private |
Definition at line 247 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by KalmanFilterFitTrackMaker(), and makeTrackImpl().
|
private |
Definition at line 261 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by getMomentum(), and initEvent().
|
private |
Definition at line 248 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by getMomentum(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 251 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by initEvent(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 249 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by getMomentum(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 256 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by getParticleID(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 252 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by getMomentum(), initEvent(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 250 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by getMomentum(), initEvent(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 245 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by KalmanFilterFitTrackMaker(), and makeTrackImpl().
|
private |
Definition at line 263 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by getMomentum().
|
private |
Definition at line 257 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by getParticleID(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 254 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by getParticleID(), initEvent(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 255 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by initEvent(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 246 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by KalmanFilterFitTrackMaker().
|
private |
Definition at line 264 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by getMomentum().