test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
gbl::GblPoint Class Reference

Point on trajectory. More...

#include <GblPoint.h>

Public Member Functions

void addGlobals (const std::vector< int > &aLabels, const TMatrixD &aDerivatives)
 Add global derivatives to a point. More...
 
void addLocals (const TMatrixD &aDerivatives)
 Add local derivatives to a point. More...
 
void addMeasurement (const TMatrixD &aProjection, const TVectorD &aResiduals, const TVectorD &aPrecision, double minPrecision=0.)
 Add a measurement to a point. More...
 
void addMeasurement (const TMatrixD &aProjection, const TVectorD &aResiduals, const TMatrixDSym &aPrecision, double minPrecision=0.)
 Add a measurement to a point. More...
 
void addMeasurement (const TVectorD &aResiduals, const TVectorD &aPrecision, double minPrecision=0.)
 Add a measurement to a point. More...
 
void addMeasurement (const TVectorD &aResiduals, const TMatrixDSym &aPrecision, double minPrecision=0.)
 Add a measurement to a point. More...
 
void addNextJacobian (const SMatrix55 &aJac)
 Define jacobian to next scatterer (by GBLTrajectory constructor) More...
 
void addPrevJacobian (const SMatrix55 &aJac)
 Define jacobian to previous scatterer (by GBLTrajectory constructor) More...
 
void addScatterer (const TVectorD &aResiduals, const TVectorD &aPrecision)
 Add a (thin) scatterer to a point. More...
 
void addScatterer (const TVectorD &aResiduals, const TMatrixDSym &aPrecision)
 Add a (thin) scatterer to a point. More...
 
 GblPoint (const TMatrixD &aJacobian)
 Create a point. More...
 
 GblPoint (const SMatrix55 &aJacobian)
 
void getDerivatives (int aDirection, SMatrix22 &matW, SMatrix22 &matWJ, SVector2 &vecWd) const
 Retrieve derivatives of local track model. More...
 
const TMatrixD & getGlobalDerivatives () const
 Retrieve global derivatives from a point. More...
 
std::vector< int > getGlobalLabels () const
 Retrieve global derivatives labels from a point. More...
 
unsigned int getLabel () const
 Retrieve label of point. More...
 
const TMatrixD & getLocalDerivatives () const
 Retrieve local derivatives from a point. More...
 
void getMeasTransformation (TMatrixD &aTransformation) const
 Get measurement transformation (from diagonalization). More...
 
void getMeasurement (SMatrix55 &aProjection, SVector5 &aResiduals, SVector5 &aPrecision) const
 Retrieve measurement of a point. More...
 
unsigned int getNumGlobals () const
 Retrieve number of global derivatives from a point. More...
 
unsigned int getNumLocals () const
 Retrieve number of local derivatives from a point. More...
 
int getOffset () const
 Retrieve offset for point. More...
 
const SMatrix55getP2pJacobian () const
 Retrieve point-to-(previous)point jacobian. More...
 
void getScatterer (SMatrix22 &aTransformation, SVector2 &aResiduals, SVector2 &aPrecision) const
 Retrieve scatterer of a point. More...
 
void getScatTransformation (TMatrixD &aTransformation) const
 Get scatterer transformation (from diagonalization). More...
 
unsigned int hasMeasurement () const
 Check for measurement at a point. More...
 
bool hasScatterer () const
 Check for scatterer at a point. More...
 
void printPoint (unsigned int level=0) const
 Print GblPoint. More...
 
void setLabel (unsigned int aLabel)
 Define label of point (by GBLTrajectory constructor) More...
 
void setOffset (int anOffset)
 Define offset for point (by GBLTrajectory constructor) More...
 
virtual ~GblPoint ()
 

Private Attributes

TMatrixD globalDerivatives
 Derivatives of measurement vs additional global (MP-II) parameters. More...
 
std::vector< int > globalLabels
 Labels of global (MP-II) derivatives. More...
 
TMatrixD localDerivatives
 Derivatives of measurement vs additional local (fit) parameters. More...
 
unsigned int measDim
 Dimension of measurement (1-5), 0 indicates absence of measurement. More...
 
SVector5 measPrecision
 Measurement precision (diagonal of inverse covariance matrix) More...
 
SMatrix55 measProjection
 Projection from measurement to local system. More...
 
SVector5 measResiduals
 Measurement residuals. More...
 
TMatrixD measTransformation
 Transformation of diagonalization (of meas. precision matrix) More...
 
SMatrix55 nextJacobian
 Jacobian to next scatterer (or last measurement) More...
 
SMatrix55 p2pJacobian
 Point-to-point jacobian from previous point. More...
 
SMatrix55 prevJacobian
 Jacobian to previous scatterer (or first measurement) More...
 
bool scatFlag
 Scatterer present? More...
 
SVector2 scatPrecision
 Scattering precision (diagonal of inverse covariance matrix) More...
 
SVector2 scatResiduals
 Scattering residuals (initial kinks if iterating) More...
 
SMatrix22 scatTransformation
 Transformation of diagonalization (of scat. precision matrix) More...
 
unsigned int theLabel
 Label identifying point. More...
 
int theOffset
 Offset number at point if not negative (else interpolation needed) More...
 
bool transFlag
 Transformation exists? More...
 

Detailed Description

Point on trajectory.

User supplied point on (initial) trajectory.

Must have jacobian for propagation from previous point. May have:

  1. Measurement (1D - 5D)
  2. Scatterer (thin, 2D kinks)
  3. Additional local parameters (with derivatives). Fitted together with track parameters.
  4. Additional global parameters (with labels and derivatives). Not fitted, only passed on to (binary) file for fitting with Millepede-II.

Definition at line 46 of file GblPoint.h.

Constructor & Destructor Documentation

gbl::GblPoint::GblPoint ( const TMatrixD &  aJacobian)

Create a point.

Create point on (initial) trajectory. Needs transformation jacobian from previous point.

Parameters
[in]aJacobianTransformation jacobian from previous point

Definition at line 18 of file GblPoint.cc.

References i, j, and p2pJacobian.

18  :
21 
22  for (unsigned int i = 0; i < 5; ++i) {
23  for (unsigned int j = 0; j < 5; ++j) {
24  p2pJacobian(i, j) = aJacobian(i, j);
25  }
26  }
27 }
int i
Definition: DBlmapReader.cc:9
TMatrixD globalDerivatives
Derivatives of measurement vs additional global (MP-II) parameters.
Definition: GblPoint.h:107
bool transFlag
Transformation exists?
Definition: GblPoint.h:99
bool scatFlag
Scatterer present?
Definition: GblPoint.h:101
int theOffset
Offset number at point if not negative (else interpolation needed)
Definition: GblPoint.h:91
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
Definition: GblPoint.h:95
std::vector< int > globalLabels
Labels of global (MP-II) derivatives.
Definition: GblPoint.h:106
int j
Definition: DBlmapReader.cc:9
TMatrixD measTransformation
Transformation of diagonalization (of meas. precision matrix)
Definition: GblPoint.h:100
TMatrixD localDerivatives
Derivatives of measurement vs additional local (fit) parameters.
Definition: GblPoint.h:105
unsigned int theLabel
Label identifying point.
Definition: GblPoint.h:90
SMatrix55 p2pJacobian
Point-to-point jacobian from previous point.
Definition: GblPoint.h:92
gbl::GblPoint::GblPoint ( const SMatrix55 aJacobian)

Definition at line 29 of file GblPoint.cc.

29  :
30  theLabel(0), theOffset(0), p2pJacobian(aJacobian), measDim(0), transFlag(
32 
33 }
TMatrixD globalDerivatives
Derivatives of measurement vs additional global (MP-II) parameters.
Definition: GblPoint.h:107
bool transFlag
Transformation exists?
Definition: GblPoint.h:99
bool scatFlag
Scatterer present?
Definition: GblPoint.h:101
int theOffset
Offset number at point if not negative (else interpolation needed)
Definition: GblPoint.h:91
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
Definition: GblPoint.h:95
std::vector< int > globalLabels
Labels of global (MP-II) derivatives.
Definition: GblPoint.h:106
TMatrixD measTransformation
Transformation of diagonalization (of meas. precision matrix)
Definition: GblPoint.h:100
TMatrixD localDerivatives
Derivatives of measurement vs additional local (fit) parameters.
Definition: GblPoint.h:105
unsigned int theLabel
Label identifying point.
Definition: GblPoint.h:90
SMatrix55 p2pJacobian
Point-to-point jacobian from previous point.
Definition: GblPoint.h:92
gbl::GblPoint::~GblPoint ( )
virtual

Definition at line 35 of file GblPoint.cc.

35  {
36 }

Member Function Documentation

void gbl::GblPoint::addGlobals ( const std::vector< int > &  aLabels,
const TMatrixD &  aDerivatives 
)

Add global derivatives to a point.

Point needs to have a measurement.

Parameters
[in]aLabelsGlobal derivatives labels
[in]aDerivativesGlobal derivatives (matrix)

Definition at line 298 of file GblPoint.cc.

References globalDerivatives, globalLabels, measDim, measTransformation, and transFlag.

Referenced by MillePedeAlignmentAlgorithm::addGlobalData().

299  {
300  if (measDim) {
301  globalLabels = aLabels;
302  globalDerivatives.ResizeTo(aDerivatives);
303  if (transFlag) {
304  globalDerivatives = measTransformation * aDerivatives;
305  } else {
306  globalDerivatives = aDerivatives;
307  }
308 
309  }
310 }
TMatrixD globalDerivatives
Derivatives of measurement vs additional global (MP-II) parameters.
Definition: GblPoint.h:107
bool transFlag
Transformation exists?
Definition: GblPoint.h:99
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
Definition: GblPoint.h:95
std::vector< int > globalLabels
Labels of global (MP-II) derivatives.
Definition: GblPoint.h:106
TMatrixD measTransformation
Transformation of diagonalization (of meas. precision matrix)
Definition: GblPoint.h:100
void gbl::GblPoint::addLocals ( const TMatrixD &  aDerivatives)

Add local derivatives to a point.

Point needs to have a measurement.

Parameters
[in]aDerivativesLocal derivatives (matrix)

Definition at line 271 of file GblPoint.cc.

References localDerivatives, measDim, measTransformation, and transFlag.

271  {
272  if (measDim) {
273  localDerivatives.ResizeTo(aDerivatives);
274  if (transFlag) {
275  localDerivatives = measTransformation * aDerivatives;
276  } else {
277  localDerivatives = aDerivatives;
278  }
279  }
280 }
bool transFlag
Transformation exists?
Definition: GblPoint.h:99
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
Definition: GblPoint.h:95
TMatrixD measTransformation
Transformation of diagonalization (of meas. precision matrix)
Definition: GblPoint.h:100
TMatrixD localDerivatives
Derivatives of measurement vs additional local (fit) parameters.
Definition: GblPoint.h:105
void gbl::GblPoint::addMeasurement ( const TMatrixD &  aProjection,
const TVectorD &  aResiduals,
const TVectorD &  aPrecision,
double  minPrecision = 0. 
)

Add a measurement to a point.

Add measurement (in meas. system) with diagonal precision (inverse covariance) matrix. ((up to) 2D: position, 4D: slope+position, 5D: curvature+slope+position)

Parameters
[in]aProjectionProjection from local to measurement system
[in]aResidualsMeasurement residuals
[in]aPrecisionMeasurement precision (diagonal)
[in]minPrecisionMinimal precision to accept measurement

Definition at line 47 of file GblPoint.cc.

References i, j, measDim, measPrecision, measProjection, and measResiduals.

Referenced by ReferenceTrajectory::addMaterialEffectsCurvlinGbl(), and ReferenceTrajectory::addMaterialEffectsLocalGbl().

49  {
50  measDim = aResiduals.GetNrows();
51  unsigned int iOff = 5 - measDim;
52  for (unsigned int i = 0; i < measDim; ++i) {
53  measResiduals(iOff + i) = aResiduals[i];
54  measPrecision(iOff + i) = (
55  aPrecision[i] >= minPrecision ? aPrecision[i] : 0.);
56  for (unsigned int j = 0; j < measDim; ++j) {
57  measProjection(iOff + i, iOff + j) = aProjection(i, j);
58  }
59  }
60 }
int i
Definition: DBlmapReader.cc:9
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
Definition: GblPoint.h:95
SVector5 measResiduals
Measurement residuals.
Definition: GblPoint.h:97
int j
Definition: DBlmapReader.cc:9
SVector5 measPrecision
Measurement precision (diagonal of inverse covariance matrix)
Definition: GblPoint.h:98
SMatrix55 measProjection
Projection from measurement to local system.
Definition: GblPoint.h:96
void gbl::GblPoint::addMeasurement ( const TMatrixD &  aProjection,
const TVectorD &  aResiduals,
const TMatrixDSym &  aPrecision,
double  minPrecision = 0. 
)

Add a measurement to a point.

Add measurement (in meas. system) with arbitrary precision (inverse covariance) matrix. Will be diagonalized. ((up to) 2D: position, 4D: slope+position, 5D: curvature+slope+position)

Parameters
[in]aProjectionProjection from local to measurement system
[in]aResidualsMeasurement residuals
[in]aPrecisionMeasurement precision (matrix)
[in]minPrecisionMinimal precision to accept measurement

Definition at line 72 of file GblPoint.cc.

References i, j, measDim, measPrecision, measProjection, measResiduals, measTransformation, and transFlag.

74  {
75  measDim = aResiduals.GetNrows();
76  TMatrixDSymEigen measEigen(aPrecision);
78  measTransformation = measEigen.GetEigenVectors();
80  transFlag = true;
81  TVectorD transResiduals = measTransformation * aResiduals;
82  TVectorD transPrecision = measEigen.GetEigenValues();
83  TMatrixD transProjection = measTransformation * aProjection;
84  unsigned int iOff = 5 - measDim;
85  for (unsigned int i = 0; i < measDim; ++i) {
86  measResiduals(iOff + i) = transResiduals[i];
87  measPrecision(iOff + i) = (
88  transPrecision[i] >= minPrecision ? transPrecision[i] : 0.);
89  for (unsigned int j = 0; j < measDim; ++j) {
90  measProjection(iOff + i, iOff + j) = transProjection(i, j);
91  }
92  }
93 }
int i
Definition: DBlmapReader.cc:9
bool transFlag
Transformation exists?
Definition: GblPoint.h:99
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
Definition: GblPoint.h:95
SVector5 measResiduals
Measurement residuals.
Definition: GblPoint.h:97
int j
Definition: DBlmapReader.cc:9
SVector5 measPrecision
Measurement precision (diagonal of inverse covariance matrix)
Definition: GblPoint.h:98
TMatrixD measTransformation
Transformation of diagonalization (of meas. precision matrix)
Definition: GblPoint.h:100
SMatrix55 measProjection
Projection from measurement to local system.
Definition: GblPoint.h:96
void gbl::GblPoint::addMeasurement ( const TVectorD &  aResiduals,
const TVectorD &  aPrecision,
double  minPrecision = 0. 
)

Add a measurement to a point.

Add measurement in local system with diagonal precision (inverse covariance) matrix. ((up to) 2D: position, 4D: slope+position, 5D: curvature+slope+position)

Parameters
[in]aResidualsMeasurement residuals
[in]aPrecisionMeasurement precision (diagonal)
[in]minPrecisionMinimal precision to accept measurement

Definition at line 103 of file GblPoint.cc.

References i, measDim, measPrecision, measProjection, and measResiduals.

104  {
105  measDim = aResiduals.GetNrows();
106  unsigned int iOff = 5 - measDim;
107  for (unsigned int i = 0; i < measDim; ++i) {
108  measResiduals(iOff + i) = aResiduals[i];
109  measPrecision(iOff + i) = (
110  aPrecision[i] >= minPrecision ? aPrecision[i] : 0.);
111  }
112  measProjection = ROOT::Math::SMatrixIdentity();
113 }
int i
Definition: DBlmapReader.cc:9
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
Definition: GblPoint.h:95
SVector5 measResiduals
Measurement residuals.
Definition: GblPoint.h:97
SVector5 measPrecision
Measurement precision (diagonal of inverse covariance matrix)
Definition: GblPoint.h:98
SMatrix55 measProjection
Projection from measurement to local system.
Definition: GblPoint.h:96
void gbl::GblPoint::addMeasurement ( const TVectorD &  aResiduals,
const TMatrixDSym &  aPrecision,
double  minPrecision = 0. 
)

Add a measurement to a point.

Add measurement in local system with arbitrary precision (inverse covariance) matrix. Will be diagonalized. ((up to) 2D: position, 4D: slope+position, 5D: curvature+slope+position)

Parameters
[in]aResidualsMeasurement residuals
[in]aPrecisionMeasurement precision (matrix)
[in]minPrecisionMinimal precision to accept measurement

Definition at line 124 of file GblPoint.cc.

References i, j, measDim, measPrecision, measProjection, measResiduals, measTransformation, and transFlag.

125  {
126  measDim = aResiduals.GetNrows();
127  TMatrixDSymEigen measEigen(aPrecision);
129  measTransformation = measEigen.GetEigenVectors();
130  measTransformation.T();
131  transFlag = true;
132  TVectorD transResiduals = measTransformation * aResiduals;
133  TVectorD transPrecision = measEigen.GetEigenValues();
134  unsigned int iOff = 5 - measDim;
135  for (unsigned int i = 0; i < measDim; ++i) {
136  measResiduals(iOff + i) = transResiduals[i];
137  measPrecision(iOff + i) = (
138  transPrecision[i] >= minPrecision ? transPrecision[i] : 0.);
139  for (unsigned int j = 0; j < measDim; ++j) {
140  measProjection(iOff + i, iOff + j) = measTransformation(i, j);
141  }
142  }
143 }
int i
Definition: DBlmapReader.cc:9
bool transFlag
Transformation exists?
Definition: GblPoint.h:99
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
Definition: GblPoint.h:95
SVector5 measResiduals
Measurement residuals.
Definition: GblPoint.h:97
int j
Definition: DBlmapReader.cc:9
SVector5 measPrecision
Measurement precision (diagonal of inverse covariance matrix)
Definition: GblPoint.h:98
TMatrixD measTransformation
Transformation of diagonalization (of meas. precision matrix)
Definition: GblPoint.h:100
SMatrix55 measProjection
Projection from measurement to local system.
Definition: GblPoint.h:96
void gbl::GblPoint::addNextJacobian ( const SMatrix55 aJac)

Define jacobian to next scatterer (by GBLTrajectory constructor)

Parameters
[in]aJacJacobian

Definition at line 379 of file GblPoint.cc.

References nextJacobian.

Referenced by gbl::GblTrajectory::calcJacobians().

379  {
380  nextJacobian = aJac;
381 }
SMatrix55 nextJacobian
Jacobian to next scatterer (or last measurement)
Definition: GblPoint.h:94
void gbl::GblPoint::addPrevJacobian ( const SMatrix55 aJac)

Define jacobian to previous scatterer (by GBLTrajectory constructor)

Parameters
[in]aJacJacobian

Definition at line 362 of file GblPoint.cc.

References prevJacobian.

362  {
363  int ifail = 0;
364 // to optimize: need only two last rows of inverse
365 // prevJacobian = aJac.InverseFast(ifail);
366 // block matrix algebra
367  SMatrix23 CA = aJac.Sub<SMatrix23>(3, 0)
368  * aJac.Sub<SMatrix33>(0, 0).InverseFast(ifail); // C*A^-1
369  SMatrix22 DCAB = aJac.Sub<SMatrix22>(3, 3) - CA * aJac.Sub<SMatrix32>(0, 3); // D - C*A^-1 *B
370  DCAB.InvertFast();
371  prevJacobian.Place_at(DCAB, 3, 3);
372  prevJacobian.Place_at(-DCAB * CA, 3, 0);
373 }
SMatrix55 prevJacobian
Jacobian to previous scatterer (or first measurement)
Definition: GblPoint.h:93
ROOT::Math::SMatrix< double, 3, 2 > SMatrix32
Definition: GblPoint.h:26
ROOT::Math::SMatrix< double, 2 > SMatrix22
Definition: GblPoint.h:22
ROOT::Math::SMatrix< double, 2, 3 > SMatrix23
Definition: GblPoint.h:23
ROOT::Math::SMatrix< double, 3 > SMatrix33
Definition: GblPoint.h:27
void gbl::GblPoint::addScatterer ( const TVectorD &  aResiduals,
const TVectorD &  aPrecision 
)

Add a (thin) scatterer to a point.

Add scatterer with diagonal precision (inverse covariance) matrix. Changes local track direction.

Parameters
[in]aResidualsScatterer residuals
[in]aPrecisionScatterer precision (diagonal of inverse covariance matrix)

Definition at line 188 of file GblPoint.cc.

References scatFlag, scatPrecision, scatResiduals, and scatTransformation.

Referenced by ReferenceTrajectory::addMaterialEffectsCurvlinGbl(), and ReferenceTrajectory::addMaterialEffectsLocalGbl().

189  {
190  scatFlag = true;
191  scatResiduals(0) = aResiduals[0];
192  scatResiduals(1) = aResiduals[1];
193  scatPrecision(0) = aPrecision[0];
194  scatPrecision(1) = aPrecision[1];
195  scatTransformation = ROOT::Math::SMatrixIdentity();
196 }
bool scatFlag
Scatterer present?
Definition: GblPoint.h:101
SVector2 scatPrecision
Scattering precision (diagonal of inverse covariance matrix)
Definition: GblPoint.h:104
SVector2 scatResiduals
Scattering residuals (initial kinks if iterating)
Definition: GblPoint.h:103
SMatrix22 scatTransformation
Transformation of diagonalization (of scat. precision matrix)
Definition: GblPoint.h:102
void gbl::GblPoint::addScatterer ( const TVectorD &  aResiduals,
const TMatrixDSym &  aPrecision 
)

Add a (thin) scatterer to a point.

Add scatterer with arbitrary precision (inverse covariance) matrix. Will be diagonalized. Changes local track direction.

The precision matrix for the local slopes is defined by the angular scattering error theta_0 and the scalar products c_1, c_2 of the offset directions in the local frame with the track direction:

       (1 - c_1*c_1 - c_2*c_2)   |  1 - c_1*c_1     - c_1*c_2  |
  P =  ----------------------- * |                             |
           theta_0*theta_0       |    - c_1*c_2   1 - c_2*c_2  |
Parameters
[in]aResidualsScatterer residuals
[in]aPrecisionScatterer precision (matrix)

Definition at line 214 of file GblPoint.cc.

References i, j, scatFlag, scatPrecision, scatResiduals, and scatTransformation.

215  {
216  scatFlag = true;
217  TMatrixDSymEigen scatEigen(aPrecision);
218  TMatrixD aTransformation = scatEigen.GetEigenVectors();
219  aTransformation.T();
220  TVectorD transResiduals = aTransformation * aResiduals;
221  TVectorD transPrecision = scatEigen.GetEigenValues();
222  for (unsigned int i = 0; i < 2; ++i) {
223  scatResiduals(i) = transResiduals[i];
224  scatPrecision(i) = transPrecision[i];
225  for (unsigned int j = 0; j < 2; ++j) {
226  scatTransformation(i, j) = aTransformation(i, j);
227  }
228  }
229 }
int i
Definition: DBlmapReader.cc:9
bool scatFlag
Scatterer present?
Definition: GblPoint.h:101
SVector2 scatPrecision
Scattering precision (diagonal of inverse covariance matrix)
Definition: GblPoint.h:104
int j
Definition: DBlmapReader.cc:9
SVector2 scatResiduals
Scattering residuals (initial kinks if iterating)
Definition: GblPoint.h:103
SMatrix22 scatTransformation
Transformation of diagonalization (of scat. precision matrix)
Definition: GblPoint.h:102
void gbl::GblPoint::getDerivatives ( int  aDirection,
SMatrix22 matW,
SMatrix22 matWJ,
SVector2 vecWd 
) const

Retrieve derivatives of local track model.

Linearized track model: F_u(q/p,u',u) = J*u + S*u' + d*q/p, W is inverse of S, negated for backward propagation.

Parameters
[in]aDirectionPropagation direction (>0 forward, else backward)
[out]matWW
[out]matWJW*J
[out]vecWdW*d
Exceptions
std::overflow_error: matrix S is singular.

Definition at line 393 of file GblPoint.cc.

References gather_cfg::cout, nextJacobian, and prevJacobian.

Referenced by gbl::GblTrajectory::getFitToKinkJacobian(), and gbl::GblTrajectory::getFitToLocalJacobian().

394  {
395 
396  SMatrix22 matJ;
397  SVector2 vecd;
398  if (aDirection < 1) {
399  matJ = prevJacobian.Sub<SMatrix22>(3, 3);
400  matW = -prevJacobian.Sub<SMatrix22>(3, 1);
401  vecd = prevJacobian.SubCol<SVector2>(0, 3);
402  } else {
403  matJ = nextJacobian.Sub<SMatrix22>(3, 3);
404  matW = nextJacobian.Sub<SMatrix22>(3, 1);
405  vecd = nextJacobian.SubCol<SVector2>(0, 3);
406  }
407 
408  if (!matW.InvertFast()) {
409  std::cout << " GblPoint::getDerivatives failed to invert matrix: "
410  << matW << std::endl;
411  std::cout
412  << " Possible reason for singular matrix: multiple GblPoints at same arc-length"
413  << std::endl;
414  throw std::overflow_error("Singular matrix inversion exception");
415  }
416  matWJ = matW * matJ;
417  vecWd = matW * vecd;
418 
419 }
SMatrix55 prevJacobian
Jacobian to previous scatterer (or first measurement)
Definition: GblPoint.h:93
ROOT::Math::SVector< double, 2 > SVector2
Definition: GblPoint.h:29
ROOT::Math::SMatrix< double, 2 > SMatrix22
Definition: GblPoint.h:22
SMatrix55 nextJacobian
Jacobian to next scatterer (or last measurement)
Definition: GblPoint.h:94
tuple cout
Definition: gather_cfg.py:145
const TMatrixD & gbl::GblPoint::getGlobalDerivatives ( ) const

Retrieve global derivatives from a point.

Definition at line 323 of file GblPoint.cc.

References globalDerivatives.

323  {
324  return globalDerivatives;
325 }
TMatrixD globalDerivatives
Derivatives of measurement vs additional global (MP-II) parameters.
Definition: GblPoint.h:107
std::vector< int > gbl::GblPoint::getGlobalLabels ( ) const

Retrieve global derivatives labels from a point.

Definition at line 318 of file GblPoint.cc.

References globalLabels.

318  {
319  return globalLabels;
320 }
std::vector< int > globalLabels
Labels of global (MP-II) derivatives.
Definition: GblPoint.h:106
unsigned int gbl::GblPoint::getLabel ( ) const

Retrieve label of point.

Definition at line 336 of file GblPoint.cc.

References theLabel.

336  {
337  return theLabel;
338 }
unsigned int theLabel
Label identifying point.
Definition: GblPoint.h:90
const TMatrixD & gbl::GblPoint::getLocalDerivatives ( ) const

Retrieve local derivatives from a point.

Definition at line 288 of file GblPoint.cc.

References localDerivatives.

288  {
289  return localDerivatives;
290 }
TMatrixD localDerivatives
Derivatives of measurement vs additional local (fit) parameters.
Definition: GblPoint.h:105
void gbl::GblPoint::getMeasTransformation ( TMatrixD &  aTransformation) const

Get measurement transformation (from diagonalization).

Parameters
[out]aTransformationTransformation matrix

Definition at line 171 of file GblPoint.cc.

References measDim, measTransformation, and transFlag.

171  {
172  aTransformation.ResizeTo(measDim, measDim);
173  if (transFlag) {
174  aTransformation = measTransformation;
175  } else {
176  aTransformation.UnitMatrix();
177  }
178 }
bool transFlag
Transformation exists?
Definition: GblPoint.h:99
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
Definition: GblPoint.h:95
TMatrixD measTransformation
Transformation of diagonalization (of meas. precision matrix)
Definition: GblPoint.h:100
void gbl::GblPoint::getMeasurement ( SMatrix55 aProjection,
SVector5 aResiduals,
SVector5 aPrecision 
) const

Retrieve measurement of a point.

Parameters
[out]aProjectionProjection from (diagonalized) measurement to local system
[out]aResidualsMeasurement residuals
[out]aPrecisionMeasurement precision (diagonal)

Definition at line 160 of file GblPoint.cc.

References measPrecision, measProjection, and measResiduals.

161  {
162  aProjection = measProjection;
163  aResiduals = measResiduals;
164  aPrecision = measPrecision;
165 }
SVector5 measResiduals
Measurement residuals.
Definition: GblPoint.h:97
SVector5 measPrecision
Measurement precision (diagonal of inverse covariance matrix)
Definition: GblPoint.h:98
SMatrix55 measProjection
Projection from measurement to local system.
Definition: GblPoint.h:96
unsigned int gbl::GblPoint::getNumGlobals ( ) const

Retrieve number of global derivatives from a point.

Definition at line 313 of file GblPoint.cc.

References globalDerivatives.

313  {
314  return globalDerivatives.GetNcols();
315 }
TMatrixD globalDerivatives
Derivatives of measurement vs additional global (MP-II) parameters.
Definition: GblPoint.h:107
unsigned int gbl::GblPoint::getNumLocals ( ) const

Retrieve number of local derivatives from a point.

Definition at line 283 of file GblPoint.cc.

References localDerivatives.

283  {
284  return localDerivatives.GetNcols();
285 }
TMatrixD localDerivatives
Derivatives of measurement vs additional local (fit) parameters.
Definition: GblPoint.h:105
int gbl::GblPoint::getOffset ( ) const

Retrieve offset for point.

Definition at line 349 of file GblPoint.cc.

References theOffset.

Referenced by gbl::GblTrajectory::getFitToKinkJacobian(), and gbl::GblTrajectory::getFitToLocalJacobian().

349  {
350  return theOffset;
351 }
int theOffset
Offset number at point if not negative (else interpolation needed)
Definition: GblPoint.h:91
const SMatrix55 & gbl::GblPoint::getP2pJacobian ( ) const

Retrieve point-to-(previous)point jacobian.

Definition at line 354 of file GblPoint.cc.

References p2pJacobian.

Referenced by gbl::GblTrajectory::calcJacobians().

354  {
355  return p2pJacobian;
356 }
SMatrix55 p2pJacobian
Point-to-point jacobian from previous point.
Definition: GblPoint.h:92
void gbl::GblPoint::getScatterer ( SMatrix22 aTransformation,
SVector2 aResiduals,
SVector2 aPrecision 
) const

Retrieve scatterer of a point.

Parameters
[out]aTransformationScatterer transformation from diagonalization
[out]aResidualsScatterer residuals
[out]aPrecisionScatterer precision (diagonal)

Definition at line 242 of file GblPoint.cc.

References scatPrecision, scatResiduals, and scatTransformation.

243  {
244  aTransformation = scatTransformation;
245  aResiduals = scatResiduals;
246  aPrecision = scatPrecision;
247 }
SVector2 scatPrecision
Scattering precision (diagonal of inverse covariance matrix)
Definition: GblPoint.h:104
SVector2 scatResiduals
Scattering residuals (initial kinks if iterating)
Definition: GblPoint.h:103
SMatrix22 scatTransformation
Transformation of diagonalization (of scat. precision matrix)
Definition: GblPoint.h:102
void gbl::GblPoint::getScatTransformation ( TMatrixD &  aTransformation) const

Get scatterer transformation (from diagonalization).

Parameters
[out]aTransformationTransformation matrix

Definition at line 253 of file GblPoint.cc.

References i, j, scatFlag, and scatTransformation.

253  {
254  aTransformation.ResizeTo(2, 2);
255  if (scatFlag) {
256  for (unsigned int i = 0; i < 2; ++i) {
257  for (unsigned int j = 0; j < 2; ++j) {
258  aTransformation(i, j) = scatTransformation(i, j);
259  }
260  }
261  } else {
262  aTransformation.UnitMatrix();
263  }
264 }
int i
Definition: DBlmapReader.cc:9
bool scatFlag
Scatterer present?
Definition: GblPoint.h:101
int j
Definition: DBlmapReader.cc:9
SMatrix22 scatTransformation
Transformation of diagonalization (of scat. precision matrix)
Definition: GblPoint.h:102
unsigned int gbl::GblPoint::hasMeasurement ( ) const

Check for measurement at a point.

Get dimension of measurement (0 = none).

Returns
measurement dimension

Definition at line 150 of file GblPoint.cc.

References measDim.

150  {
151  return measDim;
152 }
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
Definition: GblPoint.h:95
bool gbl::GblPoint::hasScatterer ( ) const

Check for scatterer at a point.

Definition at line 232 of file GblPoint.cc.

References scatFlag.

232  {
233  return scatFlag;
234 }
bool scatFlag
Scatterer present?
Definition: GblPoint.h:101
void gbl::GblPoint::printPoint ( unsigned int  level = 0) const

Print GblPoint.

Parameters
[in]levelprint level (0: minimum, >0: more)

Definition at line 425 of file GblPoint.cc.

References gather_cfg::cout, globalDerivatives, globalLabels, i, localDerivatives, measDim, measPrecision, measProjection, measResiduals, nextJacobian, p2pJacobian, prevJacobian, scatFlag, scatPrecision, scatResiduals, theLabel, theOffset, and transFlag.

425  {
426  std::cout << " GblPoint";
427  if (theLabel) {
428  std::cout << ", label " << theLabel;
429  if (theOffset >= 0) {
430  std::cout << ", offset " << theOffset;
431  }
432  }
433  if (measDim) {
434  std::cout << ", " << measDim << " measurements";
435  }
436  if (scatFlag) {
437  std::cout << ", scatterer";
438  }
439  if (transFlag) {
440  std::cout << ", diagonalized";
441  }
442  if (localDerivatives.GetNcols()) {
443  std::cout << ", " << localDerivatives.GetNcols()
444  << " local derivatives";
445  }
446  if (globalDerivatives.GetNcols()) {
447  std::cout << ", " << globalDerivatives.GetNcols()
448  << " global derivatives";
449  }
450  std::cout << std::endl;
451  if (level > 0) {
452  if (measDim) {
453  std::cout << " Measurement" << std::endl;
454  std::cout << " Projection: " << std::endl << measProjection
455  << std::endl;
456  std::cout << " Residuals: " << measResiduals << std::endl;
457  std::cout << " Precision: " << measPrecision << std::endl;
458  }
459  if (scatFlag) {
460  std::cout << " Scatterer" << std::endl;
461  std::cout << " Residuals: " << scatResiduals << std::endl;
462  std::cout << " Precision: " << scatPrecision << std::endl;
463  }
464  if (localDerivatives.GetNcols()) {
465  std::cout << " Local Derivatives:" << std::endl;
466  localDerivatives.Print();
467  }
468  if (globalDerivatives.GetNcols()) {
469  std::cout << " Global Labels:";
470  for (unsigned int i = 0; i < globalLabels.size(); ++i) {
471  std::cout << " " << globalLabels[i];
472  }
473  std::cout << std::endl;
474  std::cout << " Global Derivatives:" << std::endl;
475  globalDerivatives.Print();
476  }
477  std::cout << " Jacobian " << std::endl;
478  std::cout << " Point-to-point " << std::endl << p2pJacobian
479  << std::endl;
480  if (theLabel) {
481  std::cout << " To previous offset " << std::endl << prevJacobian
482  << std::endl;
483  std::cout << " To next offset " << std::endl << nextJacobian
484  << std::endl;
485  }
486  }
487 }
int i
Definition: DBlmapReader.cc:9
SMatrix55 prevJacobian
Jacobian to previous scatterer (or first measurement)
Definition: GblPoint.h:93
TMatrixD globalDerivatives
Derivatives of measurement vs additional global (MP-II) parameters.
Definition: GblPoint.h:107
bool transFlag
Transformation exists?
Definition: GblPoint.h:99
bool scatFlag
Scatterer present?
Definition: GblPoint.h:101
int theOffset
Offset number at point if not negative (else interpolation needed)
Definition: GblPoint.h:91
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
Definition: GblPoint.h:95
SVector5 measResiduals
Measurement residuals.
Definition: GblPoint.h:97
SVector2 scatPrecision
Scattering precision (diagonal of inverse covariance matrix)
Definition: GblPoint.h:104
std::vector< int > globalLabels
Labels of global (MP-II) derivatives.
Definition: GblPoint.h:106
SMatrix55 nextJacobian
Jacobian to next scatterer (or last measurement)
Definition: GblPoint.h:94
SVector5 measPrecision
Measurement precision (diagonal of inverse covariance matrix)
Definition: GblPoint.h:98
SVector2 scatResiduals
Scattering residuals (initial kinks if iterating)
Definition: GblPoint.h:103
TMatrixD localDerivatives
Derivatives of measurement vs additional local (fit) parameters.
Definition: GblPoint.h:105
tuple cout
Definition: gather_cfg.py:145
unsigned int theLabel
Label identifying point.
Definition: GblPoint.h:90
tuple level
Definition: testEve_cfg.py:34
SMatrix55 p2pJacobian
Point-to-point jacobian from previous point.
Definition: GblPoint.h:92
SMatrix55 measProjection
Projection from measurement to local system.
Definition: GblPoint.h:96
void gbl::GblPoint::setLabel ( unsigned int  aLabel)

Define label of point (by GBLTrajectory constructor)

Parameters
[in]aLabelLabel identifying point

Definition at line 331 of file GblPoint.cc.

References theLabel.

Referenced by SequenceTypes.DummyModule::__init__(), SequenceTypes.DummyBooleanModule::__init__(), and Vispa.Gui.FindDialog.FindDialog::reset().

331  {
332  theLabel = aLabel;
333 }
unsigned int theLabel
Label identifying point.
Definition: GblPoint.h:90
void gbl::GblPoint::setOffset ( int  anOffset)

Define offset for point (by GBLTrajectory constructor)

Parameters
[in]anOffsetOffset number

Definition at line 344 of file GblPoint.cc.

References theOffset.

344  {
345  theOffset = anOffset;
346 }
int theOffset
Offset number at point if not negative (else interpolation needed)
Definition: GblPoint.h:91

Member Data Documentation

TMatrixD gbl::GblPoint::globalDerivatives
private

Derivatives of measurement vs additional global (MP-II) parameters.

Definition at line 107 of file GblPoint.h.

Referenced by addGlobals(), getGlobalDerivatives(), getNumGlobals(), and printPoint().

std::vector<int> gbl::GblPoint::globalLabels
private

Labels of global (MP-II) derivatives.

Definition at line 106 of file GblPoint.h.

Referenced by addGlobals(), getGlobalLabels(), and printPoint().

TMatrixD gbl::GblPoint::localDerivatives
private

Derivatives of measurement vs additional local (fit) parameters.

Definition at line 105 of file GblPoint.h.

Referenced by addLocals(), getLocalDerivatives(), getNumLocals(), and printPoint().

unsigned int gbl::GblPoint::measDim
private

Dimension of measurement (1-5), 0 indicates absence of measurement.

Definition at line 95 of file GblPoint.h.

Referenced by addGlobals(), addLocals(), addMeasurement(), getMeasTransformation(), hasMeasurement(), and printPoint().

SVector5 gbl::GblPoint::measPrecision
private

Measurement precision (diagonal of inverse covariance matrix)

Definition at line 98 of file GblPoint.h.

Referenced by addMeasurement(), getMeasurement(), and printPoint().

SMatrix55 gbl::GblPoint::measProjection
private

Projection from measurement to local system.

Definition at line 96 of file GblPoint.h.

Referenced by addMeasurement(), getMeasurement(), and printPoint().

SVector5 gbl::GblPoint::measResiduals
private

Measurement residuals.

Definition at line 97 of file GblPoint.h.

Referenced by addMeasurement(), getMeasurement(), and printPoint().

TMatrixD gbl::GblPoint::measTransformation
private

Transformation of diagonalization (of meas. precision matrix)

Definition at line 100 of file GblPoint.h.

Referenced by addGlobals(), addLocals(), addMeasurement(), and getMeasTransformation().

SMatrix55 gbl::GblPoint::nextJacobian
private

Jacobian to next scatterer (or last measurement)

Definition at line 94 of file GblPoint.h.

Referenced by addNextJacobian(), getDerivatives(), and printPoint().

SMatrix55 gbl::GblPoint::p2pJacobian
private

Point-to-point jacobian from previous point.

Definition at line 92 of file GblPoint.h.

Referenced by GblPoint(), getP2pJacobian(), and printPoint().

SMatrix55 gbl::GblPoint::prevJacobian
private

Jacobian to previous scatterer (or first measurement)

Definition at line 93 of file GblPoint.h.

Referenced by addPrevJacobian(), getDerivatives(), and printPoint().

bool gbl::GblPoint::scatFlag
private

Scatterer present?

Definition at line 101 of file GblPoint.h.

Referenced by addScatterer(), getScatTransformation(), hasScatterer(), and printPoint().

SVector2 gbl::GblPoint::scatPrecision
private

Scattering precision (diagonal of inverse covariance matrix)

Definition at line 104 of file GblPoint.h.

Referenced by addScatterer(), getScatterer(), and printPoint().

SVector2 gbl::GblPoint::scatResiduals
private

Scattering residuals (initial kinks if iterating)

Definition at line 103 of file GblPoint.h.

Referenced by addScatterer(), getScatterer(), and printPoint().

SMatrix22 gbl::GblPoint::scatTransformation
private

Transformation of diagonalization (of scat. precision matrix)

Definition at line 102 of file GblPoint.h.

Referenced by addScatterer(), getScatterer(), and getScatTransformation().

unsigned int gbl::GblPoint::theLabel
private

Label identifying point.

Definition at line 90 of file GblPoint.h.

Referenced by getLabel(), printPoint(), and setLabel().

int gbl::GblPoint::theOffset
private

Offset number at point if not negative (else interpolation needed)

Definition at line 91 of file GblPoint.h.

Referenced by getOffset(), printPoint(), and setOffset().

bool gbl::GblPoint::transFlag
private

Transformation exists?

Definition at line 99 of file GblPoint.h.

Referenced by addGlobals(), addLocals(), addMeasurement(), getMeasTransformation(), and printPoint().