BOSS
7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/MdcGeom/MdcGeom/EntranceAngle.h
Go to the documentation of this file.
1
#ifndef ENTRANCEANGLE_H
2
#define ENTRANCEANGLE_H
3
////////////////////////////////
4
//
5
// BESIII MDC entrance angles are in radians, and degress should inly be used
6
// when absolutely necessary. Automatic conversions to and from
7
// the radians form are provided, but you have to manually
8
// go to and from degrees
9
//
10
// By convention, angles are represented as [-pi/2, pi/2]
11
//
12
#include "MdcGeom/Constants.h"
13
#include <math.h>
14
15
16
class
EntranceAngle
17
{
18
public
:
19
inline
EntranceAngle
();
20
inline
EntranceAngle
(
const
double
);
21
inline
~EntranceAngle
();
22
23
inline
operator
double()
const
{
return
_phi
;};
// automatic conversion to double
24
25
inline
double
rad
()
const
;
26
inline
double
deg
()
const
;
27
// convention : returns value in [-90, 90]
28
29
protected
:
30
double
_phi
;
31
32
inline
static
double
normalize
(
double
);
33
34
};
35
36
//
37
// Methods for EntranceAngle
38
//
39
40
inline
double
EntranceAngle::normalize
(
double
angle) {
41
while
(angle < -
Constants::halfPi
) {
42
angle +=
Constants::pi
;
43
}
44
while
(angle >
Constants::halfPi
) {
45
angle -=
Constants::pi
;
46
}
47
return
angle;
48
}
49
50
inline
EntranceAngle::EntranceAngle
() : _phi(0)
51
{ }
52
53
inline
EntranceAngle::EntranceAngle
(
const
double
phi) : _phi(normalize(phi))
54
{}
55
56
inline
EntranceAngle::~EntranceAngle
() {}
57
58
inline
double
EntranceAngle::rad
()
const
59
{
return
_phi
; }
60
61
inline
double
EntranceAngle::deg
()
const
62
{
return
_phi
*
Constants::radToDegrees
; }
63
64
#endif
Constants::pi
static const double pi
Definition:
InstallArea/include/MdcGeom/MdcGeom/Constants.h:38
Constants::halfPi
static const double halfPi
Definition:
InstallArea/include/MdcGeom/MdcGeom/Constants.h:40
Constants::radToDegrees
static const double radToDegrees
Definition:
InstallArea/include/MdcGeom/MdcGeom/Constants.h:41
EntranceAngle
Definition:
InstallArea/include/MdcGeom/MdcGeom/EntranceAngle.h:17
EntranceAngle::EntranceAngle
EntranceAngle()
Definition:
InstallArea/include/MdcGeom/MdcGeom/EntranceAngle.h:50
EntranceAngle::_phi
double _phi
Definition:
InstallArea/include/MdcGeom/MdcGeom/EntranceAngle.h:30
EntranceAngle::rad
double rad() const
Definition:
InstallArea/include/MdcGeom/MdcGeom/EntranceAngle.h:58
EntranceAngle::~EntranceAngle
~EntranceAngle()
Definition:
InstallArea/include/MdcGeom/MdcGeom/EntranceAngle.h:56
EntranceAngle::normalize
static double normalize(double)
Definition:
InstallArea/include/MdcGeom/MdcGeom/EntranceAngle.h:40
EntranceAngle::deg
double deg() const
Definition:
InstallArea/include/MdcGeom/MdcGeom/EntranceAngle.h:61
source
InstallArea
include
MdcGeom
MdcGeom
EntranceAngle.h
Generated by
1.9.6