PandaRoot
KalmanCalculator.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 // ******************************************************
14 // DecayTreeFitter Package
15 // We thank the original author Wouter Hulsbergen
16 // (BaBar, LHCb) for providing the sources.
17 // http://arxiv.org/abs/physics/0503191v1 (2005)
18 // Adaptation & Development for PANDA: Ralf Kliemt (2015)
19 // ******************************************************
20 #ifndef KALMANCALCULATOR_H
21 #define KALMANCALCULATOR_H 1
22 
23 #include "TVectorD.h"
24 #include "TMatrixD.h"
25 #include "TMatrixDSym.h"
26 #include "FitParams.h"
27 #include "ErrCode.h"
28 #include "Rtypes.h"
29 
30 namespace DecayTreeFitter {
31 
33  public:
35  virtual ~KalmanCalculator(){};
36 
37  ErrCode init(const TVectorD &value, const TMatrixD &G, const FitParams *fitparams, const TMatrixDSym &V, int weight = 1);
38  void updatePar(FitParams *fitparams);
39  void updatePar(const TVectorD &prediction, FitParams *fitparams);
40  void updateCov(FitParams *fitparams);
41  double chisq() const { return m_chisq; }
42 
43  private:
44  int m_nconstraints; // dimension of the constraint
45  int m_nparameters; // dimension of the state
46  const TVectorD *m_value;
47  const TMatrixD *m_matrixG;
48  TMatrixDSym m_matrixR; // cov of residual
49  TMatrixDSym m_matrixRinv; // inverse of cov of residual
50  TMatrixD m_matrixK; // kalman gain matrix
51  double m_chisq;
52  int m_ierr;
53  // some temporary results
54  TMatrixD m_matrixCGT;
55  ClassDef(KalmanCalculator, 1)
56 };
57 } // namespace DecayTreeFitter
58 
59 #endif
void updatePar(FitParams *fitparams)
void updateCov(FitParams *fitparams)
TMatrixT< double > TMatrixD
Definition: PndLmdDim.h:64
ErrCode init(const TVectorD &value, const TMatrixD &G, const FitParams *fitparams, const TMatrixDSym &V, int weight=1)