CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 13 of file KfComponentsHolder.h.

Constructor & Destructor Documentation

KfComponentsHolder::KfComponentsHolder ( )
inline

Definition at line 15 of file KfComponentsHolder.h.

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

Member Function Documentation

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

Definition at line 122 of file KfComponentsHolder.h.

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

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

Definition at line 39 of file KfComponentsHolder.h.

References cms::cuda::assert(), and errors_.

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

39  {
40 #ifdef Debug_KfComponentsHolder
41  assert(size_ == D);
42 #endif
43  return *reinterpret_cast<typename AlgebraicROOTObject<D, D>::SymMatrix *>(errors_);
44  }
ROOT::Math::SMatrix< double, D1, D1, ROOT::Math::MatRepSym< double, D1 > > SymMatrix
assert(be >=bs)
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 mergeVDriftHistosByStation::name.

Referenced by TrackingRecHit::getKfComponents().

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 data-class-funcs::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 AlgebraicVector parameters() const =0
virtual AlgebraicMatrix projectionMatrix() const =0
const AlgebraicSymMatrix55 * tsosLocalErrors_
ROOT::Math::SVector< double, D1 > Vector
const AlgebraicVector5 * tsosLocalParameters_
virtual AlgebraicSymMatrix parametersError() const =0
template<unsigned int D>
AlgebraicROOTObject<D, D>::SymMatrix& KfComponentsHolder::measuredErrors ( )
inline

Definition at line 75 of file KfComponentsHolder.h.

References cms::cuda::assert(), and measuredErrors_.

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

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

Definition at line 67 of file KfComponentsHolder.h.

References cms::cuda::assert(), and measuredParams_.

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

67  {
68 #ifdef Debug_KfComponentsHolder
69  assert(size_ == D);
70 #endif
71  return *reinterpret_cast<typename AlgebraicROOTObject<D>::Vector *>(measuredParams_);
72  }
assert(be >=bs)
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 31 of file KfComponentsHolder.h.

References cms::cuda::assert(), and params_.

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

31  {
32 #ifdef Debug_KfComponentsHolder
33  assert(size_ == D);
34 #endif
35  return *reinterpret_cast<typename AlgebraicROOTObject<D>::Vector *>(params_);
36  }
assert(be >=bs)
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 47 of file KfComponentsHolder.h.

References cms::cuda::assert(), and makeMuonMisalignmentScenario::matrix.

Referenced by ReferenceTrajectory::getHitProjectionMatrixT().

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

Definition at line 56 of file KfComponentsHolder.h.

References cms::cuda::assert(), and projFunc_.

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

56  {
57 #ifdef Debug_KfComponentsHolder
58  assert(size_ == D);
59 #endif
60  return *reinterpret_cast<ProjectMatrix<double, 5, D> *>(projFunc_);
61  }
assert(be >=bs)
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 101 of file KfComponentsHolder.h.

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

Referenced by ReferenceTrajectory::getHitProjectionMatrixT().

107  {
108 #ifdef Debug_KfComponentsHolder
109  assert(size_ == 0); // which means it was uninitialized
110  size_ = D;
111 #endif
112  params_ = params;
113  errors_ = errors;
119 }
assert(be >=bs)
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
const AlgebraicVector5& KfComponentsHolder::tsosLocalParameters ( ) const
inline

Member Data Documentation

void * KfComponentsHolder::errors_
private

Definition at line 92 of file KfComponentsHolder.h.

Referenced by errors(), and setup().

void * KfComponentsHolder::measuredErrors_
private

Definition at line 92 of file KfComponentsHolder.h.

Referenced by measuredErrors(), and setup().

void * KfComponentsHolder::measuredParams_
private

Definition at line 92 of file KfComponentsHolder.h.

Referenced by measuredParams(), and setup().

void* KfComponentsHolder::params_
private

Definition at line 92 of file KfComponentsHolder.h.

Referenced by params(), and setup().

void * KfComponentsHolder::projFunc_
private

Definition at line 92 of file KfComponentsHolder.h.

Referenced by projFunc(), and setup().

const AlgebraicSymMatrix55* KfComponentsHolder::tsosLocalErrors_
private

Definition at line 94 of file KfComponentsHolder.h.

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

const AlgebraicVector5* KfComponentsHolder::tsosLocalParameters_
private

Definition at line 93 of file KfComponentsHolder.h.

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