#ifndef ROO_ABS_NUM_GENERATOR
#define ROO_ABS_NUM_GENERATOR
#include "TNamed.h"
#include "RooPrintable.h"
#include "RooArgSet.h"
#include "RooArgList.h"
class RooAbsReal;
class RooRealVar;
class RooDataSet;
class RooRealBinding;
class RooNumGenConfig ;
class RooAbsNumGenerator : public TNamed, public RooPrintable {
public:
RooAbsNumGenerator() : _cloneSet(0), _funcClone(0), _funcMaxVal(0), _verbose(kFALSE), _isValid(kFALSE), _funcValStore(0), _funcValPtr(0), _cache(0) {} ;
RooAbsNumGenerator(const RooAbsReal &func, const RooArgSet &genVars, Bool_t verbose=kFALSE, const RooAbsReal* maxFuncVal=0);
virtual RooAbsNumGenerator* clone(const RooAbsReal&, const RooArgSet& genVars, const RooArgSet& condVars,
const RooNumGenConfig& config, Bool_t verbose=kFALSE, const RooAbsReal* maxFuncVal=0) const = 0 ;
Bool_t isValid() const {
return _isValid;
}
virtual ~RooAbsNumGenerator();
inline void setVerbose(Bool_t verbose= kTRUE) {
_verbose= verbose;
}
inline Bool_t isVerbose() const {
return _verbose;
}
virtual const RooArgSet *generateEvent(UInt_t remaining, Double_t& resampleRatio) = 0;
virtual Double_t getFuncMax() { return 0 ; }
inline virtual void Print(Option_t *options= 0) const {
printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
}
virtual void printName(std::ostream& os) const ;
virtual void printTitle(std::ostream& os) const ;
virtual void printClassName(std::ostream& os) const ;
virtual void printArgs(std::ostream& os) const ;
void attachParameters(const RooArgSet& vars) ;
virtual Bool_t canSampleCategories() const { return kFALSE ; }
virtual Bool_t canSampleConditional() const { return kFALSE ; }
protected:
RooArgSet *_cloneSet;
RooAbsReal *_funcClone;
const RooAbsReal *_funcMaxVal ;
RooArgSet _catVars,_realVars ;
Bool_t _verbose, _isValid;
RooRealVar *_funcValStore,*_funcValPtr;
RooDataSet *_cache;
ClassDef(RooAbsNumGenerator,0)
};
#endif