CMS 3D CMS Logo

TrajectoryStateOnSurface.h
Go to the documentation of this file.
1 #ifndef TrajectoryStateOnSurface_H
2 #define TrajectoryStateOnSurface_H
3 
7 
8 #include <iosfwd>
9 
21 
22 public:
23  // construct
29 
31 
33 
35 
36  TrajectoryStateOnSurface(TrajectoryStateOnSurface&& rh) noexcept : Base(std::forward<Base>(rh)) {}
37 
39  Base::swap(rh);
40  return *this;
41  }
42 
44  Base::operator=(rh);
45  return *this;
46  }
47 
48  template <typename... Args>
49  explicit TrajectoryStateOnSurface(Args&&... args)
50  : Base(BTSOS::churn<BasicSingleTrajectoryState>(std::forward<Args>(args)...)) {}
51 
52  void swap(TrajectoryStateOnSurface& rh) noexcept { Base::swap(rh); }
53 
54  bool isValid() const { return Base::isValid() && data().isValid(); }
55 
56  bool hasError() const { return data().hasError(); }
57 
58  FreeTrajectoryState const* freeState(bool withErrors = true) const { return data().freeTrajectoryState(); }
59 
60  FreeTrajectoryState const* freeTrajectoryState(bool withErrors = true) const { return freeState(); }
61 
62  const MagneticField* magneticField() const { return data().magneticField(); }
63 
64  const GlobalTrajectoryParameters& globalParameters() const { return data().globalParameters(); }
65  GlobalPoint globalPosition() const { return data().globalPosition(); }
66  GlobalVector globalMomentum() const { return data().globalMomentum(); }
67  GlobalVector globalDirection() const { return data().globalDirection(); }
68  TrackCharge charge() const { return data().charge(); }
69  double signedInverseMomentum() const { return data().signedInverseMomentum(); }
70  double transverseCurvature() const { return data().transverseCurvature(); }
71  const CartesianTrajectoryError cartesianError() const { return data().cartesianError(); }
72  const CurvilinearTrajectoryError& curvilinearError() const { return data().curvilinearError(); }
73  const LocalTrajectoryParameters& localParameters() const { return data().localParameters(); }
74  LocalPoint localPosition() const { return data().localPosition(); }
75  LocalVector localMomentum() const { return data().localMomentum(); }
76  LocalVector localDirection() const { return data().localDirection(); }
77  const LocalTrajectoryError& localError() const { return data().localError(); }
78  const SurfaceType& surface() const { return data().surface(); }
79 
80  double weight() const { return data().weight(); }
81 
82  void rescaleError(double factor) { unsharedData().rescaleError(factor); }
83 
85  Components const& components() const { return data().components(); }
86  bool singleState() const { return data().singleState(); }
87 
89  SurfaceSide surfaceSide() const { return data().surfaceSide(); }
90 
97  const SurfaceType& aSurface,
98  const MagneticField* field,
100 
101  void update(const LocalTrajectoryParameters& p, SurfaceSide side) { unsharedData().update(p, side); }
102 
104  unsharedData().update(p, err, side);
105  }
106 
113  void update(const LocalTrajectoryParameters& p,
114  const LocalTrajectoryError& err,
115  const SurfaceType& aSurface,
116  const MagneticField* field,
118 
119  CurvilinearTrajectoryError& setCurvilinearError() { return sharedData().setCurvilinearError(); }
120 };
121 
123  // use base swap
124  rh.swap(lh);
125 }
126 
127 std::ostream& operator<<(std::ostream& os, const TrajectoryStateOnSurface& tsos);
128 #endif
TrajectoryStateOnSurface & operator=(TrajectoryStateOnSurface &&rh) noexcept
void update(const LocalTrajectoryParameters &p, SurfaceSide side)
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
const LocalTrajectoryError & localError() const
std::ostream & operator<<(std::ostream &os, const TrajectoryStateOnSurface &tsos)
CurvilinearTrajectoryError & setCurvilinearError()
const GlobalTrajectoryParameters & globalParameters() const
BasicTrajectoryState::Proxy Base
const LocalTrajectoryParameters & localParameters() const
bool int lh
Definition: SIMDVec.h:20
std::shared_ptr< T > pointer
Definition: ProxyBase11.h:25
const SurfaceType & surface() const
ProxyBase11 & operator=(std::shared_ptr< U > p)
Definition: ProxyBase11.h:35
const CartesianTrajectoryError cartesianError() const
Components const & components() const
int TrackCharge
Definition: TrackCharge.h:4
TrajectoryStateOnSurface(BasicTrajectoryState *p)
TrajectoryStateOnSurface(TrajectoryStateOnSurface const &rh) noexcept
GlobalPoint globalPosition() const
std::vector< TrajectoryStateOnSurface > Components
BasicTrajectoryState::SurfaceType SurfaceType
void update(const LocalTrajectoryParameters &p, const SurfaceType &aSurface, const MagneticField *field, SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
LocalVector localDirection() const
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
TrajectoryStateOnSurface(TrajectoryStateOnSurface &rh) noexcept
void swap(ProxyBase11 &other) noexcept
Definition: ProxyBase11.h:42
BasicTrajectoryState::Components Components
void swap(TrajectoryStateOnSurface &rh, TrajectoryStateOnSurface &lh)
bool isValid() const
Definition: ProxyBase11.h:69
T & unsharedData()
Definition: ProxyBase11.h:56
BasicTrajectoryState::SurfaceSide SurfaceSide
const T & data() const
Definition: ProxyBase11.h:51
const CurvilinearTrajectoryError & curvilinearError() const
T & sharedData()
Definition: ProxyBase11.h:64
GlobalVector globalDirection() const
TrajectoryStateOnSurface(Base::pointer p)
Constructor from one of the basic states.
GlobalVector globalMomentum() const
TrajectoryStateOnSurface(TrajectoryStateOnSurface &&rh) noexcept
FreeTrajectoryState const * freeState(bool withErrors=true) const
const MagneticField * magneticField() const
void update(const LocalTrajectoryParameters &p, const LocalTrajectoryError &err, SurfaceSide side)
TrajectoryStateOnSurface(BasicSingleTrajectoryState *p)
void swap(TrajectoryStateOnSurface &rh) noexcept
TrajectoryStateOnSurface & operator=(TrajectoryStateOnSurface const &rh) noexcept
TrajectoryStateOnSurface(Args &&... args)