FairRoot/PandaRoot
GFKalman.h
Go to the documentation of this file.
1 /* Copyright 2008-2010, Technische Universitaet Muenchen,
2  Authors: Christian Hoeppner & Sebastian Neubert
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 GFKALMAN_H
24 #define GFKALMAN_H
25 
26 #include <map>
27 #include <iostream>
28 
29 #include "TMatrixT.h"
30 
31 
32 class GFAbsRecoHit;
33 class GFAbsTrackRep;
34 class GFTrack;
35 
50 class GFKalman {
51 public:
52 
53  //friend class KalmanTester; // gives the Tester access to private methods
54 
55  // Constructors/Destructors ---------
56  GFKalman();
57  ~GFKalman();
58 
59  // Operators
65  inline void operator()(GFTrack* track){processTrack(track);}
66 
72  inline void operator()(std::pair<int,GFTrack*> tr){processTrack(tr.second);}
73 
74  // Operations ----------------------
75 
80  void setLazy(Int_t){std::cerr<<"Using outdates setLazy method of class GFKalman:"<<std::endl;}
81 
86  void setNumIterations(Int_t i){fNumIt=i;}
87 
93  void processTrack(GFTrack* trk);
94 
97  void fittingPass(GFTrack*,int dir); // continues track from lastHitInFit
98 
103 
108 
112 
113  // Private Methods -----------------
114 private:
123  void processHit(GFTrack*, int, int, int);
124 
127  void switchDirection(GFTrack* trk); // switches the direction of propagation for all reps
128 
131  TMatrixT<double> calcGain(const TMatrixT<double>& cov,
132  const TMatrixT<double>& HitCov,
133  const TMatrixT<double>& H);
134 
137  double chi2Increment(const TMatrixT<double>& r,const TMatrixT<double>& H,
138  const TMatrixT<double>& cov,const TMatrixT<double>& V);
139 
143  void blowUpCovs(GFTrack* trk);
144 
146  Int_t fNumIt;
148  bool fSmooth;
149 
150 
151 
152 
153 };
154 
155 
156 #endif
157 
double chi2Increment(const TMatrixT< double > &r, const TMatrixT< double > &H, const TMatrixT< double > &cov, const TMatrixT< double > &V)
this returns the reduced chi2 increment for a hit
Definition: GFKalman.cxx:178
Base Class for genfit track representations. Defines interface for track parameterizations.
Definition: GFAbsTrackRep.h:80
TMatrixT< double > calcGain(const TMatrixT< double > &cov, const TMatrixT< double > &HitCov, const TMatrixT< double > &H)
Calculate Kalman Gain.
Definition: GFKalman.cxx:327
int fInitialDirection
Definition: GFKalman.h:145
double r
Definition: RiemannTest.C:14
TObjArray * d
Int_t i
Definition: run_full.C:25
void setLazy(Int_t)
Switch lazy error handling.
Definition: GFKalman.h:80
Track object for genfit. genfit algorithms work on these objects.
Definition: GFTrack.h:60
PndRiemannTrack track
Definition: RiemannTest.C:33
double fBlowUpFactor
Definition: GFKalman.h:147
Generic Kalman Filter implementation.
Definition: GFKalman.h:50
bool fSmooth
Definition: GFKalman.h:148
void fittingPass(GFTrack *, int dir)
Performs fit on a GFTrack beginning with the current hit.
Definition: GFKalman.cxx:133
void setInitialDirection(int d)
Sets the inital direction of the track fit (1 for inner to outer, or -1 for outer to inner)...
Definition: GFKalman.h:107
void operator()(GFTrack *track)
Operator for use with STL.
Definition: GFKalman.h:65
~GFKalman()
Definition: GFKalman.cxx:38
TFile * f
Definition: bump_analys.C:12
void processTrack(GFTrack *trk)
Performs fit on a GFTrack.
Definition: GFKalman.cxx:40
GFKalman()
Definition: GFKalman.cxx:36
Base Class for representing a Hit in GENFIT.
Definition: GFAbsRecoHit.h:73
GFTrack * trk
Definition: checkgenfit.C:13
void operator()(std::pair< int, GFTrack * > tr)
Operator for use with STL.
Definition: GFKalman.h:72
void blowUpCovs(GFTrack *trk)
this is needed to blow up the covariance matrix before a fitting pass drops off-diagonal elements and...
Definition: GFKalman.cxx:128
void processHit(GFTrack *, int, int, int)
One Kalman step.
Definition: GFKalman.cxx:240
void setBlowUpFactor(double f)
Set the blowup factor (see blowUpCovs() )
Definition: GFKalman.h:111
double getChi2Hit(GFAbsRecoHit *, GFAbsTrackRep *)
Calculates chi2 of a given hit with respect to a given track representation.
Definition: GFKalman.cxx:215
void switchDirection(GFTrack *trk)
Used to switch between forward and backward filtering.
Definition: GFKalman.cxx:121
void setNumIterations(Int_t i)
Set number of iterations for Kalman Filter.
Definition: GFKalman.h:86
Int_t fNumIt
Definition: GFKalman.h:146