CMS 3D CMS Logo

Propagator.h
Go to the documentation of this file.
1 #ifndef CommonDet_Propagator_H
2 #define CommonDet_Propagator_H
3 
7 
8 #include <utility>
9 #include <memory>
10 
11 class Plane;
12 class Cylinder;
13 class Surface;
14 class MagneticField;
15 
16 namespace reco {
17  class BeamSpot;
18 }
19 
44 class Propagator {
45 public:
47  virtual ~Propagator();
48 
49  template <typename STA, typename SUR>
50  TrajectoryStateOnSurface propagate(STA const& state, SUR const& surface) const {
51  return propagateWithPath(state, surface).first;
52  }
53 
54 public:
64  virtual std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const FreeTrajectoryState&,
65  const Surface&) const final;
66 
67  virtual std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const FreeTrajectoryState&,
68  const Plane&) const = 0;
69 
70  virtual std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const FreeTrajectoryState&,
71  const Cylinder&) const = 0;
72 
83  virtual std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const TrajectoryStateOnSurface& tsos,
84  const Surface& sur) const final;
85 
86  virtual std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const TrajectoryStateOnSurface& tsos,
87  const Plane& sur) const {
88  return propagateWithPath(*tsos.freeState(), sur);
89  }
90 
91  virtual std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const TrajectoryStateOnSurface& tsos,
92  const Cylinder& sur) const {
93  return propagateWithPath(*tsos.freeState(), sur);
94  }
95 
98  virtual std::pair<FreeTrajectoryState, double> propagateWithPath(const FreeTrajectoryState& ftsStart,
99  const GlobalPoint& pDest) const;
101  virtual std::pair<FreeTrajectoryState, double> propagateWithPath(const FreeTrajectoryState& ftsStart,
102  const GlobalPoint& pDest1,
103  const GlobalPoint& pDest2) const;
105  virtual std::pair<FreeTrajectoryState, double> propagateWithPath(const FreeTrajectoryState& ftsStart,
106  const reco::BeamSpot& beamSpot) const;
107 
108  // this is a mess...
109  virtual FreeTrajectoryState propagate(const FreeTrajectoryState& ftsStart, const GlobalPoint& pDest) const final {
110  return propagateWithPath(ftsStart, pDest).first;
111  }
113  const GlobalPoint& pDest1,
114  const GlobalPoint& pDest2) const final {
115  return propagateWithPath(ftsStart, pDest1, pDest2).first;
116  }
118  const reco::BeamSpot& beamSpot) const final {
119  return propagateWithPath(ftsStart, beamSpot).first;
120  }
121 
122 public:
131 
140 
151  virtual bool setMaxDirectionChange(float phiMax) { return false; }
152 
153  virtual Propagator* clone() const = 0;
154 
155  virtual const MagneticField* magneticField() const = 0;
156 
157 private:
159 };
160 
161 // Put here declaration of helper function, so that it is
162 // automatically included in all proper places w/o having to add an
163 // additional include file. Keep implementation separate, to avoid
164 // multiple definition of the same symbol in all cc inlcuding this
165 // file.
166 std::unique_ptr<Propagator> SetPropagationDirection(Propagator const& iprop, PropagationDirection dir);
167 
168 #endif // CommonDet_Propagator_H
virtual FreeTrajectoryState propagate(const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest) const final
Definition: Propagator.h:109
virtual void setPropagationDirection(PropagationDirection dir)
Definition: Propagator.h:130
virtual ~Propagator()
Definition: Propagator.cc:8
Propagator(PropagationDirection dir=alongMomentum)
Definition: Propagator.h:46
virtual Propagator * clone() const =0
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:139
PropagationDirection
virtual bool setMaxDirectionChange(float phiMax)
Definition: Propagator.h:151
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
Definition: Plane.h:16
std::unique_ptr< Propagator > SetPropagationDirection(Propagator const &iprop, PropagationDirection dir)
virtual FreeTrajectoryState propagate(const FreeTrajectoryState &ftsStart, const reco::BeamSpot &beamSpot) const final
Definition: Propagator.h:117
PropagationDirection theDir
Definition: Propagator.h:158
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Surface &) const final
Definition: Propagator.cc:10
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const TrajectoryStateOnSurface &tsos, const Plane &sur) const
Definition: Propagator.h:86
virtual const MagneticField * magneticField() const =0
fixed size matrix
FreeTrajectoryState const * freeState(bool withErrors=true) const
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const TrajectoryStateOnSurface &tsos, const Cylinder &sur) const
Definition: Propagator.h:91
virtual FreeTrajectoryState propagate(const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest1, const GlobalPoint &pDest2) const final
Definition: Propagator.h:112