SND@LHC Software
Loading...
Searching...
No Matches
AbsKalmanFitter.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_AbsKalmanFitter_h
24#define genfit_AbsKalmanFitter_h
25
26#include "AbsFitter.h"
27#include "MeasurementOnPlane.h"
28#include "TrackPoint.h"
29
30
31namespace genfit {
32
33class KalmanFitterInfo;
34
47
51class AbsKalmanFitter : public AbsFitter {
52
53 public:
54
55 AbsKalmanFitter(unsigned int maxIterations = 4, double deltaPval = 1e-3, double blowUpFactor = 1e3)
56 : AbsFitter(), minIterations_(2), maxIterations_(maxIterations), deltaPval_(deltaPval), relChi2Change_(0.2),
58 maxFailedHits_(-1) {
61 }
62
63 virtual ~AbsKalmanFitter() {;}
64
65 //virtual void fitTrack(Track* tr, const AbsTrackRep* rep, double& chi2, double& ndf, int direction) = 0;
66
67 void getChiSquNdf(const Track* tr, const AbsTrackRep* rep, double& bChi2, double& fChi2, double& bNdf, double& fNdf) const;
68 double getChiSqu(const Track* tr, const AbsTrackRep* rep, int direction = -1) const;
69 double getNdf(const Track* tr, const AbsTrackRep* rep, int direction = -1) const;
70 double getRedChiSqu(const Track* tr, const AbsTrackRep* rep, int direction = -1) const;
71 double getPVal(const Track* tr, const AbsTrackRep* rep, int direction = -1) const;
73
75 virtual void setMinIterations(unsigned int n) {minIterations_ = std::max((unsigned int)1,n); if (maxIterations_ < minIterations_) maxIterations_ = minIterations_;}
78
85 void setDeltaPval(double deltaPval) {deltaPval_ = deltaPval;}
86
96 void setRelChi2Change(double relChi2Change) {relChi2Change_ = relChi2Change;}
97
100
101 virtual void setMaxFailedHits(int val) {maxFailedHits_ = val;}
102
103 bool isTrackPrepared(const Track* tr, const AbsTrackRep* rep) const;
104 bool isTrackFitted(const Track* tr, const AbsTrackRep* rep) const;
105
107 bool canIgnoreWeights() const;
108
109 protected:
110
112 const std::vector<MeasurementOnPlane *> getMeasurements(const KalmanFitterInfo* fi, const TrackPoint* tp, int direction) const;
113
115 unsigned int minIterations_;
116
118 unsigned int maxIterations_;
138
141
145
146 public:
147
148 ClassDef(AbsKalmanFitter, 1)
149
150};
151
152} /* End of namespace genfit */
155#endif //genfit_AbsKalmanFitter_h
Abstract base class for fitters.
Definition AbsFitter.h:35
Abstract base class for Kalman fitter and derived fitting algorithms.
double blowUpFactor_
Blow up the covariance of the forward (backward) fit by this factor before seeding the backward (forw...
virtual void setMaxIterations(unsigned int n)
Set the maximum number of iterations.
double getChiSqu(const Track *tr, const AbsTrackRep *rep, int direction=-1) const
unsigned int maxIterations_
Maximum number of iterations to attempt. Forward and backward are counted as one iteration.
void setDeltaPval(double deltaPval)
Set Convergence criterion.
double getRedChiSqu(const Track *tr, const AbsTrackRep *rep, int direction=-1) const
void setMultipleMeasurementHandling(eMultipleMeasurementHandling mmh)
How should multiple measurements be handled?
bool canIgnoreWeights() const
returns if the fitter can ignore the weights and handle the MeasurementOnPlanes as if they had weight...
bool isTrackFitted(const Track *tr, const AbsTrackRep *rep) const
const std::vector< MeasurementOnPlane * > getMeasurements(const KalmanFitterInfo *fi, const TrackPoint *tp, int direction) const
get the measurementsOnPlane taking the multipleMeasurementHandling_ into account
void setRelChi2Change(double relChi2Change)
void getChiSquNdf(const Track *tr, const AbsTrackRep *rep, double &bChi2, double &fChi2, double &bNdf, double &fNdf) const
double deltaPval_
Convergence criterion.
eMultipleMeasurementHandling getMultipleMeasurementHandling() const
double getPVal(const Track *tr, const AbsTrackRep *rep, int direction=-1) const
virtual void setMaxFailedHits(int val)
virtual void setMinIterations(unsigned int n)
Set the minimum number of iterations.
unsigned int minIterations_
Minimum number of iterations to attempt. Forward and backward are counted as one iteration.
bool isTrackPrepared(const Track *tr, const AbsTrackRep *rep) const
eMultipleMeasurementHandling multipleMeasurementHandling_
How to handle if there are multiple MeasurementsOnPlane.
double getNdf(const Track *tr, const AbsTrackRep *rep, int direction=-1) const
AbsKalmanFitter(unsigned int maxIterations=4, double deltaPval=1e-3, double blowUpFactor=1e3)
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 ...
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
eMultipleMeasurementHandling
@ weightedClosestToPrediction
@ weightedClosestToReference
@ weightedClosestToReferenceWire
@ unweightedClosestToReference
@ weightedClosestToPredictionWire
@ unweightedClosestToPredictionWire
@ unweightedClosestToPrediction
@ unweightedClosestToReferenceWire
@ unweightedAverage