Belle II Software light-2406-ragdoll
ThetaAngle Class Reference

#include <Angle.h>

Inheritance diagram for ThetaAngle:
Collaboration diagram for ThetaAngle:

Public Member Functions

 ThetaAngle (double angle, double error)
 Constructor using radian units.
 
bool contains (const ThetaAngle &angle) const
 Check if two angles are compatible.
 
bool containsIn (const ThetaAngle &angle, double sigma) const
 Check if two angles are compatible.
 
double getAngle () const
 Getter for the angle.
 
double getError () const
 Getter for the error of the angle.
 
double getAngleInDeg () const
 Getter for angle in degrees.
 
double getErrorInDeg () const
 Getter for the error of the angle in degrees.
 

Protected Attributes

double m_angle
 Angle in rad.
 
double m_error
 Error in rad.
 

Detailed Description

See also
BaseAngle Theta specific.

Definition at line 63 of file Angle.h.

Constructor & Destructor Documentation

◆ ThetaAngle()

ThetaAngle ( double  angle,
double  error 
)
inline

Constructor using radian units.

Theta in [0, pi].

Parameters
angletheta angle to use
errorerror on the angle

Definition at line 71 of file Angle.h.

71 : BaseAngle(angle, error)
72 {
73 m_angle = std::fabs(std::fmod(m_angle, TMath::Pi()));
74 }
BaseAngle(double angle, double error)
Constructor.
Definition: Angle.h:30
double m_angle
Angle in rad.
Definition: Angle.h:53

Member Function Documentation

◆ contains()

bool contains ( const ThetaAngle angle) const
inline

Check if two angles are compatible.

Parameters
anglesecond angle to compare to
Returns
true if within one standard deviation

Definition at line 80 of file Angle.h.

81 {
82 return containsIn(angle, 1);
83 }
bool containsIn(const ThetaAngle &angle, double sigma) const
Check if two angles are compatible.
Definition: Angle.h:90

◆ containsIn()

bool containsIn ( const ThetaAngle angle,
double  sigma 
) const
inline

Check if two angles are compatible.

Parameters
anglesecond angle to compare to
sigmawidth of the error band in standard deviations
Returns
true if within sigma standard deviations

Definition at line 90 of file Angle.h.

91 {
92 double angularDistance, sigmaError;
93 /* Distance in the range [0, pi]. */
94 angularDistance = std::abs(m_angle - angle.getAngle());
95 sigmaError = sigma * (m_error + angle.getError());
96 return angularDistance < sigmaError;
97 }
double m_error
Error in rad.
Definition: Angle.h:54

◆ getAngle()

double getAngle ( ) const
inlineinherited

Getter for the angle.

Definition at line 37 of file Angle.h.

37{ return m_angle; }

◆ getAngleInDeg()

double getAngleInDeg ( ) const
inlineinherited

Getter for angle in degrees.

Definition at line 45 of file Angle.h.

45{ return m_angle * TMath::RadToDeg(); }

◆ getError()

double getError ( ) const
inlineinherited

Getter for the error of the angle.

Definition at line 41 of file Angle.h.

41{ return m_error; }

◆ getErrorInDeg()

double getErrorInDeg ( ) const
inlineinherited

Getter for the error of the angle in degrees.

Definition at line 49 of file Angle.h.

49{ return m_error * TMath::RadToDeg(); }

Member Data Documentation

◆ m_angle

double m_angle
protectedinherited

Angle in rad.

Definition at line 53 of file Angle.h.

◆ m_error

double m_error
protectedinherited

Error in rad.

Definition at line 54 of file Angle.h.


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