CMS 3D CMS Logo

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