46typedef Eigen::Matrix<double, 5, 1>
Vector5d;
47typedef Eigen::Matrix<double, 2, 3>
Matrix23d;
48typedef Eigen::Matrix<double, 2, 5>
Matrix25d;
49typedef Eigen::Matrix<double, 3, 2>
Matrix32d;
50typedef Eigen::Matrix<double, 5, 5>
Matrix5d;
51typedef Eigen::Matrix<double, 4, 9>
Matrix49d;
70#ifdef GBL_EIGEN_SUPPORT_ROOT
73 void addMeasurement(
const TMatrixD &aProjection,
const TVectorD &aResiduals,
74 const TVectorD &aPrecision,
double minPrecision = 0.);
75 void addMeasurement(
const TMatrixD &aProjection,
const TVectorD &aResiduals,
76 const TMatrixDSym &aPrecision,
double minPrecision = 0.);
77 void addMeasurement(
const TVectorD &aResiduals,
const TVectorD &aPrecision,
78 double minPrecision = 0.);
80 const TMatrixDSym &aPrecision,
double minPrecision = 0.);
81 void addScatterer(
const TVectorD &aResiduals,
const TVectorD &aPrecision);
83 const TMatrixDSym &aPrecision);
85 const TMatrixDSym &aPrecision);
86 void addLocals(
const TMatrixD &aDerivatives);
87 void addGlobals(
const std::vector<int> &aLabels,
88 const TMatrixD &aDerivatives);
105 template<
typename Projection,
typename Residuals,
typename Precision,
106 typename std::enable_if<(Precision::ColsAtCompileTime != 1)>::type* =
108 void addMeasurement(
const Eigen::MatrixBase<Projection> &aProjection,
109 const Eigen::MatrixBase<Residuals> &aResiduals,
110 const Eigen::MatrixBase<Precision> &aPrecision,
111 double minPrecision = 0.);
125 template<
typename Projection,
typename Residuals,
typename Precision,
126 typename std::enable_if<(Precision::ColsAtCompileTime == 1)>::type* =
129 const Eigen::MatrixBase<Residuals> &aResiduals,
130 const Eigen::MatrixBase<Precision> &aPrecision,
131 double minPrecision = 0.);
144 template<
typename Residuals,
typename Precision,
typename std::enable_if<
145 (Precision::ColsAtCompileTime != 1)>::type* =
nullptr>
146 void addMeasurement(
const Eigen::MatrixBase<Residuals> &aResiduals,
147 const Eigen::MatrixBase<Precision> &aPrecision,
148 double minPrecision = 0.);
160 template<
typename Residuals,
typename Precision,
typename std::enable_if<
161 (Precision::ColsAtCompileTime == 1)>::type* =
nullptr>
163 const Eigen::MatrixBase<Precision> &aPrecision,
164 double minPrecision = 0.);
167 const Eigen::Matrix2d &aPrecision);
169 const Eigen::Vector2d &aPrecision);
171 const Eigen::Matrix4d &aPrecision);
179 template<
typename Derivative>
180 void addLocals(
const Eigen::MatrixBase<Derivative> &aDerivatives);
181 template<
typename Derivative>
190 void addGlobals(
const std::vector<int> &aLabels,
191 const Eigen::MatrixBase<Derivative> &aDerivatives);
196 Eigen::Vector4d &aResiduals, Eigen::Vector4d &aPrecision)
const;
198 Eigen::Vector4d &aResiduals, Eigen::Vector4d &aPrecision)
const;
204 Eigen::Matrix2d &matWJ, Eigen::Vector2d &vecWd)
const;
205 void printPoint(
unsigned int level = 0)
const;
207 std::vector<GblMeasurement>::iterator
getMeasEnd();
209 std::vector<int> &aLabels, std::vector<double> &aDerivatives)
const;
236template<
typename Projection,
typename Residuals,
typename Precision,
237 typename std::enable_if<(Precision::ColsAtCompileTime != 1)>::type*>
239 const Eigen::MatrixBase<Residuals> &aResiduals,
240 const Eigen::MatrixBase<Precision> &aPrecision,
double minPrecision) {
241 static_assert(
static_cast<int>(Residuals::ColsAtCompileTime) == 1,
"addMeasurement: cols(Residuals) must be 1 (vector)");
242 static_assert(
static_cast<int>(Residuals::RowsAtCompileTime) <= 5 or
static_cast<int>(Residuals::RowsAtCompileTime) == Eigen::Dynamic,
"addMeasurement: rows(Residuals) must be 1-5 or dynamic");
243 static_assert(
static_cast<int>(Residuals::RowsAtCompileTime) ==
static_cast<int>(Precision::RowsAtCompileTime),
"addMeasurement: rows(Residuals) and rows(Precision) must be equal");
244 static_assert(
static_cast<int>(Residuals::RowsAtCompileTime) ==
static_cast<int>(Projection::RowsAtCompileTime),
"addMeasurement: rows(Residuals) and rows(Projection) must be equal");
245 static_assert(
static_cast<int>(Precision::RowsAtCompileTime) ==
static_cast<int>(Precision::ColsAtCompileTime),
"addMeasurement: rows(Precision) and cols(Precision) must be equal");
246 static_assert(
static_cast<int>(Projection::RowsAtCompileTime) ==
static_cast<int>(Projection::ColsAtCompileTime),
"addMeasurement: rows(Projection) and cols(Projection) must be equal");
247 theMeasurements.emplace_back(aProjection, aResiduals, aPrecision,
251template<
typename Projection,
typename Residuals,
typename Precision,
252 typename std::enable_if<(Precision::ColsAtCompileTime == 1)>::type*>
254 const Eigen::MatrixBase<Residuals> &aResiduals,
255 const Eigen::MatrixBase<Precision> &aPrecision,
double minPrecision) {
256 static_assert(
static_cast<int>(Residuals::ColsAtCompileTime) == 1,
"addMeasurement: cols(Residuals) must be 1 (vector)");
257 static_assert(
static_cast<int>(Residuals::RowsAtCompileTime) <= 5 or
static_cast<int>(Residuals::RowsAtCompileTime) == Eigen::Dynamic,
"addMeasurement: rows(Residuals) must be 1-5 or dynamic");
258 static_assert(
static_cast<int>(Residuals::RowsAtCompileTime) ==
static_cast<int>(Precision::RowsAtCompileTime),
"addMeasurement: rows(Residuals) and rows(Precision) must be equal");
259 static_assert(
static_cast<int>(Residuals::RowsAtCompileTime) ==
static_cast<int>(Projection::RowsAtCompileTime),
"addMeasurement: rows(Residuals) and rows(Projection) must be equal");
260 static_assert(
static_cast<int>(Projection::RowsAtCompileTime) ==
static_cast<int>(Projection::ColsAtCompileTime),
"addMeasurement: rows(Projection) and cols(Projection) must be equal");
262 theMeasurements.emplace_back(aProjection, aResiduals, aPrecision,
266template<
typename Residuals,
typename Precision,
typename std::enable_if<
267 (Precision::ColsAtCompileTime != 1)>::type*>
269 const Eigen::MatrixBase<Precision> &aPrecision,
double minPrecision) {
270 static_assert(
static_cast<int>(Residuals::ColsAtCompileTime) == 1,
"addMeasurement: cols(Residuals) must be 1 (vector)");
271 static_assert(
static_cast<int>(Residuals::RowsAtCompileTime) <= 5 or
static_cast<int>(Residuals::RowsAtCompileTime) == Eigen::Dynamic,
"addMeasurement: rows(Residuals) must be 1-5 or dynamic");
272 static_assert(
static_cast<int>(Residuals::RowsAtCompileTime) ==
static_cast<int>(Precision::RowsAtCompileTime),
"addMeasurement: rows(Residuals) and rows(Precision) must be equal");
273 theMeasurements.emplace_back(aResiduals, aPrecision, minPrecision);
276template<
typename Residuals,
typename Precision,
typename std::enable_if<
277 (Precision::ColsAtCompileTime == 1)>::type*>
279 const Eigen::MatrixBase<Precision> &aPrecision,
double minPrecision) {
280 static_assert(
static_cast<int>(Residuals::ColsAtCompileTime) == 1,
"addMeasurement: cols(Residuals) must be 1 (vector)");
281 static_assert(
static_cast<int>(Residuals::RowsAtCompileTime) <= 5 or
static_cast<int>(Residuals::RowsAtCompileTime) == Eigen::Dynamic,
"addMeasurement: rows(Residuals) must be 1-5 or dynamic");
282 static_assert(
static_cast<int>(Residuals::RowsAtCompileTime) ==
static_cast<int>(Precision::RowsAtCompileTime),
"addMeasurement: rows(Residuals) and rows(Precision) must be equal");
283 theMeasurements.emplace_back(aResiduals, aPrecision, minPrecision);
286template<
typename Derivative>
292template<
typename Derivative>
294 const Eigen::MatrixBase<Derivative> &aDerivatives) {
GblMeasurement (with optional derivatives) definition.
Matrix5d nextJacobian
Jacobian to next scatterer (or last measurement)
void getScatterer(Eigen::Matrix4d &aTransformation, Eigen::Vector4d &aResiduals, Eigen::Vector4d &aPrecision) const
Retrieve scatterer of a point.
GblPoint & operator=(GblPoint &&)=default
Eigen::Matrix4d scatTransformation
Transformation of diagonalization (of scat. precision matrix)
void addMeasurement(const Eigen::MatrixBase< Residuals > &aResiduals, const Eigen::MatrixBase< Precision > &aPrecision, double minPrecision=0.)
Add a measurement to a point.
void addThickScatterer(const Eigen::Vector4d &aResiduals, const Eigen::Matrix4d &aPrecision)
Add a thick scatterer to a point.
void getScatTransformation(Eigen::MatrixXd &aTransformation) const
Get scatterer transformation (from diagonalization).
void getDerivatives(int aDirection, Eigen::Matrix2d &matW, Eigen::Matrix2d &matWJ, Eigen::Vector2d &vecWd) const
Retrieve derivatives of local track model.
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.
void getGlobalLabelsAndDerivatives(unsigned int aMeas, unsigned int aRow, std::vector< int > &aLabels, std::vector< double > &aDerivatives) const
Retrieve global derivatives from a measurement at a point for a single row.
GblPoint(GblPoint &&)=default
void setType(int aType)
Define type for point (by GBLTrajectory constructor)
void printPoint(unsigned int level=0) const
Print GblPoint.
void addPrevJacobian(const Matrix5d &aJac)
Define jacobian to previous scatterer (by GBLTrajectory constructor)
int theType
Type (-1: first, 0: inner, 1: last)
GblPoint & operator=(const GblPoint &)=default
std::vector< GblMeasurement > theMeasurements
List of measurements at point.
Eigen::Vector4d scatPrecision
Scattering precision (diagonal of inverse covariance matrix)
unsigned int numMeasurements() const
Check for measurements at a point.
void getReducedScatterer(Eigen::Matrix4d &aTransformation, Eigen::Vector4d &aResiduals, Eigen::Vector4d &aPrecision) const
Retrieve (reduced) scatterer of a point.
unsigned int theLabel
Label identifying point.
std::vector< GblMeasurement >::iterator getMeasBegin()
Get GblMeasurement iterator for begin.
unsigned int scatDim
Dimension of scatterer (0: none, 2: thin, 4:thick)
int theOffset
Offset number at point if not negative (else interpolation needed)
bool isLast() const
Is last point on (sub)trajectory?
void setLabel(unsigned int aLabel)
Define label of point (by GBLTrajectory constructor)
void addLocals(const Eigen::MatrixBase< Derivative > &aDerivatives)
Add local derivatives to a point.
void addGlobals(const std::vector< int > &aLabels, const Eigen::MatrixBase< Derivative > &aDerivatives)
Add global derivatives to a point.
friend class GblTrajectory
void addNextJacobian(const Matrix5d &aJac)
Define jacobian to next scatterer (by GBLTrajectory constructor)
unsigned int getScatDim() const
Get scatterer dimension.
unsigned int getLabel() const
Retrieve label of point.
GblPoint(const Matrix5d &aJacobian, unsigned int numMeasReserve=0)
Create a point.
Eigen::Vector4d scatResiduals
Scattering residuals (initial kinks if iterating)
Matrix5d prevJacobian
Jacobian to previous scatterer (or first measurement)
std::vector< GblMeasurement >::iterator getMeasEnd()
Get GblMeasurement iterator for end.
GblPoint(const GblPoint &)=default
const Matrix5d & getP2pJacobian() const
Retrieve point-to-(previous)point jacobian.
void addScatterer(const Eigen::Vector2d &aResiduals, const Eigen::Matrix2d &aPrecision)
Add a thin scatterer to a point.
void setOffset(int anOffset)
Define offset for point (by GBLTrajectory constructor)
bool isFirst() const
Is first point on (sub)trajectory?
Matrix5d p2pJacobian
Point-to-point jacobian from previous point.
int getOffset() const
Retrieve offset for point.
Namespace for the general broken lines package.
Eigen::Matrix< double, 3, 2 > Matrix32d
Eigen::Matrix< double, 2, 5 > Matrix25d
Eigen::Matrix< double, 2, 3 > Matrix23d
Eigen::Matrix< double, 5, 1 > Vector5d
Eigen::Matrix< double, 4, 9 > Matrix49d
Eigen::Matrix< double, 5, 5 > Matrix5d