--- DarthVader/TrackerLevel2/src/TrkLevel2.cpp 2006/11/08 16:42:28 1.16 +++ DarthVader/TrackerLevel2/src/TrkLevel2.cpp 2006/11/14 16:21:08 1.17 @@ -21,6 +21,42 @@ // // //-------------------------------------- +/** + * 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[t->npoint]; + double *dyout = new double[t->npoint]; + double *dthxout = new double[t->npoint]; + double *dthyout = new double[t->npoint]; + double *dtlout = new double[t->npoint]; + double *dzin = new double[t->npoint]; + double dal[5]; + + int ifail = 0; + + for (int i=0; i<5; i++) dal[i] = (double)al[i]; + for (int i=0; inpoint; i++) dzin[i] = (double)z[i]; + + dotrack2_(&(t->npoint),dzin,dxout,dyout,dthxout,dthyout,dtlout,dal,&ifail); + + for (int i=0; inpoint; i++){ + x[i] = (float)*dxout++; + y[i] = (float)*dyout++; + thx[i] = (float)*dthxout++; + thy[i] = (float)*dthyout++; + tl[i] = (float)*dtlout++; + } + + return ifail; +}; +//--------------------------------------------- +//--------------------------------------------- TrkTrack::TrkTrack(){ seqno = -1; image = -1;