BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
BesAngle Class Reference

#include <BesAngle.h>

Public Member Functions

 BesAngle ()
 
 BesAngle (const double)
 
 ~BesAngle ()
 
 operator double () const
 
double rad () const
 
double deg () const
 
double posRad () const
 
double posDeg () const
 
void setRad (const double)
 
void setDeg (const double)
 
double arc (double radius) const
 
void setSector (int n, int max)
 
void setSector (int n, int max, BesAngle phi_0)
 
BesAngle operator+ (const BesAngle &) const
 
BesAngle operator+ (const double) const
 
BesAngle operator- (const BesAngle &) const
 
BesAngle operator- (const double) const
 
BesAngle operator* (const double) const
 
BesAngle operator/ (const double) const
 
void operator= (const BesAngle)
 
void operator+= (BesAngle)
 
void operator-= (BesAngle)
 
void operator+= (double)
 
void operator-= (double)
 
void operator*= (double)
 
void operator/= (double)
 
int sector (int max)
 
int sector (int max, BesAngle phi_0)
 
double Rad () const
 
double Deg () const
 
int Sector (int max)
 
int Sector (int max, BesAngle phi_0)
 
 BesAngle ()
 
 BesAngle (const double)
 
 ~BesAngle ()
 
 operator double () const
 
double rad () const
 
double deg () const
 
double posRad () const
 
double posDeg () const
 
void setRad (const double)
 
void setDeg (const double)
 
double arc (double radius) const
 
void setSector (int n, int max)
 
void setSector (int n, int max, BesAngle phi_0)
 
BesAngle operator+ (const BesAngle &) const
 
BesAngle operator+ (const double) const
 
BesAngle operator- (const BesAngle &) const
 
BesAngle operator- (const double) const
 
BesAngle operator* (const double) const
 
BesAngle operator/ (const double) const
 
void operator= (const BesAngle)
 
void operator+= (BesAngle)
 
void operator-= (BesAngle)
 
void operator+= (double)
 
void operator-= (double)
 
void operator*= (double)
 
void operator/= (double)
 
int sector (int max)
 
int sector (int max, BesAngle phi_0)
 
double Rad () const
 
double Deg () const
 
int Sector (int max)
 
int Sector (int max, BesAngle phi_0)
 

Static Public Attributes

static const double pi = Constants::pi
 used instead.
 
static const double twoPi = Constants::twoPi
 

Static Protected Member Functions

static double normalize (double)
 
static double normalize (double)
 

Protected Attributes

double _phi
 

Static Protected Attributes

static const double toDegrees = Constants::radToDegrees
 

Friends

BesAngle operator* (const double, const BesAngle &)
 
double sin (const BesAngle)
 
double cos (const BesAngle)
 
double tan (const BesAngle)
 
BesAngle operator* (const double, const BesAngle &)
 
double sin (const BesAngle)
 
double cos (const BesAngle)
 
double tan (const BesAngle)
 

Detailed Description

Constructor & Destructor Documentation

◆ BesAngle() [1/4]

BesAngle::BesAngle ( )
inline

◆ BesAngle() [2/4]

BesAngle::BesAngle ( const double  phi)
inline

Definition at line 113 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

113 : _phi(normalize(phi))
114{}

◆ ~BesAngle() [1/2]

BesAngle::~BesAngle ( )
inline

Definition at line 116 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

116{}

◆ BesAngle() [3/4]

BesAngle::BesAngle ( )
inline

◆ BesAngle() [4/4]

BesAngle::BesAngle ( const double  )
inline

◆ ~BesAngle() [2/2]

BesAngle::~BesAngle ( )
inline

Member Function Documentation

◆ arc() [1/2]

double BesAngle::arc ( double  radius) const
inline

Definition at line 139 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

140{ return radius * rad(); }

◆ arc() [2/2]

double BesAngle::arc ( double  radius) const
inline

◆ deg() [1/2]

double BesAngle::deg ( ) const
inline

◆ Deg() [1/2]

double BesAngle::Deg ( ) const
inline

Definition at line 79 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

79{ return deg(); }

◆ deg() [2/2]

double BesAngle::deg ( ) const
inline

◆ Deg() [2/2]

double BesAngle::Deg ( ) const
inline

◆ normalize() [1/2]

double BesAngle::normalize ( double  angle)
inlinestaticprotected

Definition at line 98 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

98 {
99 if (angle < - Constants::pi) {
100 angle += Constants::twoPi;
101 if (angle < - Constants::pi) angle = fmod(angle+ Constants::pi, Constants::twoPi) + Constants::pi;
102 }
103 else if (angle > Constants::pi) {
104 angle -= Constants::twoPi;
105 if (angle > Constants::pi) angle = fmod(angle+Constants::pi, Constants::twoPi) - Constants::pi;
106 }
107 return angle;
108}

Referenced by operator*=(), operator+=(), operator-=(), operator/=(), operator=(), and setRad().

◆ normalize() [2/2]

static double BesAngle::normalize ( double  )
inlinestaticprotected

◆ operator double() [1/2]

BesAngle::operator double ( ) const
inline

Definition at line 24 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

24{ return _phi;}; // automatic conversion to double

◆ operator double() [2/2]

BesAngle::operator double ( ) const
inline

Definition at line 24 of file Reconstruction/MdcPatRec/MdcGeom/MdcGeom-00-01-17/MdcGeom/BesAngle.h.

24{ return _phi;}; // automatic conversion to double

◆ operator*() [1/2]

BesAngle BesAngle::operator* ( const double  x) const
inline

◆ operator*() [2/2]

BesAngle BesAngle::operator* ( const double  ) const
inline

◆ operator*=() [1/2]

void BesAngle::operator*= ( double  x)
inline

Definition at line 189 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

190{ _phi = normalize(_phi*x);
191}

◆ operator*=() [2/2]

void BesAngle::operator*= ( double  )
inline

◆ operator+() [1/4]

BesAngle BesAngle::operator+ ( const BesAngle a) const
inline

Definition at line 148 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

149{ return BesAngle(_phi + a._phi); }

◆ operator+() [2/4]

BesAngle BesAngle::operator+ ( const BesAngle ) const
inline

◆ operator+() [3/4]

BesAngle BesAngle::operator+ ( const double  a) const
inline

Definition at line 151 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

152{ return BesAngle(_phi + a); }

◆ operator+() [4/4]

BesAngle BesAngle::operator+ ( const double  ) const
inline

◆ operator+=() [1/4]

void BesAngle::operator+= ( BesAngle  a)
inline

Definition at line 173 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

174{ _phi = normalize(_phi + a._phi );
175}

◆ operator+=() [2/4]

void BesAngle::operator+= ( BesAngle  )
inline

◆ operator+=() [3/4]

void BesAngle::operator+= ( double  a)
inline

Definition at line 177 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

178{ _phi = normalize(_phi + a);
179}

◆ operator+=() [4/4]

void BesAngle::operator+= ( double  )
inline

◆ operator-() [1/4]

BesAngle BesAngle::operator- ( const BesAngle a) const
inline

Definition at line 154 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

155{ return BesAngle(_phi - a._phi); }

◆ operator-() [2/4]

BesAngle BesAngle::operator- ( const BesAngle ) const
inline

◆ operator-() [3/4]

BesAngle BesAngle::operator- ( const double  a) const
inline

Definition at line 157 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

158{ return BesAngle(_phi - a); }

◆ operator-() [4/4]

BesAngle BesAngle::operator- ( const double  ) const
inline

◆ operator-=() [1/4]

void BesAngle::operator-= ( BesAngle  a)
inline

Definition at line 181 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

182{ _phi = normalize(_phi - a._phi );
183}

◆ operator-=() [2/4]

void BesAngle::operator-= ( BesAngle  )
inline

◆ operator-=() [3/4]

void BesAngle::operator-= ( double  a)
inline

Definition at line 185 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

186{ _phi = normalize(_phi - a);
187}

◆ operator-=() [4/4]

void BesAngle::operator-= ( double  )
inline

◆ operator/() [1/2]

BesAngle BesAngle::operator/ ( const double  x) const
inline

Definition at line 163 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

164{ return BesAngle(_phi / x); }

◆ operator/() [2/2]

BesAngle BesAngle::operator/ ( const double  ) const
inline

◆ operator/=() [1/2]

void BesAngle::operator/= ( double  x)
inline

Definition at line 193 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

194{ _phi = normalize(_phi/x);
195}

◆ operator/=() [2/2]

void BesAngle::operator/= ( double  )
inline

◆ operator=() [1/2]

void BesAngle::operator= ( const BesAngle  a)
inline

Definition at line 169 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

170{ _phi = normalize(a._phi);
171}

◆ operator=() [2/2]

void BesAngle::operator= ( const  BesAngle)
inline

◆ posDeg() [1/2]

double BesAngle::posDeg ( ) const
inline

◆ posDeg() [2/2]

double BesAngle::posDeg ( ) const
inline

◆ posRad() [1/2]

double BesAngle::posRad ( ) const
inline

Definition at line 124 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

125{
126 if (_phi >= 0.0) return _phi;
127 else return _phi + Constants::twoPi;
128}

Referenced by MdcTrackList::pickHits(), and posDeg().

◆ posRad() [2/2]

double BesAngle::posRad ( ) const
inline

◆ rad() [1/2]

◆ Rad() [1/2]

double BesAngle::Rad ( ) const
inline

Definition at line 78 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

78{ return rad(); }

Referenced by MdcSegGrouperCsmc::storePar().

◆ rad() [2/2]

double BesAngle::rad ( ) const
inline

◆ Rad() [2/2]

double BesAngle::Rad ( ) const
inline

◆ sector() [1/4]

int BesAngle::sector ( int  max)
inline

Definition at line 197 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

198{
199 double phi = _phi;
200 if (phi < 0) phi += Constants::twoPi;
201 return ( int (phi / (Constants::twoPi / max) ) + 1 );
202}

Referenced by Sector().

◆ Sector() [1/4]

int BesAngle::Sector ( int  max)
inline

◆ sector() [2/4]

int BesAngle::sector ( int  max)
inline

◆ Sector() [2/4]

int BesAngle::Sector ( int  max)
inline

◆ sector() [3/4]

int BesAngle::sector ( int  max,
BesAngle  phi_0 
)
inline

Definition at line 204 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

205{
206 BesAngle t( _phi - phi_0._phi);
207 return t.sector(max);
208}
int t()
Definition: t.c:1

◆ Sector() [3/4]

int BesAngle::Sector ( int  max,
BesAngle  phi_0 
)
inline

Definition at line 82 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

82{ return sector(max, phi_0); }

◆ sector() [4/4]

int BesAngle::sector ( int  max,
BesAngle  phi_0 
)
inline

◆ Sector() [4/4]

int BesAngle::Sector ( int  max,
BesAngle  phi_0 
)
inline

Definition at line 82 of file Reconstruction/MdcPatRec/MdcGeom/MdcGeom-00-01-17/MdcGeom/BesAngle.h.

82{ return sector(max, phi_0); }

◆ setDeg() [1/2]

void BesAngle::setDeg ( const double  phi)
inline

◆ setDeg() [2/2]

void BesAngle::setDeg ( const double  )
inline

◆ setRad() [1/2]

void BesAngle::setRad ( const double  phi)
inline

◆ setRad() [2/2]

void BesAngle::setRad ( const double  )
inline

◆ setSector() [1/4]

void BesAngle::setSector ( int  n,
int  max 
)
inline

Definition at line 142 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

143{ setRad((n + 0.5) * Constants::twoPi / max); }
const Int_t n

◆ setSector() [2/4]

void BesAngle::setSector ( int  n,
int  max 
)
inline

◆ setSector() [3/4]

void BesAngle::setSector ( int  n,
int  max,
BesAngle  phi_0 
)
inline

Definition at line 145 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

146{ setRad((n + 0.5) * Constants::twoPi / max + phi_0._phi); }

◆ setSector() [4/4]

void BesAngle::setSector ( int  n,
int  max,
BesAngle  phi_0 
)
inline

Friends And Related Function Documentation

◆ cos [1/2]

double cos ( const BesAngle  a)
friend

Definition at line 213 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

214{ return cos(a._phi); }
friend double cos(const BesAngle)

◆ cos [2/2]

double cos ( const BesAngle  a)
friend

Definition at line 213 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

214{ return cos(a._phi); }

◆ operator* [1/2]

BesAngle operator* ( const double  x,
const BesAngle a 
)
friend

Definition at line 166 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

167{ return BesAngle(a * x); }

◆ operator* [2/2]

BesAngle operator* ( const double  x,
const BesAngle a 
)
friend

Definition at line 166 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

167{ return BesAngle(a * x); }

◆ sin [1/2]

double sin ( const BesAngle  a)
friend

Definition at line 210 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

211{ return sin(a._phi); }
friend double sin(const BesAngle)

◆ sin [2/2]

double sin ( const BesAngle  a)
friend

Definition at line 210 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

211{ return sin(a._phi); }

◆ tan [1/2]

double tan ( const BesAngle  a)
friend

Definition at line 216 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

217{ return tan(a._phi); }
friend double tan(const BesAngle)

◆ tan [2/2]

double tan ( const BesAngle  a)
friend

Definition at line 216 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

217{ return tan(a._phi); }

Member Data Documentation

◆ _phi

◆ pi

const double BesAngle::pi = Constants::pi
static

used instead.

Definition at line 74 of file InstallArea/include/MdcGeom/MdcGeom/BesAngle.h.

◆ toDegrees

const double BesAngle::toDegrees = Constants::radToDegrees
staticprotected

◆ twoPi

const double BesAngle::twoPi = Constants::twoPi
static

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