PandaRoot
GFKalman.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 2008-2010, Technische Universitaet Muenchen,
14  Authors: Christian Hoeppner & Sebastian Neubert
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 GFKALMAN_H
36 #define GFKALMAN_H
37 
38 #include <map>
39 #include <iostream>
40 
41 #include "TMatrixT.h"
42 
43 class GFAbsRecoHit;
44 class GFAbsTrackRep;
45 class GFTrack;
46 
61 class GFKalman {
62  public:
63  // friend class KalmanTester; // gives the Tester access to private methods
64 
65  // Constructors/Destructors ---------
66  GFKalman();
67  ~GFKalman();
68 
69  // Operators
75  inline void operator()(GFTrack *track) { processTrack(track); }
76 
82  inline void operator()(std::pair<int, GFTrack *> tr) { processTrack(tr.second); }
83 
84  // Operations ----------------------
85 
90  void setLazy(Int_t) { std::cerr << "Using outdates setLazy method of class GFKalman:" << std::endl; }
91 
96  void setNumIterations(Int_t i) { fNumIt = i; }
97 
103  void processTrack(GFTrack *trk);
104 
107  void fittingPass(GFTrack *, int dir); // continues track from lastHitInFit
108 
113 
117  void setInitialDirection(int d) { fInitialDirection = d; }
118 
121  void setBlowUpFactor(double f) { fBlowUpFactor = f; }
122 
123  // Private Methods -----------------
124  private:
133  void processHit(GFTrack *, int, int, int);
134 
137  void switchDirection(GFTrack *trk); // switches the direction of propagation for all reps
138 
141  TMatrixT<double> calcGain(const TMatrixT<double> &cov, const TMatrixT<double> &HitCov, const TMatrixT<double> &H);
142 
145  double chi2Increment(const TMatrixT<double> &r, const TMatrixT<double> &H, const TMatrixT<double> &cov, const TMatrixT<double> &V);
146 
150  void blowUpCovs(GFTrack *trk);
151 
152  int fInitialDirection;
153  Int_t fNumIt;
154  double fBlowUpFactor;
155  bool fSmooth;
156 };
157 
158 #endif
159 
Base Class for genfit track representations. Defines interface for track parameterizations.
Definition: GFAbsTrackRep.h:92
void setLazy(Int_t)
Switch lazy error handling.
Definition: GFKalman.h:90
Track object for genfit. genfit algorithms work on these objects.
Definition: GFTrack.h:71
Generic Kalman Filter implementation.
Definition: GFKalman.h:61
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:117
unsigned int i
Definition: P4_F32vec4.h:33
void operator()(GFTrack *track)
Operator for use with STL.
Definition: GFKalman.h:75
void processTrack(GFTrack *trk)
Performs fit on a GFTrack.
Base Class for representing a Hit in GENFIT.
Definition: GFAbsRecoHit.h:83
float f
Definition: P4_F32vec4.h:32
void setBlowUpFactor(double f)
Set the blowup factor (see blowUpCovs() )
Definition: GFKalman.h:121
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:82
void setNumIterations(Int_t i)
Set number of iterations for Kalman Filter.
Definition: GFKalman.h:96