12 #ifndef ROOT_TFoamSampler
13 #define ROOT_TFoamSampler
39 class TFoamSampler :
public ROOT::Math::DistSampler {
48 virtual ~TFoamSampler();
51 using DistSampler::SetFunction;
54 void SetFunction(
const ROOT::Math::IGenFunction & func) {
56 SetFunction<const ROOT::Math::IGenFunction>(func, 1);
60 void SetFunction(TF1 * pdf);
66 bool Init(
const char * =
"");
71 bool Init(
const ROOT::Math::DistSamplerOptions & opt );
77 void SetRandom(TRandom * r);
84 void SetSeed(
unsigned int seed);
90 TRandom * GetRandom();
97 bool Sample(
double * x);
105 bool SampleBin(
double prob,
double & value,
double *error = 0);
119 const ROOT::Math::IGenFunction * fFunc1D;
121 TFoamIntegrand * fFoamDist;