CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrajectoryStateOnSurface.h
Go to the documentation of this file.
1 #ifndef TrajectoryStateOnSurface_H
2 #define TrajectoryStateOnSurface_H
3 
6 
7 #include <iosfwd>
8 
16 
20 
21 public:
22  // construct
25 
26  // invalid state
27  explicit TrajectoryStateOnSurface(const SurfaceType& aSurface);
28 
29 
35  const SurfaceType& aSurface,
41  const SurfaceType& aSurface,
47  const CartesianTrajectoryError& err,
48  const SurfaceType& aSurface,
55  const CurvilinearTrajectoryError& err,
56  const SurfaceType& aSurface,
58  double weight = 1.);
64  const CurvilinearTrajectoryError& err,
65  const SurfaceType& aSurface,
66  double weight);
71  const SurfaceType& aSurface,
72  const MagneticField* field,
79  const LocalTrajectoryError& err,
80  const SurfaceType& aSurface,
81  const MagneticField* field,
83  double weight = 1.);
89  const LocalTrajectoryError& err,
90  const SurfaceType& aSurface,
91  const MagneticField* field,
92  double weight);
93 
95 
96 #if defined( __GXX_EXPERIMENTAL_CXX0X__)
97 
99  Base(rh){}
100 
101 
103  Base(std::forward<Base>(rh)){}
104 
106  Base::swap(rh);
107  return *this;
108  }
109 
111  Base::operator=(rh);
112  return *this;
113  }
114 
115 
116 #endif
117 
119  Base::swap(rh);
120  }
121 
122 
123  bool isValid() const {
124  return Base::isValid() && data().isValid();
125  }
126 
127  bool hasError() const {
128  return data().hasError();
129  }
130 
131  FreeTrajectoryState const* freeState(bool withErrors = true) const {
132  return data().freeTrajectoryState();
133  }
134 
135  FreeTrajectoryState const* freeTrajectoryState(bool withErrors = true) const {
136  return freeState();
137  }
138 
139  const MagneticField *magneticField() const { return data().magneticField(); }
140 
142  return data().globalParameters();
143  }
145  return data().globalPosition();
146  }
148  return data().globalMomentum();
149  }
151  return data().globalDirection();
152  }
153  TrackCharge charge() const {
154  return data().charge();
155  }
156  double signedInverseMomentum() const {
157  return data().signedInverseMomentum();
158  }
159  double transverseCurvature() const {
160  return data().transverseCurvature();
161  }
163  return data().cartesianError();
164  }
166  return data().curvilinearError();
167  }
169  return data().localParameters();
170  }
172  return data().localPosition();
173  }
175  return data().localMomentum();
176  }
178  return data().localDirection();
179  }
181  return data().localError();
182  }
183  const SurfaceType& surface() const {
184  return data().surface();
185  }
186 
187  double weight() const {return data().weight();}
188 
189  void rescaleError(double factor) {
190  unsharedData().rescaleError(factor);
191  }
192 
193  std::vector<TrajectoryStateOnSurface> components() const {
194  return data().components();
195  }
196  /*
197  std::vector<TrajectoryStateOnSurface> components() const {
198  std::vector<BasicTrajectoryState::RCPtr> c( data().components());
199  std::vector<TrajectoryStateOnSurface> result;
200  result.reserve(c.size());
201  for (std::vector<BasicTrajectoryState::RCPtr>::iterator i=c.begin();
202  i != c.end(); i++) result.push_back(&(**i));
203  return result;
204  }
205  */
206 
209  return data().surfaceSide();
210  }
211 
217  void update( const LocalTrajectoryParameters& p,
218  const SurfaceType& aSurface,
219  const MagneticField* field,
227  void update( const LocalTrajectoryParameters& p,
228  const LocalTrajectoryError& err,
229  const SurfaceType& aSurface,
230  const MagneticField* field,
232  double weight = 1.);
233 
234 };
235 
237  // use base swap
238  rh.swap(lh);
239 }
240 
241 std::ostream& operator<<(std::ostream& os, const TrajectoryStateOnSurface & tsos);
242 #endif
void swap(ora::Record &rh, ora::Record &lh)
Definition: Record.h:70
const LocalTrajectoryParameters & localParameters() const
LocalVector localDirection() const
const CurvilinearTrajectoryError & curvilinearError() const
const CartesianTrajectoryError cartesianError() const
ProxyBase & operator=(const ProxyBase &other) noexcept
Definition: ProxyBase.h:36
GlobalPoint globalPosition() const
BasicTrajectoryState::Proxy Base
bool int lh
Definition: SIMDVec.h:19
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
const MagneticField * magneticField() const
T & unsharedData()
Definition: ProxyBase.h:69
tuple field
Definition: statics.py:62
LocalVector localMomentum() const
int TrackCharge
Definition: TrackCharge.h:4
TrajectoryStateOnSurface(BasicTrajectoryState *p)
const SurfaceType & surface() const
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
void update(const LocalTrajectoryParameters &p, const SurfaceType &aSurface, const MagneticField *field, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
BasicTrajectoryState::SurfaceType SurfaceType
void swap(ProxyBase &other) noexcept
Definition: ProxyBase.h:46
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
FreeTrajectoryState const * freeState(bool withErrors=true) const
const LocalTrajectoryError & localError() const
#define noexcept
BasicTrajectoryState::SurfaceSide SurfaceSide
const GlobalTrajectoryParameters & globalParameters() const
const T & data() const
Definition: ProxyBase.h:67
bool isValid() const
Definition: ProxyBase.h:81
GlobalVector globalMomentum() const
void swap(TrajectoryStateOnSurface &rh) noexcept
std::vector< TrajectoryStateOnSurface > components() const
GlobalVector globalDirection() const