Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:22:22

0001 #ifndef RecHitPropagator_H
0002 #define RecHitPropagator_H
0003 
0004 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0005 
0006 class TrackingRecHit;
0007 class MagneticField;
0008 class Plane;
0009 
0010 class dso_hidden RecHitPropagator {
0011 public:
0012   TrajectoryStateOnSurface propagate(const TrackingRecHit& hit,
0013                                      const Plane& plane,
0014                                      const TrajectoryStateOnSurface& ts) const;
0015 };
0016 
0017 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
0018 
0019 // propagate from glued to mono/stereo
0020 inline TrajectoryStateOnSurface fastProp(const TrajectoryStateOnSurface& ts, const Plane& oPlane, const Plane& tPlane) {
0021   GlobalVector gdir = ts.globalMomentum();
0022 
0023   double delta = tPlane.localZ(oPlane.position());
0024   LocalVector ldir = tPlane.toLocal(gdir);  // fast prop!
0025   LocalPoint lPos = tPlane.toLocal(ts.globalPosition());
0026   LocalPoint projectedPos = lPos - ldir * delta / ldir.z();
0027   // we can also patch it up as only the position-errors are used...
0028   GlobalTrajectoryParameters gp(
0029       tPlane.toGlobal(projectedPos), gdir, ts.charge(), &ts.globalParameters().magneticField());
0030   if (ts.hasError())
0031     return TrajectoryStateOnSurface(gp, ts.curvilinearError(), tPlane);
0032   else
0033     return TrajectoryStateOnSurface(gp, tPlane);
0034 }
0035 
0036 #endif