CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrajectoryStateClosestToPoint.h
Go to the documentation of this file.
1 #ifndef TrajectoryStateClosestToPoint_H
2 #define TrajectoryStateClosestToPoint_H
3 
10 #include <vector>
11 
21 {
25 
26 public:
27 
30 
38  const GlobalPoint& referencePoint, const MagneticField* field);
39 
48  const MagneticField* field);
49 
50 
57  const GlobalPoint & referencePoint() const {
58  if(!isValid()) throw TrajectoryStateException(
59  "TrajectoryStateClosestToPoint is invalid and cannot return any parameters");
60  return theRefPoint;
61  }
62 
63 
70  if(!isValid()) throw TrajectoryStateException(
71  "TrajectoryStateClosestToPoint is invalid and cannot return any parameters");
72  return theParameters;
73  }
74 
79  double pt() const {
80  if(!isValid()) throw TrajectoryStateException(
81  "TrajectoryStateClosestToPoint is invalid and cannot return any parameters");
82  return thePt;
83  }
84 
91  if(!isValid()) throw TrajectoryStateException(
92  "TrajectoryStateClosestToPoint is invalid and cannot return any parameters");
94  "TrajectoryStateClosestToPoint: attempt to access errors when none available");
95  return thePerigeeError;
96  }
97 
104  if(!isValid()) throw TrajectoryStateException(
105  "TrajectoryStateClosestToPoint is invalid and cannot return any parameters");
107  }
108 
109 
111  if(!isValid()) throw TrajectoryStateException(
112  "TrajectoryStateClosestToPoint is invalid and cannot return any parameters");
114  }
115 
116 
117  TrackCharge charge() const {
118  if(!isValid()) throw TrajectoryStateException(
119  "TrajectoryStateClosestToPoint is invalid and cannot return any parameters");
120  return theParameters.charge();
121  }
122 
123 
124  const FreeTrajectoryState & theState() const {
125  if(!isValid()) throw TrajectoryStateException(
126  "TrajectoryStateClosestToPoint is invalid and cannot return any parameters");
128  return theFTS;
129  }
130 
131 
137  bool hasError() const {
138  if(!isValid()) throw TrajectoryStateException(
139  "TrajectoryStateClosestToPoint is invalid and cannot return any parameters");
140  return errorIsAvailable;
141  }
142 
146  bool isValid() const {
147  return valid;
148  }
149 
150 
151 private:
152 
154  friend class PerigeeConversions;
155 
161  TrajectoryStateClosestToPoint(const FTS& originalFTS, const GlobalPoint& referencePoint);
162 
163  void calculateFTS() const;
164 
165  bool valid;
167 
168  mutable FTS theFTS;
169  mutable bool theFTSavailable;
170 
173  double thePt;
177 
178 };
179 #endif
const PerigeeTrajectoryError & perigeeError() const
const FreeTrajectoryState & theState() const
GlobalVector momentumFromPerigee(const AlgebraicVector3 &momentum, const TrackCharge &charge, const GlobalPoint &referencePoint, const MagneticField *field) const
TrajectoryStateClosestToPoint()
parameter dimension
int TrackCharge
Definition: TrackCharge.h:4
const PerigeeTrajectoryParameters & perigeeParameters() const
GlobalPoint positionFromPerigee(const PerigeeTrajectoryParameters &parameters, const GlobalPoint &referencePoint) const
const GlobalPoint & referencePoint() const
PerigeeTrajectoryParameters theParameters