CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Propagator.cc
Go to the documentation of this file.
7 
8 
10 
13  const Surface& sur) const
14 {
15  // try plane first, most probable case (disk "is a" plane too)
16  const Plane* bp = dynamic_cast<const Plane*>(&sur);
17  if (bp != 0) return propagate( state, *bp);
18 
19  // if not plane try cylinder
20  const Cylinder* bc = dynamic_cast<const Cylinder*>(&sur);
21  if (bc != 0) return propagate( state, *bc);
22 
23  // unknown surface - can't do it!
24  throw PropagationException("The surface is neither Cylinder nor Plane");
25 }
26 
29  const Surface& sur) const
30 {
31  // exactly same code as for FreeTrajectoryState
32 
33  // try plane first, most probable case (disk "is a" plane too)
34  const Plane* bp = dynamic_cast<const Plane*>(&sur);
35  if (bp != 0) return propagate( state, *bp);
36 
37  // if not plane try cylinder
38  const Cylinder* bc = dynamic_cast<const Cylinder*>(&sur);
39  if (bc != 0) return propagate( state, *bc);
40 
41  // unknown surface - can't do it!
42  throw PropagationException("The surface is neither Cylinder nor Plane");
43 }
44 
45 
46 // default impl. avoids the need to redefinition in concrete
47 // propagators that don't benefit from TSOS vs. FTS
50  const Plane& sur) const
51 {
52  // Protect against null propagations
53  if (fabs(sur.toLocal(tsos.globalPosition()).z())<1e-5) {
54  // Still have to tarnsform the r.f.!
55  return TrajectoryStateOnSurface(*tsos.freeState(), sur);
56  }
57  return propagate( *tsos.freeState(), sur);
58 }
59 
60 // default impl. avoids the need to redefinition in concrete
61 // propagators that don't benefit from TSOS vs. FTS
64  const Cylinder& sur) const
65 {
66  return propagate( *tsos.freeState(), sur);
67 }
68 
71  const reco::BeamSpot& beamSpot) const{
72  throw cms::Exception("Propagator::propagate(FTS,beamSpot) not implemented");
73 }
74 
75 
76 std::pair< TrajectoryStateOnSurface, double>
78  const Surface& sur) const
79 {
80  // same code as above, only method name changes
81 
82  // try plane first, most probable case (disk "is a" plane too)
83  const Plane* bp = dynamic_cast<const Plane*>(&sur);
84  if (bp != 0) return propagateWithPath( state, *bp);
85 
86  // if not plane try cylinder
87  const Cylinder* bc = dynamic_cast<const Cylinder*>(&sur);
88  if (bc != 0) return propagateWithPath( state, *bc);
89 
90  // unknown surface - can't do it!
91  throw PropagationException("The surface is neither Cylinder nor Plane");
92 }
93 
94 std::pair< TrajectoryStateOnSurface, double>
96  const Surface& sur) const
97 {
98  // same code as above, only method name changes
99 
100  // try plane first, most probable case (disk "is a" plane too)
101  const Plane* bp = dynamic_cast<const Plane*>(&sur);
102  if (bp != 0) return propagateWithPath( state, *bp);
103 
104  // if not plane try cylinder
105  const Cylinder* bc = dynamic_cast<const Cylinder*>(&sur);
106  if (bc != 0) return propagateWithPath( state, *bc);
107 
108  // unknown surface - can't do it!
109  throw PropagationException("The surface is neither Cylinder nor Plane");
110 }
111 
112 // default impl. avoids the need to redefinition in concrete
113 // propagators that don't benefit from TSOS vs. FTS
114 std::pair< TrajectoryStateOnSurface, double>
116  const Plane& sur) const
117 {
118  return propagateWithPath( *tsos.freeState(), sur);
119 }
120 
121 // default impl. avoids the need to redefinition in concrete
122 // propagators that don't benefit from TSOS vs. FTS
123 std::pair< TrajectoryStateOnSurface, double>
125  const Cylinder& sur) const
126 {
127  return propagateWithPath( *tsos.freeState(), sur);
128 }
129 
130 std::pair<FreeTrajectoryState, double>
132  const GlobalPoint& pDest1, const GlobalPoint& pDest2) const{
133  throw cms::Exception("Propagator::propagate(FTS,GlobalPoint,GlobalPoint) not implemented");
134 }
virtual ~Propagator()
Definition: Propagator.cc:9
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const TrajectoryStateOnSurface &, const Plane &) const
Definition: Propagator.cc:115
GlobalPoint globalPosition() const
Definition: Plane.h:17
float float float z
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Surface &) const
Definition: Propagator.cc:77
LocalPoint toLocal(const GlobalPoint &gp) const
FreeTrajectoryState const * freeState(bool withErrors=true) const
virtual TrajectoryStateOnSurface propagate(const FreeTrajectoryState &, const Surface &) const
Definition: Propagator.cc:12