Warning, file /include/root/RooAbsGenContext.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef ROO_ABS_GEN_CONTEXT
0017 #define ROO_ABS_GEN_CONTEXT
0018
0019 #include "TNamed.h"
0020 #include "RooPrintable.h"
0021 #include "RooArgSet.h"
0022 #include "RooAbsPdf.h"
0023
0024 class RooDataSet;
0025
0026 class RooAbsGenContext : public TNamed, public RooPrintable {
0027 public:
0028 RooAbsGenContext(const RooAbsPdf &model, const RooArgSet &vars, const RooDataSet *prototype= nullptr, const RooArgSet* auxProto=nullptr,
0029 bool _verbose= false) ;
0030
0031 virtual RooDataSet *generate(double nEvents= 0, bool skipInit=false, bool extendedMode=false);
0032
0033 bool isValid() const {
0034
0035 return _isValid;
0036 }
0037
0038 inline void setVerbose(bool verbose= true) {
0039
0040 _verbose= verbose;
0041 }
0042 inline bool isVerbose() const {
0043
0044 return _verbose;
0045 }
0046
0047 virtual void setProtoDataOrder(Int_t* lut) ;
0048
0049 inline void Print(Option_t *options= nullptr) const override {
0050
0051 printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
0052 }
0053
0054 virtual void attach(const RooArgSet& params) ;
0055
0056 void printName(std::ostream& os) const override ;
0057 void printTitle(std::ostream& os) const override ;
0058 void printClassName(std::ostream& os) const override ;
0059 void printArgs(std::ostream& os) const override ;
0060 void printMultiline(std::ostream& os, Int_t contents, bool verbose=false, TString indent="") const override;
0061
0062 Int_t defaultPrintContents(Option_t* opt) const override ;
0063 StyleOption defaultPrintStyle(Option_t* opt) const override ;
0064
0065 virtual void setExpectedData(bool) {} ;
0066
0067 virtual void generateEvent(RooArgSet &theEvent, Int_t remaining) = 0;
0068 virtual void initGenerator(const RooArgSet &theEvent);
0069
0070 protected:
0071
0072 virtual RooDataSet* createDataSet(const char* name, const char* title, const RooArgSet& obs) ;
0073
0074 void resampleData(double& ratio) ;
0075
0076 const RooDataSet *_prototype;
0077 RooArgSet _theEvent;
0078 bool _isValid;
0079 bool _verbose;
0080 UInt_t _expectedEvents;
0081 RooArgSet _protoVars;
0082 Int_t _nextProtoIndex;
0083 RooAbsPdf::ExtendMode _extendMode ;
0084 std::vector<Int_t> _protoOrder ;
0085 TString _normRange ;
0086
0087 RooDataSet* _genData = nullptr;
0088
0089 ClassDefOverride(RooAbsGenContext,0)
0090 };
0091
0092 #endif