SND@LHC Software
Loading...
Searching...
No Matches
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
8#ifndef GBLPOINT_H_
9#define GBLPOINT_H_
10
11#include <iostream>
12#include <vector>
13#include <math.h>
14#include <stdexcept>
15#include <TVectorD.h>
16#include <TMatrixD.h>
17#include <TMatrixDSym.h>
18#include <TMatrixDSymEigen.h>
19
20#include <Math/SMatrix.h>
21#include <Math/SVector.h>
22
23typedef ROOT::Math::SMatrix<double, 2> SMatrix22;
24typedef ROOT::Math::SMatrix<double, 2, 3> SMatrix23;
25typedef ROOT::Math::SMatrix<double, 2, 5> SMatrix25;
26typedef ROOT::Math::SMatrix<double, 2, 7> SMatrix27;
27typedef ROOT::Math::SMatrix<double, 3, 2> SMatrix32;
28typedef ROOT::Math::SMatrix<double, 3> SMatrix33;
29typedef ROOT::Math::SMatrix<double, 5> SMatrix55;
30typedef ROOT::Math::SVector<double, 2> SVector2;
31typedef ROOT::Math::SVector<double, 5> SVector5;
32
33
34namespace gbl {
35
37
48class GblPoint {
49public:
50 GblPoint(const TMatrixD &aJacobian);
51 GblPoint(const SMatrix55 &aJacobian);
52 virtual ~GblPoint();
53 void addMeasurement(const TMatrixD &aProjection, const TVectorD &aResiduals,
54 const TVectorD &aPrecision, double minPrecision = 0.);
55 void addMeasurement(const TMatrixD &aProjection, const TVectorD &aResiduals,
56 const TMatrixDSym &aPrecision, double minPrecision = 0.);
57 void addMeasurement(const TVectorD &aResiduals, const TVectorD &aPrecision,
58 double minPrecision = 0.);
59 void addMeasurement(const TVectorD &aResiduals,
60 const TMatrixDSym &aPrecision, double minPrecision = 0.);
61 unsigned int hasMeasurement() const;
62 void getMeasurement(SMatrix55 &aProjection, SVector5 &aResiduals,
63 SVector5 &aPrecision) const;
64 void getMeasTransformation(TMatrixD &aTransformation) const;
65 void addScatterer(const TVectorD &aResiduals, const TVectorD &aPrecision);
66 void addScatterer(const TVectorD &aResiduals,
67 const TMatrixDSym &aPrecision);
68 bool hasScatterer() const;
69 void getScatterer(SMatrix22 &aTransformation, SVector2 &aResiduals,
70 SVector2 &aPrecision) const;
71 void getScatTransformation(TMatrixD &aTransformation) const;
72 void addLocals(const TMatrixD &aDerivatives);
73 unsigned int getNumLocals() const;
74 const TMatrixD& getLocalDerivatives() const;
75 void addGlobals(const std::vector<int> &aLabels,
76 const TMatrixD &aDerivatives);
77 unsigned int getNumGlobals() const;
78 std::vector<int> getGlobalLabels() const;
79 const TMatrixD& getGlobalDerivatives() const;
80 void setLabel(unsigned int aLabel);
81 unsigned int getLabel() const;
82 void setOffset(int anOffset);
83 int getOffset() const;
84 const SMatrix55& getP2pJacobian() const;
85 void addPrevJacobian(const SMatrix55 &aJac);
86 void addNextJacobian(const SMatrix55 &aJac);
87 void getDerivatives(int aDirection, SMatrix22 &matW, SMatrix22 &matWJ,
88 SVector2 &vecWd) const;
89 void printPoint(unsigned int level = 0) const;
90
91private:
92 unsigned int theLabel;
97 unsigned int measDim;
103 bool scatFlag;
108 std::vector<int> globalLabels;
110};
111}
112#endif /* GBLPOINT_H_ */
ROOT::Math::SMatrix< double, 5, 5 > SMatrix55
Definition GblData.h:23
ROOT::Math::SMatrix< double, 2, 5 > SMatrix25
Definition GblPoint.h:25
ROOT::Math::SMatrix< double, 3 > SMatrix33
Definition GblPoint.h:28
ROOT::Math::SVector< double, 5 > SVector5
Definition GblPoint.h:31
ROOT::Math::SMatrix< double, 5 > SMatrix55
Definition GblPoint.h:29
ROOT::Math::SVector< double, 2 > SVector2
Definition GblPoint.h:30
ROOT::Math::SMatrix< double, 3, 2 > SMatrix32
Definition GblPoint.h:27
ROOT::Math::SMatrix< double, 2, 7 > SMatrix27
Definition GblPoint.h:26
ROOT::Math::SMatrix< double, 2 > SMatrix22
Definition GblPoint.h:23
ROOT::Math::SMatrix< double, 2, 3 > SMatrix23
Definition GblPoint.h:24
Point on trajectory.
Definition GblPoint.h:48
std::vector< int > getGlobalLabels() const
Retrieve global derivatives labels from a point.
Definition GblPoint.cc:318
TMatrixD localDerivatives
Derivatives of measurement vs additional local (fit) parameters.
Definition GblPoint.h:107
std::vector< int > globalLabels
Labels of global (MP-II) derivatives.
Definition GblPoint.h:108
void addMeasurement(const TMatrixD &aProjection, const TVectorD &aResiduals, const TVectorD &aPrecision, double minPrecision=0.)
Add a measurement to a point.
Definition GblPoint.cc:47
SMatrix55 nextJacobian
Jacobian to next scatterer (or last measurement)
Definition GblPoint.h:96
void getScatterer(SMatrix22 &aTransformation, SVector2 &aResiduals, SVector2 &aPrecision) const
Retrieve scatterer of a point.
Definition GblPoint.cc:242
TMatrixD measTransformation
Transformation of diagonalization (of meas. precision matrix)
Definition GblPoint.h:102
void printPoint(unsigned int level=0) const
Print GblPoint.
Definition GblPoint.cc:425
void getDerivatives(int aDirection, SMatrix22 &matW, SMatrix22 &matWJ, SVector2 &vecWd) const
Retrieve derivatives of local track model.
Definition GblPoint.cc:393
bool scatFlag
Scatterer present?
Definition GblPoint.h:103
void addScatterer(const TVectorD &aResiduals, const TVectorD &aPrecision)
Add a (thin) scatterer to a point.
Definition GblPoint.cc:188
unsigned int hasMeasurement() const
Check for measurement at a point.
Definition GblPoint.cc:150
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
Definition GblPoint.h:97
const SMatrix55 & getP2pJacobian() const
Retrieve point-to-(previous)point jacobian.
Definition GblPoint.cc:354
bool transFlag
Transformation exists?
Definition GblPoint.h:101
bool hasScatterer() const
Check for scatterer at a point.
Definition GblPoint.cc:232
void getMeasTransformation(TMatrixD &aTransformation) const
Get measurement transformation (from diagonalization).
Definition GblPoint.cc:171
const TMatrixD & getGlobalDerivatives() const
Retrieve global derivatives from a point.
Definition GblPoint.cc:323
void getMeasurement(SMatrix55 &aProjection, SVector5 &aResiduals, SVector5 &aPrecision) const
Retrieve measurement of a point.
Definition GblPoint.cc:160
void addLocals(const TMatrixD &aDerivatives)
Add local derivatives to a point.
Definition GblPoint.cc:271
SVector2 scatResiduals
Scattering residuals (initial kinks if iterating)
Definition GblPoint.h:105
unsigned int theLabel
Label identifying point.
Definition GblPoint.h:92
unsigned int getNumLocals() const
Retrieve number of local derivatives from a point.
Definition GblPoint.cc:283
int theOffset
Offset number at point if not negative (else interpolation needed)
Definition GblPoint.h:93
void addGlobals(const std::vector< int > &aLabels, const TMatrixD &aDerivatives)
Add global derivatives to a point.
Definition GblPoint.cc:298
void addNextJacobian(const SMatrix55 &aJac)
Define jacobian to next scatterer (by GBLTrajectory constructor)
Definition GblPoint.cc:379
void setLabel(unsigned int aLabel)
Define label of point (by GBLTrajectory constructor)
Definition GblPoint.cc:331
TMatrixD globalDerivatives
Derivatives of measurement vs additional global (MP-II) parameters.
Definition GblPoint.h:109
void addPrevJacobian(const SMatrix55 &aJac)
Define jacobian to previous scatterer (by GBLTrajectory constructor)
Definition GblPoint.cc:362
unsigned int getLabel() const
Retrieve label of point.
Definition GblPoint.cc:336
SMatrix22 scatTransformation
Transformation of diagonalization (of scat. precision matrix)
Definition GblPoint.h:104
SVector2 scatPrecision
Scattering precision (diagonal of inverse covariance matrix)
Definition GblPoint.h:106
const TMatrixD & getLocalDerivatives() const
Retrieve local derivatives from a point.
Definition GblPoint.cc:288
virtual ~GblPoint()
Definition GblPoint.cc:35
SVector5 measPrecision
Measurement precision (diagonal of inverse covariance matrix)
Definition GblPoint.h:100
SMatrix55 measProjection
Projection from measurement to local system.
Definition GblPoint.h:98
SMatrix55 p2pJacobian
Point-to-point jacobian from previous point.
Definition GblPoint.h:94
void setOffset(int anOffset)
Define offset for point (by GBLTrajectory constructor)
Definition GblPoint.cc:344
unsigned int getNumGlobals() const
Retrieve number of global derivatives from a point.
Definition GblPoint.cc:313
SVector5 measResiduals
Measurement residuals.
Definition GblPoint.h:99
SMatrix55 prevJacobian
Jacobian to previous scatterer (or first measurement)
Definition GblPoint.h:95
void getScatTransformation(TMatrixD &aTransformation) const
Get scatterer transformation (from diagonalization).
Definition GblPoint.cc:253
int getOffset() const
Retrieve offset for point.
Definition GblPoint.cc:349
Namespace for the general broken lines package.