40using std::cout, std::endl, std::ostream;
51 _prototype(prototype),
57 coutE(Generation) <<
"RooAbsGenContext::ctor: Error in PDF dependents" << endl ;
145 <<
":generate: PDF not extendable: cannot calculate expected number of events" << endl;
152 <<
":generate: cannot calculate expected number of events" << endl;
156 << nEvents <<
" events" << endl;
161 double nExpEvents = nEvents;
163 cxcoutI(Generation) <<
" Extended mode active, number of events generated (" << nEvents <<
") is Poisson fluctuation on "
164 <<
GetName() <<
"::expectedEvents() = " << nExpEvents << endl ;
174 coutE(InputArguments) <<
ClassName() <<
"::" <<
GetName() <<
":generate: prototype dataset is missing \""
175 << arg->GetName() <<
"\"" << endl;
181 if(!ok)
return nullptr;
190 title.
Prepend(
"Generated From ");
212 if(
nullptr != subEvent) {
217 << actualProtoIdx <<
" from prototype dataset" << endl;
296 os << arg->GetName() ;
326 for (i=0 ; i<
n ; i++) {
345 cxcoutD(Generation) <<
"RooGenContext::resampleData*( existing production trimmed from " << nOrig <<
" to " << trimmedData->numEntries() <<
" events" << endl ;
379 if (opt &&
TString(opt).Contains(
"v")) {
bool _verbose
Verbose messaging if true.
Common abstract base class for objects that represent a value and a "shape" in RooFit.
bool recursiveCheckObservables(const RooArgSet *nset) const
Recursively call checkObservables on all nodes in the expression tree.
bool contains(const RooAbsArg &var) const
Check if collection contains an argument with the same name as var.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
void assign(const RooAbsCollection &other) const
Sets the value, cache and constant attribute of any argument in our set that also appears in the othe...
virtual RooAbsArg * addClone(const RooAbsArg &var, bool silent=false)
Add a clone of the specified argument to list.
void setDirtyProp(bool flag)
Control propagation of dirty flags from observables in dataset.
RooFit::OwningPtr< RooAbsData > reduce(const RooCmdArg &arg1, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={})
Create a reduced copy of this dataset.
virtual Int_t numEntries() const
Return number of entries in dataset, i.e., count unweighted entries.
Abstract base class for generator contexts of RooAbsPdf objects.
virtual RooDataSet * createDataSet(const char *name, const char *title, const RooArgSet &obs)
Create an empty dataset to hold the events that will be generated.
std::vector< Int_t > _protoOrder
LUT with traversal order of prototype data.
RooAbsPdf::ExtendMode _extendMode
Extended mode capabilities of p.d.f.
StyleOption defaultPrintStyle(Option_t *opt) const override
Define default print style.
Int_t defaultPrintContents(Option_t *opt) const override
Define default contents when printing.
virtual void attach(const RooArgSet ¶ms)
Interface to attach given parameters to object in this context.
RooDataSet * _genData
! Data being generated
virtual RooDataSet * generate(double nEvents=0, bool skipInit=false, bool extendedMode=false)
Generate the specified number of events with nEvents>0 and and return a dataset containing the genera...
void printClassName(std::ostream &os) const override
Print class name of context.
void printName(std::ostream &os) const override
Print name of context.
virtual void initGenerator(const RooArgSet &theEvent)
Interface function to initialize context for generation for given set of observables.
RooArgSet _theEvent
Pointer to observable event being generated.
RooAbsGenContext(const RooAbsPdf &model, const RooArgSet &vars, const RooDataSet *prototype=nullptr, const RooArgSet *auxProto=nullptr, bool _verbose=false)
Constructor.
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Interface for multi-line printing.
const RooDataSet * _prototype
Pointer to prototype dataset.
void Print(Option_t *options=nullptr) const override
This method must be overridden when a class wants to print itself.
TString _normRange
Normalization range of pdf.
void printArgs(std::ostream &os) const override
Print arguments of context, i.e. the observables being generated in this context.
UInt_t _expectedEvents
Number of expected events from extended p.d.f.
Int_t _nextProtoIndex
Next prototype event to load according to LUT.
RooArgSet _protoVars
Prototype observables.
void printTitle(std::ostream &os) const override
Print title of context.
virtual void generateEvent(RooArgSet &theEvent, Int_t remaining)=0
bool _verbose
Verbose messaging?
bool _isValid
Is context in valid state?
virtual void setProtoDataOrder(Int_t *lut)
Set the traversal order of prototype data to that in the lookup tables passed as argument.
void resampleData(double &ratio)
Rescale existing output buffer with given ratio.
Abstract interface for all probability density functions.
virtual double expectedEvents(const RooArgSet *nset) const
Return expected number of events to be used in calculation of extended likelihood.
bool canBeExtended() const
If true, PDF can provide extended likelihood term.
const char * normRange() const
virtual ExtendMode extendMode() const
Returns ability of PDF to provide extended likelihood terms.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
bool isInRange(const char *rangeSpec)
RooArgSet * snapshot(bool deepCopy=true) const
Use RooAbsCollection::snapshot(), but return as RooArgSet.
Container class to hold unbinned data.
const RooArgSet * get(Int_t index) const override
Return RooArgSet with coordinates of event 'index'.
virtual void addFast(const RooArgSet &row, double weight=1.0, double weightError=0.0)
Add a data point, with its coordinates specified in the 'data' argset, to the data set.
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual ULong64_t Poisson(Double_t mean)
Generates a random integer N according to a Poisson law.
const char * Data() const
TString & Prepend(const char *cs)
RooCmdArg EventRange(Int_t nStart, Int_t nStop)