All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GFDaf.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 */
19 /** @addtogroup genfit
20  * @{
21  */
22 
23 
24 #ifndef GFDAF_H
25 #define GFDAF_H
26 
27 #include <map>
28 #include <vector>
29 
30 #include "TMatrixT.h"
31 
32 
33 
34 /** @brief Determinstic Annealing Filter (DAF) implementation
35  *
36  * @author Christian H&ouml;ppner (Technische Universit&auml;t M&uuml;nchen, original author)
37  *
38  * The DAF is an iterative Kalman filter with annealing. It is capable of fitting tracks which are
39  * contaminated with noise hits. The alogrithm is taken from the references
40  * R. Fruehwirth & A. Strandlie, Computer Physics Communications 120 (199) 197-214
41  * and CERN thesis: Dissertation by Matthias Winkler.
42 
43  */
44 
45 namespace genf {
46 
47 class GFTrack;
48 
49 
50 class GFDaf {
51 public:
52 
53 
54  /** @brief Standard CTOR. Sets default values for annealing scheme and probablity cut.
55  */
56  GFDaf();
57 
58 
59  ~GFDaf();
60 
61 
62 
63  /** @brief Performs DAF fit on all track representations in a GFTrack.
64  *
65  */
66  void processTrack(GFTrack*);
67 
68 
69  /** @brief Set the blowup factor (see blowUpCovs() )
70  */
71  void setBlowUpFactor(double f){fBlowUpFactor=f;}
72 
73  /** @brief Set the probabilty cut for the weight calculation for the hits. Currently
74  * supported are the values 0.01 0.005, and 0.001. The corresponding chi2 cuts for
75  * different hits dimensionalities are hardcoded in the implementation because I did
76  * not yet figure out how to calculate them. Please feel very welcome to change the
77  * implementtion if you know how to do it.
78  */
79  void setProbCut(double val);
80 
81  /** @brief Configure the annealing scheme.
82  * In the current implementation you need to provide at least two temperatures. The maximum would ten
83  * tempertatures.
84  */
85  void setBetas(double b1,double b2,double b3=-1.,double b4=-1.,double b5=-1.,double b6=-1.,double b7=-1.,double b8=-1.,double b9=-1.,double b10=-1.);
86  // Private Methods -----------------
87 private:
88 
89  /** @brief Calculate Kalman Gain
90  */
91  TMatrixT<Double_t> calcGain(const TMatrixT<Double_t>& cov,
92  const TMatrixT<Double_t>& HitCov,
93  const TMatrixT<Double_t>& H,
94  const double& p);
95 
96 
97  /** @brief This is needed to blow up the covariance matrix before a fitting pass.
98  * The method drops off-diagonal elements and blows up diagonal by blowUpFactor.
99  */
100  void blowUpCovs(GFTrack* trk);
101 
102  /** @brief invert a matrix. First argument is matrix to be inverted, second is return by ref.
103  */
104  void invertMatrix(const TMatrixT<Double_t>&,TMatrixT<Double_t>&);
105 
107  std::vector<double> fBeta;
108  std::map<int,double> chi2Cuts;
109 };
110 
111 } // namespace genf
112 #endif
113 
114 /** @} */
GFDaf()
Standard CTOR. Sets default values for annealing scheme and probablity cut.
Definition: GFDaf.cxx:44
pdgs p
Definition: selectors.fcl:22
void invertMatrix(const TMatrixT< Double_t > &, TMatrixT< Double_t > &)
invert a matrix. First argument is matrix to be inverted, second is return by ref.
Definition: GFDaf.cxx:380
void setBetas(double b1, double b2, double b3=-1., double b4=-1., double b5=-1., double b6=-1., double b7=-1., double b8=-1., double b9=-1., double b10=-1.)
Configure the annealing scheme. In the current implementation you need to provide at least two temper...
Definition: GFDaf.cxx:451
void processTrack(GFTrack *)
Performs DAF fit on all track representations in a GFTrack.
Definition: GFDaf.cxx:52
double fBlowUpFactor
Definition: GFDaf.h:106
std::map< int, double > chi2Cuts
Definition: GFDaf.h:108
std::vector< double > fBeta
Definition: GFDaf.h:107
TMatrixT< Double_t > calcGain(const TMatrixT< Double_t > &cov, const TMatrixT< Double_t > &HitCov, const TMatrixT< Double_t > &H, const double &p)
Calculate Kalman Gain.
Definition: GFDaf.cxx:399
void setProbCut(double val)
Set the probabilty cut for the weight calculation for the hits. Currently supported are the values 0...
Definition: GFDaf.cxx:421
void blowUpCovs(GFTrack *trk)
This is needed to blow up the covariance matrix before a fitting pass. The method drops off-diagonal ...
Definition: GFDaf.cxx:355
void setBlowUpFactor(double f)
Set the blowup factor (see blowUpCovs() )
Definition: GFDaf.h:71