Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:31:34

0001 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
0002 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
0003 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0004 #include "TrackingTools/GeomPropagators/interface/PropagationExceptions.h"
0005 #include "DataFormats/GeometrySurface/interface/Cylinder.h"
0006 #include "DataFormats/GeometrySurface/interface/Plane.h"
0007 
0008 Propagator::~Propagator() {}
0009 
0010 std::pair<TrajectoryStateOnSurface, double> Propagator::propagateWithPath(const FreeTrajectoryState& state,
0011                                                                           const Surface& sur) const {
0012   // try plane first, most probable case (disk "is a" plane too)
0013   const Plane* bp = dynamic_cast<const Plane*>(&sur);
0014   if (bp != nullptr)
0015     return propagateWithPath(state, *bp);
0016 
0017   // if not plane try cylinder
0018   const Cylinder* bc = dynamic_cast<const Cylinder*>(&sur);
0019   if (bc != nullptr)
0020     return propagateWithPath(state, *bc);
0021 
0022   // unknown surface - can't do it!
0023   throw PropagationException("The surface is neither Cylinder nor Plane");
0024 }
0025 
0026 std::pair<TrajectoryStateOnSurface, double> Propagator::propagateWithPath(const TrajectoryStateOnSurface& state,
0027                                                                           const Surface& sur) const {
0028   // try plane first, most probable case (disk "is a" plane too)
0029   const Plane* bp = dynamic_cast<const Plane*>(&sur);
0030   if (bp != nullptr)
0031     return propagateWithPath(state, *bp);
0032 
0033   // if not plane try cylinder
0034   const Cylinder* bc = dynamic_cast<const Cylinder*>(&sur);
0035   if (bc != nullptr)
0036     return propagateWithPath(state, *bc);
0037 
0038   // unknown surface - can't do it!
0039   throw PropagationException("The surface is neither Cylinder nor Plane");
0040 }
0041 
0042 std::pair<FreeTrajectoryState, double> Propagator::propagateWithPath(const FreeTrajectoryState&,
0043                                                                      const GlobalPoint&) const {
0044   throw cms::Exception("Propagator::propagate(FTS,GlobalPoint) not implemented");
0045   return std::pair<FreeTrajectoryState, double>();
0046 }
0047 std::pair<FreeTrajectoryState, double> Propagator::propagateWithPath(const FreeTrajectoryState&,
0048                                                                      const GlobalPoint&,
0049                                                                      const GlobalPoint&) const {
0050   throw cms::Exception("Propagator::propagate(FTS,GlobalPoint,GlobalPoint) not implemented");
0051   return std::pair<FreeTrajectoryState, double>();
0052 }
0053 std::pair<FreeTrajectoryState, double> Propagator::propagateWithPath(const FreeTrajectoryState& ftsStart,
0054                                                                      const reco::BeamSpot& beamSpot) const {
0055   throw cms::Exception("Propagator::propagate(FTS,beamSpot) not implemented");
0056   return std::pair<FreeTrajectoryState, double>();
0057 }