LArSoft
v06_85_00
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... | |
~KalmanFilterFitTrackMaker () | |
Destructor. 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 |
override of TrackMaker purely virtual function with recob::TrackTrajectory as argument More... | |
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 | setParticleID (const recob::TrackTrajectory &traj, const int tkID) const |
set the particle ID hypothesis More... | |
double | setMomentum (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 |
restore the TrajectoryPoints in the Track to be the same as those in the input TrackTrajectory (but keep covariance matrices and chi2 from fit). More... | |
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::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... | |
Private Attributes | |
Parameters | p_ |
const trkf::TrackKalmanFitter * | kalmanFitter |
const trkf::TrackStatePropagator * | prop |
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 40 of file KalmanFilterFitTrackMaker_tool.cc.
Definition at line 127 of file KalmanFilterFitTrackMaker_tool.cc.
|
inlineexplicit |
Constructor from Parameters.
Definition at line 130 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.
|
inline |
Destructor.
Definition at line 177 of file KalmanFilterFitTrackMaker_tool.cc.
References kalmanFitter, mcsfitter, and prop.
|
inlineoverridevirtual |
initialize event: get collection of recob::MCSFitResult
Reimplemented from trkmkr::TrackMaker.
Definition at line 184 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 304 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().
|
inlinevirtualinherited |
makeTrack functions with recob::Track as argument; calls the version with recob::TrackTrajectory.
Definition at line 189 of file TrackMaker.h.
|
inlineoverridevirtual |
override of TrackMaker purely virtual function with recob::TrackTrajectory as argument
Implements trkmkr::TrackMaker.
Definition at line 201 of file KalmanFilterFitTrackMaker_tool.cc.
References makeTrackImpl().
|
inlineoverridevirtual |
override of TrackMaker virtual function with recob::Track as argument
Reimplemented from trkmkr::TrackMaker.
Definition at line 207 of file KalmanFilterFitTrackMaker_tool.cc.
References recob::Track::Covariances(), recob::Track::ID(), isFlipDirection(), makeTrackImpl(), restoreInputPoints(), setMomentum(), setParticleID(), 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 249 of file KalmanFilterFitTrackMaker_tool.cc.
References trkf::TrackKalmanFitter::fitTrack(), isFlipDirection(), kalmanFitter, trkmkr::KalmanFilterFitTrackMaker::Options::keepInputTrajectoryPoints, p_, restoreInputPoints(), setMomentum(), and setParticleID().
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 314 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::Trajectory::LocationAtPoint(), recob::TrajectoryPointFlags::mask(), recob::Trajectory::MomentumVectorAtPoint(), recob::TrajectoryPointFlagTraits::NoPoint, recob::Track::NumberTrajectoryPoints(), recob::Track::ParticleId(), and util::flags::BitMask< Storage >::unset().
Referenced by makeTrack(), and makeTrackImpl().
double trkmkr::KalmanFilterFitTrackMaker::setMomentum | ( | const recob::TrackTrajectory & | traj, |
const int | pid, | ||
const bool | isFlip, | ||
const int | tkID | ||
) | const |
set the initial momentum estimate
Definition at line 269 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::setParticleID | ( | const recob::TrackTrajectory & | traj, |
const int | tkID | ||
) | const |
set the particle ID hypothesis
Definition at line 294 of file KalmanFilterFitTrackMaker_tool.cc.
References recob::TrackTrajectory::Length(), mom_len_cut_, pid_def_, and pidFromColl_.
Referenced by makeTrack(), and makeTrackImpl().
|
private |
Definition at line 238 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by isFlipDirection(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 242 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by initEvent(), and setMomentum().
|
private |
Definition at line 233 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by initEvent(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 239 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by isFlipDirection(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 240 of file KalmanFilterFitTrackMaker_tool.cc.
|
private |
Definition at line 226 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by KalmanFilterFitTrackMaker(), makeTrackImpl(), and ~KalmanFilterFitTrackMaker().
|
private |
Definition at line 241 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by initEvent(), and setMomentum().
|
private |
Definition at line 228 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by KalmanFilterFitTrackMaker(), setMomentum(), and ~KalmanFilterFitTrackMaker().
|
private |
Definition at line 231 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by initEvent(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 229 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by KalmanFilterFitTrackMaker(), and setMomentum().
|
private |
Definition at line 236 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by KalmanFilterFitTrackMaker(), and setParticleID().
|
private |
Definition at line 232 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by initEvent(), KalmanFilterFitTrackMaker(), and setMomentum().
|
private |
Definition at line 230 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by initEvent(), KalmanFilterFitTrackMaker(), and setMomentum().
|
private |
Definition at line 225 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by KalmanFilterFitTrackMaker(), and makeTrackImpl().
|
private |
Definition at line 243 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by setMomentum().
|
private |
Definition at line 237 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by KalmanFilterFitTrackMaker(), and setParticleID().
|
private |
Definition at line 234 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by initEvent(), KalmanFilterFitTrackMaker(), and setParticleID().
|
private |
Definition at line 235 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by initEvent(), and KalmanFilterFitTrackMaker().
|
private |
Definition at line 227 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by KalmanFilterFitTrackMaker(), and ~KalmanFilterFitTrackMaker().
|
mutableprivate |
Definition at line 244 of file KalmanFilterFitTrackMaker_tool.cc.
Referenced by setMomentum().