CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/TrackingTools/GeomPropagators/interface/AnalyticalPropagator.h

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,bool isOld=true) :
00030     Propagator(dir),
00031     theMaxDPhi2(maxDPhi*maxDPhi),
00032     theMaxDBzRatio(0.5),
00033     theField(field),
00034     isOldPropagationType(isOld) {}
00035 
00036   ~AnalyticalPropagator() {}
00037   //
00038   // use base class methods where necessary:
00039   // - propagation from TrajectoryStateOnSurface 
00040   //     (will use propagation from FreeTrajectoryState)
00041   // - propagation to general Surface
00042   //     (will use specialised methods for planes or cylinders)
00043   //
00044   using Propagator::propagate;
00045   using Propagator::propagateWithPath;
00046 
00048   TrajectoryStateOnSurface propagate(const FreeTrajectoryState& fts, 
00049                                      const Plane& plane) const {
00050     return propagateWithPath(fts,plane).first;
00051   }
00053   std::pair<TrajectoryStateOnSurface,double> 
00054   propagateWithPath(const FreeTrajectoryState& fts, 
00055                     const Plane& plane) const; 
00056   
00058   TrajectoryStateOnSurface propagate(const FreeTrajectoryState& fts, 
00059                                      const Cylinder& cylinder) const {
00060     return propagateWithPath(fts,cylinder).first;
00061   }
00063   std::pair<TrajectoryStateOnSurface,double> 
00064   propagateWithPath(const FreeTrajectoryState& fts, 
00065                     const Cylinder& cylinder) const;
00069   virtual bool setMaxDirectionChange( float phiMax) { 
00070     theMaxDPhi2 = phiMax*phiMax;
00071     return true;
00072   }
00073   
00074 #ifndef CMS_NO_RELAXED_RETURN_TYPE
00075   virtual AnalyticalPropagator * clone() const 
00076 #else
00077     virtual Propagator * clone() const
00078 #endif
00079   {
00080     return new AnalyticalPropagator(*this);
00081   }
00082   
00087   void setMaxRelativeChangeInBz (const float maxDBz) {
00088     theMaxDBzRatio = maxDBz;
00089   }
00090 
00091 
00092 private:
00094   std::pair<TrajectoryStateOnSurface,double> 
00095   propagatedStateWithPath (const FreeTrajectoryState& fts, 
00096                            const Surface& surface, 
00097                            const GlobalTrajectoryParameters& gtp, 
00098                            const double& s) const dso_internal;
00099 
00101   bool propagateParametersOnCylinder(const FreeTrajectoryState& fts, 
00102                                      const Cylinder& cylinder, 
00103                                      GlobalPoint& x, 
00104                                      GlobalVector& p, 
00105                                      double& s) const dso_internal;
00106 
00108   bool propagateParametersOnPlane(const FreeTrajectoryState& fts, 
00109                                   const Plane& plane, 
00110                                   GlobalPoint& x, 
00111                                   GlobalVector& p, 
00112                                   double& s) const dso_internal;
00113   
00115   bool propagateWithLineCrossing(const GlobalPoint&, const GlobalVector&, 
00116                                  const Plane&, GlobalPoint&, double&) const dso_internal;
00118   bool propagateWithLineCrossing(const GlobalPoint&, const GlobalVector&, 
00119                                  const Cylinder&, GlobalPoint&, double&) const dso_internal;
00121   bool propagateWithHelixCrossing(HelixPlaneCrossing&, const Plane&, const float,
00122                                   GlobalPoint&, GlobalVector&, double& s) const dso_internal;
00123 
00124   virtual const MagneticField* magneticField() const {return theField;}
00125 
00126 private:
00127   typedef std::pair<TrajectoryStateOnSurface,double> TsosWP;
00128   float theMaxDPhi2;
00129   float theMaxDBzRatio;
00130   const MagneticField* theField;
00131   bool isOldPropagationType;
00132 };
00133 
00134 #endif