61 init(_x, _y, _half_size_x, _half_size_y);
71 if (
v!=NULL)
delete v;
91int Cquadtree::init(
double _x,
double _y,
double _half_size_x,
double _half_size_y){
138 new_half_size_x, new_half_size_y);
140 new_half_size_x, new_half_size_y);
142 new_half_size_x, new_half_size_y);
144 new_half_size_x, new_half_size_y);
199 dy = fabs(cy -
v->
phi);
204 if (dx*dx+dy*dy<cR2){
218 if (dy_c>M_PI) dy_c = 2.0*M_PI-dy_c;
227 if (dx*dx+dy*dy>=cR2){
237 if (dy>M_PI) dy = M_PI;
240 if (dx*dx+dy*dy<cR2){
base class for dynamic coordinates management
Creference ref
reference number for the vector
double eta
particle pseudo-rapidity
double phi
particle azimuthal angle
double half_size_x
HALF size of the cell.
double half_size_y
HALF size of the cell.
Creference circle_intersect(double cx, double cy, double cR2)
circle intersection.
~Cquadtree()
default destructor at destruction, everything is destroyed except physical values at the leaves
int add(Cmomentum *v_add)
adding a particle to the tree.
int save(FILE *flux)
output a data file for drawing the grid.
double centre_x
x-position of the centre of the cell
int save_leaves(FILE *flux)
output a data file for drawing the tree leaves.
double centre_y
y-position of the centre of the cell
bool has_child
true if not a leaf
Cmomentum * v
physical contents
int init(double _x, double _y, double _half_size_x, double _half_size_y)
init the tree.
Cquadtree * children[2][2]
sub-cells ( 0,1->left-right; 0,1->bottom,top)
references used for checksums.