32namespace siscone_spherical{
34#define PHI_RANGE_MASK 0xFFFFFFFF
68 double xmin = max(c_theta-R,
theta_min+0.00001);
69 double xmax = min(c_theta+R,
theta_max-0.00001);
71 unsigned int cell_min = get_theta_cell(xmin);
72 unsigned int cell_max = get_theta_cell(xmax);
84 double extra = asin(R/M_PI);
94 extra = max(1.0/sin(xmin), 1.0/sin(xmax));
95 ymin = (c_phi-R)*extra;
96 while (ymin<-M_PI) ymin+=
twopi;
97 while (ymin> M_PI) ymin-=
twopi;
98 ymax = (c_phi-R)*extra;
99 while (ymax<-M_PI) ymax+=
twopi;
100 while (ymax> M_PI) ymax-=
twopi;
102 cell_min = get_phi_cell(ymin);
103 cell_max = get_phi_cell(ymax);
107 phi_range = (cell_max-cell_min)+cell_max;
111 : ((PHI_RANGE_MASK^(cell_min-cell_max)) + cell_max);
132 unsigned int theta_cell = get_theta_cell(theta);
141 if ((theta_cell == 0x1) || (theta_cell == 0x80000000))
166const CSphtheta_phi_range range_union (
const CSphtheta_phi_range &r1,
const CSphtheta_phi_range &r2){
167 CSphtheta_phi_range tmp;
170 tmp.theta_range = r1.theta_range | r2.theta_range;
173 tmp.
phi_range = r1.phi_range | r2.phi_range;
unsigned int phi_range
phi range as a binary coding of covered cells
class for holding a covering range in eta-phi
int add_particle(const double theta, const double phi)
add a particle to the range
CSphtheta_phi_range & operator=(const CSphtheta_phi_range &r)
assignment of range
static double theta_max
maximal value for theta (set to pi)
unsigned int theta_range
theta range as a binary coding of covered cells
static double theta_min
extremal value for theta
CSphtheta_phi_range()
default ctor
unsigned int phi_range
phi range as a binary coding of covered cells
const double twopi
definition of 2*M_PI which is useful a bit everyhere!