--- DarthVader/TrackerLevel2/src/TrkLevel2.cpp 2007/05/24 13:29:09 1.34 +++ DarthVader/TrackerLevel2/src/TrkLevel2.cpp 2007/05/24 14:32:14 1.35 @@ -754,8 +754,22 @@ extern cMini2track track_; track_.istepmin = istepmin; } - - +/** + * Returns 1 if the track is inside the magnet cavity + * Set the minimum number of steps for tracking precision + */ +Bool_t TrkTrack::IsInsideCavity(){ + float xmagntop, ymagntop, xmagnbottom, ymagnbottom; + xmagntop = xv[0] + (ZMAGNHIGH-zv[0])*tan(cos(-1.0)*axv[0]/180.); + ymagntop = yv[0] + (ZMAGNHIGH-zv[0])*tan(cos(-1.0)*ayv[0]/180.); + xmagnbottom = xv[5] + (ZMAGNLOW-zv[5])*tan(cos(-1.0)*axv[5]/180.); + ymagnbottom = yv[5] + (ZMAGNLOW-zv[5])*tan(cos(-1.0)*ayv[5]/180.); + if( xmagntop>XMAGNLOW && xmagntopYMAGNLOW && ymagntopXMAGNLOW && xmagnbottomYMAGNLOW && ymagnbottom