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:
00034 PropagatorWithMaterial (PropagationDirection dir, const float mass,
00035 const MagneticField * mf=0,const float maxDPhi=1.6,
00036 bool useRungeKutta=false);
00039 PropagatorWithMaterial(const Propagator& Propagator,
00040 const MaterialEffectsUpdator& MEUpdator,
00041 const MagneticField * mf=0,
00042 bool useRungeKutta=false);
00043
00044 ~PropagatorWithMaterial() {}
00045
00046 virtual TrajectoryStateOnSurface propagate (const TrajectoryStateOnSurface& tsos,
00047 const Plane& plane) const
00048 {
00049
00050
00051 return propagateWithPath(tsos,plane).first;
00052 }
00053
00054 virtual TrajectoryStateOnSurface propagate (const FreeTrajectoryState& fts,
00055 const Plane& plane) const
00056 {
00057
00058
00059 return propagateWithPath(fts,plane).first;
00060 }
00061
00062 virtual std::pair<TrajectoryStateOnSurface,double> propagateWithPath (const TrajectoryStateOnSurface& tsos,
00063 const Plane& plane) const;
00064
00065 virtual std::pair<TrajectoryStateOnSurface,double> propagateWithPath (const FreeTrajectoryState& fts,
00066 const Plane& plane) const;
00067
00068 virtual TrajectoryStateOnSurface propagate (const TrajectoryStateOnSurface& tsos,
00069 const Cylinder& cylinder) const
00070 {
00071
00072
00073 return propagateWithPath(tsos,cylinder).first;
00074 }
00075
00076 virtual TrajectoryStateOnSurface propagate (const FreeTrajectoryState& fts,
00077 const Cylinder& cylinder) const
00078 {
00079
00080
00081 return propagateWithPath(fts,cylinder).first;
00082 }
00083
00084 virtual std::pair<TrajectoryStateOnSurface,double> propagateWithPath (const TrajectoryStateOnSurface& tsos,
00085 const Cylinder& cylinder) const;
00086
00087 virtual std::pair<TrajectoryStateOnSurface,double> propagateWithPath (const FreeTrajectoryState& fts,
00088 const Cylinder& cylinder) const;
00089
00091 virtual bool setMaxDirectionChange( float phiMax) {
00092 return theGeometricalPropagator->setMaxDirectionChange(phiMax);
00093 }
00095 virtual void setPropagationDirection (PropagationDirection dir);
00096
00097 enum MaterialLocation {atSource, atDestination, fromDirection};
00106 void setMaterialLocation (const MaterialLocation location) {
00107 theMaterialLocation = location;
00108 }
00110 const Propagator& geometricalPropagator() const {
00111 return *theGeometricalPropagator;
00112 }
00114 const MaterialEffectsUpdator& materialEffectsUpdator() const {
00115 return *theMEUpdator;
00116 }
00117
00118 virtual const MagneticField* magneticField() const {return field;}
00119
00120
00121 virtual PropagatorWithMaterial* clone() const
00122 {
00123 return new PropagatorWithMaterial(*this);
00124 }
00125
00126 private:
00128 bool materialAtSource() const;
00129
00130 private:
00131
00132 DeepCopyPointerByClone<Propagator> theGeometricalPropagator;
00133
00134
00135
00136 DeepCopyPointerByClone<MaterialEffectsUpdator> theMEUpdator;
00137 typedef std::pair<TrajectoryStateOnSurface,double> TsosWP;
00138
00139 MaterialLocation theMaterialLocation;
00140 const MagneticField * field;
00141 bool useRungeKutta_;
00142 };
00143
00144 #endif
00145
00146