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