#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) |
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) |
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) |
Definition at line 17 of file BesAngle.h.
BesAngle::BesAngle | ( | ) | [inline] |
Definition at line 110 of file BesAngle.h.
Referenced by operator *(), operator+(), operator-(), and operator/().
00110 : _phi(0) 00111 { }
BesAngle::BesAngle | ( | const | double | ) | [inline] |
BesAngle::~BesAngle | ( | ) | [inline] |
double BesAngle::arc | ( | double | radius | ) | const [inline] |
double BesAngle::Deg | ( | ) | const [inline] |
double BesAngle::deg | ( | ) | const [inline] |
Definition at line 121 of file BesAngle.h.
References _phi, and Constants::radToDegrees.
Referenced by Deg(), and MdcTrackList::pickHits().
00122 { return _phi * Constants::radToDegrees; }
double BesAngle::normalize | ( | double | ) | [inline, static, protected] |
Definition at line 98 of file BesAngle.h.
References Constants::pi, and Constants::twoPi.
Referenced by operator *=(), operator+=(), operator-=(), operator/=(), operator=(), and setRad().
00098 { 00099 if (angle < - Constants::pi) { 00100 angle += Constants::twoPi; 00101 if (angle < - Constants::pi) angle = fmod(angle+ Constants::pi, Constants::twoPi) + Constants::pi; 00102 } 00103 else if (angle > Constants::pi) { 00104 angle -= Constants::twoPi; 00105 if (angle > Constants::pi) angle = fmod(angle+Constants::pi, Constants::twoPi) - Constants::pi; 00106 } 00107 return angle; 00108 }
BesAngle BesAngle::operator * | ( | const | double | ) | const [inline] |
void BesAngle::operator *= | ( | double | ) | [inline] |
BesAngle::operator double | ( | ) | const [inline] |
Definition at line 24 of file BesAngle.h.
References _phi.
00024 { return _phi;}; // automatic conversion to double
BesAngle BesAngle::operator+ | ( | const | double | ) | const [inline] |
void BesAngle::operator+= | ( | double | ) | [inline] |
void BesAngle::operator+= | ( | BesAngle | ) | [inline] |
BesAngle BesAngle::operator- | ( | const | double | ) | const [inline] |
void BesAngle::operator-= | ( | double | ) | [inline] |
void BesAngle::operator-= | ( | BesAngle | ) | [inline] |
BesAngle BesAngle::operator/ | ( | const | double | ) | const [inline] |
void BesAngle::operator/= | ( | double | ) | [inline] |
void BesAngle::operator= | ( | const | BesAngle | ) | [inline] |
double BesAngle::posDeg | ( | ) | const [inline] |
Definition at line 130 of file BesAngle.h.
References posRad(), and Constants::radToDegrees.
00131 { return posRad() * Constants::radToDegrees; }
double BesAngle::posRad | ( | ) | const [inline] |
Definition at line 124 of file BesAngle.h.
References _phi, and Constants::twoPi.
Referenced by MdcTrackList::pickHits(), and posDeg().
00125 { 00126 if (_phi >= 0.0) return _phi; 00127 else return _phi + Constants::twoPi; 00128 }
double BesAngle::Rad | ( | ) | const [inline] |
Definition at line 78 of file BesAngle.h.
References rad().
Referenced by MdcSegGrouperCsmc::storePar().
00078 { return rad(); }
double BesAngle::rad | ( | ) | const [inline] |
Definition at line 118 of file BesAngle.h.
References _phi.
Referenced by arc(), MdcSegInfoSterO::calcStereo(), MdcUtilitySvc::cellTrackPassedByPhiPatPar(), MdcSegFinder::createSegs(), MdcxFindSegs::initWireGroups(), Rad(), and MdcSegGrouperAx::storePar().
00119 { return _phi; }
int BesAngle::Sector | ( | int | max, | |
BesAngle | phi_0 | |||
) | [inline] |
int BesAngle::Sector | ( | int | max | ) | [inline] |
int BesAngle::sector | ( | int | max, | |
BesAngle | phi_0 | |||
) | [inline] |
int BesAngle::sector | ( | int | max | ) | [inline] |
Definition at line 197 of file BesAngle.h.
References _phi, and Constants::twoPi.
Referenced by Sector().
00198 { 00199 double phi = _phi; 00200 if (phi < 0) phi += Constants::twoPi; 00201 return ( int (phi / (Constants::twoPi / max) ) + 1 ); 00202 }
void BesAngle::setDeg | ( | const | double | ) | [inline] |
Definition at line 136 of file BesAngle.h.
References Constants::radToDegrees, and setRad().
00137 { setRad(phi / Constants::radToDegrees); }
void BesAngle::setRad | ( | const | double | ) | [inline] |
Definition at line 133 of file BesAngle.h.
References _phi, and normalize().
Referenced by MdcSegGrouperSt::fillWithSegs(), MdcTrack::projectToR(), setDeg(), and setSector().
void BesAngle::setSector | ( | int | n, | |
int | max, | |||
BesAngle | phi_0 | |||
) | [inline] |
Definition at line 145 of file BesAngle.h.
References _phi, setRad(), and Constants::twoPi.
00146 { setRad((n + 0.5) * Constants::twoPi / max + phi_0._phi); }
void BesAngle::setSector | ( | int | n, | |
int | max | |||
) | [inline] |
Definition at line 142 of file BesAngle.h.
References setRad(), and Constants::twoPi.
00143 { setRad((n + 0.5) * Constants::twoPi / max); }
double cos | ( | const | BesAngle | ) | [friend] |
double sin | ( | const | BesAngle | ) | [friend] |
double tan | ( | const | BesAngle | ) | [friend] |
double BesAngle::_phi [protected] |
Definition at line 85 of file BesAngle.h.
Referenced by cos(), deg(), operator *(), operator *=(), operator double(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator=(), posRad(), rad(), sector(), setRad(), setSector(), sin(), and tan().
const double BesAngle::pi = Constants::pi [static] |
const double BesAngle::toDegrees = Constants::radToDegrees [static, protected] |
Definition at line 89 of file BesAngle.h.
const double BesAngle::twoPi = Constants::twoPi [static] |
Definition at line 75 of file BesAngle.h.