--- DarthVader/TrackerLevel2/src/TrkLevel2.cpp 2009/02/03 13:57:15 1.53 +++ DarthVader/TrackerLevel2/src/TrkLevel2.cpp 2009/03/11 14:19:10 1.54 @@ -1019,21 +1019,89 @@ * by the intersection among magnet cavity, silicon-plane sensitive area and * ToF sensitive area (nominal values from the official document used to * calculate the geometrical factor) + * @param toll Tolerance around the nominal volume (toll>0 define an inner fiducial volume) */ -Bool_t TrkTrack::IsInsideAcceptance(){ +// Bool_t TrkTrack::IsInsideAcceptance(){ + +// int ngf = TrkParams::nGF; +// for(int i=0; i= TrkParams::xGF_max[i] || +// yGF[i] <= TrkParams::yGF_min[i] || +// yGF[i] >= TrkParams::yGF_max[i] || +// false)return false; +// } +// return true; + +// } +Bool_t TrkTrack::IsInsideAcceptance(float toll){ + int ngf = TrkParams::nGF; for(int i=0; i= TrkParams::xGF_max[i] || - yGF[i] <= TrkParams::yGF_min[i] || - yGF[i] >= TrkParams::yGF_max[i] || - false)return false; + xGF[i] <= TrkParams::xGF_min[i] + toll || + xGF[i] >= TrkParams::xGF_max[i] - toll || + yGF[i] <= TrkParams::yGF_min[i] + toll || + yGF[i] >= TrkParams::yGF_max[i] - toll || + false){ + + return false; + } } return true; +} + +/** + * Returns true if the track is inside one of the surfaces which define the + * geometrical acceptance. + * @param surf tag of the surface (possible values are: S11 S12 S21 S22 T1 + * CUF T2 T3 T4 T5 CLF T6 S31 S32). + * @param toll Tolerance around the nominal surface (toll>0 define an inner + * fiducial surface) +*/ +Bool_t TrkTrack::IsInsideGFSurface(const char* surf, float toll){ + + + int ngf = TrkParams::nGF; + bool SURFOK = false; + for(int i=0; i TrkParams::xGF_min[i] + toll && + xGF[i] < TrkParams::xGF_max[i] - toll && + yGF[i] > TrkParams::yGF_min[i] + toll && + yGF[i] < TrkParams::yGF_max[i] - toll && + true)return true; + } + } + if( !SURFOK )cout << " Bool_t TrkTrack::IsInsideGFSurface(char* surf, float toll) --> suface "<