#ifndef ROO_ACCEPT_REJECT
#define ROO_ACCEPT_REJECT
#include "RooAbsNumGenerator.h"
#include "RooPrintable.h"
#include "RooArgSet.h"
class RooAbsReal;
class RooRealVar;
class RooDataSet;
class RooRealBinding;
class RooNumGenFactory ;
class RooAcceptReject : public RooAbsNumGenerator {
public:
RooAcceptReject() : _nextCatVar(0), _nextRealVar(0) {
} ;
RooAcceptReject(const RooAbsReal &func, const RooArgSet &genVars, const RooNumGenConfig& config, Bool_t verbose=kFALSE, const RooAbsReal* maxFuncVal=0);
RooAbsNumGenerator* clone(const RooAbsReal& func, const RooArgSet& genVars, const RooArgSet& ,
const RooNumGenConfig& config, Bool_t verbose=kFALSE, const RooAbsReal* maxFuncVal=0) const {
return new RooAcceptReject(func,genVars,config,verbose,maxFuncVal) ;
}
virtual ~RooAcceptReject();
const RooArgSet *generateEvent(UInt_t remaining, Double_t& resampleRatio);
Double_t getFuncMax() ;
virtual Bool_t canSampleConditional() const { return kTRUE ; }
virtual Bool_t canSampleCategories() const { return kTRUE ; }
protected:
friend class RooNumGenFactory ;
static void registerSampler(RooNumGenFactory& fact) ;
void addEventToCache();
const RooArgSet *nextAcceptedEvent();
Double_t _maxFuncVal, _funcSum;
UInt_t _realSampleDim,_catSampleMult;
UInt_t _minTrials;
UInt_t _totalEvents;
UInt_t _eventsUsed;
TIterator *_nextCatVar;
TIterator *_nextRealVar;
UInt_t _minTrialsArray[4];
ClassDef(RooAcceptReject,0)
};
#endif