CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BasicSingleTrajectoryState.h
Go to the documentation of this file.
1 #ifndef BasicSingleTrajectoryState_H
2 #define BasicSingleTrajectoryState_H
3 
8 
10 
14 
16 #include <iostream>
17 
18 //class MagneticField;
20 
25 public:
26 
31  const Surface& aSurface,
37  const Surface& aSurface,
43  const CartesianTrajectoryError& err,
44  const Surface& aSurface,
51  const CurvilinearTrajectoryError& err,
52  const Surface& aSurface,
54  double weight = 1.);
60  const CurvilinearTrajectoryError& err,
61  const Surface& aSurface,
62  double weight);
67  const Surface& aSurface,
68  const MagneticField* field,
75  const LocalTrajectoryError& err,
76  const Surface& aSurface,
77  const MagneticField* field,
79  double weight = 1.);
85  const LocalTrajectoryError& err,
86  const Surface& aSurface,
87  const MagneticField* field,
88  double weight);
89 
91  BasicSingleTrajectoryState(const Surface& aSurface);
92 
94 
95  bool isValid() const {
97  }
98  static void notValid();
99 
100  bool hasError() const;
101 
102  void missingError(char const * where) const;
103 
104 // access global parameters/errors
106  return freeTrajectoryState(false)->parameters();
107  }
109  return freeTrajectoryState(false)->position();
110  }
112  return freeTrajectoryState(false)->momentum();
113  }
115  return freeTrajectoryState(false)->momentum().unit();
116  }
117  TrackCharge charge() const {
118  return freeTrajectoryState(false)->charge();
119  }
120  double signedInverseMomentum() const {
122  }
123  double transverseCurvature() const {
124  return freeTrajectoryState(false)->transverseCurvature();
125  }
127  if(!hasError()) missingError(" accesing cartesian error.");
129  }
131  if(!hasError()) missingError(" accesing curvilinearerror.");
133  }
134 
135 
136  FreeTrajectoryState* freeTrajectoryState(bool withErrors = true) const;
137 
138  const MagneticField *magneticField() const { return theField; }
139 
140 // access local parameters/errors
142  if (!isValid()) notValid();
145  return theLocalParameters;
146  }
148  return localParameters().position();
149  }
151  return localParameters().momentum();
152  }
154  return localMomentum().unit();
155  }
156 
158  if (!hasError()) missingError(" accessing local error.");
159  if (!theLocalErrorValid)
161  return theLocalError;
162  }
163 
164  const Surface& surface() const {
165  return *theSurfaceP;
166  }
167 
168  virtual double weight() const {return theWeight;}
169 
170  void rescaleError(double factor);
171 
172 
174  return new BasicSingleTrajectoryState(*this);
175  }
176 
178  virtual SurfaceSide surfaceSide() const {
179  return theSurfaceSide;
180  }
181 
182  virtual bool canUpdateLocalParameters() const { return true; }
183  virtual void update( const LocalTrajectoryParameters& p,
184  const Surface& aSurface,
185  const MagneticField* field,
186  const SurfaceSide side ) ;
187  virtual void update( const LocalTrajectoryParameters& p,
188  const LocalTrajectoryError& err,
189  const Surface& aSurface,
190  const MagneticField* field,
191  const SurfaceSide side,
192  double weight ) ;
193 private:
194 
195 // create global parameters and errors from local
196  void checkGlobalParameters() const;
197  void checkCurvilinError() const;
198  void checkCartesianError() const;
199 
200 // create local parameters and errors from global
201  void createLocalParameters() const;
202  // create local errors from global
203  void createLocalError() const;
206 
207 private:
208 
210 
214  mutable bool theLocalErrorValid;
215 
219 
220 
223 
224  double theWeight;
226 
227 };
228 
229 #endif
DeepCopyPointer< FreeTrajectoryState > theFreeState
const MagneticField * magneticField() const
ConstReferenceCountingPointer< Surface > theSurfaceP
void missingError(char const *where) const
SurfaceSideDefinition::SurfaceSide SurfaceSide
const GlobalTrajectoryParameters & parameters() const
LocalPoint position() const
Local x and y position coordinates.
TrackCharge charge() const
BasicSingleTrajectoryState(const FreeTrajectoryState &fts, const Surface &aSurface, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
const CurvilinearTrajectoryError & curvilinearError() const
BasicSingleTrajectoryState * clone() const
const LocalTrajectoryParameters & localParameters() const
const CartesianTrajectoryError & cartesianError() const
int TrackCharge
Definition: TrackCharge.h:4
LocalVector momentum() const
Momentum vector in the local frame.
GlobalVector momentum() const
const GlobalTrajectoryParameters & globalParameters() const
const LocalTrajectoryError & localError() const
Vector3DBase unit() const
Definition: Vector3DBase.h:57
GlobalPoint position() const
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
const CartesianTrajectoryError & cartesianError() const
double transverseCurvature() const
virtual SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
const CurvilinearTrajectoryError & curvilinearError() const
virtual void update(const LocalTrajectoryParameters &p, const Surface &aSurface, const MagneticField *field, const SurfaceSide side)
double signedInverseMomentum() const
LocalTrajectoryParameters theLocalParameters
virtual bool canUpdateLocalParameters() const
const double par[8 *NPar][4]