54 cxcoutI(Generation) <<
"RooBinnedGenContext::ctor() setting up event special generator context for sum p.d.f. " << model.
GetName()
55 <<
" for generation of observable(s) " << vars ;
56 if (prototype)
ccxcoutI(Generation) <<
" with prototype data for " << *prototype->
get() ;
57 if (auxProto && auxProto->
getSize()>0)
ccxcoutI(Generation) <<
" with auxiliary prototypes " << *auxProto ;
69 coefNSet.
add(*prototype->
get()) ;
79 while((var=viter.
next())) {
148 coutE(InputArguments) <<
"RooAbsPdf::generateBinned(" <<
GetName()
149 <<
") ERROR: No event count provided and p.d.f does not provide expected number of events" << endl ;
172 Int_t histOutSum(0) ;
181 }
else if (extended) {
195 histOutSum += histOut[i] ;
205 Int_t nEvtExtra = abs(
Int_t(nEvents)-histOutSum) ;
206 Int_t wgt = (histOutSum>nEvents) ? -1 : 1 ;
215 if (ranY<_hist->weight()) {
217 histOut[ibinRand]++ ;
220 if (histOut[ibinRand]>0) {
221 histOut[ibinRand]-- ;
260 os <<
indent <<
"--- RooBinnedGenContext ---" << endl ;
261 os <<
indent <<
"Using PDF ";
static void indent(ostringstream &buf, int indent_level)
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
Given a set of possible observables, return the observables that this PDF depends on.
void setOperMode(OperMode mode, Bool_t recurseADirty=kTRUE)
Set the operation mode of this node.
Bool_t recursiveRedirectServers(const RooAbsCollection &newServerList, Bool_t mustReplaceAll=kFALSE, Bool_t nameChange=kFALSE, Bool_t recurseInNewSet=kTRUE)
Recursively replace all servers with the new servers in newSet.
RooFIter fwdIterator() const
One-time forward iterator.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
RooAbsArg * find(const char *name) const
Find object with given name in list.
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Interface for multi-line printing.
Bool_t canBeExtended() const
If true, PDF can provide extended likelihood term.
virtual Double_t expectedEvents(const RooArgSet *nset) const
Return expected number of events to be used in calculation of extended likelihood.
virtual Double_t getMax(const char *name=0) const
Get maximum of currently defined range.
virtual Double_t getMin(const char *name=0) const
Get miniminum of currently defined range.
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &obs, Double_t xlo, Double_t xhi) const
Retrieve bin boundaries if this distribution is binned in obs.
virtual void fixAddCoefNormalization(const RooArgSet &addNormSet=RooArgSet(), Bool_t force=kTRUE)
Fix the interpretation of the coefficient of any RooAddPdf component in the expression tree headed by...
RooDataHist * fillDataHist(RooDataHist *hist, const RooArgSet *nset, Double_t scaleFactor, Bool_t correctForBinVolume=kFALSE, Bool_t showProgress=kFALSE) const
Fill a RooDataHist with values sampled from this function at the bin centers.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooArgSet * snapshot(bool deepCopy=true) const
Use RooAbsCollection::snapshot(), but return as RooArgSet.
RooBinnedGenContext is an efficient implementation of the generator context specific for binned pdfs.
RooBinnedGenContext(const RooAbsPdf &model, const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t _verbose=kFALSE)
Constructor.
virtual void initGenerator(const RooArgSet &theEvent)
One-time initialization of generator contex.
virtual void attach(const RooArgSet ¶ms)
Attach given set of variables to internal p.d.f. clone.
virtual void generateEvent(RooArgSet &theEvent, Int_t remaining)
this method is not implemented for this context
virtual ~RooBinnedGenContext()
Destructor. Delete all owned subgenerator contexts.
virtual void setExpectedData(Bool_t)
virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
Print the details of the context.
RooDataSet * generate(Double_t nEvents=0, Bool_t skipInit=kFALSE, Bool_t extendedMode=kFALSE)
Generate the specified number of events with nEvents>0 and and return a dataset containing the genera...
The RooDataHist is a container class to hold N-dimensional binned data.
double weight(std::size_t i) const
Return weight of i-th bin.
Int_t numEntries() const override
Return the number of bins.
void reset() override
Reset all bin weights to zero.
const RooArgSet * get() const override
Get bin centre of current bin.
RooDataSet is a container class to hold unbinned data.
virtual const RooArgSet * get(Int_t index) const override
Return RooArgSet with coordinates of event 'index'.
virtual void add(const RooArgSet &row, Double_t weight=1.0, Double_t weightError=0) override
Add a data point, with its coordinates specified in the 'data' argset, to the data set.
A one-time forward iterator working on RooLinkedList or RooAbsCollection.
RooAbsArg * next()
Return next element or nullptr if at end.
virtual void printStream(std::ostream &os, Int_t contents, StyleOption style, TString indent="") const
Print description of object on ostream, printing contents set by contents integer,...
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
RooRealVar represents a variable that can be changed from the outside.
virtual const char * GetName() const
Returns name of object.
virtual Int_t Poisson(Double_t mean)
Generates a random integer N according to a Poisson law.
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
virtual UInt_t Integer(UInt_t imax)
Returns a random integer uniformly distributed on the interval [ 0, imax-1 ].
RooCmdArg WeightVar(const char *name, Bool_t reinterpretAsWeight=kFALSE)