CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
KfComponentsHolder Class Reference

#include <KfComponentsHolder.h>

Public Member Functions

template<unsigned int D>
void dump ()
 
template<unsigned int D>
AlgebraicROOTObject< D, D >::SymMatrix & errors ()
 
void genericFill (const TrackingRecHit &hit)
 Fill in datamembers from a generic TrackingRecHit using the CLHEP matrices. More...
 
 KfComponentsHolder ()
 
template<unsigned int D>
AlgebraicROOTObject< D, D >::SymMatrix & measuredErrors ()
 
template<unsigned int D>
AlgebraicROOTObject< D >::VectormeasuredParams ()
 
template<unsigned int D>
AlgebraicROOTObject< D >::Vectorparams ()
 
template<unsigned int D>
AlgebraicROOTObject< D, 5 >::Matrix projection ()
 
template<unsigned int D>
ProjectMatrix< double, 5, D > & projFunc ()
 
template<unsigned int D>
void setup (typename AlgebraicROOTObject< D >::Vector *params, typename AlgebraicROOTObject< D, D >::SymMatrix *errors, ProjectMatrix< double, 5, D > *projFunc, typename AlgebraicROOTObject< D >::Vector *measuredParams, typename AlgebraicROOTObject< D, D >::SymMatrix *measuredErrors, const AlgebraicVector5 &tsosLocalParameters, const AlgebraicSymMatrix55 &tsosLocalErrors)
 
const AlgebraicSymMatrix55tsosLocalErrors () const
 
const AlgebraicVector5tsosLocalParameters () const
 

Private Member Functions

template<unsigned int D>
void genericFill_ (const TrackingRecHit &hit)
 

Private Attributes

void * errors_
 
void * measuredErrors_
 
void * measuredParams_
 
void * params_
 
void * projFunc_
 
const AlgebraicSymMatrix55tsosLocalErrors_
 
const AlgebraicVector5tsosLocalParameters_
 

Detailed Description

Definition at line 12 of file KfComponentsHolder.h.

Constructor & Destructor Documentation

KfComponentsHolder::KfComponentsHolder ( )
inline

Definition at line 14 of file KfComponentsHolder.h.

References measuredErrors(), measuredParams(), params(), projFunc(), setup(), tsosLocalErrors(), and tsosLocalParameters().

14  {
15 #ifdef Debug_KfComponentsHolder
16  size_ = 0;
17 #endif
18  }

Member Function Documentation

template<unsigned int D>
void KfComponentsHolder::dump ( void  )

Definition at line 121 of file KfComponentsHolder.h.

References gather_cfg::cout, tsosLocalErrors(), and tsosLocalParameters().

Referenced by tsosLocalErrors().

121  {
122  using namespace std;
123  cout << "Params my: " << params<D>() << endl;
124  cout << " tsos: " << tsosLocalParameters() << endl;
125  cout << " meas: " << measuredParams<D>() << endl;
126  cout << "Errors my:\n" << errors<D>() << endl;
127  cout << " tsos:\n" << tsosLocalErrors() << endl;
128  cout << " meas:\n" << measuredErrors<D>() << endl;
129  cout << "Projection:\n" << projection<D>() << endl;
130 }
const AlgebraicVector5 & tsosLocalParameters() const
const AlgebraicSymMatrix55 & tsosLocalErrors() const
template<unsigned int D>
AlgebraicROOTObject<D, D>::SymMatrix& KfComponentsHolder::errors ( )
inline

Definition at line 38 of file KfComponentsHolder.h.

References errors_.

Referenced by BaseTrackerRecHit::getKfComponents1D(), BaseTrackerRecHit::getKfComponents2D(), and setup().

38  {
39 #ifdef Debug_KfComponentsHolder
40  assert(size_ == D);
41 #endif
42  return *reinterpret_cast<typename AlgebraicROOTObject<D, D>::SymMatrix *>(errors_);
43  }
ROOT::Math::SMatrix< double, D1, D1, ROOT::Math::MatRepSym< double, D1 > > SymMatrix
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
void KfComponentsHolder::genericFill ( const TrackingRecHit hit)

Fill in datamembers from a generic TrackingRecHit using the CLHEP matrices.

Definition at line 22 of file KfComponentsHolder.cc.

References TrackingRecHit::dimension(), Exception, and Skims_PA_cff::name.

Referenced by TrackingRecHit::getKfComponents(), and projFunc().

22  {
23  switch (hit.dimension()) {
24  case 1:
25  genericFill_<1>(hit);
26  break;
27  case 2:
28  genericFill_<2>(hit);
29  break;
30  case 3:
31  genericFill_<3>(hit);
32  break;
33  case 4:
34  genericFill_<4>(hit);
35  break;
36  case 5:
37  genericFill_<5>(hit);
38  break;
39  default:
40  throw cms::Exception("Rec hit of invalid dimension (not 1,2,3,4,5)")
41  << "The dimension was " << hit.dimension() << ", type is " << typeid(hit).name() << "\n";
42  }
43 }
virtual int dimension() const =0
template<unsigned int D>
void KfComponentsHolder::genericFill_ ( const TrackingRecHit hit)
private

Definition at line 7 of file KfComponentsHolder.cc.

References class-composition::H, TrackingRecHit::parameters(), TrackingRecHit::parametersError(), TrackingRecHit::projectionMatrix(), tsosLocalErrors_, and tsosLocalParameters_.

7  {
8  typedef typename AlgebraicROOTObject<D, 5>::Matrix MatD5;
9  typedef typename AlgebraicROOTObject<D, D>::SymMatrix SMatDD;
10  typedef typename AlgebraicROOTObject<D>::Vector VecD;
11 
12  params<D>() = asSVector<D>(hit.parameters());
13  errors<D>() = asSMatrix<D>(hit.parametersError());
14 
15  MatD5 &&H = asSMatrix<D, 5>(hit.projectionMatrix());
16  projFunc<D>().fromH(H);
17 
18  measuredParams<D>() = H * (*tsosLocalParameters_);
19  measuredErrors<D>() = ROOT::Math::Similarity(H, (*tsosLocalErrors_));
20 }
ROOT::Math::SMatrix< double, D1, D1, ROOT::Math::MatRepSym< double, D1 > > SymMatrix
ROOT::Math::SMatrix< double, D1, D2, ROOT::Math::MatRepStd< double, D1, D2 > > Matrix
virtual AlgebraicSymMatrix parametersError() const =0
virtual AlgebraicVector parameters() const =0
const AlgebraicSymMatrix55 * tsosLocalErrors_
ROOT::Math::SVector< double, D1 > Vector
const AlgebraicVector5 * tsosLocalParameters_
virtual AlgebraicMatrix projectionMatrix() const =0
template<unsigned int D>
AlgebraicROOTObject<D, D>::SymMatrix& KfComponentsHolder::measuredErrors ( )
inline

Definition at line 74 of file KfComponentsHolder.h.

References measuredErrors_.

Referenced by BaseTrackerRecHit::getKfComponents1D(), BaseTrackerRecHit::getKfComponents2D(), KfComponentsHolder(), and setup().

74  {
75 #ifdef Debug_KfComponentsHolder
76  assert(size_ == D);
77 #endif
78  return *reinterpret_cast<typename AlgebraicROOTObject<D, D>::SymMatrix *>(measuredErrors_);
79  }
ROOT::Math::SMatrix< double, D1, D1, ROOT::Math::MatRepSym< double, D1 > > SymMatrix
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
template<unsigned int D>
AlgebraicROOTObject<D>::Vector& KfComponentsHolder::measuredParams ( )
inline

Definition at line 66 of file KfComponentsHolder.h.

References measuredParams_.

Referenced by BaseTrackerRecHit::getKfComponents1D(), BaseTrackerRecHit::getKfComponents2D(), KfComponentsHolder(), and setup().

66  {
67 #ifdef Debug_KfComponentsHolder
68  assert(size_ == D);
69 #endif
70  return *reinterpret_cast<typename AlgebraicROOTObject<D>::Vector *>(measuredParams_);
71  }
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
ROOT::Math::SVector< double, D1 > Vector
template<unsigned int D>
AlgebraicROOTObject<D>::Vector& KfComponentsHolder::params ( )
inline

Definition at line 30 of file KfComponentsHolder.h.

References params_.

Referenced by BaseTrackerRecHit::getKfComponents1D(), BaseTrackerRecHit::getKfComponents2D(), KfComponentsHolder(), and setup().

30  {
31 #ifdef Debug_KfComponentsHolder
32  assert(size_ == D);
33 #endif
34  return *reinterpret_cast<typename AlgebraicROOTObject<D>::Vector *>(params_);
35  }
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
ROOT::Math::SVector< double, D1 > Vector
template<unsigned int D>
AlgebraicROOTObject<D, 5>::Matrix KfComponentsHolder::projection ( )
inline

Definition at line 46 of file KfComponentsHolder.h.

References makeMuonMisalignmentScenario::matrix.

Referenced by ReferenceTrajectory::getHitProjectionMatrixT().

46  {
47 #ifdef Debug_KfComponentsHolder
48  assert(size_ == D);
49 #endif
50  return this->projFunc<D>().matrix();
51  //return * reinterpret_cast<typename AlgebraicROOTObject<D,5>::Matrix *>(projection_);
52  }
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
template<unsigned int D>
ProjectMatrix<double, 5, D>& KfComponentsHolder::projFunc ( )
inline

Definition at line 55 of file KfComponentsHolder.h.

References genericFill(), and projFunc_.

Referenced by BaseTrackerRecHit::getKfComponents1D(), BaseTrackerRecHit::getKfComponents2D(), KfComponentsHolder(), and setup().

55  {
56 #ifdef Debug_KfComponentsHolder
57  assert(size_ == D);
58 #endif
59  return *reinterpret_cast<ProjectMatrix<double, 5, D> *>(projFunc_);
60  }
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
template<unsigned int D>
void KfComponentsHolder::setup ( typename AlgebraicROOTObject< D >::Vector params,
typename AlgebraicROOTObject< D, D >::SymMatrix *  errors,
ProjectMatrix< double, 5, D > *  projFunc,
typename AlgebraicROOTObject< D >::Vector measuredParams,
typename AlgebraicROOTObject< D, D >::SymMatrix *  measuredErrors,
const AlgebraicVector5 tsosLocalParameters,
const AlgebraicSymMatrix55 tsosLocalErrors 
)

Definition at line 100 of file KfComponentsHolder.h.

References errors(), errors_, measuredErrors(), measuredErrors_, measuredParams(), measuredParams_, params(), params_, projFunc(), projFunc_, tsosLocalErrors(), tsosLocalErrors_, tsosLocalParameters(), and tsosLocalParameters_.

Referenced by ReferenceTrajectory::getHitProjectionMatrixT(), and KfComponentsHolder().

106  {
107 #ifdef Debug_KfComponentsHolder
108  assert(size_ == 0); // which means it was uninitialized
109  size_ = D;
110 #endif
111  params_ = params;
112  errors_ = errors;
118 }
AlgebraicROOTObject< D, D >::SymMatrix & measuredErrors()
AlgebraicROOTObject< D >::Vector & params()
AlgebraicROOTObject< D, D >::SymMatrix & errors()
ProjectMatrix< double, 5, D > & projFunc()
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
const AlgebraicVector5 & tsosLocalParameters() const
const AlgebraicSymMatrix55 * tsosLocalErrors_
AlgebraicROOTObject< D >::Vector & measuredParams()
const AlgebraicSymMatrix55 & tsosLocalErrors() const
const AlgebraicVector5 * tsosLocalParameters_
const AlgebraicSymMatrix55& KfComponentsHolder::tsosLocalErrors ( ) const
inline

Definition at line 82 of file KfComponentsHolder.h.

References dump(), and tsosLocalErrors_.

Referenced by dump(), BaseTrackerRecHit::getKfComponents1D(), BaseTrackerRecHit::getKfComponents2D(), KfComponentsHolder(), and setup().

82 { return *tsosLocalErrors_; }
const AlgebraicSymMatrix55 * tsosLocalErrors_
const AlgebraicVector5& KfComponentsHolder::tsosLocalParameters ( ) const
inline

Member Data Documentation

void * KfComponentsHolder::errors_
private

Definition at line 91 of file KfComponentsHolder.h.

Referenced by errors(), and setup().

void * KfComponentsHolder::measuredErrors_
private

Definition at line 91 of file KfComponentsHolder.h.

Referenced by measuredErrors(), and setup().

void * KfComponentsHolder::measuredParams_
private

Definition at line 91 of file KfComponentsHolder.h.

Referenced by measuredParams(), and setup().

void* KfComponentsHolder::params_
private

Definition at line 91 of file KfComponentsHolder.h.

Referenced by params(), and setup().

void * KfComponentsHolder::projFunc_
private

Definition at line 91 of file KfComponentsHolder.h.

Referenced by projFunc(), and setup().

const AlgebraicSymMatrix55* KfComponentsHolder::tsosLocalErrors_
private

Definition at line 93 of file KfComponentsHolder.h.

Referenced by genericFill_(), setup(), and tsosLocalErrors().

const AlgebraicVector5* KfComponentsHolder::tsosLocalParameters_
private

Definition at line 92 of file KfComponentsHolder.h.

Referenced by genericFill_(), setup(), and tsosLocalParameters().