GeneralBrokenLines V03-01-03
using EIGEN
GblUtilities.h
Go to the documentation of this file.
1/*
2 * GblUtilities.h
3 *
4 * Created on: 6 Nov 2018
5 * Author: kleinwrt
6 */
7
30#ifndef GBLUTILITIES_H_
31#define GBLUTILITIES_H_
32
33#include "Eigen/Dense"
34#include<iostream>
35
37namespace gbl {
38
39double unrm();
40double unif();
41Eigen::Matrix<double, 5, 5> gblSimpleJacobian(double ds, double cosl,
42 double bfac);
43double gblMultipleScatteringError(double qbyp, double xbyx0);
44
46
50public:
51 GblHelixPrediction(double sArc, const Eigen::Vector2d &aPred,
52 const Eigen::Vector3d &tDir, const Eigen::Vector3d &uDir,
53 const Eigen::Vector3d &vDir, const Eigen::Vector3d &nDir,
54 const Eigen::Vector3d &aPos);
55 virtual ~GblHelixPrediction();
56 double getArcLength() const;
57 const Eigen::Vector2d& getMeasPred() const;
58 const Eigen::Vector3d& getPosition() const;
59 const Eigen::Vector3d& getDirection() const;
60 double getCosIncidence() const;
61 Eigen::Matrix<double, 2, 3> getCurvilinearDirs() const;
62
63private:
64 const double sarc;
65 const Eigen::Vector2d pred;
66 const Eigen::Vector3d tdir;
67 const Eigen::Vector3d udir;
68 const Eigen::Vector3d vdir;
69 const Eigen::Vector3d ndir;
70 const Eigen::Vector3d pos;
71 Eigen::Matrix3d global2meas;
72};
73
75
79public:
80 GblSimpleHelix(double aRinv, double aPhi0, double aDca, double aDzds,
81 double aZ0);
82 virtual ~GblSimpleHelix();
83 double getPhi(double aRadius) const;
84 double getArcLengthR(double aRadius) const;
85 double getArcLengthXY(double xPos, double yPos) const;
86 void moveToXY(double xPos, double yPos, double &newPhi0, double &newDca,
87 double &newZ0) const;
88 GblHelixPrediction getPrediction(const Eigen::Vector3d &refPos,
89 const Eigen::Vector3d &uDir, const Eigen::Vector3d &vDir) const;
90
91private:
92 const double rinv;
93 const double phi0;
94 const double dca;
95 const double dzds;
96 const double z0;
97 const double cosPhi0;
98 const double sinPhi0;
99 const double xRelCenter;
100 const double yRelCenter;
101};
102
104
108public:
109 GblDetectorLayer(const std::string aName, const unsigned int aLayer,
110 const int aDim, const double thickness, Eigen::Vector3d &aCenter,
111 Eigen::Vector2d &aResolution, Eigen::Vector2d &aPrecision,
112 Eigen::Matrix3d &measTrafo, Eigen::Matrix3d &alignTrafo);
113 virtual ~GblDetectorLayer();
114 void print() const;
115 void printMP2Constraint() const;
116 unsigned int getRigidBodyGlobalLabel(const unsigned int aPar) const;
117 unsigned int getLayerID() const;
118 double getRadiationLength() const;
119 Eigen::Vector2d getResolution() const;
120 Eigen::Vector2d getPrecision() const;
121 Eigen::Vector3d getCenter() const;
122 Eigen::Matrix3d getMeasSystemDirs() const;
123 Eigen::Matrix3d getAlignSystemDirs() const;
125 Eigen::Matrix<double, 3, 6> getRigidBodyDerGlobal(Eigen::Vector3d &position,
126 Eigen::Vector3d &direction) const;
127 Eigen::Matrix<double, 2, 6> getRigidBodyDerLocal(Eigen::Vector3d &position,
128 Eigen::Vector3d &direction) const;
129 Eigen::Matrix<double, 6, 6> getTrafoGlobalToLocal(Eigen::Vector3d &offset,
130 Eigen::Matrix3d &rotation) const;
131 Eigen::Matrix<double, 6, 6> getTrafoLocalToGlobal(Eigen::Vector3d &offset,
132 Eigen::Matrix3d &rotation) const;
133
134private:
135 std::string name;
136 unsigned int layer;
137 unsigned int measDim;
138 double xbyx0;
139 Eigen::Vector3d center;
140 Eigen::Vector2d resolution;
141 Eigen::Vector2d precision;
142 Eigen::Vector3d udir;
143 Eigen::Vector3d vdir;
144 Eigen::Vector3d ndir;
145 Eigen::Matrix3d global2meas;
146 Eigen::Matrix3d global2align;
148};
149
150}
151#endif /* GBLUTILITIES_H_ */
Detector layer.
Definition: GblUtilities.h:107
double xbyx0
normalized material thickness
Definition: GblUtilities.h:138
Eigen::Vector3d getCenter() const
Get center.
unsigned int getRigidBodyGlobalLabel(const unsigned int aPar) const
Get global label.
GblHelixPrediction intersectWithHelix(GblSimpleHelix hlx) const
Intersect with helix.
Eigen::Vector3d ndir
normal to measurement plane
Definition: GblUtilities.h:144
Eigen::Vector3d center
center
Definition: GblUtilities.h:139
double getRadiationLength() const
Get radiation length.
void print() const
Print GblDetectorLayer.
unsigned int measDim
measurement dimension (1 or 2)
Definition: GblUtilities.h:137
Eigen::Matrix< double, 2, 6 > getRigidBodyDerLocal(Eigen::Vector3d &position, Eigen::Vector3d &direction) const
Get rigid body derivatives in local (alignment) frame (rotated in measurement plane).
unsigned int getLayerID() const
Get layer ID.
Eigen::Matrix3d getMeasSystemDirs() const
Get directions of measurement system.
Eigen::Matrix< double, 6, 6 > getTrafoGlobalToLocal(Eigen::Vector3d &offset, Eigen::Matrix3d &rotation) const
Get transformation for rigid body derivatives from global to local (alignment) system.
Eigen::Matrix< double, 3, 6 > getRigidBodyDerGlobal(Eigen::Vector3d &position, Eigen::Vector3d &direction) const
Get rigid body derivatives in global frame.
Eigen::Matrix3d global2meas
transformation into measurement system
Definition: GblUtilities.h:145
unsigned int layer
layer ID
Definition: GblUtilities.h:136
GblDetectorLayer(const std::string aName, const unsigned int aLayer, const int aDim, const double thickness, Eigen::Vector3d &aCenter, Eigen::Vector2d &aResolution, Eigen::Vector2d &aPrecision, Eigen::Matrix3d &measTrafo, Eigen::Matrix3d &alignTrafo)
Create a detector layer.
Eigen::Matrix3d getAlignSystemDirs() const
Get directions of alignment system.
Eigen::Vector2d precision
measurements precision
Definition: GblUtilities.h:141
Eigen::Vector3d vdir
Definition: GblUtilities.h:143
Eigen::Vector2d getResolution() const
Get resolution.
void printMP2Constraint() const
Print MP2 constraint.
bool alignInMeasSys
alignment == measurement system?
Definition: GblUtilities.h:147
Eigen::Vector3d udir
Definition: GblUtilities.h:142
Eigen::Matrix< double, 6, 6 > getTrafoLocalToGlobal(Eigen::Vector3d &offset, Eigen::Matrix3d &rotation) const
Get transformation for rigid body derivatives from local (alignment) to global system.
Eigen::Vector2d resolution
measurements resolution
Definition: GblUtilities.h:140
std::string name
name
Definition: GblUtilities.h:135
Eigen::Vector2d getPrecision() const
Get precision.
Eigen::Matrix3d global2align
transformation into (local) alignment system
Definition: GblUtilities.h:146
Prediction on helix.
Definition: GblUtilities.h:49
Eigen::Matrix< double, 2, 3 > getCurvilinearDirs() const
Get curvilinear directions (U,V)
const Eigen::Vector3d pos
position at prediction
Definition: GblUtilities.h:70
double getArcLength() const
Get arc-length.
const Eigen::Vector2d & getMeasPred() const
Get (measurement) prediction.
const double sarc
arc-length at prediction
Definition: GblUtilities.h:64
double getCosIncidence() const
Get cosine of incidence.
Eigen::Matrix3d global2meas
transformation into measurement system
Definition: GblUtilities.h:71
const Eigen::Vector3d & getPosition() const
Get position.
const Eigen::Vector3d vdir
measurement direction for v
Definition: GblUtilities.h:68
const Eigen::Vector2d pred
prediction for measurement (u,v)
Definition: GblUtilities.h:65
const Eigen::Vector3d udir
measurement direction for u
Definition: GblUtilities.h:67
const Eigen::Vector3d tdir
track direction at prediction
Definition: GblUtilities.h:66
GblHelixPrediction(double sArc, const Eigen::Vector2d &aPred, const Eigen::Vector3d &tDir, const Eigen::Vector3d &uDir, const Eigen::Vector3d &vDir, const Eigen::Vector3d &nDir, const Eigen::Vector3d &aPos)
Create helix prediction.
const Eigen::Vector3d & getDirection() const
Get position.
const Eigen::Vector3d ndir
normal to measurement plane
Definition: GblUtilities.h:69
Simple helix.
Definition: GblUtilities.h:78
double getArcLengthR(double aRadius) const
Get (2D) arc length for given radius (to ref. point)
void moveToXY(double xPos, double yPos, double &newPhi0, double &newDca, double &newZ0) const
Move to new reference point (X,Y)
GblHelixPrediction getPrediction(const Eigen::Vector3d &refPos, const Eigen::Vector3d &uDir, const Eigen::Vector3d &vDir) const
Get prediction.
GblSimpleHelix(double aRinv, double aPhi0, double aDca, double aDzds, double aZ0)
Create simple helix.
const double rinv
curvature (1/Radius)
Definition: GblUtilities.h:92
double getPhi(double aRadius) const
Get phi (of point on circle) for given radius (to ref. point)
const double sinPhi0
sin(phi0)
Definition: GblUtilities.h:98
double getArcLengthXY(double xPos, double yPos) const
Get (2D) arc length for given point.
const double dca
distance to origin in XY plane at PCA
Definition: GblUtilities.h:94
const double z0
offset in ZS plane
Definition: GblUtilities.h:96
const double cosPhi0
cos(phi0)
Definition: GblUtilities.h:97
const double xRelCenter
X position of circle center / R.
Definition: GblUtilities.h:99
const double dzds
slope in ZS plane (dZ/dS)
Definition: GblUtilities.h:95
const double phi0
azimuth at PCA (point of closest approach to origin in XY plane, defines arc-length S=0)
Definition: GblUtilities.h:93
const double yRelCenter
Y position of circle center / R.
Definition: GblUtilities.h:100
Namespace for the general broken lines package.
double unrm()
unit normal distribution, Box-Muller method, polar form
double gblMultipleScatteringError(double qbyp, double xbyx0)
Multiple scattering error.
double unif()
uniform distribution [0..1]
Matrix5d gblSimpleJacobian(double ds, double cosl, double bfac)
Simple jacobian.