GENFIT  Rev:NoNumberAvailable
RKTools.h
Go to the documentation of this file.
1 /* Copyright 2008-2009, Technische Universitaet Muenchen,
2  Authors: Christian Hoeppner & Sebastian Neubert & Johannes Rauch
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 
24 #ifndef genfit_RKTools_h
25 #define genfit_RKTools_h
26 
27 #include <stddef.h>
28 #include <algorithm>
29 
30 namespace genfit {
31 
32 template <size_t nRows, size_t nCols>
33 struct RKMatrix {
34  double vals[nRows * nCols];
35 
36  double& operator()(size_t iRow, size_t iCol) {
37  return vals[nCols*iRow + iCol];
38  }
39  double& operator[](size_t n) {
40  return vals[n];
41  }
42  const double& operator[](size_t n) const {
43  return vals[n];
44  }
45  double* begin() { return vals; }
46  double* end() { return vals + nRows * nCols; }
47  const double* begin() const { return vals; }
48  const double* end() const { return vals + nRows * nCols; }
50  std::copy(o.begin(), o.end(), this->begin());
51  return *this;
52  }
53 
54  void print();
55 };
56 
67 
71 namespace RKTools {
72 
73  void J_pMTxcov5xJ_pM(const M5x7& J_pM, const M5x5& cov5, M7x7& out7);
74  void J_pMTxcov5xJ_pM(const M5x6& J_pM, const M5x5& cov5, M6x6& out6);
75 
76  void J_MpTxcov7xJ_Mp(const M7x5& J_Mp, const M7x7& cov7, M5x5& out5);
77  void J_MpTxcov6xJ_Mp(const M6x5& J_Mp, const M6x6& cov6, M5x5& out5);
78 
79  void J_MMTxcov7xJ_MM(const M7x7& J_MM, M7x7& cov7);
80 
81  void J_MMxJ_MM(M7x7& J_MM, const M7x7& J_MM_old);
82 
83  void J_pMTTxJ_MMTTxJ_MpTT(const M7x5& J_pMT, const M7x7& J_MMT, const M5x7& J_MpT, M5x5& J_pp);
84 
85  void Np_N_NpT(const M7x7& Np, M7x7& N);
86 
87  void printDim(const double* mat, unsigned int dimX, unsigned int dimY);
88 
89 }
90 
91 template<size_t nRows, size_t nCols>
92 inline void
94  RKTools::printDim(this->vals, nRows, nCols);
95 }
96 
97 } /* End of namespace genfit */
100 #endif // genfit_RKTools_h
101 
genfit::M6x5
RKMatrix< 6, 5 > M6x5
Definition: RKTools.h:63
genfit::RKMatrix::operator[]
const double & operator[](size_t n) const
Definition: RKTools.h:42
genfit::RKMatrix
Definition: RKTools.h:33
genfit::RKMatrix::vals
double vals[nRows *nCols]
Definition: RKTools.h:34
genfit::M1x3
RKMatrix< 1, 3 > M1x3
Definition: RKTools.h:57
genfit::RKMatrix::operator=
RKMatrix< nRows, nCols > & operator=(const RKMatrix< nRows, nCols > &o)
Definition: RKTools.h:49
genfit::M5x7
RKMatrix< 5, 7 > M5x7
Definition: RKTools.h:66
genfit::M1x4
RKMatrix< 1, 4 > M1x4
Definition: RKTools.h:58
genfit
Defines for I/O streams used for error and debug printing.
Definition: AbsFinitePlane.cc:22
genfit::M7x5
RKMatrix< 7, 5 > M7x5
Definition: RKTools.h:64
genfit::RKTools::J_pMTTxJ_MMTTxJ_MpTT
void J_pMTTxJ_MMTTxJ_MpTT(const M7x5 &J_pMT, const M7x7 &J_MMT, const M5x7 &J_MpT, M5x5 &J_pp)
Definition: RKTools.cc:527
genfit::M5x6
RKMatrix< 5, 6 > M5x6
Definition: RKTools.h:65
genfit::RKTools::J_MpTxcov6xJ_Mp
void J_MpTxcov6xJ_Mp(const M6x5 &J_Mp, const M6x6 &cov6, M5x5 &out5)
Definition: RKTools.cc:290
genfit::RKMatrix::end
double * end()
Definition: RKTools.h:46
genfit::RKMatrix::operator[]
double & operator[](size_t n)
Definition: RKTools.h:39
genfit::M5x5
RKMatrix< 5, 5 > M5x5
Definition: RKTools.h:60
genfit::RKMatrix::begin
const double * begin() const
Definition: RKTools.h:47
genfit::RKTools::J_MMxJ_MM
void J_MMxJ_MM(M7x7 &J_MM, const M7x7 &J_MM_old)
Definition: RKTools.cc:455
genfit::RKTools::printDim
void printDim(const double *mat, unsigned int dimX, unsigned int dimY)
Definition: RKTools.cc:710
genfit::RKTools::J_MpTxcov7xJ_Mp
void J_MpTxcov7xJ_Mp(const M7x5 &J_Mp, const M7x7 &cov7, M5x5 &out5)
Definition: RKTools.cc:209
genfit::M7x7
RKMatrix< 7, 7 > M7x7
Definition: RKTools.h:62
genfit::M6x6
RKMatrix< 6, 6 > M6x6
Definition: RKTools.h:61
genfit::RKTools::Np_N_NpT
void Np_N_NpT(const M7x7 &Np, M7x7 &N)
Definition: RKTools.cc:637
genfit::RKMatrix::print
void print()
Definition: RKTools.h:93
genfit::M1x7
RKMatrix< 1, 7 > M1x7
Definition: RKTools.h:59
genfit::RKMatrix::operator()
double & operator()(size_t iRow, size_t iCol)
Definition: RKTools.h:36
genfit::RKMatrix::end
const double * end() const
Definition: RKTools.h:48
genfit::RKTools::J_MMTxcov7xJ_MM
void J_MMTxcov7xJ_MM(const M7x7 &J_MM, M7x7 &cov7)
Definition: RKTools.cc:374
genfit::RKMatrix::begin
double * begin()
Definition: RKTools.h:45
genfit::RKTools::J_pMTxcov5xJ_pM
void J_pMTxcov5xJ_pM(const M5x7 &J_pM, const M5x5 &cov5, M7x7 &out7)
Definition: RKTools.cc:34