CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/RecoTracker/MeasurementDet/plugins/RecHitPropagator.cc

Go to the documentation of this file.
00001 #include "RecHitPropagator.h"
00002 #include "TrackingTools/GeomPropagators/interface/AnalyticalPropagator.h"
00003 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
00004 
00005 TrajectoryStateOnSurface 
00006 RecHitPropagator::propagate( const TransientTrackingRecHit& hit,
00007                              const Plane& plane, 
00008                              const TrajectoryStateOnSurface& ts) const
00009 {
00010   const MagneticField& field = ts.globalParameters().magneticField();
00011   AnalyticalPropagator prop( &field, anyDirection);
00012   TrajectoryStateOnSurface tsNoErr = TrajectoryStateOnSurface( ts.globalParameters(), ts.surface());
00013   TrajectoryStateOnSurface hitts = prop.propagate( tsNoErr, hit.det()->specificSurface());
00014 
00015   // LocalVector ldir = hit.det()->specificSurface().toLocal(ts.globalMomentum());
00016   LocalVector ldir = hitts.localMomentum();
00017   LocalTrajectoryParameters ltp( hit.localPosition(), ldir, ts.charge());
00018   AlgebraicSymMatrix55 m;
00019   LocalError lhe = hit.localPositionError();
00020   m[3][3] = lhe.xx();
00021   m[3][4] = lhe.xy();
00022   m[4][4] = lhe.yy();
00023 
00024   const double epsilon = 1.e-8; // very small errors on momentum and angle
00025   m[0][0] = epsilon;
00026   m[1][1] = epsilon;
00027   m[2][2] = epsilon;
00028   LocalTrajectoryError lte( m);
00029 
00030   TrajectoryStateOnSurface startingState( ltp, lte, hit.det()->specificSurface(), &field);
00031 
00032   return prop.propagate( startingState, plane);
00033 }