SND@LHC Software
Loading...
Searching...
No Matches
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
29namespace genfit {
30
31class KalmanFitterInfo;
32class TrackPoint;
33
38 public:
39 KalmanFitterRefTrack(unsigned int maxIterations = 4, double deltaPval = 1e-3, double blowUpFactor = 1e3)
40 : AbsKalmanFitter(maxIterations, deltaPval, blowUpFactor), refitAll_(false), deltaChi2Ref_(1) {}
41
43
48 TrackPoint* fitTrack(Track* tr, const AbsTrackRep* rep, double& chi2, double& ndf, int direction);
49
50 void processTrackWithRep(Track* tr, const AbsTrackRep* rep, bool resortHits = false);
51
59 bool prepareTrack(Track* tr, const AbsTrackRep* rep, bool setSortingParams, int& nFailedHits);
60
62 void setRefitAll(bool refit = true) {refitAll_ = refit;}
63
68 void setDeltaChi2Ref(double dChi2) {deltaChi2Ref_ = dChi2;}
69
70 private:
71 void processTrackPoint(KalmanFitterInfo* fi, const KalmanFitterInfo* prevFi, const TrackPoint* tp, double& chi2, double& ndf, int direction);
72
79 bool removeOutdated(Track* tr, const AbsTrackRep* rep, int& notChangedUntil, int& notChangedFrom);
80
82 void removeForwardBackwardInfo(Track* tr, const AbsTrackRep* rep, int notChangedUntil, int notChangedFrom) const;
83
84 bool refitAll_; // always refit all points or only if reference states have changed
85 double deltaChi2Ref_; // reference track update cut
86
87 // aux variables for prepareTrack
90 TMatrixDSym FNoiseMatrix_;
91 TMatrixDSym BNoiseMatrix_;
94
95 // aux variables for processTrackPoint
96 TVectorD p_;
97 TMatrixDSym C_;
98 TMatrixDSym covSumInv_;
99 TMatrixDSym Rinv_;
100 TVectorD res_;
101
102 // aux variables for removeOutdated
103 TVectorD resM_;
104
105 public:
106 ClassDef(KalmanFitterRefTrack, 1)
107
108};
109
110} /* End of namespace genfit */
113#endif //genfit_KalmanFitterRefTrack_h
Abstract base class for Kalman fitter and derived fitting algorithms.
Abstract base class for a track representation.
Definition AbsTrackRep.h:66
Collects information needed and produced by a AbsKalmanFitter implementations and is specific to one ...
Kalman filter implementation with linearization around a reference track.
void processTrackPoint(KalmanFitterInfo *fi, const KalmanFitterInfo *prevFi, const TrackPoint *tp, double &chi2, double &ndf, int direction)
void processTrackWithRep(Track *tr, const AbsTrackRep *rep, bool resortHits=false)
void removeForwardBackwardInfo(Track *tr, const AbsTrackRep *rep, int notChangedUntil, int notChangedFrom) const
If refitAll_, remove all information.
bool removeOutdated(Track *tr, const AbsTrackRep *rep, int &notChangedUntil, int &notChangedFrom)
Remove referenceStates if they are too far from smoothed states.
void setRefitAll(bool refit=true)
If true always refit all points, otherwise fit points only if reference states have changed.
KalmanFitterRefTrack(unsigned int maxIterations=4, double deltaPval=1e-3, double blowUpFactor=1e3)
bool prepareTrack(Track *tr, const AbsTrackRep *rep, bool setSortingParams, int &nFailedHits)
Prepare the track.
TrackPoint * fitTrack(Track *tr, const AbsTrackRep *rep, double &chi2, double &ndf, int direction)
Fit the track.
Object containing AbsMeasurement and AbsFitterInfo objects.
Definition TrackPoint.h:50
Collection of TrackPoint objects, AbsTrackRep objects and FitStatus objects.
Definition Track.h:71
Matrix inversion tools.
Definition AbsBField.h:29