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 class GFAbsRecoHit;
32 class GFAbsTrackRep;
33 class GFTrack;
34 
49 class GFKalman {
50  public:
51  // friend class KalmanTester; // gives the Tester access to private methods
52 
53  // Constructors/Destructors ---------
54  GFKalman();
55  ~GFKalman();
56 
57  // Operators
63  inline void operator()(GFTrack *track) { processTrack(track); }
64 
70  inline void operator()(std::pair<int, GFTrack *> tr) { processTrack(tr.second); }
71 
72  // Operations ----------------------
73 
78  void setLazy(Int_t) { std::cerr << "Using outdates setLazy method of class GFKalman:" << std::endl; }
79 
84  void setNumIterations(Int_t i) { fNumIt = i; }
85 
91  void processTrack(GFTrack *trk);
92 
95  void fittingPass(GFTrack *, int dir); // continues track from lastHitInFit
96 
101 
105  void setInitialDirection(int d) { fInitialDirection = d; }
106 
109  void setBlowUpFactor(double f) { fBlowUpFactor = f; }
110 
111  // Private Methods -----------------
112  private:
121  void processHit(GFTrack *, int, int, int);
122 
125  void switchDirection(GFTrack *trk); // switches the direction of propagation for all reps
126 
129  TMatrixT<double> calcGain(const TMatrixT<double> &cov, const TMatrixT<double> &HitCov, const TMatrixT<double> &H);
130 
133  double chi2Increment(const TMatrixT<double> &r, const TMatrixT<double> &H, const TMatrixT<double> &cov, const TMatrixT<double> &V);
134 
138  void blowUpCovs(GFTrack *trk);
139 
140  int fInitialDirection;
141  Int_t fNumIt;
142  double fBlowUpFactor;
143  bool fSmooth;
144 };
145 
146 #endif
147 
Base Class for genfit track representations. Defines interface for track parameterizations.
Definition: GFAbsTrackRep.h:80
void setLazy(Int_t)
Switch lazy error handling.
Definition: GFKalman.h:78
Track object for genfit. genfit algorithms work on these objects.
Definition: GFTrack.h:59
Generic Kalman Filter implementation.
Definition: GFKalman.h:49
void fittingPass(GFTrack *, int dir)
Performs fit on a GFTrack beginning with the current hit.
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:105
unsigned int i
Definition: P4_F32vec4.h:21
void operator()(GFTrack *track)
Operator for use with STL.
Definition: GFKalman.h:63
void processTrack(GFTrack *trk)
Performs fit on a GFTrack.
Base Class for representing a Hit in GENFIT.
Definition: GFAbsRecoHit.h:71
float f
Definition: P4_F32vec4.h:20
void setBlowUpFactor(double f)
Set the blowup factor (see blowUpCovs() )
Definition: GFKalman.h:109
double getChi2Hit(GFAbsRecoHit *, GFAbsTrackRep *)
Calculates chi2 of a given hit with respect to a given track representation.
void operator()(std::pair< int, GFTrack *> tr)
Operator for use with STL.
Definition: GFKalman.h:70
void setNumIterations(Int_t i)
Set number of iterations for Kalman Filter.
Definition: GFKalman.h:84