CMS 3D CMS Logo

Functions
GsfMatrixTools Namespace Reference

Functions

template<typename T , unsigned int N>
T trace (ROOT::Math::SMatrix< T, N, N > const &matrix)
 
template<typename T , unsigned int N>
T 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<typename T , unsigned int N>
T GsfMatrixTools::trace ( ROOT::Math::SMatrix< T, N, N > const &  matrix)

Definition at line 18 of file GsfMatrixTools.h.

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

Referenced by edm::pythonToCppException().

18  {
19  T 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
#define N
Definition: blowfish.cc:9
long double T
template<typename T , unsigned int N>
T 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  auto i1 = a.begin();
32  auto e1 = a.end();
33  auto i2 = b.begin();
34 
35  T res =0;
36  // sum of the lower triangle;
37  for (;i1!=e1; i1++, i2++)
38  res += (*i1)*(*i2);
39  res *= T(2.);
40  // remove the duplicated diagonal...
41  for (unsigned int i=0;i<N;++i)
42  res -= a(i,i)*b(i,i);
43  return res;
44  }
int i
Definition: DBlmapReader.cc:9
Definition: Electron.h:4
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