#ifndef BONSAIFIT #define BONSAIFIT #include "fitquality.h" #include "searchgrid.h" //#define DEBUG //#define DEBUG_TWO // ************************************************************* // * maximize the vertex quality function provided by qual * // ************************************************************* class bonsaifit { fitquality *qual; // quality criterion to be maximized float rmax,rmax2,zmax; // maximum allowed x^2+y^2, |z| short int nbranch,current; // number of branches and current br. short int best,worst; // best and worst fit branch float *branches; // positions, radii, qualities,... float rad; // active radius float *vertex,*q; // active search positons, qualities // find deviation to fiducial volume edge, adjust search rad inline void fiducial_dev(float &inter_x,float &inter_y, float &inter_z,float &dev); // set position out of vertex array and set end radius inline void end_search(float *point,int indx,int indy,int indz, float rmax); // find minimum and maximum quality inline void find_extreme(void); // de-activate all branches with qualityreamthr, keep // active only reamfrac of the branches; then find the best for each // each active branch with cut-off radius rmax inline void search(float reamthr,float reamfrac,float rmax); // if the quality range between best and worst fit>reamthr, keep // active only reamfrac of the branches; then average close points // together and find the best fit for each remaining branch (after // increasing search radii