20 #include "StRandomSelector.h"
29 double totalElem = GetTotalNumber();
36 double tolerance = 1/(totalElem+1/totalElem);
38 if ( mAbsoluteThreshold )
41 std::abs((
double)mTotalElemReturned/totalElem - mProbability) < tolerance
44 Skip( GetTotalNumber() );
50 mRand.Rndm() > mProbability
51 && mTotalElemSkipped+mTotalElemReturned < totalElem
60 && std::abs((
double)mTotalElemSkipped/totalElem - 1.0 + mProbability) < tolerance