CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/src/TrackingTools/PatternTools/interface/MeasurementExtractor.h

Go to the documentation of this file.
00001 #ifndef MeasurementExtractor_H
00002 #define MeasurementExtractor_H
00003  
00004 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
00005 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
00006 
00007  
00012 class MeasurementExtractor {
00013  public:
00014   // construct
00015   MeasurementExtractor(const TrajectoryStateOnSurface& aTSoS) :
00016     theTSoS(aTSoS) {}
00017  
00018   // access
00019   
00020   // Following methods can be overloaded against their argument
00021   // thus allowing one to have different behaviour for different RecHit types
00022  
00023   AlgebraicVector measuredParameters(const  TransientTrackingRecHit&);
00024   AlgebraicSymMatrix measuredError(const  TransientTrackingRecHit&);
00025 
00026   template <unsigned int D> typename AlgebraicROOTObject<D>::Vector measuredParameters(const TransientTrackingRecHit &hit) {
00027       typedef typename AlgebraicROOTObject<D,5>::Matrix Mat;
00028       AlgebraicVector5 par5( theTSoS.localParameters().vector());
00029       Mat H = asSMatrix<D,5>( hit.projectionMatrix() );
00030       return H*par5;
00031   }
00032 
00033   template <unsigned int D> typename AlgebraicROOTObject<D>::SymMatrix measuredError(const TransientTrackingRecHit &hit) {
00034       typedef typename AlgebraicROOTObject<D,5>::Matrix Mat;
00035       const AlgebraicSymMatrix55 &err5 =  theTSoS.localError().matrix();
00036       Mat H = asSMatrix<D,5>( hit.projectionMatrix() );
00037       return ROOT::Math::Similarity(H,err5); 
00038   }
00039 
00040  private:
00041   const TrajectoryStateOnSurface& theTSoS;
00042 };
00043 
00044 #endif
00045  
00046