PandaRoot
KalmanFitterRefTrack.h
Go to the documentation of this file.
1 /* Copyright 2013, Ludwig-Maximilians Universität München,
2  Authors: Tobias Schlüter & Johannes Rauch
3 
4  This file is part of GENFIT.
5 
6  GENFIT is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published
8  by the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  GENFIT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
18 */
23 #ifndef genfit_KalmanFitterRefTrack_h
24 #define genfit_KalmanFitterRefTrack_h
25 
26 #include "AbsKalmanFitter.h"
27 
28 namespace genfit {
29 
30 class KalmanFitterInfo;
31 class TrackPoint;
32 
37  public:
38  KalmanFitterRefTrack(unsigned int maxIterations = 4, double deltaPval = 1e-3, double blowUpFactor = 1e3)
39  : AbsKalmanFitter(maxIterations, deltaPval, blowUpFactor), refitAll_(false), deltaChi2Ref_(1)
40  {
41  }
42 
43  virtual ~KalmanFitterRefTrack() {}
44 
49  TrackPoint *fitTrack(Track *tr, const AbsTrackRep *rep, double &chi2, double &ndf, int direction);
50 
51  void processTrackWithRep(Track *tr, const AbsTrackRep *rep, bool resortHits = false);
52 
60  bool prepareTrack(Track *tr, const AbsTrackRep *rep, bool setSortingParams, int &nFailedHits);
61 
63  void setRefitAll(bool refit = true) { refitAll_ = refit; }
64 
69  void setDeltaChi2Ref(double dChi2) { deltaChi2Ref_ = dChi2; }
70 
71  private:
72  void processTrackPoint(KalmanFitterInfo *fi, const KalmanFitterInfo *prevFi, const TrackPoint *tp, double &chi2, double &ndf, int direction);
73 
80  bool removeOutdated(Track *tr, const AbsTrackRep *rep, int &notChangedUntil, int &notChangedFrom);
81 
83  void removeForwardBackwardInfo(Track *tr, const AbsTrackRep *rep, int notChangedUntil, int notChangedFrom) const;
84 
85  bool refitAll_; // always refit all points or only if reference states have changed
86  double deltaChi2Ref_; // reference track update cut
87 
88  // aux variables for prepareTrack
89  TMatrixD FTransportMatrix_;
90  TMatrixD BTransportMatrix_;
91  TMatrixDSym FNoiseMatrix_;
92  TMatrixDSym BNoiseMatrix_;
93  TVectorD forwardDeltaState_;
94  TVectorD backwardDeltaState_;
95 
96  // aux variables for processTrackPoint
97  TVectorD p_;
98  TMatrixDSym C_;
99  TMatrixDSym covSumInv_;
100  TMatrixDSym Rinv_;
101  TVectorD res_;
102 
103  // aux variables for removeOutdated
104  TVectorD resM_;
105 
106  public:
107  ClassDef(KalmanFitterRefTrack, 1)
108 };
109 
110 } /* End of namespace genfit */
113 #endif // genfit_KalmanFitterRefTrack_h
Kalman filter implementation with linearization around a reference track.
Collection of TrackPoint objects, AbsTrackRep objects and FitStatus objects.
Definition: Track.h:67
Abstract base class for a track representation.
Definition: AbsTrackRep.h:62
KalmanFitterRefTrack(unsigned int maxIterations=4, double deltaPval=1e-3, double blowUpFactor=1e3)
Abstract base class for Kalman fitter and derived fitting algorithms.
Object containing AbsMeasurement and AbsFitterInfo objects.
Definition: TrackPoint.h:49
bool prepareTrack(Track *tr, const AbsTrackRep *rep, bool setSortingParams, int &nFailedHits)
Prepare the track.
void processTrackWithRep(Track *tr, const AbsTrackRep *rep, bool resortHits=false)
void setRefitAll(bool refit=true)
If true always refit all points, otherwise fit points only if reference states have changed...
TrackPoint * fitTrack(Track *tr, const AbsTrackRep *rep, double &chi2, double &ndf, int direction)
Fit the track.
Collects information needed and produced by a AbsKalmanFitter implementations and is specific to one ...
TMatrixT< double > TMatrixD
Definition: PndLmdDim.h:52
Matrix inversion tools.
Definition: AbsBField.h:28