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 
7 
8 
9 #include <iosfwd>
10 
18 
23 
24 public:
25  // construct
28 #ifndef CMS_NOCXX11
29  explicit TrajectoryStateOnSurface( Base::pointer p) : Base(p) {}
30 #endif
33 
35 
36 #ifndef CMS_NOCXX11
37 
39  Base(rh){}
40 
42  Base(rh){}
43 
44 
46  Base(std::forward<Base>(rh)){}
47 
49  Base::swap(rh);
50  return *this;
51  }
52 
54  Base::operator=(rh);
55  return *this;
56  }
57 
58  template<typename... Args>
59  explicit TrajectoryStateOnSurface(Args && ...args) : Base(BTSOS::churn<BasicSingleTrajectoryState>(std::forward<Args>(args)...)){}
60 
61 #endif
62 
64  Base::swap(rh);
65  }
66 
67 
68  bool isValid() const {
69  return Base::isValid() && data().isValid();
70  }
71 
72  bool hasError() const {
73  return data().hasError();
74  }
75 
76  FreeTrajectoryState const* freeState(bool withErrors = true) const {
77  return data().freeTrajectoryState();
78  }
79 
80  FreeTrajectoryState const* freeTrajectoryState(bool withErrors = true) const {
81  return freeState();
82  }
83 
84  const MagneticField *magneticField() const { return data().magneticField(); }
85 
87  return data().globalParameters();
88  }
90  return data().globalPosition();
91  }
93  return data().globalMomentum();
94  }
96  return data().globalDirection();
97  }
98  TrackCharge charge() const {
99  return data().charge();
100  }
101  double signedInverseMomentum() const {
102  return data().signedInverseMomentum();
103  }
104  double transverseCurvature() const {
105  return data().transverseCurvature();
106  }
108  return data().cartesianError();
109  }
111  return data().curvilinearError();
112  }
114  return data().localParameters();
115  }
117  return data().localPosition();
118  }
120  return data().localMomentum();
121  }
123  return data().localDirection();
124  }
126  return data().localError();
127  }
128  const SurfaceType& surface() const {
129  return data().surface();
130  }
131 
132  double weight() const {return data().weight();}
133 
134  void rescaleError(double factor) {
135  unsharedData().rescaleError(factor);
136  }
137 
138  std::vector<TrajectoryStateOnSurface> components() const {
139  return data().components();
140  }
141  /*
142  std::vector<TrajectoryStateOnSurface> components() const {
143  std::vector<BasicTrajectoryState::RCPtr> c( data().components());
144  std::vector<TrajectoryStateOnSurface> result;
145  result.reserve(c.size());
146  for (std::vector<BasicTrajectoryState::RCPtr>::iterator i=c.begin();
147  i != c.end(); i++) result.push_back(&(**i));
148  return result;
149  }
150  */
151 
154  return data().surfaceSide();
155  }
156 
162  void update( const LocalTrajectoryParameters& p,
163  const SurfaceType& aSurface,
164  const MagneticField* field,
166 
168  SurfaceSide side) { unsharedData().update(p, side);}
169 
171  const LocalTrajectoryError& err,
172  SurfaceSide side) {unsharedData().update(p, err, side);}
173 
174  /*
175  void update( const GlobalTrajectoryParameters& par,
176  const SurfaceType& aSurface,
177  SurfaceSide side) { unsharedData().update(par, aSurface, side);}
178 
179  void update( const GlobalTrajectoryParameters& par,
180  const CurvilinearTrajectoryError& err,
181  const SurfaceType& aSurface,
182  SurfaceSide side) { unsharedData().update(par, err, aSurface, side);}
183  */
184 
191  void update(const LocalTrajectoryParameters& p,
192  const LocalTrajectoryError& err,
193  const SurfaceType& aSurface,
194  const MagneticField* field,
196  /*
197 #ifndef CMS_NOCXX11
198  template<typename... Args>
199  void update(Args && ...args) {
200  if (data().canUpdateLocalParameters()) {
201  unsharedData().update(std::forward<Args>(args)...);
202  } else {
203  *this = TrajectoryStateOnSurface(std::forward<Args>(args)...);
204  }
205  }
206 #endif
207  */
208 
210  return sharedData().setCurvilinearError();
211  }
212 
213 
214 
215 };
216 
218  // use base swap
219  rh.swap(lh);
220 }
221 
222 std::ostream& operator<<(std::ostream& os, const TrajectoryStateOnSurface & tsos);
223 #endif
void swap(ora::Record &rh, ora::Record &lh)
Definition: Record.h:70
void update(const LocalTrajectoryParameters &p, SurfaceSide side)
const LocalTrajectoryParameters & localParameters() const
CurvilinearTrajectoryError & setCurvilinearError()
LocalVector localDirection() const
const CurvilinearTrajectoryError & curvilinearError() const
const CartesianTrajectoryError cartesianError() const
#define noexcept
GlobalPoint globalPosition() const
BasicTrajectoryState::Proxy Base
bool int lh
Definition: SIMDVec.h:21
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
const MagneticField * magneticField() const
const T & data() const
Definition: ProxyBase11.h:66
LocalVector localMomentum() const
int TrackCharge
Definition: TrackCharge.h:4
TrajectoryStateOnSurface(BasicTrajectoryState *p)
Constructor from one of the basic states.
const SurfaceType & surface() const
void swap(TrajectoryStateOnSurface &rh)
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)
const LocalTrajectoryError & localError() const
void swap(ProxyBase11 &other)
Definition: ProxyBase11.h:48
T & unsharedData()
Definition: ProxyBase11.h:68
BasicTrajectoryState::SurfaceSide SurfaceSide
const GlobalTrajectoryParameters & globalParameters() const
T & sharedData()
Definition: ProxyBase11.h:76
GlobalVector globalMomentum() const
void update(const LocalTrajectoryParameters &p, const LocalTrajectoryError &err, SurfaceSide side)
TrajectoryStateOnSurface(BasicSingleTrajectoryState *p)
bool isValid() const
Definition: ProxyBase11.h:78
std::vector< TrajectoryStateOnSurface > components() const
GlobalVector globalDirection() const
ProxyBase11 & operator=(const ProxyBase11 &other)
Definition: ProxyBase11.h:53