#ifndef ROO_ABS_GEN_CONTEXT
#define ROO_ABS_GEN_CONTEXT
#include "TNamed.h"
#include "RooPrintable.h"
#include "RooArgSet.h"
#include "RooAbsPdf.h"
class RooDataSet;
class RooAbsGenContext : public TNamed, public RooPrintable {
public:
RooAbsGenContext(const RooAbsPdf &model, const RooArgSet &vars, const RooDataSet *prototype= 0, const RooArgSet* auxProto=0,
Bool_t _verbose= kFALSE) ;
virtual ~RooAbsGenContext();
virtual RooDataSet *generate(Double_t nEvents= 0, Bool_t skipInit=kFALSE, Bool_t extendedMode=kFALSE);
Bool_t isValid() const {
return _isValid;
}
inline void setVerbose(Bool_t verbose= kTRUE) {
_verbose= verbose;
}
inline Bool_t isVerbose() const {
return _verbose;
}
virtual void setProtoDataOrder(Int_t* lut) ;
inline virtual void Print(Option_t *options= 0) const {
printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
}
virtual void attach(const RooArgSet& params) ;
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 ;
virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const;
virtual Int_t defaultPrintContents(Option_t* opt) const ;
virtual StyleOption defaultPrintStyle(Option_t* opt) const ;
virtual void setExpectedData(Bool_t) {} ;
protected:
virtual RooDataSet* createDataSet(const char* name, const char* title, const RooArgSet& obs) ;
friend class RooConvGenContext ;
friend class RooProdGenContext ;
friend class RooAddGenContext ;
friend class RooSimGenContext ;
friend class RooSimSplitGenContext ;
friend class RooEffGenContext ;
virtual void initGenerator(const RooArgSet &theEvent);
virtual void generateEvent(RooArgSet &theEvent, Int_t remaining) = 0;
void resampleData(Double_t& ratio) ;
const RooDataSet *_prototype;
RooArgSet *_theEvent;
Bool_t _isValid;
Bool_t _verbose;
UInt_t _expectedEvents;
RooArgSet _protoVars;
Int_t _nextProtoIndex;
RooAbsPdf::ExtendMode _extendMode ;
Int_t* _protoOrder ;
TString _normRange ;
RooDataSet* _genData ;
ClassDef(RooAbsGenContext,0)
};
#endif