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 |
} |
} |
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. |
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]; |
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++) { |
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; // " |
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 |
// |
// |