Belle II Software development
PhiAngle Class Reference

#include <Angle.h>

Inheritance diagram for PhiAngle:
BaseAngle

Public Member Functions

 PhiAngle (double angle, double error)
 Constructor using radian units.
 
bool contains (const PhiAngle &angle) const
 Check if two angles are compatible.
 
bool containsIn (const PhiAngle &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 Phi specific.

Definition at line 106 of file Angle.h.

Constructor & Destructor Documentation

◆ PhiAngle()

PhiAngle ( double  angle,
double  error 
)
inline

Constructor using radian units.

Phi in [0, 2 * pi).

Parameters
anglephi angle
errorerror on the phi angle

Definition at line 114 of file Angle.h.

114 : BaseAngle(angle, error)
115 {
116 /* Angle in the range (-2 * pi, 2 * pi). */
117 m_angle = std::fmod(m_angle, TMath::TwoPi());
118 if (m_angle < 0)
119 m_angle = m_angle + TMath::TwoPi();
120 }
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 PhiAngle angle) const
inline

Check if two angles are compatible.

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

Definition at line 126 of file Angle.h.

127 {
128 return containsIn(angle, 1);
129 }
bool containsIn(const PhiAngle &angle, double sigma) const
Check if two angles are compatible.
Definition: Angle.h:136

◆ containsIn()

bool containsIn ( const PhiAngle 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 136 of file Angle.h.

137 {
138 double angularDistance, shortestAngularDistance, sigmaError;
139 /* Distance in the range [0, 2 * pi). */
140 angularDistance = std::abs(m_angle - angle.getAngle());
141 /* Distance in the range [0, pi]. */
142 if (angularDistance > TMath::Pi())
143 shortestAngularDistance = TMath::TwoPi() - angularDistance;
144 else
145 shortestAngularDistance = angularDistance;
146 sigmaError = sigma * (m_error + angle.getError());
147 return shortestAngularDistance < sigmaError;
148 }
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: