44 for (
unsigned int i = 0; i < 5; ++i) {
45 for (
unsigned int j = 0; j < 5; ++j) {
70 const TVectorD &aResiduals,
const TVectorD &aPrecision,
71 double minPrecision) {
72 measDim = aResiduals.GetNrows();
73 unsigned int iOff = 5 -
measDim;
74 for (
unsigned int i = 0; i <
measDim; ++i) {
77 aPrecision[i] >= minPrecision ? aPrecision[i] : 0.);
78 for (
unsigned int j = 0; j <
measDim; ++j) {
95 const TVectorD &aResiduals,
const TMatrixDSym &aPrecision,
96 double minPrecision) {
97 measDim = aResiduals.GetNrows();
98 TMatrixDSymEigen measEigen(aPrecision);
104 TVectorD transPrecision = measEigen.GetEigenValues();
106 unsigned int iOff = 5 -
measDim;
107 for (
unsigned int i = 0; i <
measDim; ++i) {
110 transPrecision[i] >= minPrecision ? transPrecision[i] : 0.);
111 for (
unsigned int j = 0; j <
measDim; ++j) {
126 const TVectorD &aPrecision,
double minPrecision) {
127 measDim = aResiduals.GetNrows();
128 unsigned int iOff = 5 -
measDim;
129 for (
unsigned int i = 0; i <
measDim; ++i) {
132 aPrecision[i] >= minPrecision ? aPrecision[i] : 0.);
147 const TMatrixDSym &aPrecision,
double minPrecision) {
148 measDim = aResiduals.GetNrows();
149 TMatrixDSymEigen measEigen(aPrecision);
155 TVectorD transPrecision = measEigen.GetEigenValues();
156 unsigned int iOff = 5 -
measDim;
157 for (
unsigned int i = 0; i <
measDim; ++i) {
160 transPrecision[i] >= minPrecision ? transPrecision[i] : 0.);
161 for (
unsigned int j = 0; j <
measDim; ++j) {
198 aTransformation.UnitMatrix();
211 const TVectorD &aPrecision) {
237 const TMatrixDSym &aPrecision) {
239 TMatrixDSymEigen scatEigen(aPrecision);
240 TMatrixD aTransformation = scatEigen.GetEigenVectors();
242 TVectorD transResiduals = aTransformation * aResiduals;
243 TVectorD transPrecision = scatEigen.GetEigenValues();
244 for (
unsigned int i = 0; i < 2; ++i) {
247 for (
unsigned int j = 0; j < 2; ++j) {
276 aTransformation.ResizeTo(2, 2);
278 for (
unsigned int i = 0; i < 2; ++i) {
279 for (
unsigned int j = 0; j < 2; ++j) {
284 aTransformation.UnitMatrix();
321 const TMatrixD &aDerivatives) {
390 * aJac.Sub<
SMatrix33>(0, 0).InverseFast(ifail);
420 if (aDirection < 1) {
430 if (!matW.InvertFast()) {
431 std::cout <<
" GblPoint::getDerivatives failed to invert matrix: "
432 << matW << std::endl;
434 <<
" Possible reason for singular matrix: multiple GblPoints at same arc-length"
436 throw std::overflow_error(
"Singular matrix inversion exception");
448 std::cout <<
" GblPoint";
450 std::cout <<
", label " <<
theLabel;
456 std::cout <<
", " <<
measDim <<
" measurements";
459 std::cout <<
", scatterer";
462 std::cout <<
", diagonalized";
466 <<
" local derivatives";
470 <<
" global derivatives";
472 std::cout << std::endl;
475 std::cout <<
" Measurement" << std::endl;
482 std::cout <<
" Scatterer" << std::endl;
487 std::cout <<
" Local Derivatives:" << std::endl;
491 std::cout <<
" Global Labels:";
492 for (
unsigned int i = 0; i <
globalLabels.size(); ++i) {
495 std::cout << std::endl;
496 std::cout <<
" Global Derivatives:" << std::endl;
499 std::cout <<
" Jacobian " << std::endl;
500 std::cout <<
" Point-to-point " << std::endl <<
p2pJacobian
503 std::cout <<
" To previous offset " << std::endl <<
prevJacobian
505 std::cout <<
" To next offset " << std::endl <<
nextJacobian
ROOT::Math::SMatrix< double, 5, 5 > SMatrix55
ROOT::Math::SMatrix< double, 3 > SMatrix33
ROOT::Math::SVector< double, 5 > SVector5
ROOT::Math::SVector< double, 2 > SVector2
ROOT::Math::SMatrix< double, 3, 2 > SMatrix32
ROOT::Math::SMatrix< double, 2 > SMatrix22
ROOT::Math::SMatrix< double, 2, 3 > SMatrix23
GblPoint(const TMatrixD &aJacobian)
Create a point.
std::vector< int > getGlobalLabels() const
Retrieve global derivatives labels from a point.
TMatrixD localDerivatives
Derivatives of measurement vs additional local (fit) parameters.
std::vector< int > globalLabels
Labels of global (MP-II) derivatives.
void addMeasurement(const TMatrixD &aProjection, const TVectorD &aResiduals, const TVectorD &aPrecision, double minPrecision=0.)
Add a measurement to a point.
SMatrix55 nextJacobian
Jacobian to next scatterer (or last measurement)
void getScatterer(SMatrix22 &aTransformation, SVector2 &aResiduals, SVector2 &aPrecision) const
Retrieve scatterer of a point.
TMatrixD measTransformation
Transformation of diagonalization (of meas. precision matrix)
void printPoint(unsigned int level=0) const
Print GblPoint.
void getDerivatives(int aDirection, SMatrix22 &matW, SMatrix22 &matWJ, SVector2 &vecWd) const
Retrieve derivatives of local track model.
bool scatFlag
Scatterer present?
void addScatterer(const TVectorD &aResiduals, const TVectorD &aPrecision)
Add a (thin) scatterer to a point.
unsigned int hasMeasurement() const
Check for measurement at a point.
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
const SMatrix55 & getP2pJacobian() const
Retrieve point-to-(previous)point jacobian.
bool transFlag
Transformation exists?
bool hasScatterer() const
Check for scatterer at a point.
void getMeasTransformation(TMatrixD &aTransformation) const
Get measurement transformation (from diagonalization).
const TMatrixD & getGlobalDerivatives() const
Retrieve global derivatives from a point.
void getMeasurement(SMatrix55 &aProjection, SVector5 &aResiduals, SVector5 &aPrecision) const
Retrieve measurement of a point.
void addLocals(const TMatrixD &aDerivatives)
Add local derivatives to a point.
SVector2 scatResiduals
Scattering residuals (initial kinks if iterating)
unsigned int theLabel
Label identifying point.
unsigned int getNumLocals() const
Retrieve number of local derivatives from a point.
int theOffset
Offset number at point if not negative (else interpolation needed)
void addGlobals(const std::vector< int > &aLabels, const TMatrixD &aDerivatives)
Add global derivatives to a point.
void addNextJacobian(const SMatrix55 &aJac)
Define jacobian to next scatterer (by GBLTrajectory constructor)
void setLabel(unsigned int aLabel)
Define label of point (by GBLTrajectory constructor)
TMatrixD globalDerivatives
Derivatives of measurement vs additional global (MP-II) parameters.
void addPrevJacobian(const SMatrix55 &aJac)
Define jacobian to previous scatterer (by GBLTrajectory constructor)
unsigned int getLabel() const
Retrieve label of point.
SMatrix22 scatTransformation
Transformation of diagonalization (of scat. precision matrix)
SVector2 scatPrecision
Scattering precision (diagonal of inverse covariance matrix)
const TMatrixD & getLocalDerivatives() const
Retrieve local derivatives from a point.
SVector5 measPrecision
Measurement precision (diagonal of inverse covariance matrix)
SMatrix55 measProjection
Projection from measurement to local system.
SMatrix55 p2pJacobian
Point-to-point jacobian from previous point.
void setOffset(int anOffset)
Define offset for point (by GBLTrajectory constructor)
unsigned int getNumGlobals() const
Retrieve number of global derivatives from a point.
SVector5 measResiduals
Measurement residuals.
SMatrix55 prevJacobian
Jacobian to previous scatterer (or first measurement)
void getScatTransformation(TMatrixD &aTransformation) const
Get scatterer transformation (from diagonalization).
int getOffset() const
Retrieve offset for point.
Namespace for the general broken lines package.