LArSoft
v07_13_02
Liquid Argon Software toolkit - http://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... | |
virtual void | initEvent (const art::Event &e) override |
initialize event: get collection of recob::MCSFitResult More... | |
bool | makeTrackImpl (const recob::TrackTrajectory &traj, const int tkID, const std::vector< art::Ptr< recob::Hit >> &inHits, const SMatrixSym55 &covVtx, const 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 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 |
bool | makeTrack (const recob::Track &track, const std::vector< art::Ptr< recob::Hit >> &inHits, recob::Track &outTrack, std::vector< art::Ptr< recob::Hit >> &outHits, OptionalOutputs &optionals) const override |
override of TrackMaker virtual function with recob::Track as argument More... | |
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 |
virtual bool | makeTrack (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... | |
virtual bool | makeTrack (const recob::TrackTrajectory &ttraj, const int tkID, const std::vector< art::Ptr< recob::Hit > > &inHits, recob::Track &outTrack, std::vector< art::Ptr< recob::Hit > > &outHits, OptionalOutputs &optionals) const =0 |
makeTrack functions with const recob::TrackTrajectory reference as argument: purely virtual, to be implemented in concrete classes. More... | |
virtual bool | makeTrack (const recob::Trajectory &traj, const std::vector< recob::TrajectoryPointFlags > &flags, const int tkID, const std::vector< art::Ptr< recob::Hit > > &inHits, recob::Track &outTrack, std::vector< art::Ptr< recob::Hit > > &outHits, OptionalOutputs &optionals) const |
makeTrack functions with recob::Trajectory as argument; calls the version with recob::TrackTrajectory using a dummy flags vector. More... | |
virtual bool | makeTrack (const art::Ptr< recob::Trajectory > traj, const std::vector< recob::TrajectoryPointFlags > &flags, const std::vector< art::Ptr< recob::Hit > > &inHits, recob::Track &outTrack, std::vector< art::Ptr< recob::Hit > > &outHits, OptionalOutputs &optionals) const |
makeTrack functions with recob::Trajectory as argument; calls the version with recob::TrackTrajectory using a dummy flags vector. More... | |
virtual bool | makeTrack (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 |
makeTrack functions with recob::Track as argument; calls the version with recob::TrackTrajectory. More... | |
virtual bool | makeTrack (const recob::Track &track, const std::vector< art::Ptr< recob::Hit > > &inHits, recob::Track &outTrack, std::vector< art::Ptr< recob::Hit > > &outHits, OptionalOutputs &optionals) const |
makeTrack functions with recob::Track as argument; calls the version with recob::TrackTrajectory. More... | |
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 46 of file KalmanFilterFitTrackMaker_tool.cc.
Definition at line 128 of file KalmanFilterFitTrackMaker_tool.cc.
|
inlineexplicit |
Constructor from Parameters.
Definition at line 131 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 342 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, 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 379 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 193 of file KalmanFilterFitTrackMaker_tool.cc.
References cont, contInputTag_, art::DataViewImpl::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 392 of file KalmanFilterFitTrackMaker_tool.cc.
References alwaysFlip_, dirFromVec_, trkmkr::KalmanFilterFitTrackMaker::Options::dirVec, and recob::TrackTrajectory::VertexDirection().
Referenced by makeTrack(), and makeTrackImpl().
|
inlinevirtualinherited |
makeTrack functions with recob::Trajectory as argument; calls the version with recob::TrackTrajectory using a dummy flags vector.
Definition at line 162 of file TrackMaker.h.
|
inlinevirtualinherited |
makeTrack functions with recob::Trajectory as argument; calls the version with recob::TrackTrajectory using a dummy flags vector.
Definition at line 168 of file TrackMaker.h.
References art::Ptr< T >::key(), and recob::Trajectory::NPoints().
|
inlinevirtualinherited |
makeTrack functions with art::Ptr<recob::TrackTrajectory>; calls the purely virtual version with const recob::TrackTrajectory reference as argument.
Definition at line 177 of file TrackMaker.h.
References art::Ptr< T >::key(), track, recob::Track::Trajectory(), and lar::dump::vector().
|
pure virtualinherited |
makeTrack functions with const recob::TrackTrajectory reference as argument: purely virtual, to be implemented in concrete classes.
|
inlinevirtualinherited |
makeTrack functions with recob::Track as argument; calls the version with recob::TrackTrajectory.
Definition at line 189 of file TrackMaker.h.
|
inlinevirtualinherited |
makeTrack functions with recob::Track as argument; calls the version with recob::TrackTrajectory.
Definition at line 195 of file TrackMaker.h.
References recob::Track::ID(), and recob::Track::Trajectory().
|
inlineoverride |
override of TrackMaker purely virtual function with recob::TrackTrajectory as argument
Definition at line 219 of file KalmanFilterFitTrackMaker_tool.cc.
References makeTrackImpl().
|
inlineoverride |
override of TrackMaker virtual function with recob::Track as argument
Definition at line 238 of file KalmanFilterFitTrackMaker_tool.cc.
References recob::Track::Covariances(), getMomentum(), getParticleID(), recob::Track::ID(), isFlipDirection(), makeTrackImpl(), restoreInputPoints(), recob::Track::Trajectory(), and lar::dump::vector().
bool trkmkr::KalmanFilterFitTrackMaker::makeTrackImpl | ( | const recob::TrackTrajectory & | traj, |
const int | tkID, | ||
const std::vector< art::Ptr< recob::Hit >> & | inHits, | ||
const SMatrixSym55 & | covVtx, | ||
const SMatrixSym55 & | covEnd, | ||
recob::Track & | outTrack, | ||
std::vector< art::Ptr< recob::Hit >> & | outHits, | ||
OptionalOutputs & | optionals | ||
) | const |
function that actually calls the fitter
Definition at line 299 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 406 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 288 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by isFlipDirection(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 292 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by getMomentum(), and initEvent().
|
private |
Definition at line 283 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by initEvent(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 289 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by isFlipDirection(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 290 of file KalmanFilterFitTrackMaker_tool.cc.
|
private |
Definition at line 277 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by KalmanFilterFitTrackMaker(), and makeTrackImpl().
|
private |
Definition at line 291 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by getMomentum(), and initEvent().
|
private |
Definition at line 278 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by getMomentum(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 281 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by initEvent(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 279 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by getMomentum(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 286 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by getParticleID(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 282 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by getMomentum(), initEvent(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 280 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by getMomentum(), initEvent(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 275 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by KalmanFilterFitTrackMaker(), and makeTrackImpl().
|
private |
Definition at line 293 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by getMomentum().
|
private |
Definition at line 287 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by getParticleID(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 284 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by getParticleID(), initEvent(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 285 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by initEvent(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 276 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by KalmanFilterFitTrackMaker().
|
private |
Definition at line 294 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by getMomentum().