Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:27:34

0001 #include "RecHitPropagator.h"
0002 #include "TrackingTools/GeomPropagators/interface/AnalyticalPropagator.h"
0003 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
0004 
0005 TrajectoryStateOnSurface RecHitPropagator::propagate(const TrackingRecHit& hit,
0006                                                      const Plane& plane,
0007                                                      const TrajectoryStateOnSurface& ts) const {
0008   const MagneticField& field = ts.globalParameters().magneticField();
0009   AnalyticalPropagator prop(&field, anyDirection);
0010   TrajectoryStateOnSurface tsNoErr = TrajectoryStateOnSurface(ts.globalParameters(), ts.surface());
0011   TrajectoryStateOnSurface hitts = prop.propagate(tsNoErr, hit.det()->specificSurface());
0012 
0013   // LocalVector ldir = hit.det()->specificSurface().toLocal(ts.globalMomentum());
0014   LocalVector ldir = hitts.localMomentum();
0015   LocalTrajectoryParameters ltp(hit.localPosition(), ldir, ts.charge());
0016   AlgebraicSymMatrix55 m;
0017   LocalError lhe = hit.localPositionError();
0018   m[3][3] = lhe.xx();
0019   m[3][4] = lhe.xy();
0020   m[4][4] = lhe.yy();
0021 
0022   const double epsilon = 1.e-8;  // very small errors on momentum and angle
0023   m[0][0] = epsilon;
0024   m[1][1] = epsilon;
0025   m[2][2] = epsilon;
0026   LocalTrajectoryError lte(m);
0027 
0028   TrajectoryStateOnSurface startingState(ltp, lte, hit.det()->specificSurface(), &field);
0029 
0030   return prop.propagate(startingState, plane);
0031 }