CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Propagator.h
Go to the documentation of this file.
1 #ifndef CommonDet_Propagator_H
2 #define CommonDet_Propagator_H
3 
7 
8 
9 #include <utility>
10 #include <memory>
11 
12 class Plane;
13 class Cylinder;
14 class Surface;
15 class MagneticField;
16 
17 namespace reco{class BeamSpot;}
18 
43 class Propagator {
44 public:
45 
47  theDir(dir) {}
48  virtual ~Propagator();
49 
50 
51  template<typename STA, typename SUR>
53  propagate (STA const & state, SUR const & surface) const {
54  return propagateWithPath(state,surface).first;
55  }
56 
57 public:
58 
68  virtual std::pair< TrajectoryStateOnSurface, double>
69  propagateWithPath (const FreeTrajectoryState&, const Surface&) const final;
70 
71  virtual std::pair< TrajectoryStateOnSurface, double>
73 
74  virtual std::pair< TrajectoryStateOnSurface, double>
75  propagateWithPath (const FreeTrajectoryState&, const Cylinder&) const=0;
76 
87  virtual std::pair< TrajectoryStateOnSurface, double>
88  propagateWithPath (const TrajectoryStateOnSurface& tsos, const Surface& sur) const final;
89 
90  virtual std::pair< TrajectoryStateOnSurface, double>
91  propagateWithPath (const TrajectoryStateOnSurface& tsos, const Plane& sur) const {
92  return propagateWithPath( *tsos.freeState(), sur);
93  }
94 
95  virtual std::pair< TrajectoryStateOnSurface, double>
96  propagateWithPath (const TrajectoryStateOnSurface& tsos, const Cylinder& sur) const {
97  return propagateWithPath( *tsos.freeState(), sur);
98  }
99 
100 
103  virtual std::pair<FreeTrajectoryState, double>
104  propagateWithPath(const FreeTrajectoryState& ftsStart, const GlobalPoint& pDest) const;
106  virtual std::pair<FreeTrajectoryState, double>
107  propagateWithPath(const FreeTrajectoryState& ftsStart,
108  const GlobalPoint& pDest1, const GlobalPoint& pDest2) const;
110  virtual std::pair<FreeTrajectoryState, double>
111  propagateWithPath(const FreeTrajectoryState& ftsStart, const reco::BeamSpot& beamSpot) const;
112 
113  // this is a mess...
114  virtual FreeTrajectoryState
115  propagate(const FreeTrajectoryState& ftsStart, const GlobalPoint& pDest) const final {
116  return propagateWithPath(ftsStart,pDest).first;
117  }
118  virtual FreeTrajectoryState
120  const GlobalPoint& pDest1, const GlobalPoint& pDest2) const final {
121  return propagateWithPath(ftsStart,pDest1,pDest2).first;
122  }
123  virtual FreeTrajectoryState
124  propagate(const FreeTrajectoryState& ftsStart, const reco::BeamSpot& beamSpot) const final{
125  return propagateWithPath(ftsStart,beamSpot).first;
126  }
127 
128 
129 
130 
131 
132 public:
141  theDir = dir;
142  }
143 
152  return theDir;
153  }
154 
165  virtual bool setMaxDirectionChange( float phiMax) { return false;}
166 
167  virtual Propagator * clone() const = 0;
168 
169  virtual const MagneticField* magneticField() const = 0;
170 
171 private:
172 
174 };
175 
176 // Put here declaration of helper function, so that it is
177 // automatically included in all proper places w/o having to add an
178 // additional include file. Keep implementation separate, to avoid
179 // multiple definition of the same symbol in all cc inlcuding this
180 // file.
181 std::unique_ptr<Propagator> SetPropagationDirection (Propagator const & iprop,
183 
184 #endif // CommonDet_Propagator_H
virtual FreeTrajectoryState propagate(const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest) const final
Definition: Propagator.h:115
virtual void setPropagationDirection(PropagationDirection dir)
Definition: Propagator.h:140
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const TrajectoryStateOnSurface &tsos, const Cylinder &sur) const
Definition: Propagator.h:96
virtual ~Propagator()
Definition: Propagator.cc:9
Propagator(PropagationDirection dir=alongMomentum)
Definition: Propagator.h:46
virtual Propagator * clone() const =0
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:151
PropagationDirection
virtual bool setMaxDirectionChange(float phiMax)
Definition: Propagator.h:165
Definition: Plane.h:17
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:124
PropagationDirection theDir
Definition: Propagator.h:173
FreeTrajectoryState const * freeState(bool withErrors=true) const
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Surface &) const final
Definition: Propagator.cc:15
string const
Definition: compareJSON.py:14
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:53
virtual const MagneticField * magneticField() const =0
dbl *** dir
Definition: mlp_gen.cc:35
virtual FreeTrajectoryState propagate(const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest1, const GlobalPoint &pDest2) const final
Definition: Propagator.h:119