--- DarthVader/TrackerLevel2/src/TrkLevel2.cpp 2006/10/24 07:28:38 1.12 +++ DarthVader/TrackerLevel2/src/TrkLevel2.cpp 2006/11/14 16:28:42 1.18 @@ -4,6 +4,7 @@ */ #include #include +#include using namespace std; //...................................... // F77 routines @@ -11,20 +12,59 @@ extern "C" { void dotrack_(int*, double*, double*, double*, double*, int*); void dotrack2_(int*, double*, double*, double*, double*,double*, double*, double*,int*); - int readb_(const char*); +// int readb_(const char*); + int readb_(); + void mini2_(int*,int*,int*); + void guess_(); } //-------------------------------------- // // //-------------------------------------- +/** + * Evaluates the trajectory in the apparatus associated to the track. + * It integrates the equations of motion in the magnetic field. The magnetic field should be previously loaded ( by calling TrkLevel2::LoadField() ), otherwise an error message is returned. + * @param t pointer to an object of the class Trajectory, + * which z coordinates should be previously initialized by calling the proper constructor ( Trajectory::Trajectory(int n, float* zin) ). + * @return error flag. + */ +int Trajectory::DoTrack2(float* al){ + + double *dxout = new double[npoint]; + double *dyout = new double[npoint]; + double *dthxout = new double[npoint]; + double *dthyout = new double[npoint]; + double *dtlout = new double[npoint]; + double *dzin = new double[npoint]; + double dal[5]; + + int ifail = 0; + + for (int i=0; i<5; i++) dal[i] = (double)al[i]; + for (int i=0; i " << track_.al[4] << endl; + + for(int i=0; i<5; i++) al[i]=track_.al[i]; + chi2=track_.chi2; + nstep=track_.nstep; + for(int i=0; i<6; i++) xv[i]=track_.xv[i]; + for(int i=0; i<6; i++) yv[i]=track_.yv[i]; + for(int i=0; i<6; i++) zv[i]=track_.zv[i]; + for(int i=0; i<6; i++) axv[i]=track_.axv[i]; + for(int i=0; i<6; i++) ayv[i]=track_.ayv[i]; + for(int i=0; i<5; i++) { + for(int j=0; j<5; j++) coval[i][j]=track_.cov[i][j]; + } + + if(fail){ + cout << " >>>> fit failed >>>> drawing initial par"<