CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
GsfMatrixTools Namespace Reference

Functions

template<unsigned int N>
double trace (const ROOT::Math::SMatrix< double, N, N > &matrix)
 
template<typename T , unsigned int N>
double trace (ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > const &a, ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > const &b)
 

Function Documentation

template<unsigned int N>
double GsfMatrixTools::trace ( const ROOT::Math::SMatrix< double, N, N > &  matrix)

Definition at line 18 of file GsfMatrixTools.h.

References i, makeMuonMisalignmentScenario::matrix, N, and mps_fire::result.

Referenced by main(), and edm::pythonToCppException().

18  {
19  double result(0.);
20  for ( unsigned int i=0; i<N; i++ ) result += matrix(i,i);
21  return result;
22  }
int i
Definition: DBlmapReader.cc:9
tuple result
Definition: mps_fire.py:95
#define N
Definition: blowfish.cc:9
template<typename T , unsigned int N>
double GsfMatrixTools::trace ( ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > const &  a,
ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > const &  b 
)

Definition at line 29 of file GsfMatrixTools.h.

References a, b, reco::e1, i, and N.

30  {
31  typedef typename ROOT::Math::SMatrix<T,N,N,ROOT::Math::MatRepSym<T,N> >::const_iterator CI;
32  CI i1 = a.begin();
33  CI e1 = a.end();
34  CI i2 = b.begin();
35  // CI e2 = b.end();
36 
37  T res =0;
38  // sum of the lower triangle;
39  for (;i1!=e1; i1++, i2++)
40  res += (*i1)*(*i2);
41  res *=2.;
42  // remove the duplicated diagonal...
43  for (unsigned int i=0;i<N;i++)
44  res -= a(i,i)*b(i,i);
45  return res;
46  }
int i
Definition: DBlmapReader.cc:9
Float e1
Definition: deltaR.h:20
#define N
Definition: blowfish.cc:9
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
long double T