Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:28:16

0001 #ifndef RecoTracker_MkFitCore_interface_MatrixSTypes_h
0002 #define RecoTracker_MkFitCore_interface_MatrixSTypes_h
0003 
0004 #include "Math/SMatrix.h"
0005 
0006 namespace mkfit {
0007 
0008   typedef ROOT::Math::SMatrix<float, 6, 6, ROOT::Math::MatRepSym<float, 6> > SMatrixSym66;
0009   typedef ROOT::Math::SMatrix<float, 6> SMatrix66;
0010   typedef ROOT::Math::SVector<float, 6> SVector6;
0011 
0012   typedef ROOT::Math::SMatrix<float, 3> SMatrix33;
0013   typedef ROOT::Math::SMatrix<float, 3, 3, ROOT::Math::MatRepSym<float, 3> > SMatrixSym33;
0014   typedef ROOT::Math::SVector<float, 3> SVector3;
0015 
0016   typedef ROOT::Math::SMatrix<float, 2> SMatrix22;
0017   typedef ROOT::Math::SMatrix<float, 2, 2, ROOT::Math::MatRepSym<float, 2> > SMatrixSym22;
0018   typedef ROOT::Math::SVector<float, 2> SVector2;
0019 
0020   typedef ROOT::Math::SMatrix<float, 3, 6> SMatrix36;
0021   typedef ROOT::Math::SMatrix<float, 6, 3> SMatrix63;
0022 
0023   typedef ROOT::Math::SMatrix<float, 2, 6> SMatrix26;
0024   typedef ROOT::Math::SMatrix<float, 6, 2> SMatrix62;
0025 
0026   template <typename Matrix>
0027   inline void diagonalOnly(Matrix& m) {
0028     for (int r = 0; r < m.kRows; r++) {
0029       for (int c = 0; c < m.kCols; c++) {
0030         if (r != c)
0031           m[r][c] = 0.f;
0032       }
0033     }
0034   }
0035 
0036   template <typename Matrix>
0037   void dumpMatrix(Matrix m) {
0038     for (int r = 0; r < m.kRows; ++r) {
0039       for (int c = 0; c < m.kCols; ++c) {
0040         std::cout << std::setw(12) << m.At(r, c) << " ";
0041       }
0042       std::cout << std::endl;
0043     }
0044   }
0045 
0046 }  // namespace mkfit
0047 
0048 #endif