37 #ifdef GBL_EIGEN_SUPPORT_ROOT 40 #include "TMatrixDSym.h" 41 #include "TMatrixDSymEigen.h" 44 #include "Eigen/Dense" 50 typedef Eigen::Matrix<double, 2, 7>
Matrix27d;
52 typedef Eigen::Matrix<double, 5, 5>
Matrix5d;
74 #ifdef GBL_EIGEN_SUPPORT_ROOT 77 void addMeasurement(
const TMatrixD &aProjection,
const TVectorD &aResiduals,
78 const TVectorD &aPrecision,
double minPrecision = 0.);
79 void addMeasurement(
const TMatrixD &aProjection,
const TVectorD &aResiduals,
80 const TMatrixDSym &aPrecision,
double minPrecision = 0.);
81 void addMeasurement(
const TVectorD &aResiduals,
const TVectorD &aPrecision,
82 double minPrecision = 0.);
84 const TMatrixDSym &aPrecision,
double minPrecision = 0.);
85 void addScatterer(
const TVectorD &aResiduals,
const TVectorD &aPrecision);
87 const TMatrixDSym &aPrecision);
88 void addLocals(
const TMatrixD &aDerivatives);
89 void addGlobals(
const std::vector<int> &aLabels,
90 const TMatrixD &aDerivatives);
93 template <
typename Projection,
typename Residuals,
typename Precision,
96 void addMeasurement(
const Eigen::MatrixBase<Projection>& aProjection,
97 const Eigen::MatrixBase<Residuals>& aResiduals,
98 const Eigen::MatrixBase<Precision>& aPrecision,
99 double minPrecision = 0.);
100 template <
typename Projection,
typename Residuals,
typename Precision,
101 typename std::enable_if<(Residuals::ColsAtCompileTime == 1)>::type* =
nullptr,
103 void addMeasurement(
const Eigen::MatrixBase<Projection>& aProjection,
104 const Eigen::MatrixBase<Residuals>& aResiduals,
105 const Eigen::MatrixBase<Precision>& aPrecision,
106 double minPrecision = 0.);
107 template <
typename Residuals,
typename Precision,
108 typename std::enable_if<(Residuals::ColsAtCompileTime == 1)>::type* =
nullptr,
110 void addMeasurement(
const Eigen::MatrixBase<Residuals>& aResiduals,
111 const Eigen::MatrixBase<Precision>& aPrecision,
112 double minPrecision = 0.);
113 template <
typename Residuals,
typename Precision,
114 typename std::enable_if<(Residuals::ColsAtCompileTime == 1)>::type* =
nullptr,
116 void addMeasurement(
const Eigen::MatrixBase<Residuals>& aResiduals,
117 const Eigen::MatrixBase<Precision>& aPrecision,
118 double minPrecision = 0.);
119 template <
typename Precision>
121 const Eigen::MatrixBase<Precision>& aPrecision);
123 const Eigen::Vector2d& aPrecision);
128 Vector5d &aPrecision)
const;
131 void getScatterer(Eigen::Matrix2d &aTransformation, Eigen::Vector2d &aResiduals,
132 Eigen::Vector2d &aPrecision)
const;
134 template <
typename Derivative>
135 void addLocals(
const Eigen::MatrixBase<Derivative>& aDerivatives);
138 template <
typename Derivative>
139 void addGlobals(
const std::vector<int> &aLabels,
140 const Eigen::MatrixBase<Derivative>& aDerivatives);
145 std::vector<int> &aLabels, std::vector<double> &aDerivatives)
const;
153 void getDerivatives(
int aDirection, Eigen::Matrix2d &matW, Eigen::Matrix2d &matWJ,
154 Eigen::Vector2d &vecWd)
const;
191 template <
typename Projection,
typename Residuals,
typename Precision,
195 const Eigen::MatrixBase<Residuals>& aResiduals,
196 const Eigen::MatrixBase<Precision>& aPrecision,
202 Eigen::SelfAdjointEigenSolver<typename Precision::PlainObject> measEigen{aPrecision};
221 template <
typename Projection,
typename Residuals,
typename Precision,
222 typename std::enable_if<(Residuals::ColsAtCompileTime == 1)>::type*,
225 const Eigen::MatrixBase<Residuals>& aResiduals,
226 const Eigen::MatrixBase<Precision>& aPrecision,
246 template <
typename Residuals,
typename Precision,
247 typename std::enable_if<(Residuals::ColsAtCompileTime == 1)>::type*,
250 const Eigen::MatrixBase<Precision>& aPrecision,
256 Eigen::SelfAdjointEigenSolver<typename Precision::PlainObject> measEigen{aPrecision};
273 template <
typename Residuals,
typename Precision,
274 typename std::enable_if<(Residuals::ColsAtCompileTime == 1)>::type*,
277 const Eigen::MatrixBase<Precision>& aPrecision,
304 template <
typename Precision>
306 const Eigen::MatrixBase<Precision>& aPrecision)
310 Eigen::SelfAdjointEigenSolver<typename Precision::PlainObject> scatEigen{aPrecision};
322 template <
typename Derivative>
341 template <
typename Derivative>
343 const Eigen::MatrixBase<Derivative>& aDerivatives)
const Eigen::MatrixXd & getLocalDerivatives() const
Retrieve local derivatives from a point.
void addNextJacobian(const Matrix5d &aJac)
Define jacobian to next scatterer (by GBLTrajectory constructor)
void getGlobalDerivatives(Eigen::MatrixXd &aDerivatives) const
Retrieve global derivatives from a point.
Eigen::Matrix< double, 2, 5 > Matrix25d
Vector5d measResiduals
Measurement residuals.
void setLabel(unsigned int aLabel)
Define label of point (by GBLTrajectory constructor)
bool transFlag
Transformation exists?
bool scatFlag
Scatterer present?
void setOffset(int anOffset)
Define offset for point (by GBLTrajectory constructor)
int theOffset
Offset number at point if not negative (else interpolation needed)
GblPoint(const Matrix5d &aJacobian)
Create a point.
Eigen::Vector2d scatPrecision
Scattering precision (diagonal of inverse covariance matrix)
bool hasScatterer() const
Check for scatterer at a point.
unsigned int getLabel() const
Retrieve label of point.
GblPoint & operator=(const GblPoint &)=default
double measPrecMin
Minimal measurement precision (for usage)
void addGlobals(const std::vector< int > &aLabels, const Eigen::MatrixBase< Derivative > &aDerivatives)
Add global derivatives to a point.
void addLocals(const Eigen::MatrixBase< Derivative > &aDerivatives)
Add local derivatives to a point.
double getMeasPrecMin() const
get precision cutoff.
Eigen::Matrix< double, 3, 2 > Matrix32d
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
void getMeasurement(Matrix5d &aProjection, Vector5d &aResiduals, Vector5d &aPrecision) const
Retrieve measurement of a point.
int getOffset() const
Retrieve offset for point.
unsigned int hasMeasurement() const
Check for measurement at a point.
Eigen::MatrixXd globalDerivatives
Derivatives of measurement vs additional global (MP-II) parameters.
Eigen::MatrixXd localDerivatives
Derivatives of measurement vs additional local (fit) parameters.
void getGlobalLabels(std::vector< int > &aLabels) const
Retrieve global derivatives labels from a point.
void getGlobalLabelsAndDerivatives(unsigned int aRow, std::vector< int > &aLabels, std::vector< double > &aDerivatives) const
Retrieve global derivatives from a point for a single row.
void printPoint(unsigned int level=0) const
Print GblPoint.
std::vector< int > globalLabels
Labels of global (MP-II) derivatives.
void addScatterer(const Eigen::Vector2d &aResiduals, const Eigen::MatrixBase< Precision > &aPrecision)
Add a (thin) scatterer to a point.
Namespace for the general broken lines package.
unsigned int getNumLocals() const
Retrieve number of local derivatives from a point.
Matrix5d nextJacobian
Jacobian to next scatterer (or last measurement)
void getMeasTransformation(Eigen::MatrixXd &aTransformation) const
Get measurement transformation (from diagonalization).
Eigen::Matrix2d scatTransformation
Transformation of diagonalization (of scat. precision matrix)
Eigen::Matrix< double, 5, 1 > Vector5d
Eigen::Matrix< double, 2, 7 > Matrix27d
Eigen::Matrix< double, 2, 3 > Matrix23d
Vector5d measPrecision
Measurement precision (diagonal of inverse covariance matrix)
void getDerivatives(int aDirection, Eigen::Matrix2d &matW, Eigen::Matrix2d &matWJ, Eigen::Vector2d &vecWd) const
Retrieve derivatives of local track model.
Eigen::Vector2d scatResiduals
Scattering residuals (initial kinks if iterating)
Matrix5d measProjection
Projection from measurement to local system.
void getScatTransformation(Eigen::Matrix2d &aTransformation) const
Get scatterer transformation (from diagonalization).
void addMeasurement(const Eigen::MatrixBase< Projection > &aProjection, const Eigen::MatrixBase< Residuals > &aResiduals, const Eigen::MatrixBase< Precision > &aPrecision, double minPrecision=0.)
Add a measurement to a point.
Matrix5d prevJacobian
Jacobian to previous scatterer (or first measurement)
unsigned int theLabel
Label identifying point.
void addPrevJacobian(const Matrix5d &aJac)
Define jacobian to previous scatterer (by GBLTrajectory constructor)
void getScatterer(Eigen::Matrix2d &aTransformation, Eigen::Vector2d &aResiduals, Eigen::Vector2d &aPrecision) const
Retrieve scatterer of a point.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor, 5, 5 > measTransformation
Transformation of diagonalization (of meas. precision matrix)
const Matrix5d & getP2pJacobian() const
Retrieve point-to-(previous)point jacobian.
unsigned int getNumGlobals() const
Retrieve number of global derivatives from a point.
Matrix5d p2pJacobian
Point-to-point jacobian from previous point.
Eigen::Matrix< double, 5, 5 > Matrix5d