Go to the documentation of this file.00001 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
00002 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
00003 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
00004 #include "TrackingTools/GeomPropagators/interface/PropagationExceptions.h"
00005 #include "DataFormats/GeometrySurface/interface/Cylinder.h"
00006 #include "DataFormats/GeometrySurface/interface/Plane.h"
00007
00008 TrajectoryStateOnSurface
00009 Propagator::propagate( const FreeTrajectoryState& state,
00010 const Surface& sur) const
00011 {
00012
00013 const Plane* bp = dynamic_cast<const Plane*>(&sur);
00014 if (bp != 0) return propagate( state, *bp);
00015
00016
00017 const Cylinder* bc = dynamic_cast<const Cylinder*>(&sur);
00018 if (bc != 0) return propagate( state, *bc);
00019
00020
00021 throw PropagationException("The surface is neither Cylinder nor Plane");
00022 }
00023
00024 TrajectoryStateOnSurface
00025 Propagator::propagate (const TrajectoryStateOnSurface& state,
00026 const Surface& sur) const
00027 {
00028
00029
00030
00031 const Plane* bp = dynamic_cast<const Plane*>(&sur);
00032 if (bp != 0) return propagate( state, *bp);
00033
00034
00035 const Cylinder* bc = dynamic_cast<const Cylinder*>(&sur);
00036 if (bc != 0) return propagate( state, *bc);
00037
00038
00039 throw PropagationException("The surface is neither Cylinder nor Plane");
00040 }
00041
00042
00043
00044
00045 TrajectoryStateOnSurface
00046 Propagator::propagate (const TrajectoryStateOnSurface& tsos,
00047 const Plane& sur) const
00048 {
00049
00050 if (fabs(sur.toLocal(tsos.globalPosition()).z())<1e-5) {
00051
00052 return TrajectoryStateOnSurface(*tsos.freeState(), sur);
00053 }
00054 return propagate( *tsos.freeState(), sur);
00055 }
00056
00057
00058
00059 TrajectoryStateOnSurface
00060 Propagator::propagate (const TrajectoryStateOnSurface& tsos,
00061 const Cylinder& sur) const
00062 {
00063 return propagate( *tsos.freeState(), sur);
00064 }
00065
00066 FreeTrajectoryState
00067 Propagator::propagate(const FreeTrajectoryState& ftsStart,
00068 const reco::BeamSpot& beamSpot) const{
00069 throw cms::Exception("Propagator::propagate(FTS,beamSpot) not implemented");
00070 }
00071
00072
00073 std::pair< TrajectoryStateOnSurface, double>
00074 Propagator::propagateWithPath (const FreeTrajectoryState& state,
00075 const Surface& sur) const
00076 {
00077
00078
00079
00080 const Plane* bp = dynamic_cast<const Plane*>(&sur);
00081 if (bp != 0) return propagateWithPath( state, *bp);
00082
00083
00084 const Cylinder* bc = dynamic_cast<const Cylinder*>(&sur);
00085 if (bc != 0) return propagateWithPath( state, *bc);
00086
00087
00088 throw PropagationException("The surface is neither Cylinder nor Plane");
00089 }
00090
00091 std::pair< TrajectoryStateOnSurface, double>
00092 Propagator::propagateWithPath (const TrajectoryStateOnSurface& state,
00093 const Surface& sur) const
00094 {
00095
00096
00097
00098 const Plane* bp = dynamic_cast<const Plane*>(&sur);
00099 if (bp != 0) return propagateWithPath( state, *bp);
00100
00101
00102 const Cylinder* bc = dynamic_cast<const Cylinder*>(&sur);
00103 if (bc != 0) return propagateWithPath( state, *bc);
00104
00105
00106 throw PropagationException("The surface is neither Cylinder nor Plane");
00107 }
00108
00109
00110
00111 std::pair< TrajectoryStateOnSurface, double>
00112 Propagator::propagateWithPath (const TrajectoryStateOnSurface& tsos,
00113 const Plane& sur) const
00114 {
00115 return propagateWithPath( *tsos.freeState(), sur);
00116 }
00117
00118
00119
00120 std::pair< TrajectoryStateOnSurface, double>
00121 Propagator::propagateWithPath (const TrajectoryStateOnSurface& tsos,
00122 const Cylinder& sur) const
00123 {
00124 return propagateWithPath( *tsos.freeState(), sur);
00125 }
00126
00127 std::pair<FreeTrajectoryState, double>
00128 Propagator::propagateWithPath(const FreeTrajectoryState& ftsStart,
00129 const GlobalPoint& pDest1, const GlobalPoint& pDest2) const{
00130 throw cms::Exception("Propagator::propagate(FTS,GlobalPoint,GlobalPoint) not implemented");
00131 }