--- DarthVader/TrackerLevel2/src/TrkLevel2.cpp 2007/05/14 11:03:05 1.33 +++ DarthVader/TrackerLevel2/src/TrkLevel2.cpp 2007/05/24 16:45:48 1.36 @@ -12,8 +12,13 @@ extern "C" { void dotrack_(int*, double*, double*, double*, double*, int*); void dotrack2_(int*, double*, double*, double*, double*,double*, double*, double*,int*); - void mini2_(int*,int*,int*); - void guess_(); + void mini2_(int*,int*,int*); + void guess_(); + void gufld_(float*, float*); + float risxeta2_(float *); + float risxeta3_(float *); + float risxeta4_(float *); + float risyeta2_(float *); } //-------------------------------------- @@ -381,6 +386,8 @@ cout << endl << "zv : "; for(int i=0; i<6; i++)cout << zv[i] << " "; cout << endl << "resx : "; for(int i=0; i<6; i++)cout << resx[i] << " "; cout << endl << "resy : "; for(int i=0; i<6; i++)cout << resy[i] << " "; + cout << endl << "tailx : "; for(int i=0; i<6; i++)cout << tailx[i] << " "; + cout << endl << "taily : "; for(int i=0; i<6; i++)cout << taily[i] << " "; cout << endl << "coval : "; for(int i=0; i<5; i++)cout << coval[0][i]<<" "; cout << endl << " "; for(int i=0; i<5; i++)cout << coval[1][i]<<" "; cout << endl << " "; for(int i=0; i<5; i++)cout << coval[2][i]<<" "; @@ -406,7 +413,86 @@ for(int i=0; i<6; i++) resy[i]=*ry++; } /** - * Set the TrkTrack good measurement. + * Set the TrkTrack tails position resolution + */ +void TrkTrack::SetTail(double *tx, double *ty, double factor){ + for(int i=0; i<6; i++) tailx[i]=factor*(*tx++); + for(int i=0; i<6; i++) taily[i]=factor*(*ty++); +} +/** + * Set the TrkTrack Student parameter (resx,resy,tailx,taily) + * from previous gausian fit + *@param flag =0 standard, =1 with noise correction + */ +void TrkTrack::SetStudentParam(int flag){ + float sx[11]={0.000128242, + 0.000136942, + 0.000162718, + 0.000202644, + 0.00025597, + 0.000317456, + 0.000349048, + 0.000384638, + 0.000457295, + 0.000512319, + 0.000538573}; + float tx[11]={1.79402, + 2.04876, + 2.88376, + 3.3, + 3.14084, + 4.07686, + 4.44736, + 3.5179, + 3.38697, + 3.45739, + 3.18627}; + float sy[11]={0.000483075, + 0.000466925, + 0.000431658, + 0.000428317, + 0.000433854, + 0.000444044, + 0.000482098, + 0.000537579, + 0.000636279, + 0.000741998, + 0.000864261}; + float ty[11]={0.997032, + 1.11147, + 1.18526, + 1.61404, + 2.21908, + 3.08959, + 4.48833, + 4.42687, + 4.65253, + 4.52043, + 4.29926}; + int index; + float fact; + for(int i=0; i<6; i++) { + index = int((fabs(axv[i])+1.)/2.); + if(index>10) index=10; + tailx[i]=tx[index]; + if(flag==1) { + if(fabs(axv[i])<=10.) fact = resx[i]/risxeta2_(&(axv[i])); + if(fabs(axv[i])>10.&&fabs(axv[i])<=15.) fact = resx[i]/risxeta3_(&(axv[i])); + if(fabs(axv[i])>15.) fact = resx[i]/risxeta4_(&(axv[i])); + } else fact = 1.; + resx[i] = sx[index]*fact; + } + for(int i=0; i<6; i++) { + index = int((fabs(ayv[i])+1.)/2.); + if(index>10) index=10; + taily[i]=ty[index]; + if(flag==1) fact = resy[i]/risyeta2_(&(ayv[i])); + else fact = 1.; + resy[i] = sy[index]*fact; + } +} +/** + * Set the TrkTrack good measurement */ void TrkTrack::SetGood(int *xg, int *yg){ @@ -468,6 +554,8 @@ track.resx[i]=resx[i]; track.resy[i]=resy[i]; + track.tailx[i]=tailx[i]; + track.taily[i]=taily[i]; } for(int i=0; i<5; i++) track.al[i]=al[i]; @@ -523,12 +611,12 @@ * * @see TrkParams::SetPFA(int) */ -void TrkTrack::EvaluateClusterPositions(){ +Bool_t TrkTrack::EvaluateClusterPositions(){ // cout << "void TrkTrack::GetClusterPositions() "<XMAGNLOW && xmagntopYMAGNLOW && ymagntopXMAGNLOW && xmagnbottomYMAGNLOW && ymagnbottomDump(); } } +/** + * \brief Dump processing status + */ +void TrkLevel2::StatusDump(int view){ + cout << "DSP n. "<= 12)return false; + return !(good[view]&flagmask); + +}; + + //-------------------------------------- // //