CMS 3D CMS Logo

GsfMatrixTools.h

Go to the documentation of this file.
00001 #ifndef GsfMatrixTools_h_
00002 #define GsfMatrixTools_h_
00003 
00004 #include "Math/SVector.h"
00005 #include "Math/SMatrix.h"
00006 
00007 namespace GsfMatrixTools {
00008   
00009 //   template <unsigned int N>
00010 //   double similarity (ROOT::Math::SMatrix<double, N, N, ROOT::Math::MatRepSym<double, N> >,
00011 //                   ROOT::Math::SVector<double, N> vector) {
00012 //     return vector*matrix*vector;
00013 //   }
00014 
00015   template <unsigned int N>
00016   double trace (const ROOT::Math::SMatrix<double, N, N>& matrix) {
00017     double result(0.);
00018     for ( unsigned int i=0; i<N; i++ )  result += matrix(i,i);
00019     return result;
00020   }
00021 }
00022 #endif
00023 

Generated on Tue Jun 9 17:48:18 2009 for CMSSW by  doxygen 1.5.4