1 #ifndef TRACKKALMANFITTER_H 2 #define TRACKKALMANFITTER_H 21 struct OptionalOutputs;
55 Comment(
"Flag to replace the default hit error recob::Hit::SigmaPeakTime() with recob::Hit::RMS()."),
59 Name(
"sortHitsByPlane"),
60 Comment(
"Flag to sort hits along the forward fit. The hit order in each plane is preserved, the next hit to process in 3D is chosen as the one with shorter 3D propagation distance among the next hit in all planes."),
64 Name(
"sortOutputHitsMinLength"),
65 Comment(
"Flag to decide whether the hits are sorted before creating the output track in order to avoid tracks with huge length."),
70 Comment(
"Flag to decide whether, during the forward fit, the hits corresponding to a negative propagation distance should be dropped. Also, if sortOutputHitsMinLength is true, during sorting hits at a negative distance with respect to the previous are rejected."),
75 Comment(
"Flag to decide whether hits with a zigzag pattern should be iteratively removed. Zigzag identified as negative dot product of segments connecting a point to the points before and after it."),
79 Name(
"rejectHighMultHits"),
80 Comment(
"Flag to rejects hits with recob::Hit::Multiplicity()>1."),
84 Name(
"rejectHitsNegativeGOF"),
85 Comment(
"Flag to rejects hits with recob::Hit::GoodnessOfFit<0."),
89 Name(
"hitErr2ScaleFact"),
90 Comment(
"Scale the hit error squared by this factor."),
94 Name(
"tryNoSkipWhenFails"),
95 Comment(
"In case skipNegProp is true and the track fit fails, make a second attempt to fit the track with skipNegProp=false in order to attempt to avoid losing efficiency."),
100 Comment(
"0 for no debug printouts, 1 for moderate, 2 for maximum."),
108 bool rejectHighMultHits,
bool rejectHitsNegativeGOF,
float hitErr2ScaleFact,
bool tryNoSkipWhenFails,
int dumpLevel){
111 sortHitsByPlane_=sortHitsByPlane;
112 sortOutputHitsMinLength_=sortOutputHitsMinLength;
113 skipNegProp_=skipNegProp;
114 cleanZigzag_=cleanZigzag;
115 rejectHighMultHits_=rejectHighMultHits;
116 rejectHitsNegativeGOF_=rejectHitsNegativeGOF;
117 hitErr2ScaleFact_=hitErr2ScaleFact;
118 tryNoSkipWhenFails_=tryNoSkipWhenFails;
119 dumpLevel_=dumpLevel;
125 :
TrackKalmanFitter(prop,p().useRMS(),p().sortHitsByPlane(),p().sortOutputHitsMinLength(),p().skipNegProp(),p().cleanZigzag(),
126 p().rejectHighMultHits(),p().rejectHitsNegativeGOF(),p().hitErr2ScaleFact(),p().tryNoSkipWhenFails(),p().dumpLevel()) {}
136 const int tkID,
const double pval,
const int pdgid,
140 bool doFitWork(
KFTrackState& trackState, std::vector<HitState>& hitstatev, std::vector<recob::TrajectoryPointFlags::Mask_t>& hitflagsv,
141 std::vector<KFTrackState>& fwdPrdTkState, std::vector<KFTrackState>& fwdUpdTkState,
142 std::vector<unsigned int>& hitstateidx, std::vector<unsigned int>& rejectedhsidx, std::vector<unsigned int>& sortedtksidx,
143 bool applySkipClean =
true)
const;
152 std::vector<HitState>& hitstatev, std::vector<recob::TrajectoryPointFlags::Mask_t>& hitflagsv)
const;
155 void sortOutput(std::vector<HitState>& hitstatev, std::vector<KFTrackState>& fwdUpdTkState,
156 std::vector<unsigned int>& hitstateidx, std::vector<unsigned int>& rejectedhsidx,
157 std::vector<unsigned int>& sortedtksidx,
bool applySkipClean =
true)
const;
161 std::vector<HitState>& hitstatev, std::vector<recob::TrajectoryPointFlags::Mask_t>& hitflagsv,
162 std::vector<KFTrackState>& fwdPrdTkState, std::vector<KFTrackState>& fwdUpdTkState,
163 std::vector<unsigned int>& hitstateidx, std::vector<unsigned int>& rejectedhsidx, std::vector<unsigned int>& sortedtksidx,
Fit tracks using Kalman Filter fit+smooth.
Reconstruction base classes.
recob::tracking::Point_t Point_t
recob::tracking::Vector_t Vector_t
recob::tracking::SMatrixSym55 SMatrixSym55
Class for propagation of a trkf::TrackState to a recob::tracking::Plane.
const detinfo::DetectorProperties * detprop
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Extension of a TrackState to perform KalmanFilter calculations.
bool rejectHitsNegativeGOF_
Provides recob::Track data product.
A trajectory in space reconstructed from hits.
const TrackStatePropagator * propagator
art::ServiceHandle< geo::Geometry > geom
bool sortOutputHitsMinLength_
TrackKalmanFitter(const TrackStatePropagator *prop, Parameters const &p)
Constructor from TrackStatePropagator and Parameters table.
Struct holding optional TrackMaker outputs.
art framework interface to geometry description
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
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.