CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

KfComponentsHolder Class Reference

#include <KfComponentsHolder.h>

List of all members.

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.
 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_.

                       : params_(0), errors_(0), projection_(0), useProjFunc_(false)
        {
#ifdef Debug_KfComponentsHolder
            size_ = 0;
#endif
        }

Member Function Documentation

void KfComponentsHolder::doUseProjFunc ( ) [inline]

Definition at line 103 of file KfComponentsHolder.h.

References useProjFunc_.

Referenced by BaseSiTrackerRecHit2DLocalPos::getKfComponents().

{  useProjFunc_ = true; }
template<unsigned int D>
void KfComponentsHolder::dump ( void  )

Definition at line 176 of file KfComponentsHolder.h.

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

                              {
    using namespace std;
    cout << "Params  my: " << params<D>() << endl;
    cout << "      tsos: " << tsosLocalParameters() << endl;
    cout << "      meas: " << measuredParams<D>() << endl;
    cout << "Errors  my:\n" << errors<D>() << endl;
    cout << "      tsos:\n" << tsosLocalErrors() << endl;
    cout << "      meas:\n" << measuredErrors<D>() << endl;
    cout << "Projection:\n" << projection<D>() << endl;
}
template<unsigned int D>
AlgebraicROOTObject<D,D>::SymMatrix& KfComponentsHolder::errors ( ) [inline]

Definition at line 57 of file KfComponentsHolder.h.

References funct::D, errors_, and size_.

Referenced by SiStripRecHit1D::getKfComponents(), BaseSiTrackerRecHit2DLocalPos::getKfComponents(), HelpertRecHit2DLocalPos::getKfComponents(), GSSiTrackerRecHit2DLocalPos::getKfComponents(), and setup().

                                                              { 
#ifdef Debug_KfComponentsHolder
            assert(size_ == D);
#endif
            return  * reinterpret_cast<typename AlgebraicROOTObject<D,D>::SymMatrix *>(errors_);
        }
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().

                                                              {
    switch (hit.dimension()) {
        case 1: genericFill_<1>(hit); break;
        case 2: genericFill_<2>(hit); break;
        case 3: genericFill_<3>(hit); break;
        case 4: genericFill_<4>(hit); break;
        case 5: genericFill_<5>(hit); break;
        default:
            throw cms::Exception("Rec hit of invalid dimension (not 1,2,3,4,5)") <<
                "The dimension was " << hit.dimension() <<
                ", type is " << typeid(hit).name() << "\n";
    }

}
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_.

                                                               {
   typedef typename AlgebraicROOTObject<D,5>::Matrix MatD5;
   typedef typename AlgebraicROOTObject<D,D>::SymMatrix SMatDD;
   typedef typename AlgebraicROOTObject<D>::Vector VecD;

   params<D>()     = asSVector<D>(hit.parameters());
   errors<D>()     = asSMatrix<D>(hit.parametersError());
   projection<D>() = asSMatrix<D,5>(hit.projectionMatrix());

   const MatD5 & H = projection<D>();

   measuredParams<D>() = H * (*tsosLocalParameters_);
   measuredErrors<D>() = ROOT::Math::Similarity(H, (*tsosLocalErrors_));
}
template<unsigned int D>
AlgebraicROOTObject<D,D>::SymMatrix& KfComponentsHolder::measuredErrors ( ) [inline]

Definition at line 92 of file KfComponentsHolder.h.

References funct::D, measuredErrors_, and size_.

Referenced by SiStripRecHit1D::getKfComponents(), BaseSiTrackerRecHit2DLocalPos::getKfComponents(), GSSiTrackerRecHit2DLocalPos::getKfComponents(), and setup().

                                                                      { 
#ifdef Debug_KfComponentsHolder
            assert(size_ == D);
#endif
            return  * reinterpret_cast<typename AlgebraicROOTObject<D,D>::SymMatrix *>(measuredErrors_);
        }
template<unsigned int D>
AlgebraicROOTObject<D>::Vector& KfComponentsHolder::measuredParams ( ) [inline]

Definition at line 84 of file KfComponentsHolder.h.

References funct::D, measuredParams_, and size_.

Referenced by SiStripRecHit1D::getKfComponents(), BaseSiTrackerRecHit2DLocalPos::getKfComponents(), GSSiTrackerRecHit2DLocalPos::getKfComponents(), and setup().

                                                                 { 
#ifdef Debug_KfComponentsHolder
            assert(size_ == D);
#endif
            return  * reinterpret_cast<typename AlgebraicROOTObject<D>::Vector *>(measuredParams_);
        }
template<unsigned int D>
AlgebraicROOTObject<D>::Vector& KfComponentsHolder::params ( ) [inline]

Definition at line 49 of file KfComponentsHolder.h.

References funct::D, params_, and size_.

Referenced by SiStripRecHit1D::getKfComponents(), BaseSiTrackerRecHit2DLocalPos::getKfComponents(), GSSiTrackerRecHit2DLocalPos::getKfComponents(), and setup().

                                                         { 
#ifdef Debug_KfComponentsHolder
            assert(size_ == D);
#endif
            return  * reinterpret_cast<typename AlgebraicROOTObject<D>::Vector *>(params_);
        }
template<unsigned int D>
AlgebraicROOTObject<D,5>::Matrix& KfComponentsHolder::projection ( ) [inline]

Definition at line 65 of file KfComponentsHolder.h.

References funct::D, projection_, and size_.

Referenced by SiStripRecHit1D::getKfComponents(), BaseSiTrackerRecHit2DLocalPos::getKfComponents(), GSSiTrackerRecHit2DLocalPos::getKfComponents(), and setup().

                                                               { 
#ifdef Debug_KfComponentsHolder
            assert(size_ == D);
#endif
            return  * reinterpret_cast<typename AlgebraicROOTObject<D,5>::Matrix *>(projection_);
        }
template<unsigned int D>
ProjectMatrix<double,5,D>& KfComponentsHolder::projFunc ( ) [inline]

Definition at line 73 of file KfComponentsHolder.h.

References funct::D, projFunc_, and size_.

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

                                               { 
#ifdef Debug_KfComponentsHolder
            assert(size_ == D);
#endif
            return  * reinterpret_cast< ProjectMatrix<double,5,D> *>(projFunc_);
        }
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 
)
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 
)
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_.

{ return useProjFunc_;}

Member Data Documentation

void * KfComponentsHolder::errors_ [private]

Definition at line 110 of file KfComponentsHolder.h.

Referenced by errors(), and setup().

Definition at line 110 of file KfComponentsHolder.h.

Referenced by measuredErrors(), and setup().

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().

Definition at line 110 of file KfComponentsHolder.h.

Referenced by projection(), and setup().

Definition at line 110 of file KfComponentsHolder.h.

Referenced by projFunc(), and setup().

uint16_t KfComponentsHolder::size_ [private]

Definition at line 112 of file KfComponentsHolder.h.

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

Definition at line 111 of file KfComponentsHolder.h.

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

Definition at line 114 of file KfComponentsHolder.h.

Referenced by doUseProjFunc(), and useProjFunc().