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 ROOT::Math::XYVector &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.
 
ROOT::Math::XYVector intersection (const SZLine &szLine) const
 Calculates the intersection point of two line. Infinity for parallels.
 
void passiveMoveBy (const ROOT::Math::XYVector &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 ROOT::Math::XYVector &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.
 

Static Public Member Functions

static SZJacobian passiveMoveByJacobian (const ROOT::Math::XYVector &bySZ)
 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 28 of file SZLine.h.

Constructor & Destructor Documentation

◆ SZLine() [1/3]

SZLine ( )
inline

Default constructor for ROOT compatibility.

Definition at line 32 of file SZLine.h.

33 : m_tanLambda(NAN)
34 , m_z0(NAN)
35 {
36 }

◆ SZLine() [2/3]

SZLine ( double tanLambda,
double z0 )
inline

Constructor from slope and intercept in the sz space.

Definition at line 39 of file SZLine.h.

40 : m_tanLambda(tanLambda)
41 , m_z0(z0)
42 {
43 }

◆ SZLine() [3/3]

SZLine ( const SZParameters & szParameters)
inlineexplicit

Constructor from the sz parameters.

Definition at line 46 of file SZLine.h.

47 : m_tanLambda(szParameters(ESZParameter::c_TanL))
48 , m_z0(szParameters(ESZParameter::c_Z0))
49 {
50 }

Member Function Documentation

◆ distance() [1/2]

double distance ( const ROOT::Math::XYVector & 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 167 of file SZLine.h.

168 {
169 return distance(szPoint.X(), szPoint.Y());
170 }

◆ 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 177 of file SZLine.h.

178 {
179 return (map(s) - z) / hypot2(1, tanLambda());
180 }

◆ intercept()

double intercept ( ) const
inline

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

Definition at line 90 of file SZLine.h.

91 {
92 return m_z0;
93 }

◆ intersection()

ROOT::Math::XYVector 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 ROOT::Math::XYVector(s, map(s));
18}
double z0() const
Getter for the z0 parameter.
Definition SZLine.h:84
double tanLambda() const
Getter for the tan lambda parameter.
Definition SZLine.h:54
double map(double s) const
Maps the two dimensional arc length s to z.
Definition SZLine.h:118

◆ invalidate()

void invalidate ( )
inline

Sets the parameters to a invalid representation.

Definition at line 137 of file SZLine.h.

138 {
139 setZ0(NAN);
140 setTanLambda(NAN);
141 }

◆ inverseMap()

double inverseMap ( double z) const
inline

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

Definition at line 130 of file SZLine.h.

131 {
132 return (z - z0()) / tanLambda();
133 }

◆ inverseSlope()

double inverseSlope ( ) const
inline

Returns the slope over the second coordinate.

Definition at line 66 of file SZLine.h.

67 {
68 return 1 / tanLambda();
69 }

◆ isInvalid()

bool isInvalid ( ) const
inline

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

Definition at line 144 of file SZLine.h.

145 {
146 return not std::isfinite(tanLambda()) or not std::isfinite(z0());
147 }

◆ map()

double map ( double s) const
inline

Maps the two dimensional arc length s to z.

Definition at line 118 of file SZLine.h.

119 {
120 return tanLambda() * s + z0();
121 }

◆ operator()()

double operator() ( double s) const
inline

Maps the two dimensional arc length s to z.

Definition at line 124 of file SZLine.h.

125 {
126 return map(s);
127 }

◆ passiveMoveBy() [1/2]

void passiveMoveBy ( const ROOT::Math::XYVector & bySZ)
inline

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

Definition at line 186 of file SZLine.h.

187 {
188 passiveMoveBy(bySZ.X(), bySZ.Y());
189 }

◆ 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 192 of file SZLine.h.

193 {
194 m_z0 = map(s) - z;
195 }

◆ passiveMoveByJacobian()

static SZJacobian passiveMoveByJacobian ( const ROOT::Math::XYVector & bySZ)
inlinestatic

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

Definition at line 210 of file SZLine.h.

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

◆ passiveMovedBy() [1/2]

SZLine passiveMovedBy ( const ROOT::Math::XYVector & bySZ) const
inline

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

Definition at line 198 of file SZLine.h.

199 {
200 return passiveMovedBy(bySZ.X(), bySZ.Y());
201 }

◆ 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 204 of file SZLine.h.

205 {
206 return SZLine(tanLambda(), map(s) - z);
207 }

◆ reverse()

void reverse ( )
inline

Reverse the arc length direction in place.

Definition at line 150 of file SZLine.h.

151 {
152 m_tanLambda = -m_tanLambda;
153 }

◆ reversed()

SZLine reversed ( ) const
inline

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

Definition at line 156 of file SZLine.h.

157 {
158 return SZLine(-tanLambda(), z0());
159 }

◆ setTanLambda()

void setTanLambda ( double tanLambda)
inline

Getter for the tan lambda parameter.

Definition at line 78 of file SZLine.h.

79 {
80 m_tanLambda = tanLambda;
81 }

◆ setZ0()

void setZ0 ( double z0)
inline

Getter for the z0 parameter.

Definition at line 96 of file SZLine.h.

97 {
98 m_z0 = z0;
99 }

◆ slope()

double slope ( ) const
inline

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

Definition at line 60 of file SZLine.h.

61 {
62 return m_tanLambda;
63 }

◆ szParameters()

SZParameters szParameters ( ) const
inline

Getter for the sz parameters.

Definition at line 102 of file SZLine.h.

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

◆ tanLambda()

double tanLambda ( ) const
inline

Getter for the tan lambda parameter.

Definition at line 54 of file SZLine.h.

55 {
56 return m_tanLambda;
57 }

◆ theta()

double theta ( ) const
inline

Getter for the theta dip angle.

Definition at line 72 of file SZLine.h.

73 {
74 return m_tanLambda;
75 }

◆ z0()

double z0 ( ) const
inline

Getter for the z0 parameter.

Definition at line 84 of file SZLine.h.

85 {
86 return m_z0;
87 }

◆ zero()

double zero ( ) const
inline

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

Definition at line 112 of file SZLine.h.

113 {
114 return -intercept() / slope();
115 }

Member Data Documentation

◆ m_tanLambda

double m_tanLambda
private

Memory for the tan lambda parameter.

Definition at line 220 of file SZLine.h.

◆ m_z0

double m_z0
private

Memory for the z0 parameter.

Definition at line 223 of file SZLine.h.


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