CMS 3D CMS Logo

FreeTrajectoryState.h
Go to the documentation of this file.
1 #ifndef _TRACKER_FREETRAJECTORYSTATE_H_
2 #define _TRACKER_FREETRAJECTORYSTATE_H_
3 
4 // base trajectory state class
5 // track parameters and error covariance matrix
6 
12 
13 #include <iosfwd>
14 
17 
28 public:
29  // construst
30  //default constructor - needed for Persistency
31 
33 
35  : theGlobalParameters(aGlobalParameters), theCurvilinearError(InvalidError()) {}
36 
38  const GlobalVector& aP,
39  TrackCharge aCharge,
40  const MagneticField* fieldProvider)
41  : theGlobalParameters(aX, aP, aCharge, fieldProvider), theCurvilinearError(InvalidError()) {}
42 
44  const GlobalVector& aP,
45  TrackCharge aCharge,
46  const MagneticField* fieldProvider,
47  GlobalVector fieldValue)
48  : theGlobalParameters(aX, aP, aCharge, fieldProvider, fieldValue), theCurvilinearError(InvalidError()) {}
49 
51  const CurvilinearTrajectoryError& aCurvilinearError)
52  : theGlobalParameters(aGlobalParameters), theCurvilinearError(aCurvilinearError) {}
53 
55  const CartesianTrajectoryError& aCartesianError)
56  : theGlobalParameters(aGlobalParameters) {
57  createCurvilinearError(aCartesianError);
58  }
59 
62  const CurvilinearTrajectoryError& aCurvilinearError)
63  : theGlobalParameters(aGlobalParameters), theCurvilinearError(aCurvilinearError) {}
64 
65  // access
66  // propagate access to parameters
72 
73  // direct access
74 
75  bool hasCurvilinearError() const { return theCurvilinearError.valid(); }
76 
77  bool hasError() const { return hasCurvilinearError(); }
78 
80 
82  if UNLIKELY (!hasError())
83  missingError();
84  CartesianTrajectoryError aCartesianError;
85  createCartesianError(aCartesianError);
86  return aCartesianError;
87  }
88 
90  if UNLIKELY (!hasError())
91  missingError();
92  return theCurvilinearError;
93  }
94 
95  void rescaleError(double factor);
96 
99 
101 
103  // void setCurvilinearError(const AlgebraicSymMatrix55 &err) {
104  // theCurvilinearError = CurvilinearTrajectoryError(err);
105  // }
106 
107 private:
108  void missingError() const; // dso_internal;
109 
110  // convert curvilinear errors to cartesian
111  void createCartesianError(CartesianTrajectoryError& aCartesianError) const; // dso_internal;
112 
113  // convert cartesian errors to curvilinear
114  void createCurvilinearError(CartesianTrajectoryError const& aCartesianError) const; // dso_internal;
115 
116 private:
119 };
120 
121 std::ostream& operator<<(std::ostream& os, const FreeTrajectoryState& fts);
122 
123 #endif
std::ostream & operator<<(std::ostream &os, const FreeTrajectoryState &fts)
CartesianTrajectoryError cartesianError() const
const CurvilinearTrajectoryError & curvilinearError() const
void setCartesianError(const AlgebraicSymMatrix66 &err)
CurvilinearTrajectoryError theCurvilinearError
bool hasCurvilinearError() const
const GlobalTrajectoryParameters & parameters() const
FreeTrajectoryState(const GlobalTrajectoryParameters &aGlobalParameters, const CartesianTrajectoryError &, const CurvilinearTrajectoryError &aCurvilinearError)
GlobalPoint position() const
FreeTrajectoryState(const GlobalTrajectoryParameters &aGlobalParameters, const CartesianTrajectoryError &aCartesianError)
FreeTrajectoryState(const GlobalPoint &aX, const GlobalVector &aP, TrackCharge aCharge, const MagneticField *fieldProvider)
GlobalTrajectoryParameters theGlobalParameters
int TrackCharge
Definition: TrackCharge.h:4
TrackCharge charge() const
FreeTrajectoryState(const GlobalTrajectoryParameters &aGlobalParameters, const CurvilinearTrajectoryError &aCurvilinearError)
GlobalVector momentum() const
double signedInverseMomentum() const
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > AlgebraicSymMatrix66
void setCurvilinearError(const CurvilinearTrajectoryError &err)
void setCartesianError(const CartesianTrajectoryError &err)
void rescaleError(double factor)
double transverseCurvature() const
CurvilinearTrajectoryError & setCurvilinearError()
FreeTrajectoryState(const GlobalTrajectoryParameters &aGlobalParameters)
void createCartesianError(CartesianTrajectoryError &aCartesianError) const
#define UNLIKELY(x)
Definition: Likely.h:21
FreeTrajectoryState(const GlobalPoint &aX, const GlobalVector &aP, TrackCharge aCharge, const MagneticField *fieldProvider, GlobalVector fieldValue)
void createCurvilinearError(CartesianTrajectoryError const &aCartesianError) const