/[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.15 by pam-fi, Tue Nov 7 15:55:11 2006 UTC revision 1.16 by pam-fi, Wed Nov 8 16:42:28 2006 UTC
# Line 12  using namespace std; Line 12  using namespace std;
12  extern "C" {      extern "C" {    
13      void dotrack_(int*, double*, double*, double*, double*, int*);      void dotrack_(int*, double*, double*, double*, double*, int*);
14      void dotrack2_(int*, double*, double*, double*, double*,double*, double*, double*,int*);      void dotrack2_(int*, double*, double*, double*, double*,double*, double*, double*,int*);
15      int  readb_(const char*);  //    int  readb_(const char*);
16        int  readb_();
17      void mini2_(int*,int*,int*);      void mini2_(int*,int*,int*);
18      void guess_();      void guess_();
19  }  }
# Line 249  void TrkTrack::SetGood(int *xg, int *yg) Line 250  void TrkTrack::SetGood(int *xg, int *yg)
250  /**  /**
251   * Load the magnetic field   * Load the magnetic field
252   */   */
253  void TrkTrack::LoadField(TString s){  void TrkTrack::LoadField(TString path){
254      readb_(s.Data());      
255        strcpy(path_.path,path.Data());
256        path_.pathlen = path.Length();
257        path_.error   = 0;
258        readb_();
259    
260  };  };
261  /**  /**
262   * Tracking method. It calls F77 mini routine.   * Tracking method. It calls F77 mini routine.
# Line 261  void TrkTrack::Fit(double pfixed, int& f Line 267  void TrkTrack::Fit(double pfixed, int& f
267    
268      extern cMini2track track_;      extern cMini2track track_;
269      fail = 0;      fail = 0;
 //    extern cMini2fitinfo fit_info_;  
 //    extern void mini_2_(int*,int*);  
 //    track_.xm[0]=1.0;  
   
     cout << "fitting routine "<<endl;  
270    
271      for(int i=0; i<6; i++) track_.xm[i]=xm[i];      for(int i=0; i<6; i++) track_.xm[i]=xm[i];
272      for(int i=0; i<6; i++) track_.ym[i]=ym[i];      for(int i=0; i<6; i++) track_.ym[i]=ym[i];
# Line 277  void TrkTrack::Fit(double pfixed, int& f Line 278  void TrkTrack::Fit(double pfixed, int& f
278    
279  // initial guess of "al" with linear fit  // initial guess of "al" with linear fit
280  //     if(al[0]==-9999.&&al[1]==-9999.&&al[2]==-9999.&&al[3]==-9999.&&al[4]==-9999.){  //     if(al[0]==-9999.&&al[1]==-9999.&&al[2]==-9999.&&al[3]==-9999.&&al[4]==-9999.){
   
281  //      cout << "initial guess "<<endl;  //      cout << "initial guess "<<endl;
   
282  //      double szz=0., szx=0., szy=0., ssx=0., ssy=0., sz=0., s1=0.;  //      double szz=0., szx=0., szy=0., ssx=0., ssy=0., sz=0., s1=0.;
283  //      double det, ax, ay, bx, by;  //      double det, ax, ay, bx, by;
284  //      for(int i=0; i<NPLANE; i++) {  //      for(int i=0; i<NPLANE; i++) {
# Line 305  void TrkTrack::Fit(double pfixed, int& f Line 304  void TrkTrack::Fit(double pfixed, int& f
304  //          if(ax<0.) al[3]=acos(-1.)-al[3];  //          if(ax<0.) al[3]=acos(-1.)-al[3];
305  //      }  //      }
306  //      al[4]=0.;  //      al[4]=0.;
   
307  //     }  //     }
308  // end guess  // end guess
309    
310      for(int i=0; i<5; i++) track_.al[i]=al[i];      for(int i=0; i<5; i++) track_.al[i]=al[i];
311      track_.zini = 23.5; // ZINI = 23.5 !!! it should be the same parameter in all codes      track_.zini = 23.5;
312    // ZINI = 23.5 !!! it should be the same parameter in all codes
313    
 // elena -----      
314      if(al[0]==-9999.&&al[1]==-9999.&&al[2]==-9999.&&al[3]==-9999.&&al[4]==-9999.)guess_();      if(al[0]==-9999.&&al[1]==-9999.&&al[2]==-9999.&&al[3]==-9999.&&al[4]==-9999.)guess_();
 // elena -----      
315    
316        // --------------------- free momentum
317      if(pfixed==0.) {      if(pfixed==0.) {
318  //      al[4]=0.;         // free momentum  //      al[4]=0.;         // free momentum
319          track_.pfixed=0.; //         "          track_.pfixed=0.; //         "
320      }      }
321        // --------------------- fixed momentum
322      if(pfixed!=0.) {      if(pfixed!=0.) {
323          al[4]=1./pfixed;      // to fix the momentum          al[4]=1./pfixed;      // to fix the momentum
324          track_.pfixed=pfixed; //         "          track_.pfixed=pfixed; //         "
# Line 943  TrkTrack *TrkLevel2::GetTrackImage(int i Line 943  TrkTrack *TrkLevel2::GetTrackImage(int i
943   * Loads the magnetic field.   * Loads the magnetic field.
944   * @param s Path of the magnetic-field files.   * @param s Path of the magnetic-field files.
945   */   */
946  void TrkLevel2::LoadField(TString s){  void TrkLevel2::LoadField(TString path){
947      readb_(s.Data());  //
948        strcpy(path_.path,path.Data());
949        path_.pathlen = path.Length();
950        path_.error   = 0;
951        readb_();
952    //
953  };  };
954  //--------------------------------------  //--------------------------------------
955  //  //

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

  ViewVC Help
Powered by ViewVC 1.1.23