LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
KalmanFilterAlg.h
Go to the documentation of this file.
1 
41 #ifndef KALMANFILTERALG_H
42 #define KALMANFILTERALG_H
43 
44 #include <vector>
45 #include <memory>
49 #include "fhiclcpp/ParameterSet.h"
51 #include "TCanvas.h"
52 #include "TMarker.h"
53 #include "TPaveText.h"
54 
55 namespace trkf {
56 
58  public:
59 
62 
65 
67  void reconfigure(const fhicl::ParameterSet& pset);
68 
69  // Accessors.
70 
71  bool getTrace() const {return fTrace;}
72  int getPlane() const {return fPlane;}
73 
74  // Modifiers.
75 
76  void setTrace(bool trace) {fTrace = trace;}
77  void setPlane(int plane) {fPlane = plane;}
78 
79  // Methods.
80 
82  bool buildTrack(const KTrack& trk, // Starting track.
83  KGTrack& trg, // Result global track.
84  const Propagator* prop, // Propagator.
85  const Propagator::PropDirection dir, // Direction.
86  KHitContainer& hits, // Candidate measurements.
87  bool linear) const; // Linear flag.
88 
90  bool smoothTrack(KGTrack& trg, // Global track to be smoothed.
91  KGTrack* trg1, // Result of unidirectional fit.
92  const Propagator* prop) const; // Propagator.
93 
95  bool extendTrack(KGTrack& trg, // Global track.
96  const Propagator* prop, // Propagator.
97  KHitContainer& hits) const; // Candidate measurements.
98 
100  bool fitMomentumRange(const KGTrack& trg, // Global track.
101  const Propagator* prop, // Propagator.
102  KETrack& tremom) const; // Track with updated momentum.
103 
105  bool fitMomentumMS(const KGTrack& trg, // Global track.
106  const Propagator* prop, // Propagator.
107  KETrack& tremom) const; // Track with updated momentum.
108 
110  bool fitMomentum(const KGTrack& trg, // Global track.
111  const Propagator* prop, // Propagator.
112  KETrack& tremom) const; // Track with updated momentum.
113 
115  bool updateMomentum(const KETrack& tremom, // Track with momentum estimate.
116  const Propagator* prop, // Propagator.
117  KGTrack& trg) const; // Global track to be updated.
118 
120  bool smoothTrackIter(int niter, // Number of iterations.
121  KGTrack& trg, // Global track.
122  const Propagator* prop) const; // Propagator.
123 
125  void cleanTrack(KGTrack& trg) const;
126 
127  private:
128 
129  // Fcl parameters.
130 
131  bool fTrace;
132  double fMaxPErr;
133  double fGoodPErr;
134  double fMaxIncChisq;
137  double fMaxEndChisq;
138  int fMinLHits;
139  double fMaxLDist;
140  double fMaxPredDist;
142  double fMaxPropDist;
143  double fMinSortDist;
144  double fMaxSortDist;
146  double fGapDist;
148  double fMinSampleDist;
150  bool fFitMomMS;
151  bool fGTrace;
152  double fGTraceWW;
153  double fGTraceWH;
154  double fGTraceXMin;
155  double fGTraceXMax;
156  std::vector<double> fGTraceZMin;
157  std::vector<double> fGTraceZMax;
158 
159  // Other attributes.
160 
161  int fPlane;
162  mutable std::vector<std::unique_ptr<TCanvas> > fCanvases;
163  mutable std::vector<TVirtualPad*> fPads;
164  mutable TVirtualPad* fInfoPad;
165  mutable TPaveText* fMessages;
166  mutable std::map<int, TMarker*> fMarkerMap;
167  };
168 }
169 
170 #endif
bool fGTrace
Graphical trace flag.
bool fFitMomRange
Fit momentum using range.
bool fitMomentumRange(const KGTrack &trg, const Propagator *prop, KETrack &tremom) const
Estimate track momentum using range.
double fMaxPropDist
Maximum propagation distance to candidate surface.
double fGapDist
Minimum gap distance.
bool fFitMomMS
Fit momentum using multiple scattering.
std::map< int, TMarker * > fMarkerMap
Markers in current canvas.
double fMaxEndChisq
Maximum incremental chisquare for endpoint hit.
bool fTrace
Trace flag.
bool smoothTrack(KGTrack &trg, KGTrack *trg1, const Propagator *prop) const
Smooth track.
KalmanFilterAlg(const fhicl::ParameterSet &pset)
Constructor.
A collection of KHitGroups.
bool extendTrack(KGTrack &trg, const Propagator *prop, KHitContainer &hits) const
Add hits to existing track.
void cleanTrack(KGTrack &trg) const
Clean track by removing noise hits near endpoints.
~KalmanFilterAlg()
Destructor.
void setTrace(bool trace)
Set trace config parameter.
bool fitMomentum(const KGTrack &trg, const Propagator *prop, KETrack &tremom) const
Estimate track momentum using either range or multiple scattering.
std::vector< double > fGTraceZMin
Graphical trace minimum z for each view.
double fMaxLDist
Maximum distance for linearized propagation.
double fMaxSortDist
Sort high distance threshold.
double fMaxSeedPredDist
Maximum prediciton distance to accept a hit in seed phase.
double fMaxPredDist
Maximum prediciton distance to accept a hit.
M::value_type trace(const M &m)
void hits()
Definition: readHits.C:15
double fGTraceWH
Window height.
TVirtualPad * fInfoPad
Information pad.
void reconfigure(const fhicl::ParameterSet &pset)
Reconfigure method.
std::vector< std::unique_ptr< TCanvas > > fCanvases
Graphical trace canvases.
bool updateMomentum(const KETrack &tremom, const Propagator *prop, KGTrack &trg) const
Set track momentum at each track surface.
double fGTraceXMin
Graphical trace minimum x.
Base class for Kalman filter track propagator.
double fGoodPErr
Pointing error threshold for switching to free propagation.
TPaveText * fMessages
Message box.
bool smoothTrackIter(int niter, KGTrack &trg, const Propagator *prop) const
Iteratively smooth a track.
double fMaxSeedIncChisq
Maximum incremental chisquare to accept a hit in seed phase.
double fMaxSmoothIncChisq
Maximum incremental chisquare to accept a hit in smooth phase.
double fMaxIncChisq
Maximum incremental chisquare to accept a hit.
double fMinSampleDist
Minimum sample distance (for momentum measurement).
double fMinSortDist
Sort low distance threshold.
bool fitMomentumMS(const KGTrack &trg, const Propagator *prop, KETrack &tremom) const
Estimate track momentum using multiple scattering.
TDirectory * dir
Definition: macro.C:5
double fGTraceXMax
Graphical trace maximum x.
std::vector< TVirtualPad * > fPads
View pads in current canvas.
void setPlane(int plane)
Set preferred view plane.
double fGTraceWW
Window width.
int getPlane() const
Preferred view plane.
std::vector< double > fGTraceZMax
Graphical trace maximum z for each view.
bool buildTrack(const KTrack &trk, KGTrack &trg, const Propagator *prop, const Propagator::PropDirection dir, KHitContainer &hits, bool linear) const
Make a new track.
int fMaxSamePlane
Maximum consecutive hits in same plane.
int fMaxNoiseHits
Maximum number of hits in noise cluster.
A collection of KHitTracks.
bool getTrace() const
Trace config parameters.
double fMaxPErr
Maximum pointing error for free propagation.
int fMinLHits
Minimum number of hits to turn off linearized propagation.
PropDirection
Propagation direction enum.
Definition: Propagator.h:92
int fPlane
Preferred view plane.