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);
77 theta_range = (cell_max-cell_min)+cell_max;
84 double extra = asin(R/M_PI);
85 if (xmin<=theta_min+extra){
88 }
else if (xmax>=theta_max-extra){
92 extra = max(1.0/sin(xmin), 1.0/sin(xmax));
93 ymin = (c_phi-R)*extra;
94 while (ymin<-M_PI) ymin+=
twopi;
95 while (ymin> M_PI) ymin-=
twopi;
96 ymax = (c_phi-R)*extra;
97 while (ymax<-M_PI) ymax+=
twopi;
98 while (ymax> M_PI) ymax-=
twopi;
100 cell_min = get_phi_cell(ymin);
101 cell_max = get_phi_cell(ymax);
105 phi_range = (cell_max-cell_min)+cell_max;
107 phi_range = (cell_min==cell_max)
109 : ((PHI_RANGE_MASK^(cell_min-cell_max)) + cell_max);
130 theta_range |= get_theta_cell(theta);
133 phi_range |= get_phi_cell(phi);
CSphtheta_phi_range()
default ctor
static double theta_max
maximal value for theta (set to pi)
const double twopi
definition of 2*M_PI which is useful a bit everyhere!
class for holding a covering range in eta-phi
static double theta_min
extremal value for theta
unsigned int theta_range
theta range as a binary coding of covered cells
unsigned int phi_range
phi range as a binary coding of covered cells
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