CMS 3D CMS Logo

TrajectoryStateOnSurface.h
Go to the documentation of this file.
1 #ifndef TrajectoryStateOnSurface_H
2 #define TrajectoryStateOnSurface_H
3 
7 
8 
9 #include <iosfwd>
10 
18 
23 
24 public:
25  // construct
28  explicit TrajectoryStateOnSurface( Base::pointer p) : Base(p) {}
31 
33 
35  Base(rh){}
36 
38  Base(rh){}
39 
40 
42  Base(std::forward<Base>(rh)){}
43 
45  Base::swap(rh);
46  return *this;
47  }
48 
50  Base::operator=(rh);
51  return *this;
52  }
53 
54  template<typename... Args>
55  explicit TrajectoryStateOnSurface(Args && ...args) : Base(BTSOS::churn<BasicSingleTrajectoryState>(std::forward<Args>(args)...)){}
56 
58  Base::swap(rh);
59  }
60 
61 
62  bool isValid() const {
63  return Base::isValid() && data().isValid();
64  }
65 
66  bool hasError() const {
67  return data().hasError();
68  }
69 
70  FreeTrajectoryState const* freeState(bool withErrors = true) const {
71  return data().freeTrajectoryState();
72  }
73 
74  FreeTrajectoryState const* freeTrajectoryState(bool withErrors = true) const {
75  return freeState();
76  }
77 
78  const MagneticField *magneticField() const { return data().magneticField(); }
79 
81  return data().globalParameters();
82  }
84  return data().globalPosition();
85  }
87  return data().globalMomentum();
88  }
90  return data().globalDirection();
91  }
92  TrackCharge charge() const {
93  return data().charge();
94  }
95  double signedInverseMomentum() const {
96  return data().signedInverseMomentum();
97  }
98  double transverseCurvature() const {
99  return data().transverseCurvature();
100  }
102  return data().cartesianError();
103  }
105  return data().curvilinearError();
106  }
108  return data().localParameters();
109  }
111  return data().localPosition();
112  }
114  return data().localMomentum();
115  }
117  return data().localDirection();
118  }
120  return data().localError();
121  }
122  const SurfaceType& surface() const {
123  return data().surface();
124  }
125 
126  double weight() const {return data().weight();}
127 
128  void rescaleError(double factor) {
129  unsharedData().rescaleError(factor);
130  }
131 
133  Components const & components() const {
134  return data().components();
135  }
136  bool singleState() const { return data().singleState();}
137 
138 
140  SurfaceSide surfaceSide() const {
141  return data().surfaceSide();
142  }
143 
149  void update( const LocalTrajectoryParameters& p,
150  const SurfaceType& aSurface,
151  const MagneticField* field,
152  SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface);
153 
155  SurfaceSide side) { unsharedData().update(p, side);}
156 
158  const LocalTrajectoryError& err,
159  SurfaceSide side) {unsharedData().update(p, err, side);}
160 
167  void update(const LocalTrajectoryParameters& p,
168  const LocalTrajectoryError& err,
169  const SurfaceType& aSurface,
170  const MagneticField* field,
171  SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface);
172 
174  return sharedData().setCurvilinearError();
175  }
176 
177 
178 
179 };
180 
182  // use base swap
183  rh.swap(lh);
184 }
185 
186 std::ostream& operator<<(std::ostream& os, const TrajectoryStateOnSurface & tsos);
187 #endif
TrajectoryStateOnSurface(TrajectoryStateOnSurface &&rh)
void update(const LocalTrajectoryParameters &p, SurfaceSide side)
TrajectoryStateOnSurface & operator=(TrajectoryStateOnSurface const &rh)
std::ostream & operator<<(std::ostream &os, const TrajectoryStateOnSurface &tsos)
const LocalTrajectoryParameters & localParameters() const
CurvilinearTrajectoryError & setCurvilinearError()
LocalVector localDirection() const
const CurvilinearTrajectoryError & curvilinearError() const
const CartesianTrajectoryError cartesianError() const
GlobalPoint globalPosition() const
BasicTrajectoryState::Proxy Base
bool int lh
Definition: SIMDVec.h:21
std::shared_ptr< T > pointer
Definition: ProxyBase11.h:27
const MagneticField * magneticField() const
ProxyBase11 & operator=(std::shared_ptr< U > p)
Definition: ProxyBase11.h:37
const T & data() const
Definition: ProxyBase11.h:54
LocalVector localMomentum() const
int TrackCharge
Definition: TrackCharge.h:4
TrajectoryStateOnSurface(BasicTrajectoryState *p)
const SurfaceType & surface() const
void swap(TrajectoryStateOnSurface &rh)
std::vector< TrajectoryStateOnSurface > Components
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
BasicTrajectoryState::SurfaceType SurfaceType
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
FreeTrajectoryState const * freeState(bool withErrors=true) const
void update(const LocalTrajectoryParameters &p, const SurfaceType &aSurface, const MagneticField *field, SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
TrajectoryStateOnSurface(TrajectoryStateOnSurface const &rh)
void swap(ProxyBase11 &other) noexcept
Definition: ProxyBase11.h:43
TrajectoryStateOnSurface(TrajectoryStateOnSurface &rh)
const LocalTrajectoryError & localError() const
BasicTrajectoryState::Components Components
T & unsharedData()
Definition: ProxyBase11.h:56
#define noexcept
BasicTrajectoryState::SurfaceSide SurfaceSide
const GlobalTrajectoryParameters & globalParameters() const
T & sharedData()
Definition: ProxyBase11.h:64
TrajectoryStateOnSurface(Base::pointer p)
Constructor from one of the basic states.
GlobalVector globalMomentum() const
TrajectoryStateOnSurface & operator=(TrajectoryStateOnSurface &&rh)
void update(const LocalTrajectoryParameters &p, const LocalTrajectoryError &err, SurfaceSide side)
TrajectoryStateOnSurface(BasicSingleTrajectoryState *p)
bool isValid() const
Definition: ProxyBase11.h:66
Components const & components() const
GlobalVector globalDirection() const