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
0008
0009
0010
0011 class MeasurementExtractor {
0012 public:
0013
0014 MeasurementExtractor(const TrajectoryStateOnSurface &aTSoS) : theTSoS(aTSoS) {}
0015
0016
0017
0018
0019
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