00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef ROO_ABS_NUM_GENERATOR
00017 #define ROO_ABS_NUM_GENERATOR
00018
00019 #include "TNamed.h"
00020 #include "RooPrintable.h"
00021 #include "RooArgSet.h"
00022 #include "RooArgList.h"
00023
00024 class RooAbsReal;
00025 class RooRealVar;
00026 class RooDataSet;
00027 class RooRealBinding;
00028 class RooNumGenConfig ;
00029
00030 class RooAbsNumGenerator : public TNamed, public RooPrintable {
00031 public:
00032 RooAbsNumGenerator() : _cloneSet(0), _funcClone(0), _funcMaxVal(0), _verbose(kFALSE), _isValid(kFALSE), _funcValStore(0), _funcValPtr(0), _cache(0) {} ;
00033 RooAbsNumGenerator(const RooAbsReal &func, const RooArgSet &genVars, Bool_t verbose=kFALSE, const RooAbsReal* maxFuncVal=0);
00034 virtual RooAbsNumGenerator* clone(const RooAbsReal&, const RooArgSet& genVars, const RooArgSet& condVars,
00035 const RooNumGenConfig& config, Bool_t verbose=kFALSE, const RooAbsReal* maxFuncVal=0) const = 0 ;
00036
00037 Bool_t isValid() const {
00038
00039 return _isValid;
00040 }
00041 virtual ~RooAbsNumGenerator();
00042
00043 inline void setVerbose(Bool_t verbose= kTRUE) {
00044
00045 _verbose= verbose;
00046 }
00047 inline Bool_t isVerbose() const {
00048
00049 return _verbose;
00050 }
00051
00052 virtual const RooArgSet *generateEvent(UInt_t remaining, Double_t& resampleRatio) = 0;
00053 virtual Double_t getFuncMax() { return 0 ; }
00054
00055 inline virtual void Print(Option_t *options= 0) const {
00056
00057 printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
00058 }
00059
00060 virtual void printName(ostream& os) const ;
00061 virtual void printTitle(ostream& os) const ;
00062 virtual void printClassName(ostream& os) const ;
00063 virtual void printArgs(ostream& os) const ;
00064
00065 void attachParameters(const RooArgSet& vars) ;
00066
00067
00068 virtual Bool_t canSampleCategories() const { return kFALSE ; }
00069 virtual Bool_t canSampleConditional() const { return kFALSE ; }
00070
00071 protected:
00072
00073 RooArgSet *_cloneSet;
00074 RooAbsReal *_funcClone;
00075 const RooAbsReal *_funcMaxVal ;
00076 RooArgSet _catVars,_realVars ;
00077 Bool_t _verbose, _isValid;
00078 RooRealVar *_funcValStore,*_funcValPtr;
00079
00080 RooDataSet *_cache;
00081
00082 ClassDef(RooAbsNumGenerator,0)
00083 };
00084
00085 #endif