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 13 of file KfComponentsHolder.h.

Constructor & Destructor Documentation

◆ KfComponentsHolder()

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

◆ dump()

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

Definition at line 122 of file KfComponentsHolder.h.

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 }

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

◆ errors()

template<unsigned int D>
AlgebraicROOTObject<D, D>::SymMatrix& KfComponentsHolder::errors ( )
inline

Definition at line 39 of file KfComponentsHolder.h.

39  {
40 #ifdef Debug_KfComponentsHolder
41  assert(size_ == D);
42 #endif
43  return *reinterpret_cast<typename AlgebraicROOTObject<D, D>::SymMatrix *>(errors_);
44  }

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

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

◆ genericFill()

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.

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 }

References Exception, and Skims_PA_cff::name.

Referenced by TrackingRecHit::getKfComponents().

◆ genericFill_()

template<unsigned int D>
void KfComponentsHolder::genericFill_ ( const TrackingRecHit hit)
private

Definition at line 7 of file KfComponentsHolder.cc.

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 }

References class-composition::H, and tsosLocalErrors_.

◆ measuredErrors()

template<unsigned int D>
AlgebraicROOTObject<D, D>::SymMatrix& KfComponentsHolder::measuredErrors ( )
inline

Definition at line 75 of file KfComponentsHolder.h.

75  {
76 #ifdef Debug_KfComponentsHolder
77  assert(size_ == D);
78 #endif
79  return *reinterpret_cast<typename AlgebraicROOTObject<D, D>::SymMatrix *>(measuredErrors_);
80  }

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

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

◆ measuredParams()

template<unsigned int D>
AlgebraicROOTObject<D>::Vector& KfComponentsHolder::measuredParams ( )
inline

Definition at line 67 of file KfComponentsHolder.h.

67  {
68 #ifdef Debug_KfComponentsHolder
69  assert(size_ == D);
70 #endif
71  return *reinterpret_cast<typename AlgebraicROOTObject<D>::Vector *>(measuredParams_);
72  }

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

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

◆ params()

template<unsigned int D>
AlgebraicROOTObject<D>::Vector& KfComponentsHolder::params ( )
inline

Definition at line 31 of file KfComponentsHolder.h.

31  {
32 #ifdef Debug_KfComponentsHolder
33  assert(size_ == D);
34 #endif
35  return *reinterpret_cast<typename AlgebraicROOTObject<D>::Vector *>(params_);
36  }

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

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

◆ projection()

template<unsigned int D>
AlgebraicROOTObject<D, 5>::Matrix KfComponentsHolder::projection ( )
inline

Definition at line 47 of file KfComponentsHolder.h.

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  }

References cms::cuda::assert().

Referenced by ReferenceTrajectory::getHitProjectionMatrixT().

◆ projFunc()

template<unsigned int D>
ProjectMatrix<double, 5, D>& KfComponentsHolder::projFunc ( )
inline

Definition at line 56 of file KfComponentsHolder.h.

56  {
57 #ifdef Debug_KfComponentsHolder
58  assert(size_ == D);
59 #endif
60  return *reinterpret_cast<ProjectMatrix<double, 5, D> *>(projFunc_);
61  }

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

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

◆ setup()

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.

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 }

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

Referenced by ReferenceTrajectory::getHitProjectionMatrixT().

◆ tsosLocalErrors()

const AlgebraicSymMatrix55& KfComponentsHolder::tsosLocalErrors ( ) const
inline

◆ tsosLocalParameters()

const AlgebraicVector5& KfComponentsHolder::tsosLocalParameters ( ) const
inline

Member Data Documentation

◆ errors_

void * KfComponentsHolder::errors_
private

Definition at line 92 of file KfComponentsHolder.h.

Referenced by errors(), and setup().

◆ measuredErrors_

void * KfComponentsHolder::measuredErrors_
private

Definition at line 92 of file KfComponentsHolder.h.

Referenced by measuredErrors(), and setup().

◆ measuredParams_

void * KfComponentsHolder::measuredParams_
private

Definition at line 92 of file KfComponentsHolder.h.

Referenced by measuredParams(), and setup().

◆ params_

void* KfComponentsHolder::params_
private

Definition at line 92 of file KfComponentsHolder.h.

Referenced by params(), and setup().

◆ projFunc_

void * KfComponentsHolder::projFunc_
private

Definition at line 92 of file KfComponentsHolder.h.

Referenced by projFunc(), and setup().

◆ tsosLocalErrors_

const AlgebraicSymMatrix55* KfComponentsHolder::tsosLocalErrors_
private

Definition at line 94 of file KfComponentsHolder.h.

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

◆ tsosLocalParameters_

const AlgebraicVector5* KfComponentsHolder::tsosLocalParameters_
private

Definition at line 93 of file KfComponentsHolder.h.

Referenced by setup(), and tsosLocalParameters().

class-composition.H
H
Definition: class-composition.py:31
KfComponentsHolder::projFunc
ProjectMatrix< double, 5, D > & projFunc()
Definition: KfComponentsHolder.h:56
gather_cfg.cout
cout
Definition: gather_cfg.py:144
KfComponentsHolder::tsosLocalErrors
const AlgebraicSymMatrix55 & tsosLocalErrors() const
Definition: KfComponentsHolder.h:83
AlgebraicROOTObject::SymMatrix
ROOT::Math::SMatrix< double, D1, D1, ROOT::Math::MatRepSym< double, D1 > > SymMatrix
Definition: AlgebraicROOTObjects.h:68
cms::cuda::assert
assert(be >=bs)
KfComponentsHolder::tsosLocalParameters
const AlgebraicVector5 & tsosLocalParameters() const
Definition: KfComponentsHolder.h:82
KfComponentsHolder::projFunc_
void * projFunc_
Definition: KfComponentsHolder.h:92
KfComponentsHolder::measuredParams
AlgebraicROOTObject< D >::Vector & measuredParams()
Definition: KfComponentsHolder.h:67
KfComponentsHolder::params_
void * params_
Definition: KfComponentsHolder.h:92
AlgebraicROOTObject::Matrix
ROOT::Math::SMatrix< double, D1, D2, ROOT::Math::MatRepStd< double, D1, D2 > > Matrix
Definition: AlgebraicROOTObjects.h:69
KfComponentsHolder::measuredErrors_
void * measuredErrors_
Definition: KfComponentsHolder.h:92
KfComponentsHolder::measuredErrors
AlgebraicROOTObject< D, D >::SymMatrix & measuredErrors()
Definition: KfComponentsHolder.h:75
KfComponentsHolder::measuredParams_
void * measuredParams_
Definition: KfComponentsHolder.h:92
KfComponentsHolder::errors_
void * errors_
Definition: KfComponentsHolder.h:92
funct::D
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
std
Definition: JetResolutionObject.h:76
KfComponentsHolder::tsosLocalParameters_
const AlgebraicVector5 * tsosLocalParameters_
Definition: KfComponentsHolder.h:93
Exception
Definition: hltDiff.cc:246
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
KfComponentsHolder::tsosLocalErrors_
const AlgebraicSymMatrix55 * tsosLocalErrors_
Definition: KfComponentsHolder.h:94
ProjectMatrix
Definition: ProjectMatrix.h:8
AlgebraicROOTObject::Vector
ROOT::Math::SVector< double, D1 > Vector
Definition: AlgebraicROOTObjects.h:67
KfComponentsHolder::params
AlgebraicROOTObject< D >::Vector & params()
Definition: KfComponentsHolder.h:31
hit
Definition: SiStripHitEffFromCalibTree.cc:88
KfComponentsHolder::errors
AlgebraicROOTObject< D, D >::SymMatrix & errors()
Definition: KfComponentsHolder.h:39