CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/TrackingTools/MaterialEffects/interface/PropagatorWithMaterial.h

Go to the documentation of this file.
00001 #ifndef _COMMONRECO_PROPAGATORWITHMATERIAL_H_
00002 #define _COMMONRECO_PROPAGATORWITHMATERIAL_H_
00003 
00020 #include "DataFormats/GeometryCommonDetAlgo/interface/DeepCopyPointerByClone.h"
00021 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
00022 #include "TrackingTools/MaterialEffects/interface/MaterialEffectsUpdator.h"
00023 #include "MagneticField/Engine/interface/MagneticField.h"
00024 
00025 class PropagatorWithMaterial : public Propagator {
00026   
00027 public:
00038   PropagatorWithMaterial (PropagationDirection dir, const float mass,  
00039                           const MagneticField * mf=0,const float maxDPhi=1.6,
00040                           bool useRungeKutta=false, float ptMin=-1.);
00043   PropagatorWithMaterial(const Propagator& Propagator,
00044                          const MaterialEffectsUpdator& MEUpdator,
00045                          const MagneticField * mf=0,
00046                          bool useRungeKutta=false);
00047 
00048   ~PropagatorWithMaterial() {}
00049 
00050   virtual TrajectoryStateOnSurface propagate (const TrajectoryStateOnSurface& tsos, 
00051                                               const Plane& plane) const
00052   {
00053     // should be implemented (in case underlying propagator has an independent
00054     // implementation)
00055     return propagateWithPath(tsos,plane).first;
00056   }
00057 
00058   virtual TrajectoryStateOnSurface propagate (const FreeTrajectoryState& fts, 
00059                                               const Plane& plane) const
00060   {
00061     // should be implemented (in case underlying propagator has an independent
00062     // implementation)
00063     return propagateWithPath(fts,plane).first;
00064   }
00065 
00066   virtual std::pair<TrajectoryStateOnSurface,double> propagateWithPath (const TrajectoryStateOnSurface& tsos, 
00067                                                                         const Plane& plane) const;
00068 
00069   virtual std::pair<TrajectoryStateOnSurface,double> propagateWithPath (const FreeTrajectoryState& fts, 
00070                                                                         const Plane& plane) const;
00071 
00072   virtual TrajectoryStateOnSurface propagate (const TrajectoryStateOnSurface& tsos, 
00073                                               const Cylinder& cylinder) const
00074   {
00075     // should be implemented (in case underlying propagator has an independent
00076     // implementation)
00077     return propagateWithPath(tsos,cylinder).first;
00078   }
00079 
00080   virtual TrajectoryStateOnSurface propagate (const FreeTrajectoryState& fts, 
00081                                               const Cylinder& cylinder) const
00082   {
00083     // should be implemented (in case underlying propagator has an independent
00084     // implementation)
00085     return propagateWithPath(fts,cylinder).first;
00086   }
00087 
00088   virtual std::pair<TrajectoryStateOnSurface,double> propagateWithPath (const TrajectoryStateOnSurface& tsos, 
00089                                                                         const Cylinder& cylinder) const;
00090 
00091   virtual std::pair<TrajectoryStateOnSurface,double> propagateWithPath (const FreeTrajectoryState& fts, 
00092                                                                         const Cylinder& cylinder) const;
00093 
00095   virtual bool setMaxDirectionChange( float phiMax) { 
00096     return theGeometricalPropagator->setMaxDirectionChange(phiMax);
00097   }
00099   virtual void setPropagationDirection (PropagationDirection dir) const;
00100 
00101   enum MaterialLocation {atSource, atDestination, fromDirection};
00110   void setMaterialLocation (const MaterialLocation location) {
00111     theMaterialLocation = location;
00112   }
00114   const Propagator& geometricalPropagator() const {
00115     return *theGeometricalPropagator;
00116   }
00118   const MaterialEffectsUpdator& materialEffectsUpdator() const {
00119     return *theMEUpdator;
00120   }
00121 
00122   virtual const MagneticField* magneticField() const {return field;}
00123 
00124 
00125   virtual PropagatorWithMaterial* clone() const
00126     {
00127       return new PropagatorWithMaterial(*this);
00128     }
00129 
00130 private:
00132   bool materialAtSource() const;
00133 
00134 private:
00135   // Geometrical propagator
00136   DeepCopyPointerByClone<Propagator> theGeometricalPropagator;
00137 
00138 
00139   // Material effects
00140   DeepCopyPointerByClone<MaterialEffectsUpdator> theMEUpdator;
00141   typedef std::pair<TrajectoryStateOnSurface,double> TsosWP;
00142   // Use material at source?
00143   MaterialLocation theMaterialLocation;
00144   const MagneticField * field;
00145   bool useRungeKutta_;
00146 };
00147 
00148 #endif
00149 
00150