PandaRoot
KalmanFitter.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 /* Copyright 2013, Ludwig-Maximilians Universität München,
14  Authors: Tobias Schlüter & Johannes Rauch
15 
16  This file is part of GENFIT.
17 
18  GENFIT is free software: you can redistribute it and/or modify
19  it under the terms of the GNU Lesser General Public License as published
20  by the Free Software Foundation, either version 3 of the License, or
21  (at your option) any later version.
22 
23  GENFIT is distributed in the hope that it will be useful,
24  but WITHOUT ANY WARRANTY; without even the implied warranty of
25  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26  GNU Lesser General Public License for more details.
27 
28  You should have received a copy of the GNU Lesser General Public License
29  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
30 */
35 #ifndef genfit_KalmanFitter_h
36 #define genfit_KalmanFitter_h
37 
38 #include "AbsKalmanFitter.h"
39 
40 #ifndef __CINT__
41 #include <boost/scoped_ptr.hpp>
42 #endif
43 
44 namespace genfit {
45 
46 class KalmanFitterInfo;
47 class MeasuredStateOnPlane;
48 class TrackPoint;
49 
53 class KalmanFitter : public AbsKalmanFitter {
54 
55  private:
56  // These private functions are needed, otherwise strange things happen, no idea why!
57  KalmanFitter(const KalmanFitter &);
58  KalmanFitter &operator=(KalmanFitter const &);
59 
60  public:
61  KalmanFitter(unsigned int maxIterations = 4, double deltaPval = 1e-3, double blowUpFactor = 1e3, bool squareRootFormalism = false)
62  : AbsKalmanFitter(maxIterations, deltaPval, blowUpFactor), currentState_(nullptr), squareRootFormalism_(squareRootFormalism)
63  {
64  }
65 
67 
69  void processTrackWithRep(Track *tr, const AbsTrackRep *rep, bool resortHits = false);
70 
73  void processTrackPartially(Track *tr, const AbsTrackRep *rep, int startId = 0, int endId = -1);
74 
75  void useSquareRootFormalism(bool squareRootFormalism = true) { squareRootFormalism_ = squareRootFormalism; }
76 
77  private:
78  bool fitTrack(Track *tr, const AbsTrackRep *rep, double &chi2, double &ndf, int startId, int endId, int &nFailedHits);
79  void processTrackPoint(TrackPoint *tp, const AbsTrackRep *rep, double &chi2, double &ndf, int direction);
80 
81 #ifndef __CINT__
82  boost::scoped_ptr<MeasuredStateOnPlane> currentState_;
83 #else
84  MeasuredStateOnPlane *currentState_;
85 #endif
86 
87  bool squareRootFormalism_;
88 
89  public:
90  ClassDef(KalmanFitter, 1)
91 };
92 
93 } /* End of namespace genfit */
96 #endif // genfit_KalmanFitter_h
void useSquareRootFormalism(bool squareRootFormalism=true)
Definition: KalmanFitter.h:75
Simple Kalman filter implementation.
Definition: KalmanFitter.h:53
Collection of TrackPoint objects, AbsTrackRep objects and FitStatus objects.
Definition: Track.h:79
Abstract base class for a track representation.
Definition: AbsTrackRep.h:74
StateOnPlane with additional covariance matrix.
Abstract base class for Kalman fitter and derived fitting algorithms.
Object containing AbsMeasurement and AbsFitterInfo objects.
Definition: TrackPoint.h:61
void processTrackPartially(Track *tr, const AbsTrackRep *rep, int startId=0, int endId=-1)
void processTrackWithRep(Track *tr, const AbsTrackRep *rep, bool resortHits=false)
Hit resorting currently NOT supported.
KalmanFitter(unsigned int maxIterations=4, double deltaPval=1e-3, double blowUpFactor=1e3, bool squareRootFormalism=false)
Definition: KalmanFitter.h:61
Matrix inversion tools.
Definition: AbsBField.h:40