Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:33

0001 #ifndef MeasurementExtractor_H
0002 #define MeasurementExtractor_H
0003 
0004 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
0005 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0006 
0007 /** Extracts the subset of TrajectoryState parameters and errors
0008  *  that correspond to the parameters measured by a RecHit.
0009  */
0010 
0011 class MeasurementExtractor {
0012 public:
0013   // construct
0014   MeasurementExtractor(const TrajectoryStateOnSurface &aTSoS) : theTSoS(aTSoS) {}
0015 
0016   // access
0017 
0018   // Following methods can be overloaded against their argument
0019   // thus allowing one to have different behaviour for different RecHit types
0020 
0021   AlgebraicVector measuredParameters(const TrackingRecHit &);
0022   AlgebraicSymMatrix measuredError(const TrackingRecHit &);
0023 
0024   template <unsigned int D>
0025   typename AlgebraicROOTObject<D>::Vector measuredParameters(const TrackingRecHit &hit) {
0026     typedef typename AlgebraicROOTObject<D, 5>::Matrix Mat;
0027     AlgebraicVector5 par5(theTSoS.localParameters().vector());
0028     Mat H = asSMatrix<D, 5>(hit.projectionMatrix());
0029     return H * par5;
0030   }
0031 
0032   template <unsigned int D>
0033   typename AlgebraicROOTObject<D>::SymMatrix measuredError(const TrackingRecHit &hit) {
0034     typedef typename AlgebraicROOTObject<D, 5>::Matrix Mat;
0035     const AlgebraicSymMatrix55 &err5 = theTSoS.localError().matrix();
0036     Mat H = asSMatrix<D, 5>(hit.projectionMatrix());
0037     return ROOT::Math::Similarity(H, err5);
0038   }
0039 
0040 private:
0041   const TrajectoryStateOnSurface &theTSoS;
0042 };
0043 
0044 #endif