Belle II Software  release-08-01-10
GblPoint.h
Go to the documentation of this file.
1 /*
2  * GblPoint.h
3  *
4  * Created on: Aug 18, 2011
5  * Author: kleinwrt
6  */
7 
30 #ifndef GBLPOINT_H_
31 #define GBLPOINT_H_
32 
33 #include<iostream>
34 #include<vector>
35 #include<math.h>
36 #include <stdexcept>
37 #include "TVectorD.h"
38 #include "TMatrixD.h"
39 #include "TMatrixDSym.h"
40 #include "TMatrixDSymEigen.h"
41 
42 #include "Math/SMatrix.h"
43 #include "Math/SVector.h"
44 typedef ROOT::Math::SMatrix<double, 2> SMatrix22;
45 typedef ROOT::Math::SMatrix<double, 2, 3> SMatrix23;
46 typedef ROOT::Math::SMatrix<double, 2, 5> SMatrix25;
47 typedef ROOT::Math::SMatrix<double, 2, 7> SMatrix27;
48 typedef ROOT::Math::SMatrix<double, 3, 2> SMatrix32;
49 typedef ROOT::Math::SMatrix<double, 3> SMatrix33;
50 typedef ROOT::Math::SMatrix<double, 5> SMatrix55;
51 typedef ROOT::Math::SVector<double, 2> SVector2;
52 typedef ROOT::Math::SVector<double, 5> SVector5;
53 
54 namespace gbl {
55 
57 
68 class GblPoint {
69 public:
70  explicit GblPoint(const TMatrixD &aJacobian);
71  explicit GblPoint(const SMatrix55 &aJacobian);
72  virtual ~GblPoint();
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.);
79  void addMeasurement(const TVectorD &aResiduals,
80  const TMatrixDSym &aPrecision, double minPrecision = 0.);
81  unsigned int hasMeasurement() const;
82  void getMeasurement(SMatrix55 &aProjection, SVector5 &aResiduals,
83  SVector5 &aPrecision) const;
84  void getMeasTransformation(TMatrixD &aTransformation) const;
85  void addScatterer(const TVectorD &aResiduals, const TVectorD &aPrecision);
86  void addScatterer(const TVectorD &aResiduals,
87  const TMatrixDSym &aPrecision);
88  bool hasScatterer() const;
89  void getScatterer(SMatrix22 &aTransformation, SVector2 &aResiduals,
90  SVector2 &aPrecision) const;
91  void getScatTransformation(TMatrixD &aTransformation) const;
92  void addLocals(const TMatrixD &aDerivatives);
93  unsigned int getNumLocals() const;
94  const TMatrixD& getLocalDerivatives() const;
95  void addGlobals(const std::vector<int> &aLabels,
96  const TMatrixD &aDerivatives);
97  unsigned int getNumGlobals() const;
98  std::vector<int> getGlobalLabels() const;
99  const TMatrixD& getGlobalDerivatives() const;
100  void setLabel(unsigned int aLabel);
101  unsigned int getLabel() const;
102  void setOffset(int anOffset);
103  int getOffset() const;
104  const SMatrix55& getP2pJacobian() const;
105  void addPrevJacobian(const SMatrix55 &aJac);
106  void addNextJacobian(const SMatrix55 &aJac);
107  void getDerivatives(int aDirection, SMatrix22 &matW, SMatrix22 &matWJ,
108  SVector2 &vecWd) const;
109  void printPoint(unsigned int level = 0) const;
110 
111 private:
112  unsigned int theLabel;
113  int theOffset;
114  SMatrix55 p2pJacobian;
115  SMatrix55 prevJacobian;
116  SMatrix55 nextJacobian;
117  unsigned int measDim;
118  SMatrix55 measProjection;
119  SVector5 measResiduals;
120  SVector5 measPrecision;
121  bool transFlag;
123  bool scatFlag;
124  SMatrix22 scatTransformation;
125  SVector2 scatResiduals;
126  SVector2 scatPrecision;
127  TMatrixD localDerivatives;
128  std::vector<int> globalLabels;
129  TMatrixD globalDerivatives;
130 };
131 }
132 #endif /* GBLPOINT_H_ */
Point on trajectory.
Definition: GblPoint.h:68
unsigned int getNumGlobals() const
Retrieve number of global derivatives from a point.
Definition: GblPoint.cc:335
unsigned int hasMeasurement() const
Check for measurement at a point.
Definition: GblPoint.cc:172
int getOffset() const
Retrieve offset for point.
Definition: GblPoint.cc:371
void addMeasurement(const TMatrixD &aProjection, const TVectorD &aResiduals, const TVectorD &aPrecision, double minPrecision=0.)
Add a measurement to a point.
Definition: GblPoint.cc:69
void addNextJacobian(const SMatrix55 &aJac)
Define jacobian to next scatterer (by GBLTrajectory constructor)
Definition: GblPoint.cc:401
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
Definition: GblPoint.h:117
SMatrix55 measProjection
Projection from measurement to local system.
Definition: GblPoint.h:118
const TMatrixD & getLocalDerivatives() const
Retrieve local derivatives from a point.
Definition: GblPoint.cc:310
SVector5 measResiduals
Measurement residuals.
Definition: GblPoint.h:119
SMatrix55 nextJacobian
Jacobian to next scatterer (or last measurement)
Definition: GblPoint.h:116
unsigned int getLabel() const
Retrieve label of point.
Definition: GblPoint.cc:358
bool scatFlag
Scatterer present?
Definition: GblPoint.h:123
GblPoint(const TMatrixD &aJacobian)
Create a point.
Definition: GblPoint.cc:40
int theOffset
Offset number at point if not negative (else interpolation needed)
Definition: GblPoint.h:113
SVector2 scatResiduals
Scattering residuals (initial kinks if iterating)
Definition: GblPoint.h:125
void getDerivatives(int aDirection, SMatrix22 &matW, SMatrix22 &matWJ, SVector2 &vecWd) const
Retrieve derivatives of local track model.
Definition: GblPoint.cc:415
SVector5 measPrecision
Measurement precision (diagonal of inverse covariance matrix)
Definition: GblPoint.h:120
const TMatrixD & getGlobalDerivatives() const
Retrieve global derivatives from a point.
Definition: GblPoint.cc:345
void getScatterer(SMatrix22 &aTransformation, SVector2 &aResiduals, SVector2 &aPrecision) const
Retrieve scatterer of a point.
Definition: GblPoint.cc:264
SMatrix22 scatTransformation
Transformation of diagonalization (of scat. precision matrix)
Definition: GblPoint.h:124
unsigned int theLabel
Label identifying point.
Definition: GblPoint.h:112
SMatrix55 prevJacobian
Jacobian to previous scatterer (or first measurement)
Definition: GblPoint.h:115
void setOffset(int anOffset)
Define offset for point (by GBLTrajectory constructor)
Definition: GblPoint.cc:366
SMatrix55 p2pJacobian
Point-to-point jacobian from previous point.
Definition: GblPoint.h:114
unsigned int getNumLocals() const
Retrieve number of local derivatives from a point.
Definition: GblPoint.cc:305
std::vector< int > globalLabels
Labels of global (MP-II) derivatives.
Definition: GblPoint.h:128
SVector2 scatPrecision
Scattering precision (diagonal of inverse covariance matrix)
Definition: GblPoint.h:126
void getMeasTransformation(TMatrixD &aTransformation) const
Get measurement transformation (from diagonalization).
Definition: GblPoint.cc:193
void addPrevJacobian(const SMatrix55 &aJac)
Define jacobian to previous scatterer (by GBLTrajectory constructor)
Definition: GblPoint.cc:384
void printPoint(unsigned int level=0) const
Print GblPoint.
Definition: GblPoint.cc:447
void getScatTransformation(TMatrixD &aTransformation) const
Get scatterer transformation (from diagonalization).
Definition: GblPoint.cc:275
const SMatrix55 & getP2pJacobian() const
Retrieve point-to-(previous)point jacobian.
Definition: GblPoint.cc:376
TMatrixD localDerivatives
Derivatives of measurement vs additional local (fit) parameters.
Definition: GblPoint.h:127
TMatrixD globalDerivatives
Derivatives of measurement vs additional global (MP-II) parameters.
Definition: GblPoint.h:129
void getMeasurement(SMatrix55 &aProjection, SVector5 &aResiduals, SVector5 &aPrecision) const
Retrieve measurement of a point.
Definition: GblPoint.cc:182
bool transFlag
Transformation exists?
Definition: GblPoint.h:121
void addGlobals(const std::vector< int > &aLabels, const TMatrixD &aDerivatives)
Add global derivatives to a point.
Definition: GblPoint.cc:320
void addScatterer(const TVectorD &aResiduals, const TVectorD &aPrecision)
Add a (thin) scatterer to a point.
Definition: GblPoint.cc:210
bool hasScatterer() const
Check for scatterer at a point.
Definition: GblPoint.cc:254
void addLocals(const TMatrixD &aDerivatives)
Add local derivatives to a point.
Definition: GblPoint.cc:293
std::vector< int > getGlobalLabels() const
Retrieve global derivatives labels from a point.
Definition: GblPoint.cc:340
void setLabel(unsigned int aLabel)
Define label of point (by GBLTrajectory constructor)
Definition: GblPoint.cc:353
TMatrixD measTransformation
Transformation of diagonalization (of meas. precision matrix)
Definition: GblPoint.h:122
Namespace for the general broken lines package.