Go to the documentation of this file.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 #include "FWCore/Utilities/interface/Visibility.h"
00007
00008 #include <cmath>
00009 #include <cfloat>
00010
00011 class Surface;
00012 class Cylinder;
00013 class Plane;
00014 class HelixPlaneCrossing;
00015 class MagneticField;
00016
00017
00023 class AnalyticalPropagator : public Propagator {
00024
00025 public:
00026
00027 AnalyticalPropagator( const MagneticField* field,
00028 PropagationDirection dir = alongMomentum,
00029 float maxDPhi = 1.6) :
00030 Propagator(dir),
00031 theMaxDPhi2(maxDPhi*maxDPhi),
00032 theMaxDBzRatio(0.5),
00033 theField(field) {}
00034
00035 ~AnalyticalPropagator() {}
00036
00037
00038
00039
00040
00041
00042
00043 using Propagator::propagate;
00044 using Propagator::propagateWithPath;
00045
00047 TrajectoryStateOnSurface propagate(const FreeTrajectoryState& fts,
00048 const Plane& plane) const {
00049 return propagateWithPath(fts,plane).first;
00050 }
00052 std::pair<TrajectoryStateOnSurface,double>
00053 propagateWithPath(const FreeTrajectoryState& fts,
00054 const Plane& plane) const;
00055
00057 TrajectoryStateOnSurface propagate(const FreeTrajectoryState& fts,
00058 const Cylinder& cylinder) const {
00059 return propagateWithPath(fts,cylinder).first;
00060 }
00062 std::pair<TrajectoryStateOnSurface,double>
00063 propagateWithPath(const FreeTrajectoryState& fts,
00064 const Cylinder& cylinder) const;
00068 virtual bool setMaxDirectionChange( float phiMax) {
00069 theMaxDPhi2 = phiMax*phiMax;
00070 return true;
00071 }
00072
00073 #ifndef CMS_NO_RELAXED_RETURN_TYPE
00074 virtual AnalyticalPropagator * clone() const
00075 #else
00076 virtual Propagator * clone() const
00077 #endif
00078 {
00079 return new AnalyticalPropagator(*this);
00080 }
00081
00086 void setMaxRelativeChangeInBz (const float maxDBz) {
00087 theMaxDBzRatio = maxDBz;
00088 }
00089
00090
00091 private:
00093 std::pair<TrajectoryStateOnSurface,double>
00094 propagatedStateWithPath (const FreeTrajectoryState& fts,
00095 const Surface& surface,
00096 const GlobalTrajectoryParameters& gtp,
00097 const double& s) const dso_internal;
00098
00100 bool propagateParametersOnCylinder(const FreeTrajectoryState& fts,
00101 const Cylinder& cylinder,
00102 GlobalPoint& x,
00103 GlobalVector& p,
00104 double& s) const dso_internal;
00105
00107 bool propagateParametersOnPlane(const FreeTrajectoryState& fts,
00108 const Plane& plane,
00109 GlobalPoint& x,
00110 GlobalVector& p,
00111 double& s) const dso_internal;
00112
00114 bool propagateWithLineCrossing(const GlobalPoint&, const GlobalVector&,
00115 const Plane&, GlobalPoint&, double&) const dso_internal;
00117 bool propagateWithLineCrossing(const GlobalPoint&, const GlobalVector&,
00118 const Cylinder&, GlobalPoint&, double&) const dso_internal;
00120 bool propagateWithHelixCrossing(HelixPlaneCrossing&, const Plane&, const float,
00121 GlobalPoint&, GlobalVector&, double& s) const dso_internal;
00122
00123 virtual const MagneticField* magneticField() const {return theField;}
00124
00125 private:
00126 typedef std::pair<TrajectoryStateOnSurface,double> TsosWP;
00127 float theMaxDPhi2;
00128 float theMaxDBzRatio;
00129 const MagneticField* theField;
00130 };
00131
00132 #endif