/[PAMELA software]/DarthVader/TrackerLevel2/src/TrkLevel2.cpp
ViewVC logotype

Diff of /DarthVader/TrackerLevel2/src/TrkLevel2.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16 by pam-fi, Wed Nov 8 16:42:28 2006 UTC revision 1.17 by pam-fi, Tue Nov 14 16:21:08 2006 UTC
# Line 21  extern "C" {     Line 21  extern "C" {    
21  //  //
22  //  //
23  //--------------------------------------  //--------------------------------------
24    /**
25     * Evaluates the trajectory in the apparatus associated to the track.
26     * 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.  
27     * @param t pointer to an object of the class Trajectory,
28     * which z coordinates should be previously initialized by calling the proper constructor ( Trajectory::Trajectory(int n, float* zin) ).
29     * @return error flag.
30     */
31    int Trajectory::DoTrack2(float* al){
32    
33        double *dxout   = new double[t->npoint];
34        double *dyout   = new double[t->npoint];
35        double *dthxout = new double[t->npoint];
36        double *dthyout = new double[t->npoint];
37        double *dtlout  = new double[t->npoint];
38        double *dzin    = new double[t->npoint];
39        double dal[5];
40    
41        int ifail = 0;
42    
43        for (int i=0; i<5; i++)         dal[i]  = (double)al[i];
44        for (int i=0; i<t->npoint; i++) dzin[i] = (double)z[i];
45    
46        dotrack2_(&(t->npoint),dzin,dxout,dyout,dthxout,dthyout,dtlout,dal,&ifail);
47        
48        for (int i=0; i<t->npoint; i++){
49            x[i]   = (float)*dxout++;
50            y[i]   = (float)*dyout++;
51            thx[i] = (float)*dthxout++;
52            thy[i] = (float)*dthyout++;
53            tl[i]  = (float)*dtlout++;
54        }
55    
56        return ifail;
57    };
58    //---------------------------------------------
59    //---------------------------------------------
60  TrkTrack::TrkTrack(){  TrkTrack::TrkTrack(){
61      seqno = -1;      seqno = -1;
62      image = -1;      image = -1;

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.23