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_(); |
// int readb_(); |
17 |
void mini2_(int*,int*,int*); |
void mini2_(int*,int*,int*); |
18 |
void guess_(); |
void guess_(); |
19 |
|
void gufld_(float*, float*); |
20 |
} |
} |
21 |
|
|
22 |
//-------------------------------------- |
//-------------------------------------- |
23 |
// |
// |
24 |
// |
// |
51 |
}; |
}; |
52 |
clx = 0; |
clx = 0; |
53 |
cly = 0; |
cly = 0; |
54 |
|
// clx = new TRefArray(6,0); |
55 |
|
// cly = new TRefArray(6,0); |
56 |
}; |
}; |
57 |
//-------------------------------------- |
//-------------------------------------- |
58 |
// |
// |
83 |
dedx_x[ip] = t.dedx_x[ip]; |
dedx_x[ip] = t.dedx_x[ip]; |
84 |
dedx_y[ip] = t.dedx_y[ip]; |
dedx_y[ip] = t.dedx_y[ip]; |
85 |
}; |
}; |
86 |
clx = new TRefArray(*(t.clx)); |
clx = 0; |
87 |
cly = new TRefArray(*(t.cly)); |
cly = 0; |
88 |
|
if(t.clx)clx = new TRefArray(*(t.clx)); |
89 |
|
if(t.cly)cly = new TRefArray(*(t.cly)); |
90 |
|
|
91 |
}; |
}; |
92 |
//-------------------------------------- |
//-------------------------------------- |
145 |
for (int i=0; i<5; i++) dal[i] = (double)al[i]; |
for (int i=0; i<5; i++) dal[i] = (double)al[i]; |
146 |
for (int i=0; i<t->npoint; i++) dzin[i] = (double)t->z[i]; |
for (int i=0; i<t->npoint; i++) dzin[i] = (double)t->z[i]; |
147 |
|
|
148 |
|
TrkParams::Load(1); |
149 |
|
if( !TrkParams::IsLoaded(1) ){ |
150 |
|
cout << "int TrkTrack::DoTrack(Trajectory* t) --- ERROR --- m.field not loaded"<<endl; |
151 |
|
return 0; |
152 |
|
} |
153 |
dotrack_(&(t->npoint),dzin,dxout,dyout,dal,&ifail); |
dotrack_(&(t->npoint),dzin,dxout,dyout,dal,&ifail); |
154 |
|
|
155 |
for (int i=0; i<t->npoint; i++){ |
for (int i=0; i<t->npoint; i++){ |
189 |
for (int i=0; i<5; i++) dal[i] = (double)al[i]; |
for (int i=0; i<5; i++) dal[i] = (double)al[i]; |
190 |
for (int i=0; i<t->npoint; i++) dzin[i] = (double)t->z[i]; |
for (int i=0; i<t->npoint; i++) dzin[i] = (double)t->z[i]; |
191 |
|
|
192 |
|
TrkParams::Load(1); |
193 |
|
if( !TrkParams::IsLoaded(1) ){ |
194 |
|
cout << "int TrkTrack::DoTrack2(Trajectory* t) --- ERROR --- m.field not loaded"<<endl; |
195 |
|
return 0; |
196 |
|
} |
197 |
dotrack2_(&(t->npoint),dzin,dxout,dyout,dthxout,dthyout,dtlout,dal,&ifail); |
dotrack2_(&(t->npoint),dzin,dxout,dyout,dthxout,dthyout,dtlout,dal,&ifail); |
198 |
|
|
199 |
for (int i=0; i<t->npoint; i++){ |
for (int i=0; i<t->npoint; i++){ |
298 |
*/ |
*/ |
299 |
void TrkTrack::LoadField(TString path){ |
void TrkTrack::LoadField(TString path){ |
300 |
|
|
301 |
strcpy(path_.path,path.Data()); |
// strcpy(path_.path,path.Data()); |
302 |
path_.pathlen = path.Length(); |
// path_.pathlen = path.Length(); |
303 |
path_.error = 0; |
// path_.error = 0; |
304 |
readb_(); |
// readb_(); |
305 |
|
|
306 |
|
TrkParams::Set(path,1); |
307 |
|
TrkParams::Load(1); |
308 |
|
|
309 |
}; |
}; |
310 |
|
|
311 |
|
|
312 |
/** |
/** |
313 |
* Method to fill minimization-routine common |
* Method to fill minimization-routine common |
314 |
*/ |
*/ |
369 |
axv[i] = track->axv[i]; |
axv[i] = track->axv[i]; |
370 |
ayv[i] = track->ayv[i]; |
ayv[i] = track->ayv[i]; |
371 |
} |
} |
|
|
|
372 |
|
|
373 |
} |
} |
374 |
/** |
/** |
400 |
|
|
401 |
// ------------------------------------------ |
// ------------------------------------------ |
402 |
// call mini routine |
// call mini routine |
403 |
|
TrkParams::Load(1); |
404 |
|
if( !TrkParams::IsLoaded(1) ){ |
405 |
|
cout << "void TrkTrack::Fit(double pfixed, int& fail, int iprint) --- ERROR --- m.field not loaded"<<endl; |
406 |
|
return; |
407 |
|
} |
408 |
int istep=0; |
int istep=0; |
409 |
int ifail=0; |
int ifail=0; |
410 |
mini2_(&istep,&ifail, &iprint); |
mini2_(&istep,&ifail, &iprint); |
451 |
for(int j=0; j<5; j++) coval[i][j]=0.; |
for(int j=0; j<5; j++) coval[i][j]=0.; |
452 |
} |
} |
453 |
} |
} |
454 |
|
void TrkTrack::SetTrackingMode(int trackmode){ |
455 |
|
extern cMini2track track_; |
456 |
|
track_.trackmode = trackmode; |
457 |
|
} |
458 |
|
|
459 |
//-------------------------------------- |
//-------------------------------------- |
460 |
// |
// |
559 |
// |
// |
560 |
//-------------------------------------- |
//-------------------------------------- |
561 |
TrkLevel2::TrkLevel2(){ |
TrkLevel2::TrkLevel2(){ |
562 |
// cout <<"TrkLevel2::TrkLevel2()"<<endl; |
// cout <<"TrkLevel2::TrkLevel2()"<<endl; |
563 |
for(Int_t i=0; i<12 ; i++){ |
for(Int_t i=0; i<12 ; i++){ |
564 |
good[i] = -1; |
good[i] = -1; |
565 |
}; |
}; |
566 |
// Track = new TClonesArray("TrkTrack"); |
// okkio!! memory-leak |
567 |
// SingletX = new TClonesArray("TrkSinglet"); |
// Track = new TClonesArray("TrkTrack"); |
568 |
// SingletY = new TClonesArray("TrkSinglet"); |
// SingletX = new TClonesArray("TrkSinglet"); |
569 |
|
// SingletY = new TClonesArray("TrkSinglet"); |
570 |
Track = 0; |
Track = 0; |
571 |
SingletX = 0; |
SingletX = 0; |
572 |
SingletY = 0; |
SingletY = 0; |
576 |
// |
// |
577 |
// |
// |
578 |
//-------------------------------------- |
//-------------------------------------- |
579 |
|
void TrkLevel2::Set(){ |
580 |
|
if(!Track)Track = new TClonesArray("TrkTrack"); |
581 |
|
if(!SingletX)SingletX = new TClonesArray("TrkSinglet"); |
582 |
|
if(!SingletY)SingletY = new TClonesArray("TrkSinglet"); |
583 |
|
} |
584 |
|
//-------------------------------------- |
585 |
|
// |
586 |
|
// |
587 |
|
//-------------------------------------- |
588 |
void TrkLevel2::Dump(){ |
void TrkLevel2::Dump(){ |
589 |
|
|
590 |
// |
// |
619 |
/** |
/** |
620 |
* Fills a TrkLevel2 object with values from a struct cTrkLevel2 (to get data from F77 common). |
* Fills a TrkLevel2 object with values from a struct cTrkLevel2 (to get data from F77 common). |
621 |
*/ |
*/ |
622 |
void TrkLevel2::SetFromLevel2Struct(cTrkLevel2 *l2){ |
// void TrkLevel2::SetFromLevel2Struct(cTrkLevel2 *l2){ |
|
|
|
|
// temporary objects: |
|
|
TrkSinglet* t_singlet = new TrkSinglet(); |
|
|
TrkTrack* t_track = new TrkTrack(); |
|
623 |
|
|
624 |
// **** general variables **** |
// // temporary objects: |
625 |
// good2 = l2->good2; |
// TrkSinglet* t_singlet = new TrkSinglet(); |
626 |
for(Int_t i=0; i<12 ; i++){ |
// TrkTrack* t_track = new TrkTrack(); |
627 |
// crc[i] = l2->crc[i]; |
|
628 |
good[i] = l2->good[i]; |
// // **** general variables **** |
629 |
}; |
// // good2 = l2->good2; |
630 |
// *** TRACKS *** |
// for(Int_t i=0; i<12 ; i++){ |
631 |
if(!Track) Track = new TClonesArray("TrkTrack"); |
// // crc[i] = l2->crc[i]; |
632 |
TClonesArray &t = *Track; |
// good[i] = l2->good[i]; |
633 |
for(int i=0; i<l2->ntrk; i++){ |
// }; |
634 |
t_track->seqno = i;// NBNBNBNB deve sempre essere = i |
// // *** TRACKS *** |
635 |
t_track->image = l2->image[i]-1; |
// if(!Track) Track = new TClonesArray("TrkTrack"); |
636 |
// cout << "track "<<i<<t_track->seqno << t_track->image<<endl; |
// TClonesArray &t = *Track; |
637 |
t_track->chi2 = l2->chi2_nt[i]; |
// for(int i=0; i<l2->ntrk; i++){ |
638 |
t_track->nstep = l2->nstep_nt[i]; |
// t_track->seqno = i;// NBNBNBNB deve sempre essere = i |
639 |
for(int it1=0;it1<5;it1++){ |
// t_track->image = l2->image[i]-1; |
640 |
t_track->al[it1] = l2->al_nt[i][it1]; |
// // cout << "track "<<i<<t_track->seqno << t_track->image<<endl; |
641 |
for(int it2=0;it2<5;it2++) |
// t_track->chi2 = l2->chi2_nt[i]; |
642 |
t_track->coval[it1][it2] = l2->coval[i][it2][it1]; |
// t_track->nstep = l2->nstep_nt[i]; |
643 |
}; |
// for(int it1=0;it1<5;it1++){ |
644 |
for(int ip=0;ip<6;ip++){ |
// t_track->al[it1] = l2->al_nt[i][it1]; |
645 |
t_track->xgood[ip] = l2->xgood_nt[i][ip]; |
// for(int it2=0;it2<5;it2++) |
646 |
t_track->ygood[ip] = l2->ygood_nt[i][ip]; |
// t_track->coval[it1][it2] = l2->coval[i][it2][it1]; |
647 |
t_track->xm[ip] = l2->xm_nt[i][ip]; |
// }; |
648 |
t_track->ym[ip] = l2->ym_nt[i][ip]; |
// for(int ip=0;ip<6;ip++){ |
649 |
t_track->zm[ip] = l2->zm_nt[i][ip]; |
// t_track->xgood[ip] = l2->xgood_nt[i][ip]; |
650 |
t_track->resx[ip] = l2->resx_nt[i][ip]; |
// t_track->ygood[ip] = l2->ygood_nt[i][ip]; |
651 |
t_track->resy[ip] = l2->resy_nt[i][ip]; |
// t_track->xm[ip] = l2->xm_nt[i][ip]; |
652 |
t_track->xv[ip] = l2->xv_nt[i][ip]; |
// t_track->ym[ip] = l2->ym_nt[i][ip]; |
653 |
t_track->yv[ip] = l2->yv_nt[i][ip]; |
// t_track->zm[ip] = l2->zm_nt[i][ip]; |
654 |
t_track->zv[ip] = l2->zv_nt[i][ip]; |
// t_track->resx[ip] = l2->resx_nt[i][ip]; |
655 |
t_track->axv[ip] = l2->axv_nt[i][ip]; |
// t_track->resy[ip] = l2->resy_nt[i][ip]; |
656 |
t_track->ayv[ip] = l2->ayv_nt[i][ip]; |
// t_track->xv[ip] = l2->xv_nt[i][ip]; |
657 |
t_track->dedx_x[ip] = l2->dedx_x[i][ip]; |
// t_track->yv[ip] = l2->yv_nt[i][ip]; |
658 |
t_track->dedx_y[ip] = l2->dedx_y[i][ip]; |
// t_track->zv[ip] = l2->zv_nt[i][ip]; |
659 |
// t_track->clx[ip] = 0; |
// t_track->axv[ip] = l2->axv_nt[i][ip]; |
660 |
// t_track->cly[ip] = 0; |
// t_track->ayv[ip] = l2->ayv_nt[i][ip]; |
661 |
}; |
// t_track->dedx_x[ip] = l2->dedx_x[i][ip]; |
662 |
new(t[i]) TrkTrack(*t_track); |
// t_track->dedx_y[ip] = l2->dedx_y[i][ip]; |
663 |
t_track->Clear(); |
// // t_track->clx[ip] = 0; |
664 |
}; |
// // t_track->cly[ip] = 0; |
665 |
// *** SINGLETS *** |
// }; |
666 |
if(!SingletX)SingletX = new TClonesArray("TrkSinglet"); |
// new(t[i]) TrkTrack(*t_track); |
667 |
TClonesArray &sx = *SingletX; |
// t_track->Clear(); |
668 |
for(int i=0; i<l2->nclsx; i++){ |
// }; |
669 |
t_singlet->plane = l2->planex[i]; |
// // *** SINGLETS *** |
670 |
t_singlet->coord[0] = l2->xs[i][0]; |
// if(!SingletX)SingletX = new TClonesArray("TrkSinglet"); |
671 |
t_singlet->coord[1] = l2->xs[i][1]; |
// TClonesArray &sx = *SingletX; |
672 |
t_singlet->sgnl = l2->signlxs[i]; |
// for(int i=0; i<l2->nclsx; i++){ |
673 |
// t_singlet->cls = 0; |
// t_singlet->plane = l2->planex[i]; |
674 |
new(sx[i]) TrkSinglet(*t_singlet); |
// t_singlet->coord[0] = l2->xs[i][0]; |
675 |
t_singlet->Clear(); |
// t_singlet->coord[1] = l2->xs[i][1]; |
676 |
} |
// t_singlet->sgnl = l2->signlxs[i]; |
677 |
if(!SingletY)SingletY = new TClonesArray("TrkSinglet"); |
// // t_singlet->cls = 0; |
678 |
TClonesArray &sy = *SingletY; |
// new(sx[i]) TrkSinglet(*t_singlet); |
679 |
for(int i=0; i<l2->nclsy; i++){ |
// t_singlet->Clear(); |
680 |
t_singlet->plane = l2->planey[i]; |
// } |
681 |
t_singlet->coord[0] = l2->ys[i][0]; |
// if(!SingletY)SingletY = new TClonesArray("TrkSinglet"); |
682 |
t_singlet->coord[1] = l2->ys[i][1]; |
// TClonesArray &sy = *SingletY; |
683 |
t_singlet->sgnl = l2->signlys[i]; |
// for(int i=0; i<l2->nclsy; i++){ |
684 |
// t_singlet->cls = 0; |
// t_singlet->plane = l2->planey[i]; |
685 |
new(sy[i]) TrkSinglet(*t_singlet); |
// t_singlet->coord[0] = l2->ys[i][0]; |
686 |
t_singlet->Clear(); |
// t_singlet->coord[1] = l2->ys[i][1]; |
687 |
}; |
// t_singlet->sgnl = l2->signlys[i]; |
688 |
|
// // t_singlet->cls = 0; |
689 |
|
// new(sy[i]) TrkSinglet(*t_singlet); |
690 |
|
// t_singlet->Clear(); |
691 |
|
// }; |
692 |
|
|
693 |
delete t_track; |
// delete t_track; |
694 |
delete t_singlet; |
// delete t_singlet; |
695 |
} |
// } |
696 |
//-------------------------------------- |
//-------------------------------------- |
697 |
// |
// |
698 |
// |
// |
715 |
// *** TRACKS *** |
// *** TRACKS *** |
716 |
if(!Track) Track = new TClonesArray("TrkTrack"); |
if(!Track) Track = new TClonesArray("TrkTrack"); |
717 |
TClonesArray &t = *Track; |
TClonesArray &t = *Track; |
718 |
if(!t_track->clx)t_track->clx = new TRefArray(6,0); |
//----------------------------------------------------- |
719 |
if(!t_track->cly)t_track->cly = new TRefArray(6,0); |
if(l1 && !t_track->clx)t_track->clx = new TRefArray(6,0); |
720 |
|
if(l1 && !t_track->cly)t_track->cly = new TRefArray(6,0); |
721 |
|
//----------------------------------------------------- |
722 |
for(int i=0; i<l2->ntrk; i++){ |
for(int i=0; i<l2->ntrk; i++){ |
723 |
t_track->seqno = i;// NBNBNBNB deve sempre essere = i |
t_track->seqno = i;// NBNBNBNB deve sempre essere = i |
724 |
t_track->image = l2->image[i]-1; |
t_track->image = l2->image[i]-1; |
745 |
t_track->ayv[ip] = l2->ayv_nt[i][ip]; |
t_track->ayv[ip] = l2->ayv_nt[i][ip]; |
746 |
t_track->dedx_x[ip] = l2->dedx_x[i][ip]; |
t_track->dedx_x[ip] = l2->dedx_x[i][ip]; |
747 |
t_track->dedx_y[ip] = l2->dedx_y[i][ip]; |
t_track->dedx_y[ip] = l2->dedx_y[i][ip]; |
|
// cout << "traccia "<<i<<" -- "<< ip << " "<< l2->cltrx[i][ip] <<" "<< l2->cltry[i][ip] <<" "<< t_track->xgood[ip] << t_track->ygood[ip]<<endl; |
|
748 |
//----------------------------------------------------- |
//----------------------------------------------------- |
749 |
//----------------------------------------------------- |
//----------------------------------------------------- |
750 |
if(t_track->xgood[ip])t_track->clx->AddAt(l1->GetCluster(l2->cltrx[i][ip]-1),ip); |
if(l1 && t_track->xgood[ip])t_track->clx->AddAt(l1->GetCluster(l2->cltrx[i][ip]-1),ip); |
751 |
if(t_track->ygood[ip])t_track->cly->AddAt(l1->GetCluster(l2->cltry[i][ip]-1),ip); |
if(l1 && t_track->ygood[ip])t_track->cly->AddAt(l1->GetCluster(l2->cltry[i][ip]-1),ip); |
|
// if(t_track->ygood[ip])cout<<" i "<<i<<" ip "<<ip<<" l2->cltry[i][ip] "<<l2->cltry[i][ip]<< " l1->GetCluster(l2->cltry[i][ip]-1) "<<l1->GetCluster(l2->cltry[i][ip]-1)<<endl; |
|
|
// if(t_track->xgood[ip])cout<<" i "<<i<<" ip "<<ip<<" l2->cltrx[i][ip] "<<l2->cltrx[i][ip]<< " l1->GetCluster(l2->cltrx[i][ip]-1) "<<l1->GetCluster(l2->cltrx[i][ip]-1)<<endl; |
|
752 |
//----------------------------------------------------- |
//----------------------------------------------------- |
753 |
//----------------------------------------------------- |
//----------------------------------------------------- |
754 |
}; |
}; |
764 |
t_singlet->coord[1] = l2->xs[i][1]; |
t_singlet->coord[1] = l2->xs[i][1]; |
765 |
t_singlet->sgnl = l2->signlxs[i]; |
t_singlet->sgnl = l2->signlxs[i]; |
766 |
//----------------------------------------------------- |
//----------------------------------------------------- |
767 |
// cout << "singolo x "<<i<<" -- "<< l2->clsx[i] <<endl; |
if(l1) t_singlet->cls = l1->GetCluster(l2->clsx[i]-1); |
|
t_singlet->cls = l1->GetCluster(l2->clsx[i]-1); |
|
|
// cout<<" i "<<i<<" l2->clsx[i] "<<l2->clsx[i]<< " l1->GetCluster(l2->clsx[i]-1) "<<l1->GetCluster(l2->clsx[i]-1)<<endl; |
|
768 |
//----------------------------------------------------- |
//----------------------------------------------------- |
769 |
new(sx[i]) TrkSinglet(*t_singlet); |
new(sx[i]) TrkSinglet(*t_singlet); |
770 |
t_singlet->Clear(); |
t_singlet->Clear(); |
777 |
t_singlet->coord[1] = l2->ys[i][1]; |
t_singlet->coord[1] = l2->ys[i][1]; |
778 |
t_singlet->sgnl = l2->signlys[i]; |
t_singlet->sgnl = l2->signlys[i]; |
779 |
//----------------------------------------------------- |
//----------------------------------------------------- |
780 |
// cout << "singolo y "<<i<<" -- "<< l2->clsy[i] <<endl; |
if(l1) t_singlet->cls = l1->GetCluster(l2->clsy[i]-1); |
|
t_singlet->cls = l1->GetCluster(l2->clsy[i]-1); |
|
|
// cout<<" i "<<i<<" l2->clsy[i] "<<l2->clsy[i]<< " l1->GetCluster(l2->clsy[i]-1) "<<l1->GetCluster(l2->clsy[i]-1)<<endl; |
|
781 |
//----------------------------------------------------- |
//----------------------------------------------------- |
782 |
new(sy[i]) TrkSinglet(*t_singlet); |
new(sy[i]) TrkSinglet(*t_singlet); |
783 |
t_singlet->Clear(); |
t_singlet->Clear(); |
900 |
|
|
901 |
int indo=0; |
int indo=0; |
902 |
int indi=0; |
int indi=0; |
903 |
while(N != 0){ |
while(N > 0){ |
904 |
|
// while(N != 0){ |
905 |
int nfit =0; |
int nfit =0; |
906 |
float chi2ref = numeric_limits<float>::max(); |
float chi2ref = numeric_limits<float>::max(); |
907 |
|
|
912 |
} |
} |
913 |
} |
} |
914 |
//second loop to search minimum chi2 among selected |
//second loop to search minimum chi2 among selected |
915 |
for(int i=0; i<this->ntrk(); i++){ |
for(int i=0; i<ntrk(); i++){ |
916 |
Float_t chi2 = ((TrkTrack *)t[i])->chi2; |
Float_t chi2 = ((TrkTrack *)t[i])->chi2; |
917 |
if(chi2 < 0) chi2 = chi2*1000; |
if(chi2 < 0) chi2 = -chi2*1000; |
918 |
if( chi2 < chi2ref |
if( chi2 < chi2ref |
919 |
&& ((TrkTrack *)t[i])->GetNtot() == nfit |
&& ((TrkTrack *)t[i])->GetNtot() == nfit |
920 |
&& m[i]==1){ |
&& m[i]==1){ |
926 |
m[((TrkTrack *)t[indi])->image] = 0; |
m[((TrkTrack *)t[indi])->image] = 0; |
927 |
N--; |
N--; |
928 |
|
|
929 |
// cout << "i** "<< ((TrkTrack *)t[indi])->image << " " << nfiti <<" "<<chi2i<<endl; |
// cout << "i** "<< ((TrkTrack *)t[indi])->image << " " << nfiti <<" "<<chi2i<<endl; |
930 |
}; |
}; |
931 |
sorted->Add( (TrkTrack*)t[indi] ); |
sorted->Add( (TrkTrack*)t[indi] ); |
932 |
|
|
933 |
m[indi] = 0; |
m[indi] = 0; |
934 |
// cout << "SORTED "<< indo << " "<< indi << " "<< N << endl; |
// cout << "SORTED "<< indo << " "<< indi << " "<< N << " "<<((TrkTrack *)t[indi])->image<<" "<<chi2ref<<endl; |
935 |
N--; |
N--; |
936 |
indo++; |
indo++; |
937 |
} |
} |
938 |
m.clear(); |
m.clear(); |
939 |
// cout << "GetTracks_NFitSorted(it): Done"<< endl; |
// cout << "GetTracks_NFitSorted(it): Done"<< endl; |
940 |
|
|
941 |
return sorted; |
return sorted; |
942 |
// return PhysicalTrack; |
// return PhysicalTrack; |
1086 |
*/ |
*/ |
1087 |
void TrkLevel2::LoadField(TString path){ |
void TrkLevel2::LoadField(TString path){ |
1088 |
// |
// |
1089 |
strcpy(path_.path,path.Data()); |
// strcpy(path_.path,path.Data()); |
1090 |
path_.pathlen = path.Length(); |
// path_.pathlen = path.Length(); |
1091 |
path_.error = 0; |
// path_.error = 0; |
1092 |
readb_(); |
// readb_(); |
1093 |
|
|
1094 |
|
TrkParams::Set(path,1); |
1095 |
|
TrkParams::Load(1); |
1096 |
|
|
1097 |
// |
// |
1098 |
}; |
}; |
1099 |
|
/** |
1100 |
|
* Get BY (kGauss) |
1101 |
|
* @param v (x,y,z) coordinates in cm |
1102 |
|
*/ |
1103 |
|
float TrkLevel2::GetBX(float* v){ |
1104 |
|
float b[3]; |
1105 |
|
gufld_(v,b); |
1106 |
|
return b[0]/10.; |
1107 |
|
} |
1108 |
|
/** |
1109 |
|
* Get BY (kGauss) |
1110 |
|
* @param v (x,y,z) coordinates in cm |
1111 |
|
*/ |
1112 |
|
float TrkLevel2::GetBY(float* v){ |
1113 |
|
float b[3]; |
1114 |
|
gufld_(v,b); |
1115 |
|
return b[1]/10.; |
1116 |
|
} |
1117 |
|
/** |
1118 |
|
* Get BY (kGauss) |
1119 |
|
* @param v (x,y,z) coordinates in cm |
1120 |
|
*/ |
1121 |
|
float TrkLevel2::GetBZ(float* v){ |
1122 |
|
float b[3]; |
1123 |
|
gufld_(v,b); |
1124 |
|
return b[2]/10.; |
1125 |
|
} |
1126 |
//-------------------------------------- |
//-------------------------------------- |
1127 |
// |
// |
1128 |
// |
// |
1300 |
for (int i=0; i<5; i++) dal[i] = (double)al[i]; |
for (int i=0; i<5; i++) dal[i] = (double)al[i]; |
1301 |
for (int i=0; i<npoint; i++) dzin[i] = (double)z[i]; |
for (int i=0; i<npoint; i++) dzin[i] = (double)z[i]; |
1302 |
|
|
1303 |
|
TrkParams::Load(1); |
1304 |
|
if( !TrkParams::IsLoaded(1) ){ |
1305 |
|
cout << "int Trajectory::DoTrack2(float* al) --- ERROR --- m.field not loaded"<<endl; |
1306 |
|
return 0; |
1307 |
|
} |
1308 |
dotrack2_(&(npoint),dzin,dxout,dyout,dthxout,dthyout,dtlout,dal,&ifail); |
dotrack2_(&(npoint),dzin,dxout,dyout,dthxout,dthyout,dtlout,dal,&ifail); |
1309 |
|
|
1310 |
for (int i=0; i<npoint; i++){ |
for (int i=0; i<npoint; i++){ |