//
//     track shared library        v. 0.1
//
//     calls the fortran tracking routine track.f
//
//     Written by Emiliano Mocchiutti
//
#define track track_
extern "C" int track(int&, Double_t[], Double_t[], Double_t[], Double_t[], int&);
void ctrack(int npoint, Double_t zin[100], Double_t xout[100], Double_t yout[100], Double_t al_p[5], int& ifail) {
  //
  Double_t czin[100];
  Double_t cxout[100];
  Double_t cyout[100];
  for ( int i = 0 ; i<100 ; i++){
    if ( i < npoint ) {
      czin[i] = zin[i];
      //printf("CTRK =====>< zin %i %f \n",i,czin[i]);
    } else {
      czin[i] = 0.;
    };
    cxout[i] = 0.;
    cyout[i] = 0.;
  };
  //
  track(npoint, czin, cxout, cyout, al_p, ifail);
  //
  for ( int i = 0 ; i<npoint ; i++){
    xout[i] = cxout[i];
    yout[i] = cyout[i];
    //    printf("CTRK ===> xout %i %f %f\n",i,xout[i],cxout[i]);
  };
};


