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;
52 for (
unsigned int i = 0; i <
measDim; ++i) {
55 aPrecision[i] >= minPrecision ? aPrecision[i] : 0.);
56 for (
unsigned int j = 0; j <
measDim; ++j) {
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;
85 for (
unsigned int i = 0; i <
measDim; ++i) {
88 transPrecision[i] >= minPrecision ? transPrecision[i] : 0.);
89 for (
unsigned int j = 0; j <
measDim; ++j) {
104 const TVectorD &aPrecision,
double minPrecision) {
105 measDim = aResiduals.GetNrows();
106 unsigned int iOff = 5 -
measDim;
107 for (
unsigned int i = 0; i <
measDim; ++i) {
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;
135 for (
unsigned int i = 0; i <
measDim; ++i) {
138 transPrecision[i] >= minPrecision ? transPrecision[i] : 0.);
139 for (
unsigned int j = 0; j <
measDim; ++j) {
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");
426 std::cout <<
" GblPoint";
428 std::cout <<
", label " <<
theLabel;
434 std::cout <<
", " <<
measDim <<
" measurements";
437 std::cout <<
", scatterer";
440 std::cout <<
", diagonalized";
444 <<
" local derivatives";
448 <<
" global derivatives";
450 std::cout << std::endl;
453 std::cout <<
" Measurement" << std::endl;
460 std::cout <<
" Scatterer" << std::endl;
465 std::cout <<
" Local Derivatives:" << std::endl;
469 std::cout <<
" Global Labels:";
470 for (
unsigned int i = 0; i <
globalLabels.size(); ++i) {
473 std::cout << std::endl;
474 std::cout <<
" Global Derivatives:" << std::endl;
477 std::cout <<
" Jacobian " << std::endl;
478 std::cout <<
" Point-to-point " << std::endl <<
p2pJacobian
481 std::cout <<
" To previous offset " << std::endl <<
prevJacobian
483 std::cout <<
" To next offset " << std::endl <<
nextJacobian
void getDerivatives(int aDirection, SMatrix22 &matW, SMatrix22 &matWJ, SVector2 &vecWd) const
void addLocals(const TMatrixD &aDerivatives)
ROOT::Math::SMatrix< double, 5, 5 > SMatrix55
ROOT::Math::SMatrix< double, 2 > SMatrix22
void addNextJacobian(const SMatrix55 &aJac)
bool hasScatterer() const
SVector5 measResiduals
Measurement residuals.
ROOT::Math::SVector< double, 2 > SVector2
void getMeasurement(SMatrix55 &aProjection, SVector5 &aResiduals, SVector5 &aPrecision) const
Retrieve measurement of a point.
SVector2 scatResiduals
Scattering residuals (initial kinks if iterating)
ROOT::Math::SMatrix< double, 2, 3 > SMatrix23
unsigned int theLabel
Label identifying point.
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)
const TMatrixD & getGlobalDerivatives() const
const TMatrixD & getLocalDerivatives() const
ROOT::Math::SVector< double, 5 > SVector5
bool transFlag
Transformation exists?
SMatrix55 p2pJacobian
Point-to-point jacobian from previous point.
void addGlobals(const std::vector< int > &aLabels, const TMatrixD &aDerivatives)
TMatrixD globalDerivatives
Derivatives of measurement vs additional global (MP-II) parameters.
unsigned int hasMeasurement() const
Check for measurement at a point.
SMatrix55 measProjection
Projection from measurement to local system.
int theOffset
Offset number at point if not negative (else interpolation needed)
std::vector< int > globalLabels
Labels of global (MP-II) derivatives.
TMatrixD localDerivatives
Derivatives of measurement vs additional local (fit) parameters.
ROOT::Math::SMatrix< double, 3, 2 > SMatrix32
void setLabel(unsigned int aLabel)
SMatrix22 scatTransformation
Transformation of diagonalization (of scat. precision matrix)
Namespace for the general broken lines package.
SMatrix55 prevJacobian
Jacobian to previous scatterer (or first measurement)
void addPrevJacobian(const SMatrix55 &aJac)
unsigned int getNumGlobals() const
GblPoint(const TMatrixD &aJacobian)
Create a point.
void getScatTransformation(TMatrixD &aTransformation) const
std::vector< int > getGlobalLabels() const
TMatrixD measTransformation
Transformation of diagonalization (of meas. precision matrix)
void addScatterer(const TVectorD &aResiduals, const TVectorD &aPrecision)
Add a (thin) scatterer to a point.
ROOT::Math::SMatrix< double, 3 > SMatrix33
bool scatFlag
Scatterer present?
SVector5 measPrecision
Measurement precision (diagonal of inverse covariance matrix)
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
SVector2 scatPrecision
Scattering precision (diagonal of inverse covariance matrix)
void getMeasTransformation(TMatrixD &aTransformation) const
Get measurement transformation (from diagonalization).
unsigned int getLabel() const
void setOffset(int anOffset)
void printPoint(unsigned int level=0) const
unsigned int getNumLocals() const
void getScatterer(SMatrix22 &aTransformation, SVector2 &aResiduals, SVector2 &aPrecision) const
const SMatrix55 & getP2pJacobian() const