File indexing completed on 2024-04-06 12:31:28
0001 #ifndef CommonDet_Propagator_H
0002 #define CommonDet_Propagator_H
0003
0004 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
0005 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
0006 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0007
0008 #include <utility>
0009 #include <memory>
0010
0011 class Plane;
0012 class Cylinder;
0013 class Surface;
0014 class MagneticField;
0015
0016 namespace reco {
0017 class BeamSpot;
0018 }
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044 class Propagator {
0045 public:
0046 explicit Propagator(PropagationDirection dir = alongMomentum) : theDir(dir) {}
0047 virtual ~Propagator();
0048
0049 template <typename STA, typename SUR>
0050 TrajectoryStateOnSurface propagate(STA const& state, SUR const& surface) const {
0051 return propagateWithPath(state, surface).first;
0052 }
0053
0054 public:
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064 virtual std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const FreeTrajectoryState&,
0065 const Surface&) const final;
0066
0067 virtual std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const FreeTrajectoryState&,
0068 const Plane&) const = 0;
0069
0070 virtual std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const FreeTrajectoryState&,
0071 const Cylinder&) const = 0;
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083 virtual std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const TrajectoryStateOnSurface& tsos,
0084 const Surface& sur) const final;
0085
0086 virtual std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const TrajectoryStateOnSurface& tsos,
0087 const Plane& sur) const {
0088 return propagateWithPath(*tsos.freeState(), sur);
0089 }
0090
0091 virtual std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const TrajectoryStateOnSurface& tsos,
0092 const Cylinder& sur) const {
0093 return propagateWithPath(*tsos.freeState(), sur);
0094 }
0095
0096
0097
0098 virtual std::pair<FreeTrajectoryState, double> propagateWithPath(const FreeTrajectoryState& ftsStart,
0099 const GlobalPoint& pDest) const;
0100
0101 virtual std::pair<FreeTrajectoryState, double> propagateWithPath(const FreeTrajectoryState& ftsStart,
0102 const GlobalPoint& pDest1,
0103 const GlobalPoint& pDest2) const;
0104
0105 virtual std::pair<FreeTrajectoryState, double> propagateWithPath(const FreeTrajectoryState& ftsStart,
0106 const reco::BeamSpot& beamSpot) const;
0107
0108
0109 virtual FreeTrajectoryState propagate(const FreeTrajectoryState& ftsStart, const GlobalPoint& pDest) const final {
0110 return propagateWithPath(ftsStart, pDest).first;
0111 }
0112 virtual FreeTrajectoryState propagate(const FreeTrajectoryState& ftsStart,
0113 const GlobalPoint& pDest1,
0114 const GlobalPoint& pDest2) const final {
0115 return propagateWithPath(ftsStart, pDest1, pDest2).first;
0116 }
0117 virtual FreeTrajectoryState propagate(const FreeTrajectoryState& ftsStart,
0118 const reco::BeamSpot& beamSpot) const final {
0119 return propagateWithPath(ftsStart, beamSpot).first;
0120 }
0121
0122 public:
0123
0124
0125
0126
0127
0128
0129
0130 virtual void setPropagationDirection(PropagationDirection dir) { theDir = dir; }
0131
0132
0133
0134
0135
0136
0137
0138
0139 virtual PropagationDirection propagationDirection() const final { return theDir; }
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151 virtual bool setMaxDirectionChange(float phiMax) { return false; }
0152
0153 virtual Propagator* clone() const = 0;
0154
0155 virtual const MagneticField* magneticField() const = 0;
0156
0157 private:
0158 PropagationDirection theDir;
0159 };
0160
0161
0162
0163
0164
0165
0166 std::unique_ptr<Propagator> SetPropagationDirection(Propagator const& iprop, PropagationDirection dir);
0167
0168 #endif