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 
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>
72  propagateWithPath (const FreeTrajectoryState&, const Plane&) const = 0;
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 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
Propagator(PropagationDirection dir=alongMomentum)
Definition: Propagator.h:46
PropagationDirection
virtual bool setMaxDirectionChange(float phiMax)
Definition: Propagator.h:165
Definition: Plane.h:17
virtual FreeTrajectoryState propagate(const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest) const final
Definition: Propagator.h:115
std::unique_ptr< Propagator > SetPropagationDirection(Propagator const &iprop, PropagationDirection dir)
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:151
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const TrajectoryStateOnSurface &tsos, const Plane &sur) const
Definition: Propagator.h:91
PropagationDirection theDir
Definition: Propagator.h:173
FreeTrajectoryState const * freeState(bool withErrors=true) const
virtual FreeTrajectoryState propagate(const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest1, const GlobalPoint &pDest2) const final
Definition: Propagator.h:119
virtual FreeTrajectoryState propagate(const FreeTrajectoryState &ftsStart, const reco::BeamSpot &beamSpot) const final
Definition: Propagator.h:124
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:53
fixed size matrix
dbl *** dir
Definition: mlp_gen.cc:35