00001 #ifndef _COMMONRECO_ANALYTICALPROPAGATOR_H_
00002 #define _COMMONRECO_ANALYTICALPROPAGATOR_H_
00003
00004 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
00005 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
00006
00007 #include <cmath>
00008 #include <cfloat>
00009
00010 class Surface;
00011 class Cylinder;
00012 class Plane;
00013 class HelixPlaneCrossing;
00014 class MagneticField;
00015
00016
00022 class AnalyticalPropagator : public Propagator {
00023
00024 public:
00025
00026 AnalyticalPropagator( const MagneticField* field,
00027 PropagationDirection dir = alongMomentum,
00028 float maxDPhi = 1.6) :
00029 Propagator(dir),
00030 theMaxDPhi2(maxDPhi*maxDPhi),
00031 theMaxDBzRatio(0.5),
00032 theField(field) {}
00033
00034 ~AnalyticalPropagator() {}
00035
00036
00037
00038
00039
00040
00041
00042 using Propagator::propagate;
00043 using Propagator::propagateWithPath;
00044
00046 TrajectoryStateOnSurface propagate(const FreeTrajectoryState& fts,
00047 const Plane& plane) const {
00048 return propagateWithPath(fts,plane).first;
00049 }
00051 std::pair<TrajectoryStateOnSurface,double>
00052 propagateWithPath(const FreeTrajectoryState& fts,
00053 const Plane& plane) const;
00054
00056 TrajectoryStateOnSurface propagate(const FreeTrajectoryState& fts,
00057 const Cylinder& cylinder) const {
00058 return propagateWithPath(fts,cylinder).first;
00059 }
00061 std::pair<TrajectoryStateOnSurface,double>
00062 propagateWithPath(const FreeTrajectoryState& fts,
00063 const Cylinder& cylinder) const;
00067 virtual bool setMaxDirectionChange( float phiMax) {
00068 theMaxDPhi2 = phiMax*phiMax;
00069 return true;
00070 }
00071
00072 #ifndef CMS_NO_RELAXED_RETURN_TYPE
00073 virtual AnalyticalPropagator * clone() const
00074 #else
00075 virtual Propagator * clone() const
00076 #endif
00077 {
00078 return new AnalyticalPropagator(*this);
00079 }
00080
00085 void setMaxRelativeChangeInBz (const float maxDBz) {
00086 theMaxDBzRatio = maxDBz;
00087 }
00088
00089
00090 private:
00092 std::pair<TrajectoryStateOnSurface,double>
00093 propagatedStateWithPath (const FreeTrajectoryState& fts,
00094 const Surface& surface,
00095 const GlobalTrajectoryParameters& gtp,
00096 const double& s) const;
00097
00099 bool propagateParametersOnCylinder(const FreeTrajectoryState& fts,
00100 const Cylinder& cylinder,
00101 GlobalPoint& x,
00102 GlobalVector& p,
00103 double& s) const;
00104
00106 bool propagateParametersOnPlane(const FreeTrajectoryState& fts,
00107 const Plane& plane,
00108 GlobalPoint& x,
00109 GlobalVector& p,
00110 double& s) const;
00111
00113 bool propagateWithLineCrossing(const GlobalPoint&, const GlobalVector&,
00114 const Plane&, GlobalPoint&, double&) const;
00116 bool propagateWithLineCrossing(const GlobalPoint&, const GlobalVector&,
00117 const Cylinder&, GlobalPoint&, double&) const;
00119 bool propagateWithHelixCrossing(HelixPlaneCrossing&, const Plane&, const float,
00120 GlobalPoint&, GlobalVector&, double& s) const;
00121
00122 virtual const MagneticField* magneticField() const {return theField;}
00123
00124 private:
00125 typedef std::pair<TrajectoryStateOnSurface,double> TsosWP;
00126 float theMaxDPhi2;
00127 float theMaxDBzRatio;
00128 const MagneticField* theField;
00129 };
00130
00131 #endif