19 theLabel(0), theOffset(0), measDim(0), transFlag(
false), measTransformation(), scatFlag(
20 false), localDerivatives(), globalLabels(), globalDerivatives() {
22 for (
unsigned int i = 0;
i < 5; ++
i) {
23 for (
unsigned int j = 0;
j < 5; ++
j) {
30 theLabel(0), theOffset(0), p2pJacobian(aJacobian), measDim(0), transFlag(
31 false), measTransformation(), scatFlag(
false), localDerivatives(), globalLabels(), globalDerivatives() {
48 const TVectorD &aResiduals,
const TVectorD &aPrecision,
49 double minPrecision) {
50 measDim = aResiduals.GetNrows();
51 unsigned int iOff = 5 -
measDim;
55 aPrecision[
i] >= minPrecision ? aPrecision[
i] : 0.);
73 const TVectorD &aResiduals,
const TMatrixDSym &aPrecision,
74 double minPrecision) {
75 measDim = aResiduals.GetNrows();
76 TMatrixDSymEigen measEigen(aPrecision);
82 TVectorD transPrecision = measEigen.GetEigenValues();
84 unsigned int iOff = 5 -
measDim;
88 transPrecision[
i] >= minPrecision ? transPrecision[
i] : 0.);
104 const TVectorD &aPrecision,
double minPrecision) {
105 measDim = aResiduals.GetNrows();
106 unsigned int iOff = 5 -
measDim;
110 aPrecision[
i] >= minPrecision ? aPrecision[
i] : 0.);
125 const TMatrixDSym &aPrecision,
double minPrecision) {
126 measDim = aResiduals.GetNrows();
127 TMatrixDSymEigen measEigen(aPrecision);
133 TVectorD transPrecision = measEigen.GetEigenValues();
134 unsigned int iOff = 5 -
measDim;
138 transPrecision[
i] >= minPrecision ? transPrecision[
i] : 0.);
176 aTransformation.UnitMatrix();
189 const TVectorD &aPrecision) {
215 const TMatrixDSym &aPrecision) {
217 TMatrixDSymEigen scatEigen(aPrecision);
218 TMatrixD aTransformation = scatEigen.GetEigenVectors();
220 TVectorD transResiduals = aTransformation * aResiduals;
221 TVectorD transPrecision = scatEigen.GetEigenValues();
222 for (
unsigned int i = 0;
i < 2; ++
i) {
225 for (
unsigned int j = 0;
j < 2; ++
j) {
254 aTransformation.ResizeTo(2, 2);
256 for (
unsigned int i = 0;
i < 2; ++
i) {
257 for (
unsigned int j = 0;
j < 2; ++
j) {
262 aTransformation.UnitMatrix();
299 const TMatrixD &aDerivatives) {
368 * aJac.Sub<
SMatrix33>(0, 0).InverseFast(ifail);
398 if (aDirection < 1) {
408 if (!matW.InvertFast()) {
409 std::cout <<
" GblPoint::getDerivatives failed to invert matrix: "
410 << matW << std::endl;
412 <<
" Possible reason for singular matrix: multiple GblPoints at same arc-length"
414 throw std::overflow_error(
"Singular matrix inversion exception");
444 <<
" local derivatives";
448 <<
" global derivatives";
453 std::cout <<
" Measurement" << std::endl;
465 std::cout <<
" Local Derivatives:" << std::endl;
474 std::cout <<
" Global Derivatives:" << std::endl;
void getDerivatives(int aDirection, SMatrix22 &matW, SMatrix22 &matWJ, SVector2 &vecWd) const
Retrieve derivatives of local track model.
void addMeasurement(const TMatrixD &aProjection, const TVectorD &aResiduals, const TVectorD &aPrecision, double minPrecision=0.)
Add a measurement to a point.
SMatrix55 prevJacobian
Jacobian to previous scatterer (or first measurement)
void getScatTransformation(TMatrixD &aTransformation) const
Get scatterer transformation (from diagonalization).
void setLabel(unsigned int aLabel)
Define label of point (by GBLTrajectory constructor)
TMatrixD globalDerivatives
Derivatives of measurement vs additional global (MP-II) parameters.
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)
bool hasScatterer() const
Check for scatterer at a point.
std::vector< int > getGlobalLabels() const
Retrieve global derivatives labels from a point.
unsigned int getLabel() const
Retrieve label of point.
void addLocals(const TMatrixD &aDerivatives)
Add local derivatives to a point.
ROOT::Math::SVector< double, 2 > SVector2
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
SVector5 measResiduals
Measurement residuals.
int getOffset() const
Retrieve offset for point.
ROOT::Math::SMatrix< double, 5, 5 > SMatrix55
unsigned int hasMeasurement() const
Check for measurement at a point.
const TMatrixD & getGlobalDerivatives() const
Retrieve global derivatives from a point.
void getMeasTransformation(TMatrixD &aTransformation) const
Get measurement transformation (from diagonalization).
ROOT::Math::SVector< double, 5 > SVector5
ROOT::Math::SMatrix< double, 3, 2 > SMatrix32
SVector2 scatPrecision
Scattering precision (diagonal of inverse covariance matrix)
void printPoint(unsigned int level=0) const
Print GblPoint.
ROOT::Math::SMatrix< double, 2 > SMatrix22
std::vector< int > globalLabels
Labels of global (MP-II) derivatives.
void addScatterer(const TVectorD &aResiduals, const TVectorD &aPrecision)
Add a (thin) scatterer to a point.
void addGlobals(const std::vector< int > &aLabels, const TMatrixD &aDerivatives)
Add global derivatives to a point.
unsigned int getNumLocals() const
Retrieve number of local derivatives from a point.
SMatrix55 nextJacobian
Jacobian to next scatterer (or last measurement)
SVector5 measPrecision
Measurement precision (diagonal of inverse covariance matrix)
GblPoint(const TMatrixD &aJacobian)
Create a point.
TMatrixD measTransformation
Transformation of diagonalization (of meas. precision matrix)
void getScatterer(SMatrix22 &aTransformation, SVector2 &aResiduals, SVector2 &aPrecision) const
Retrieve scatterer of a point.
void getMeasurement(SMatrix55 &aProjection, SVector5 &aResiduals, SVector5 &aPrecision) const
Retrieve measurement of a point.
SVector2 scatResiduals
Scattering residuals (initial kinks if iterating)
void addNextJacobian(const SMatrix55 &aJac)
Define jacobian to next scatterer (by GBLTrajectory constructor)
TMatrixD localDerivatives
Derivatives of measurement vs additional local (fit) parameters.
unsigned int theLabel
Label identifying point.
SMatrix55 p2pJacobian
Point-to-point jacobian from previous point.
volatile std::atomic< bool > shutdown_flag false
const TMatrixD & getLocalDerivatives() const
Retrieve local derivatives from a point.
SMatrix55 measProjection
Projection from measurement to local system.
ROOT::Math::SMatrix< double, 2, 3 > SMatrix23
SMatrix22 scatTransformation
Transformation of diagonalization (of scat. precision matrix)
const SMatrix55 & getP2pJacobian() const
Retrieve point-to-(previous)point jacobian.
void addPrevJacobian(const SMatrix55 &aJac)
Define jacobian to previous scatterer (by GBLTrajectory constructor)
ROOT::Math::SMatrix< double, 3 > SMatrix33
unsigned int getNumGlobals() const
Retrieve number of global derivatives from a point.