12 #ifndef ROOT_TUnuranSampler
13 #define ROOT_TUnuranSampler
49 class TUnuranSampler :
public ROOT::Math::DistSampler {
58 virtual ~TUnuranSampler();
61 using DistSampler::SetFunction;
64 void SetFunction(
const ROOT::Math::IGenFunction & func) {
66 SetFunction<const ROOT::Math::IGenFunction>(func, 1);
70 void SetFunction(TF1 * pdf);
77 bool Init(
const char * algo =
"");
84 bool Init(
const ROOT::Math::DistSamplerOptions & opt );
90 void SetRandom(TRandom * r);
97 void SetSeed(
unsigned int seed);
103 void SetPrintLevel(
int level) {fLevel = level;}
108 void SetMode(
double mode) {
116 void SetArea(
double area) {
124 TRandom * GetRandom();
138 bool Sample(
double * x);
151 bool SampleBin(
double prob,
double & value,
double *error = 0);
158 bool DoInit1D(
const char * algo);
160 bool DoInitDiscrete1D(
const char * algo);
162 bool DoInitND(
const char * algo);
175 const ROOT::Math::IGenFunction * fFunc1D;