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