--- DarthVader/TrackerLevel2/src/TrkLevel2.cpp 2008/04/11 13:44:38 1.46 +++ DarthVader/TrackerLevel2/src/TrkLevel2.cpp 2008/12/05 08:30:27 1.51 @@ -400,6 +400,23 @@ return (last_plane-first_plane+1); } /** + * Returns the track "lever-arm" on the x+y view, defined as the distance (in planes) between + * the upper and lower x,y (couple) measurements (the maximum value of lever-arm is 6). + */ +Int_t TrkTrack::GetLeverArmXY(){ + int first_plane = -1; + int last_plane = -1; + for(Int_t ip=0; ip<6; ip++){ + if( XGood(ip)*YGood(ip) && first_plane == -1 )first_plane = ip; + if( XGood(ip)*YGood(ip) && first_plane != -1 )last_plane = ip; + } + if( first_plane == -1 || last_plane == -1){ + cout<< "Int_t TrkTrack::GetLeverArmXY() -- XGood(ip)*YGood(ip) always false ??? "<10) index=10; @@ -657,6 +674,9 @@ TrkParams::Set(path,1); TrkParams::Load(1); + if( !TrkParams::IsLoaded(1) ){ + cout << "void TrkTrack::LoadField(TString path) --- ERROR --- m.field not loaded"<max)max=GetDEDX(i,j); - + for(int j=vfrom; jmax)max=GetDEDX(i,j); + if(j==1 && YGood(i) && GetDEDX(i,j)>max)max=GetDEDX(i,j); + } return max; }; @@ -1220,15 +1241,16 @@ vto = iv+1; } for(int i=pfrom; ifabs(max))max=xv[i]-xm[i]; - if(j==1 && YGood(i) && fabs(ym[i]-yv[i])>fabs(max))max=yv[i]-ym[i]; + for(int j=vfrom; jfabs(max))max=xm[i]-xv[i]; + if(j==1 && YGood(i) && fabs(ym[i]-yv[i])>fabs(max))max=ym[i]-yv[i]; } } return max; }; +/** + * \brief Give the anerage spatial residual + */ +Float_t TrkTrack::GetResidual_av(int ip, int iv){ + // +//Sum$((xm>-50)*(xm-xv)/resx)/sqrt(TrkTrack.GetNX()*TrkTrack.GetChi2X())<0.3 + + Float_t av = 0.; + int nav = 0; + // + int pfrom = 0; + int pto = 6; + int vfrom = 0; + int vto = 2; + if(ip>=0&&ip<6){ + pfrom = ip; + pto = ip+1; + } + if(iv>=0&&iv<2){ + vfrom = iv; + vto = iv+1; + } + for(int i=pfrom; i