CMS 3D CMS Logo

Functions
Migration.h File Reference
#include "DataFormats/Math/interface/AlgebraicROOTObjects.h"
#include "CLHEP/Matrix/Matrix.h"
#include "CLHEP/Matrix/Vector.h"
#include "CLHEP/Matrix/SymMatrix.h"
#include <cstring>
#include <cassert>

Go to the source code of this file.

Functions

template<unsigned int N1, unsigned int N2>
CLHEP::HepMatrix asHepMatrix (const ROOT::Math::SMatrix< double, N1, N2, typename ROOT::Math::MatRepStd< double, N1, N2 > > &rm)
 
template<unsigned int N1>
CLHEP::HepSymMatrix asHepMatrix (const ROOT::Math::SMatrix< double, N1, N1, typename ROOT::Math::MatRepSym< double, N1 > > &rm)
 
template<unsigned int N>
CLHEP::HepVector asHepVector (const ROOT::Math::SVector< double, N > &v)
 
template<unsigned int N1, unsigned int N2>
ROOT::Math::SMatrix< double, N1, N2, typename ROOT::Math::MatRepStd< double, N1, N2 > > asSMatrix (const CLHEP::HepMatrix &m)
 
template<unsigned int N1>
ROOT::Math::SMatrix< double, N1, N1, typename ROOT::Math::MatRepSym< double, N1 > > asSMatrix (const CLHEP::HepSymMatrix &m)
 
template<unsigned int N1>
ROOT::Math::SVector< double, N1 > asSVector (const CLHEP::HepVector &m)
 

Function Documentation

◆ asHepMatrix() [1/2]

template<unsigned int N1, unsigned int N2>
CLHEP::HepMatrix asHepMatrix ( const ROOT::Math::SMatrix< double, N1, N2, typename ROOT::Math::MatRepStd< double, N1, N2 > > &  rm)

◆ asHepMatrix() [2/2]

template<unsigned int N1>
CLHEP::HepSymMatrix asHepMatrix ( const ROOT::Math::SMatrix< double, N1, N1, typename ROOT::Math::MatRepSym< double, N1 > > &  rm)

Definition at line 68 of file Migration.h.

References eostools::rm().

69  {
70  CLHEP::HepSymMatrix am(N1);
71  memcpy(&am(1, 1), rm.Array(), (N1 * (N1 + 1)) / 2 * sizeof(double));
72  return am;
73 }
def rm(path, rec=False)
Definition: eostools.py:363

◆ asHepVector()

template<unsigned int N>
CLHEP::HepVector asHepVector ( const ROOT::Math::SVector< double, N > &  v)

Definition at line 53 of file Migration.h.

References N, and findQualityFiles::v.

Referenced by BzeroReferenceTrajectory::BzeroReferenceTrajectory(), TwoBodyDecayEstimator::constructMatrices(), MeasurementExtractor::measuredParameters(), and TRecHit5DParamConstraint::parameters().

53  {
54  CLHEP::HepVector hv(N);
55  memcpy(&hv[0], &v[0], N * sizeof(double));
56  return hv;
57 }
#define N
Definition: blowfish.cc:9

◆ asSMatrix() [1/2]

template<unsigned int N1, unsigned int N2>
ROOT::Math::SMatrix<double, N1, N2, typename ROOT::Math::MatRepStd<double, N1, N2> > asSMatrix ( const CLHEP::HepMatrix &  m)

Definition at line 31 of file Migration.h.

References cms::cuda::assert(), and visualization-live-secondInstance_cfg::m.

32  {
33  typedef typename ROOT::Math::MatRepStd<double, N1, N2> REP;
34  assert(m.num_row() == N1);
35  assert(m.num_col() == N2);
36  return ROOT::Math::SMatrix<double, N1, N2, REP>(&m(1, 1), REP::kSize);
37 }
assert(be >=bs)

◆ asSMatrix() [2/2]

template<unsigned int N1>
ROOT::Math::SMatrix<double, N1, N1, typename ROOT::Math::MatRepSym<double, N1> > asSMatrix ( const CLHEP::HepSymMatrix &  m)

Definition at line 40 of file Migration.h.

References cms::cuda::assert(), and visualization-live-secondInstance_cfg::m.

41  {
42  typedef typename ROOT::Math::MatRepSym<double, N1> REP;
43  assert(m.num_row() == N1);
44  return ROOT::Math::SMatrix<double, N1, N1, REP>(&m(1, 1), REP::kSize);
45 }
assert(be >=bs)

◆ asSVector()

template<unsigned int N1>
ROOT::Math::SVector<double, N1> asSVector ( const CLHEP::HepVector &  m)

Definition at line 48 of file Migration.h.

References visualization-live-secondInstance_cfg::m.

48  {
49  return ROOT::Math::SVector<double, N1>(&m[0], N1);
50 }