46 for (const_iterator i = this->begin(); i != this->end(); ++i) {
48 const double x = dir.
getDot(*i);
52 index = std::distance(this->begin(), i);
134 double thetaMin = theta.first;
135 double thetaMax = theta.second;
137 if (thetaMin < 0.0) { thetaMin = 0.0; }
138 if (thetaMin > PI) { thetaMin = PI; }
139 if (thetaMax < 0.0) { thetaMax = 0.0; }
140 if (thetaMax > PI) { thetaMax = PI; }
142 if (thetaMax > thetaMin) {
146 const double rad = thetaMax - thetaMin;
147 const double bin = rad / floor(rad/(1.4*grid) + 0.5);
148 const double unit = 2.0 * sqrt(1.0 - cos(grid));
150 for (
double theta = thetaMin; theta < thetaMax + 0.5*bin; theta += bin) {
154 if (theta > 0.5*bin && PI - theta > 0.5*bin)
155 step = PI / floor(PI*sin(theta)/unit + 0.5);
159 for (
double phi = 0.0; phi < 2.0*PI - 0.5*step; phi += step) {
176 return 10.0 * sqrt((
double) 240 / (
double) N) * PI / 180.0;
207 for (JOmega3D::const_iterator i = group.begin(); i != group.end(); ++i) {
208 this->push_back({*i, {}});
211 for (JOmega3D::const_iterator i = omega.begin(); i != omega.end(); ++i) {
213 const int index = group.
find(*i);
215 (*this)[index].push_back(*i);
Data structure for angles in three dimensions.
double getDot(const JAngle3D &angle) const
Get dot product.
Data structure for direction in three dimensions.
Direction set covering (part of) solid angle.
JOmega3D()
Default constructor.
void configure(const JAngle3D &dir, const range_type &theta, const double grid)
Configure direction set.
JOmega3D(const JAngle3D &dir, const range_type &theta, const double grid)
Constructor.
static double getAngle(const size_t N)
Get approximate angular spacing given number of directions.
JOmega3D(const JAngle3D &dir)
Constructor.
JOmega3D(const double grid)
Constructor.
Auxiliary classes and methods for 3D geometrical objects and operations.
double getAngle(const JQuaternion3D &first, const JQuaternion3D &second)
Get space angle between quanternions.
static const double PI
Mathematical constants.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Base class for direction set.
std::pair< double, double > range_type
int find(const JAngle3D &dir) const
Get index of direction closest to given direction.
Auxiliary data structure to group direction sets.
JOmega3S(const JOmega3D &omega, const JOmega3D &group)
Constructor.
JOmega3S(const JOmega3D &omega, const size_t N)
Constructor.
JOmega3S(const double grid, const size_t N)
Constructor.