Belle II Software development
SZLine Class Reference

A line in the sz space. More...

#include <SZLine.h>

Public Member Functions

 SZLine ()
 Default constructor for ROOT compatibility.
 
 SZLine (double tanLambda, double z0)
 Constructor from slope and intercept in the sz space.
 
 SZLine (const SZParameters &szParameters)
 Constructor from the sz parameters.
 
double tanLambda () const
 Getter for the tan lambda parameter.
 
double slope () const
 Getter for the slope in the sz space which is equivalent to tan lambda.
 
double inverseSlope () const
 Returns the slope over the second coordinate.
 
double theta () const
 Getter for the theta dip angle.
 
void setTanLambda (double tanLambda)
 Getter for the tan lambda parameter.
 
double z0 () const
 Getter for the z0 parameter.
 
double intercept () const
 Getter for the intercept in the sz space which is equivalent to z0.
 
void setZ0 (double z0)
 Getter for the z0 parameter.
 
SZParameters szParameters () const
 Getter for the sz parameters.
 
double zero () const
 Returns the the two dimensional arc length s where the z coordinate approaches zero.
 
double map (double s) const
 Maps the two dimensional arc length s to z.
 
double operator() (double s) const
 Maps the two dimensional arc length s to z.
 
double inverseMap (double z) const
 Maps the z coordinate to the two dimensional arc length s.
 
void invalidate ()
 Sets the parameters to a invalid representation.
 
bool isInvalid () const
 Indicates if the line parameters do not represent a valid line.
 
void reverse ()
 Reverse the arc length direction in place.
 
SZLine reversed () const
 Returns a copy of the line with reversed the arc length direction.
 
double distance (const Vector2D &szPoint) const
 Calculates the signed distance of the point to the line.
 
double distance (double s, double z) const
 Calculates the signed distance of the point given by its to coordinates to the line.
 
Vector2D intersection (const SZLine &szLine) const
 Calculates the intersection point of two line. Infinity for parallels.
 
void passiveMoveBy (const Vector2D &bySZ)
 Passively move the coordinate system in place by the given sz vector.
 
void passiveMoveBy (double s, double z)
 Passively move the coordinate system in place by the given s and z coordinates.
 
SZLine passiveMovedBy (const Vector2D &bySZ) const
 Return a line passively move by the given vector as a copy.
 
SZLine passiveMovedBy (double s, double z) const
 Return a line passively move by the given s and z coordinates as a copy.
 
SZJacobian passiveMoveByJacobian (const Vector2D &bySZ) const
 Computes the Jacobi matrix for a move of the coordinate system by the given vector.
 

Private Attributes

double m_tanLambda
 Memory for the tan lambda parameter.
 
double m_z0
 Memory for the z0 parameter.
 

Detailed Description

A line in the sz space.

The line is represented in sz parameters tan lambda and z0 beginning the slope and the intercept of the line in the sz space.

Definition at line 26 of file SZLine.h.

Constructor & Destructor Documentation

◆ SZLine() [1/3]

SZLine ( )
inline

Default constructor for ROOT compatibility.

Definition at line 30 of file SZLine.h.

31 : m_tanLambda(NAN)
32 , m_z0(NAN)
33 {
34 }
double m_tanLambda
Memory for the tan lambda parameter.
Definition: SZLine.h:218
double m_z0
Memory for the z0 parameter.
Definition: SZLine.h:221

◆ SZLine() [2/3]

SZLine ( double  tanLambda,
double  z0 
)
inline

Constructor from slope and intercept in the sz space.

Definition at line 37 of file SZLine.h.

39 , m_z0(z0)
40 {
41 }
double z0() const
Getter for the z0 parameter.
Definition: SZLine.h:82
double tanLambda() const
Getter for the tan lambda parameter.
Definition: SZLine.h:52

◆ SZLine() [3/3]

SZLine ( const SZParameters szParameters)
inlineexplicit

Constructor from the sz parameters.

Definition at line 44 of file SZLine.h.

45 : m_tanLambda(szParameters(ESZParameter::c_TanL))
46 , m_z0(szParameters(ESZParameter::c_Z0))
47 {
48 }
SZParameters szParameters() const
Getter for the sz parameters.
Definition: SZLine.h:100

Member Function Documentation

◆ distance() [1/2]

double distance ( const Vector2D szPoint) const
inline

Calculates the signed distance of the point to the line.

Returns the signed distance of the point to the line. The sign is positive
below the curve and negative above it.

Definition at line 165 of file SZLine.h.

166 {
167 return distance(szPoint.first(), szPoint.second());
168 }
double distance(const Vector2D &szPoint) const
Calculates the signed distance of the point to the line.
Definition: SZLine.h:165

◆ distance() [2/2]

double distance ( double  s,
double  z 
) const
inline

Calculates the signed distance of the point given by its to coordinates to the line.

Returns the signed distance of the point to the line. The sign is positive
below the curve and negative above it.

Definition at line 175 of file SZLine.h.

176 {
177 return (map(s) - z) / hypot2(1, tanLambda());
178 }
double map(double s) const
Maps the two dimensional arc length s to z.
Definition: SZLine.h:116

◆ intercept()

double intercept ( ) const
inline

Getter for the intercept in the sz space which is equivalent to z0.

Definition at line 88 of file SZLine.h.

89 {
90 return m_z0;
91 }

◆ intersection()

Vector2D intersection ( const SZLine szLine) const

Calculates the intersection point of two line. Infinity for parallels.

Definition at line 14 of file SZLine.cc.

15{
16 const double s = -(z0() - szLine.z0()) / (tanLambda() - szLine.tanLambda());
17 return Vector2D(s, map(s));
18}
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
Definition: Vector2D.h:32

◆ invalidate()

void invalidate ( )
inline

Sets the parameters to a invalid representation.

Definition at line 135 of file SZLine.h.

136 {
137 setZ0(NAN);
138 setTanLambda(NAN);
139 }
void setZ0(double z0)
Getter for the z0 parameter.
Definition: SZLine.h:94
void setTanLambda(double tanLambda)
Getter for the tan lambda parameter.
Definition: SZLine.h:76

◆ inverseMap()

double inverseMap ( double  z) const
inline

Maps the z coordinate to the two dimensional arc length s.

Definition at line 128 of file SZLine.h.

129 {
130 return (z - z0()) / tanLambda();
131 }

◆ inverseSlope()

double inverseSlope ( ) const
inline

Returns the slope over the second coordinate.

Definition at line 64 of file SZLine.h.

65 {
66 return 1 / tanLambda();
67 }

◆ isInvalid()

bool isInvalid ( ) const
inline

Indicates if the line parameters do not represent a valid line.

Definition at line 142 of file SZLine.h.

143 {
144 return not std::isfinite(tanLambda()) or not std::isfinite(z0());
145 }
STL namespace.

◆ map()

double map ( double  s) const
inline

Maps the two dimensional arc length s to z.

Definition at line 116 of file SZLine.h.

117 {
118 return tanLambda() * s + z0();
119 }

◆ operator()()

double operator() ( double  s) const
inline

Maps the two dimensional arc length s to z.

Definition at line 122 of file SZLine.h.

123 {
124 return map(s);
125 }

◆ passiveMoveBy() [1/2]

void passiveMoveBy ( const Vector2D bySZ)
inline

Passively move the coordinate system in place by the given sz vector.

Definition at line 184 of file SZLine.h.

185 {
186 passiveMoveBy(bySZ.first(), bySZ.second());
187 }
void passiveMoveBy(const Vector2D &bySZ)
Passively move the coordinate system in place by the given sz vector.
Definition: SZLine.h:184

◆ passiveMoveBy() [2/2]

void passiveMoveBy ( double  s,
double  z 
)
inline

Passively move the coordinate system in place by the given s and z coordinates.

Definition at line 190 of file SZLine.h.

191 {
192 m_z0 = map(s) - z;
193 }

◆ passiveMoveByJacobian()

SZJacobian passiveMoveByJacobian ( const Vector2D bySZ) const
inline

Computes the Jacobi matrix for a move of the coordinate system by the given vector.

Definition at line 208 of file SZLine.h.

209 {
210 using namespace NSZParameterIndices;
211 SZJacobian result = SZUtil::identity();
212 result(c_Z0, c_TanL) = bySZ.first();
213 return result;
214 }

◆ passiveMovedBy() [1/2]

SZLine passiveMovedBy ( const Vector2D bySZ) const
inline

Return a line passively move by the given vector as a copy.

Definition at line 196 of file SZLine.h.

197 {
198 return passiveMovedBy(bySZ.first(), bySZ.second());
199 }
SZLine passiveMovedBy(const Vector2D &bySZ) const
Return a line passively move by the given vector as a copy.
Definition: SZLine.h:196

◆ passiveMovedBy() [2/2]

SZLine passiveMovedBy ( double  s,
double  z 
) const
inline

Return a line passively move by the given s and z coordinates as a copy.

Definition at line 202 of file SZLine.h.

203 {
204 return SZLine(tanLambda(), map(s) - z);
205 }
SZLine()
Default constructor for ROOT compatibility.
Definition: SZLine.h:30

◆ reverse()

void reverse ( )
inline

Reverse the arc length direction in place.

Definition at line 148 of file SZLine.h.

149 {
151 }

◆ reversed()

SZLine reversed ( ) const
inline

Returns a copy of the line with reversed the arc length direction.

Definition at line 154 of file SZLine.h.

155 {
156 return SZLine(-tanLambda(), z0());
157 }

◆ setTanLambda()

void setTanLambda ( double  tanLambda)
inline

Getter for the tan lambda parameter.

Definition at line 76 of file SZLine.h.

77 {
79 }

◆ setZ0()

void setZ0 ( double  z0)
inline

Getter for the z0 parameter.

Definition at line 94 of file SZLine.h.

95 {
96 m_z0 = z0;
97 }

◆ slope()

double slope ( ) const
inline

Getter for the slope in the sz space which is equivalent to tan lambda.

Definition at line 58 of file SZLine.h.

59 {
60 return m_tanLambda;
61 }

◆ szParameters()

SZParameters szParameters ( ) const
inline

Getter for the sz parameters.

Definition at line 100 of file SZLine.h.

101 {
102 using namespace NSZParameterIndices;
103 SZParameters result;
104 result(c_TanL) = tanLambda();
105 result(c_Z0) = z0();
106 return result;
107 }

◆ tanLambda()

double tanLambda ( ) const
inline

Getter for the tan lambda parameter.

Definition at line 52 of file SZLine.h.

53 {
54 return m_tanLambda;
55 }

◆ theta()

double theta ( ) const
inline

Getter for the theta dip angle.

Definition at line 70 of file SZLine.h.

71 {
72 return m_tanLambda;
73 }

◆ z0()

double z0 ( ) const
inline

Getter for the z0 parameter.

Definition at line 82 of file SZLine.h.

83 {
84 return m_z0;
85 }

◆ zero()

double zero ( ) const
inline

Returns the the two dimensional arc length s where the z coordinate approaches zero.

Definition at line 110 of file SZLine.h.

111 {
112 return -intercept() / slope();
113 }
double slope() const
Getter for the slope in the sz space which is equivalent to tan lambda.
Definition: SZLine.h:58
double intercept() const
Getter for the intercept in the sz space which is equivalent to z0.
Definition: SZLine.h:88

Member Data Documentation

◆ m_tanLambda

double m_tanLambda
private

Memory for the tan lambda parameter.

Definition at line 218 of file SZLine.h.

◆ m_z0

double m_z0
private

Memory for the z0 parameter.

Definition at line 221 of file SZLine.h.


The documentation for this class was generated from the following files: