test
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

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.

References edm::size_().

15  {
16 #ifdef Debug_KfComponentsHolder
17  size_ = 0;
18 #endif
19 }
size_(0)
Definition: OwnArray.h:181

Member Function Documentation

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

Definition at line 131 of file KfComponentsHolder.h.

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

131  {
132  using namespace std;
133  cout << "Params my: " << params<D>() << endl;
134  cout << " tsos: " << tsosLocalParameters() << endl;
135  cout << " meas: " << measuredParams<D>() << endl;
136  cout << "Errors my:\n" << errors<D>() << endl;
137  cout << " tsos:\n" << tsosLocalErrors() << endl;
138  cout << " meas:\n" << measuredErrors<D>() << endl;
139  cout << "Projection:\n" << projection<D>() << endl;
140 }
const AlgebraicVector5 & tsosLocalParameters() const
tuple cout
Definition: gather_cfg.py:145
const AlgebraicSymMatrix55 & tsosLocalErrors() const
template<unsigned int D>
AlgebraicROOTObject<D,D>::SymMatrix& KfComponentsHolder::errors ( )
inline

Definition at line 42 of file KfComponentsHolder.h.

References assert(), errors_, and edm::size_().

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

42  {
43 #ifdef Debug_KfComponentsHolder
44  assert(size_ == D);
45 #endif
46  return * reinterpret_cast<typename AlgebraicROOTObject<D,D>::SymMatrix *>(errors_);
47  }
ROOT::Math::SMatrix< double, D1, D1, ROOT::Math::MatRepSym< double, D1 > > SymMatrix
assert(m_qm.get())
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
size_(0)
Definition: OwnArray.h:181
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: 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 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
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 81 of file KfComponentsHolder.h.

References assert(), measuredErrors_, and edm::size_().

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

81  {
82 #ifdef Debug_KfComponentsHolder
83  assert(size_ == D);
84 #endif
85  return * reinterpret_cast<typename AlgebraicROOTObject<D,D>::SymMatrix *>(measuredErrors_);
86  }
ROOT::Math::SMatrix< double, D1, D1, ROOT::Math::MatRepSym< double, D1 > > SymMatrix
assert(m_qm.get())
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
size_(0)
Definition: OwnArray.h:181
template<unsigned int D>
AlgebraicROOTObject<D>::Vector& KfComponentsHolder::measuredParams ( )
inline

Definition at line 73 of file KfComponentsHolder.h.

References assert(), measuredParams_, and edm::size_().

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

73  {
74 #ifdef Debug_KfComponentsHolder
75  assert(size_ == D);
76 #endif
77  return * reinterpret_cast<typename AlgebraicROOTObject<D>::Vector *>(measuredParams_);
78  }
assert(m_qm.get())
ROOT::Math::SVector< double, D1 > Vector
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
size_(0)
Definition: OwnArray.h:181
template<unsigned int D>
AlgebraicROOTObject<D>::Vector& KfComponentsHolder::params ( )
inline

Definition at line 34 of file KfComponentsHolder.h.

References assert(), params_, and edm::size_().

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

34  {
35 #ifdef Debug_KfComponentsHolder
36  assert(size_ == D);
37 #endif
38  return * reinterpret_cast<typename AlgebraicROOTObject<D>::Vector *>(params_);
39  }
assert(m_qm.get())
ROOT::Math::SVector< double, D1 > Vector
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
size_(0)
Definition: OwnArray.h:181
template<unsigned int D>
AlgebraicROOTObject<D,5>::Matrix KfComponentsHolder::projection ( )
inline

Definition at line 51 of file KfComponentsHolder.h.

References assert(), makeMuonMisalignmentScenario::matrix, and edm::size_().

Referenced by ReferenceTrajectory::getHitProjectionMatrixT().

51  {
52 #ifdef Debug_KfComponentsHolder
53  assert(size_ == D);
54 #endif
55  return this->projFunc<D>().matrix();
56  //return * reinterpret_cast<typename AlgebraicROOTObject<D,5>::Matrix *>(projection_);
57  }
assert(m_qm.get())
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
size_(0)
Definition: OwnArray.h:181
template<unsigned int D>
ProjectMatrix<double,5,D>& KfComponentsHolder::projFunc ( )
inline

Definition at line 62 of file KfComponentsHolder.h.

References assert(), projFunc_, and edm::size_().

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

62  {
63 #ifdef Debug_KfComponentsHolder
64  assert(size_ == D);
65 #endif
66  return * reinterpret_cast< ProjectMatrix<double,5,D> *>(projFunc_);
67  }
assert(m_qm.get())
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
size_(0)
Definition: OwnArray.h:181
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 108 of file KfComponentsHolder.h.

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

Referenced by ReferenceTrajectory::getHitProjectionMatrixT().

116 {
117 #ifdef Debug_KfComponentsHolder
118  assert(size_ == 0); // which means it was uninitialized
119  size_ = D;
120 #endif
121  params_ = params;
122  errors_ = errors;
128 }
AlgebraicROOTObject< D, D >::SymMatrix & measuredErrors()
assert(m_qm.get())
AlgebraicROOTObject< D >::Vector & params()
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
const AlgebraicVector5 & tsosLocalParameters() const
const AlgebraicSymMatrix55 * tsosLocalErrors_
AlgebraicROOTObject< D >::Vector & measuredParams()
size_(0)
Definition: OwnArray.h:181
AlgebraicROOTObject< D, D >::SymMatrix & errors()
const AlgebraicSymMatrix55 & tsosLocalErrors() const
ProjectMatrix< double, 5, D > & projFunc()
const AlgebraicVector5 * tsosLocalParameters_
const AlgebraicSymMatrix55& KfComponentsHolder::tsosLocalErrors ( ) const
inline

Definition at line 89 of file KfComponentsHolder.h.

References tsosLocalErrors_.

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

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

Definition at line 88 of file KfComponentsHolder.h.

References tsosLocalParameters_.

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

88 { return *tsosLocalParameters_; }
const AlgebraicVector5 * tsosLocalParameters_

Member Data Documentation

void * KfComponentsHolder::errors_
private

Definition at line 97 of file KfComponentsHolder.h.

Referenced by errors(), and setup().

void * KfComponentsHolder::measuredErrors_
private

Definition at line 97 of file KfComponentsHolder.h.

Referenced by measuredErrors(), and setup().

void * KfComponentsHolder::measuredParams_
private

Definition at line 97 of file KfComponentsHolder.h.

Referenced by measuredParams(), and setup().

void* KfComponentsHolder::params_
private

Definition at line 97 of file KfComponentsHolder.h.

Referenced by params(), and setup().

void * KfComponentsHolder::projFunc_
private

Definition at line 97 of file KfComponentsHolder.h.

Referenced by projFunc(), and setup().

const AlgebraicSymMatrix55* KfComponentsHolder::tsosLocalErrors_
private

Definition at line 99 of file KfComponentsHolder.h.

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

const AlgebraicVector5* KfComponentsHolder::tsosLocalParameters_
private

Definition at line 98 of file KfComponentsHolder.h.

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