CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BasicTrajectoryState.h
Go to the documentation of this file.
1 #ifndef BasicTrajectoryState_H
2 #define BasicTrajectoryState_H
3 
7 
14 
15 #include <vector>
16 
17 
21 
23 
27 
30 
32 #include <iostream>
33 
34 //class MagneticField;
36 
37 
38 
40 
41 
49 public:
50 
55 
56 private:
57  friend class ProxyBase< BTSOS, CopyUsingClone<BTSOS> >;
59 public:
60 
61  // default constructor : to make root happy
63 
65  explicit BasicTrajectoryState(const Surface& aSurface);
66 
67  virtual ~BasicTrajectoryState();
68 
73  const Surface& aSurface,
79  const Surface& aSurface,
85  const CartesianTrajectoryError& err,
86  const Surface& aSurface,
88 
94  const CurvilinearTrajectoryError& err,
95  const Surface& aSurface,
97  double weight = 1.);
103  const CurvilinearTrajectoryError& err,
104  const Surface& aSurface,
105  double weight);
110  const Surface& aSurface,
111  const MagneticField* field,
118  const LocalTrajectoryError& err,
119  const Surface& aSurface,
120  const MagneticField* field,
122  double weight = 1.);
128  const LocalTrajectoryError& err,
129  const Surface& aSurface,
130  const MagneticField* field,
131  double weight);
132 
133 
134  bool isValid() const {
136  }
137 
138 
139 // access global parameters/errors
141  return freeTrajectoryState(false)->parameters();
142  }
144  return freeTrajectoryState(false)->position();
145  }
147  return freeTrajectoryState(false)->momentum();
148  }
150  return freeTrajectoryState(false)->momentum().unit();
151  }
152  TrackCharge charge() const {
153  return freeTrajectoryState(false)->charge();
154  }
155  double signedInverseMomentum() const {
157  }
158  double transverseCurvature() const {
159  return freeTrajectoryState(false)->transverseCurvature();
160  }
161 
163  if unlikely(!hasError()) {
164  missingError(" accesing cartesian error.");
165  return CartesianTrajectoryError();
166  }
168  }
170  if unlikely(!hasError()) {
171  missingError(" accesing curvilinearerror.");
172  static CurvilinearTrajectoryError crap;
173  return crap;
174  }
176  }
177 
178 
179  FreeTrajectoryState* freeTrajectoryState(bool withErrors = true) const;
180 
181  const MagneticField *magneticField() const { return theField; }
182 
183 // access local parameters/errors
185  if unlikely(!isValid()) notValid();
188  return theLocalParameters;
189  }
191  return localParameters().position();
192  }
194  return localParameters().momentum();
195  }
197  return localMomentum().unit();
198  }
199 
201  if unlikely(!hasError()) {
202  missingError(" accessing local error.");
203  return theLocalError;
204  }
206  return theLocalError;
207  }
208 
209  const Surface& surface() const {
210  return *theSurfaceP;
211  }
212 
213  virtual double weight() const {return theWeight;}
214 
215  void rescaleError(double factor);
216 
217 
218 
221  return theSurfaceSide;
222  }
223 
224  bool hasError() const {
226  }
227 
228 
229  virtual BasicTrajectoryState* clone() const=0;
230 
231  virtual bool canUpdateLocalParameters() const { return true; }
232 
233  virtual void update( const LocalTrajectoryParameters& p,
234  const Surface& aSurface,
235  const MagneticField* field,
236  const SurfaceSide side ) ;
237 
238  virtual void update( const LocalTrajectoryParameters& p,
239  const LocalTrajectoryError& err,
240  const Surface& aSurface,
241  const MagneticField* field,
242  const SurfaceSide side,
243  double weight ) ;
244 
245 public:
246  virtual std::vector<TrajectoryStateOnSurface> components() const;
247 
248 private:
249 
250  static void notValid();
251 
252 
253  void missingError(char const * where) const; // dso_internal;
254 
255 // create global parameters and errors from local
258 
259 // create local parameters and errors from global
261  // create local errors from global
262  void createLocalError() const;
263  void createLocalErrorFromCurvilinearError() const dso_internal;
264 
265 private:
266 
268 
271 
274 
275 
278 
279  double theWeight;
281 
282 };
283 
284 #endif
GlobalPoint globalPosition() const
const Surface & surface() const
LocalPoint localPosition() const
CartesianTrajectoryError cartesianError() const
const MagneticField * magneticField() const
SurfaceSideDefinition::SurfaceSide SurfaceSide
ConstReferenceCountingPointer< Surface > theSurfaceP
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
const GlobalTrajectoryParameters & parameters() const
LocalPoint position() const
Local x and y position coordinates.
const CartesianTrajectoryError cartesianError() const
TrackCharge charge() const
virtual void update(const LocalTrajectoryParameters &p, const Surface &aSurface, const MagneticField *field, const SurfaceSide side)
TrackCharge charge() const
const CurvilinearTrajectoryError & curvilinearError() const
void rescaleError(double factor)
#define unlikely(x)
Definition: Likely.h:21
int TrackCharge
Definition: TrackCharge.h:4
GlobalVector globalDirection() const
void createLocalErrorFromCurvilinearError() const
const LocalTrajectoryError & localError() const
DeepCopyPointer< FreeTrajectoryState > theFreeState
double signedInverseMomentum() const
void createLocalParameters() const
#define dso_internal
Definition: Visibility.h:13
void checkGlobalParameters() const
LocalVector momentum() const
Momentum vector in the local frame.
GlobalVector momentum() const
ReferenceCountingPointer< BasicTrajectoryState > RCPtr
const MagneticField * theField
Vector3DBase unit() const
Definition: Vector3DBase.h:57
GlobalPoint position() const
ProxyBase< BTSOS, CopyUsingClone< BTSOS > > Proxy
const GlobalTrajectoryParameters & globalParameters() const
double transverseCurvature() const
string const
Definition: compareJSON.py:14
double transverseCurvature() const
virtual double weight() const
void missingError(char const *where) const
#define private
Definition: FWFileEntry.h:18
GlobalVector globalMomentum() const
const LocalTrajectoryParameters & localParameters() const
virtual std::vector< TrajectoryStateOnSurface > components() const
LocalTrajectoryParameters theLocalParameters
virtual bool canUpdateLocalParameters() const
virtual BasicTrajectoryState * clone() const =0
LocalVector localDirection() const
LocalVector localMomentum() const
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
const CurvilinearTrajectoryError & curvilinearError() const
LocalTrajectoryError theLocalError
double signedInverseMomentum() const
BasicTrajectoryState BTSOS