CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
KfComponentsHolder Class Reference

#include <KfComponentsHolder.h>

Public Member Functions

void doUseProjFunc ()
 
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, typename AlgebraicROOTObject< D, 5 >::Matrix *projection, ProjectMatrix< double, 5, D > *projFunc, typename AlgebraicROOTObject< D >::Vector *measuredParams, typename AlgebraicROOTObject< D, D >::SymMatrix *measuredErrors, const AlgebraicVector5 &tsosLocalParameters, const AlgebraicSymMatrix55 &tsosLocalErrors)
 
template<unsigned int D>
void setup (typename AlgebraicROOTObject< D >::Vector *params, typename AlgebraicROOTObject< D, D >::SymMatrix *errors, typename AlgebraicROOTObject< D, 5 >::Matrix *projection, typename AlgebraicROOTObject< D >::Vector *measuredParams, typename AlgebraicROOTObject< D, D >::SymMatrix *measuredErrors, const AlgebraicVector5 &tsosLocalParameters, const AlgebraicSymMatrix55 &tsosLocalErrors)
 
const AlgebraicSymMatrix55tsosLocalErrors () const
 
const AlgebraicVector5tsosLocalParameters () const
 
bool useProjFunc () const
 

Private Member Functions

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

Private Attributes

void * errors_
 
void * measuredErrors_
 
void * measuredParams_
 
void * params_
 
void * projection_
 
void * projFunc_
 
uint16_t size_
 
const AlgebraicSymMatrix55tsosLocalErrors_
 
const AlgebraicVector5tsosLocalParameters_
 
bool useProjFunc_
 

Detailed Description

Definition at line 13 of file KfComponentsHolder.h.

Constructor & Destructor Documentation

KfComponentsHolder::KfComponentsHolder ( )
inline

Definition at line 15 of file KfComponentsHolder.h.

References size_.

15  : params_(0), errors_(0), projection_(0), useProjFunc_(false)
16  {
17 #ifdef Debug_KfComponentsHolder
18  size_ = 0;
19 #endif
20  }

Member Function Documentation

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

Definition at line 176 of file KfComponentsHolder.h.

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

176  {
177  using namespace std;
178  cout << "Params my: " << params<D>() << endl;
179  cout << " tsos: " << tsosLocalParameters() << endl;
180  cout << " meas: " << measuredParams<D>() << endl;
181  cout << "Errors my:\n" << errors<D>() << endl;
182  cout << " tsos:\n" << tsosLocalErrors() << endl;
183  cout << " meas:\n" << measuredErrors<D>() << endl;
184  cout << "Projection:\n" << projection<D>() << endl;
185 }
const AlgebraicVector5 & tsosLocalParameters() const
tuple cout
Definition: gather_cfg.py:121
const AlgebraicSymMatrix55 & tsosLocalErrors() const
template<unsigned int D>
AlgebraicROOTObject<D,D>::SymMatrix& KfComponentsHolder::errors ( )
inline

Definition at line 57 of file KfComponentsHolder.h.

References errors_, and size_.

Referenced by GSSiTrackerRecHit2DLocalPos::getKfComponents(), HelpertRecHit2DLocalPos::getKfComponents(), BaseSiTrackerRecHit2DLocalPos::getKfComponents(), BaseTrackerRecHit::getKfComponents1D(), BaseTrackerRecHit::getKfComponents2D(), and setup().

57  {
58 #ifdef Debug_KfComponentsHolder
59  assert(size_ == D);
60 #endif
61  return * reinterpret_cast<typename AlgebraicROOTObject<D,D>::SymMatrix *>(errors_);
62  }
ROOT::Math::SMatrix< double, D1, D1, ROOT::Math::MatRepSym< double, D1 > > SymMatrix
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
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(), edm::hlt::Exception, and mergeVDriftHistosByStation::name.

Referenced by TrackingRecHit::getKfComponents().

22  {
23  switch (hit.dimension()) {
24  case 1: genericFill_<1>(hit); break;
25  case 2: genericFill_<2>(hit); break;
26  case 3: genericFill_<3>(hit); break;
27  case 4: genericFill_<4>(hit); break;
28  case 5: genericFill_<5>(hit); break;
29  default:
30  throw cms::Exception("Rec hit of invalid dimension (not 1,2,3,4,5)") <<
31  "The dimension was " << hit.dimension() <<
32  ", type is " << typeid(hit).name() << "\n";
33  }
34 
35 }
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 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  projection<D>() = asSMatrix<D,5>(hit.projectionMatrix());
15 
16  const MatD5 & H = projection<D>();
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
virtual AlgebraicVector parameters() const =0
ROOT::Math::SMatrix< double, D1, D2, ROOT::Math::MatRepStd< double, D1, D2 > > Matrix
ROOT::Math::SVector< double, D1 > Vector
virtual AlgebraicMatrix projectionMatrix() const =0
const AlgebraicSymMatrix55 * tsosLocalErrors_
const AlgebraicVector5 * tsosLocalParameters_
virtual AlgebraicSymMatrix parametersError() const =0
template<unsigned int D>
AlgebraicROOTObject<D,D>::SymMatrix& KfComponentsHolder::measuredErrors ( )
inline

Definition at line 92 of file KfComponentsHolder.h.

References measuredErrors_, and size_.

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

92  {
93 #ifdef Debug_KfComponentsHolder
94  assert(size_ == D);
95 #endif
96  return * reinterpret_cast<typename AlgebraicROOTObject<D,D>::SymMatrix *>(measuredErrors_);
97  }
ROOT::Math::SMatrix< double, D1, D1, ROOT::Math::MatRepSym< double, D1 > > SymMatrix
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
template<unsigned int D>
AlgebraicROOTObject<D>::Vector& KfComponentsHolder::measuredParams ( )
inline

Definition at line 84 of file KfComponentsHolder.h.

References measuredParams_, and size_.

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

84  {
85 #ifdef Debug_KfComponentsHolder
86  assert(size_ == D);
87 #endif
88  return * reinterpret_cast<typename AlgebraicROOTObject<D>::Vector *>(measuredParams_);
89  }
ROOT::Math::SVector< double, D1 > Vector
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
template<unsigned int D>
AlgebraicROOTObject<D>::Vector& KfComponentsHolder::params ( )
inline

Definition at line 49 of file KfComponentsHolder.h.

References params_, and size_.

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

49  {
50 #ifdef Debug_KfComponentsHolder
51  assert(size_ == D);
52 #endif
53  return * reinterpret_cast<typename AlgebraicROOTObject<D>::Vector *>(params_);
54  }
ROOT::Math::SVector< double, D1 > Vector
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
template<unsigned int D>
AlgebraicROOTObject<D,5>::Matrix& KfComponentsHolder::projection ( )
inline

Definition at line 65 of file KfComponentsHolder.h.

References projection_, and size_.

Referenced by ReferenceTrajectory::getHitProjectionMatrixT(), GSSiTrackerRecHit2DLocalPos::getKfComponents(), BaseSiTrackerRecHit2DLocalPos::getKfComponents(), BaseTrackerRecHit::getKfComponents1D(), BaseTrackerRecHit::getKfComponents2D(), and setup().

65  {
66 #ifdef Debug_KfComponentsHolder
67  assert(size_ == D);
68 #endif
69  return * reinterpret_cast<typename AlgebraicROOTObject<D,5>::Matrix *>(projection_);
70  }
ROOT::Math::SMatrix< double, D1, D2, ROOT::Math::MatRepStd< double, D1, D2 > > Matrix
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
template<unsigned int D>
ProjectMatrix<double,5,D>& KfComponentsHolder::projFunc ( )
inline

Definition at line 73 of file KfComponentsHolder.h.

References projFunc_, and size_.

Referenced by BaseSiTrackerRecHit2DLocalPos::getKfComponents(), BaseTrackerRecHit::getKfComponents2D(), and setup().

73  {
74 #ifdef Debug_KfComponentsHolder
75  assert(size_ == D);
76 #endif
77  return * reinterpret_cast< ProjectMatrix<double,5,D> *>(projFunc_);
78  }
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
template<unsigned int D>
void KfComponentsHolder::setup ( typename AlgebraicROOTObject< D >::Vector params,
typename AlgebraicROOTObject< D, D >::SymMatrix *  errors,
typename AlgebraicROOTObject< D, 5 >::Matrix *  projection,
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 124 of file KfComponentsHolder.h.

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

Referenced by ReferenceTrajectory::getHitProjectionMatrixT().

133 {
134 #ifdef Debug_KfComponentsHolder
135  assert(size_ == 0); // which means it was uninitialized
136  size_ = D;
137 #endif
138  params_ = params;
139  errors_ = errors;
146 }
AlgebraicROOTObject< D, D >::SymMatrix & measuredErrors()
AlgebraicROOTObject< D >::Vector & params()
const AlgebraicVector5 & tsosLocalParameters() const
const AlgebraicSymMatrix55 * tsosLocalErrors_
AlgebraicROOTObject< D >::Vector & measuredParams()
AlgebraicROOTObject< D, D >::SymMatrix & errors()
AlgebraicROOTObject< D, 5 >::Matrix & projection()
const AlgebraicSymMatrix55 & tsosLocalErrors() const
ProjectMatrix< double, 5, D > & projFunc()
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
const AlgebraicVector5 * tsosLocalParameters_
template<unsigned int D>
void KfComponentsHolder::setup ( typename AlgebraicROOTObject< D >::Vector params,
typename AlgebraicROOTObject< D, D >::SymMatrix *  errors,
typename AlgebraicROOTObject< D, 5 >::Matrix *  projection,
typename AlgebraicROOTObject< D >::Vector measuredParams,
typename AlgebraicROOTObject< D, D >::SymMatrix *  measuredErrors,
const AlgebraicVector5 tsosLocalParameters,
const AlgebraicSymMatrix55 tsosLocalErrors 
)

Definition at line 150 of file KfComponentsHolder.h.

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

158 {
159 #ifdef Debug_KfComponentsHolder
160  assert(size_ == 0); // which means it was uninitialized
161  size_ = D;
162 #endif
163  static ProjectMatrix<double,5,D> dummy;
164  params_ = params;
165  errors_ = errors;
167  projFunc_ = &dummy;
172 }
AlgebraicROOTObject< D, D >::SymMatrix & measuredErrors()
AlgebraicROOTObject< D >::Vector & params()
const AlgebraicVector5 & tsosLocalParameters() const
const AlgebraicSymMatrix55 * tsosLocalErrors_
AlgebraicROOTObject< D >::Vector & measuredParams()
AlgebraicROOTObject< D, D >::SymMatrix & errors()
AlgebraicROOTObject< D, 5 >::Matrix & projection()
const AlgebraicSymMatrix55 & tsosLocalErrors() const
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
const AlgebraicVector5 * tsosLocalParameters_
const AlgebraicSymMatrix55& KfComponentsHolder::tsosLocalErrors ( ) const
inline
const AlgebraicVector5& KfComponentsHolder::tsosLocalParameters ( ) const
inline
bool KfComponentsHolder::useProjFunc ( ) const
inline

Definition at line 102 of file KfComponentsHolder.h.

References useProjFunc_.

102 { return useProjFunc_;}

Member Data Documentation

void * KfComponentsHolder::errors_
private

Definition at line 110 of file KfComponentsHolder.h.

Referenced by errors(), and setup().

void * KfComponentsHolder::measuredErrors_
private

Definition at line 110 of file KfComponentsHolder.h.

Referenced by measuredErrors(), and setup().

void * KfComponentsHolder::measuredParams_
private

Definition at line 110 of file KfComponentsHolder.h.

Referenced by measuredParams(), and setup().

void* KfComponentsHolder::params_
private

Definition at line 110 of file KfComponentsHolder.h.

Referenced by params(), and setup().

void * KfComponentsHolder::projection_
private

Definition at line 110 of file KfComponentsHolder.h.

Referenced by projection(), and setup().

void * KfComponentsHolder::projFunc_
private

Definition at line 110 of file KfComponentsHolder.h.

Referenced by projFunc(), and setup().

uint16_t KfComponentsHolder::size_
private
const AlgebraicSymMatrix55* KfComponentsHolder::tsosLocalErrors_
private

Definition at line 112 of file KfComponentsHolder.h.

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

const AlgebraicVector5* KfComponentsHolder::tsosLocalParameters_
private

Definition at line 111 of file KfComponentsHolder.h.

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

bool KfComponentsHolder::useProjFunc_
private

Definition at line 114 of file KfComponentsHolder.h.

Referenced by doUseProjFunc(), and useProjFunc().