51 cxcoutI(
Generation) <<
"RooBinnedGenContext::ctor() setting up event special generator context for sum p.d.f. " << model.
GetName()
52 <<
" for generation of observable(s) " << vars ;
66 coefNSet.
add(*prototype->
get()) ;
76 while((var=viter.
next())) {
146 <<
") ERROR: No event count provided and p.d.f does not provide expected number of events" << endl ;
169 Int_t histOutSum(0) ;
178 }
else if (extended) {
192 histOutSum += histOut[i] ;
203 Int_t wgt = (histOutSum>nEvents) ? -1 : 1 ;
212 if (ranY<_hist->weight()) {
214 histOut[ibinRand]++ ;
217 if (histOut[ibinRand]>0) {
218 histOut[ibinRand]-- ;
257 os <<
indent <<
"--- RooBinnedGenContext ---" << endl ;
258 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.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
Int_t getSize() const
Return the number of elements in the collection.
RooFIter fwdIterator() const
One-time forward iterator.
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.
void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const override
Interface for multi-line printing.
RooArgSet _theEvent
Pointer to observable event being generated.
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 minimum 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.
RooAbsPdf * _pdf
Pointer to cloned p.d.f.
void setExpectedData(Bool_t) override
RooBinnedGenContext(const RooAbsPdf &model, const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t _verbose=kFALSE)
Constructor.
~RooBinnedGenContext() override
Destructor. Delete all owned subgenerator contexts.
void generateEvent(RooArgSet &theEvent, Int_t remaining) override
this method is not implemented for this context
RooDataHist * _hist
Histogram.
RooDataSet * generate(Double_t nEvents=0, Bool_t skipInit=kFALSE, Bool_t extendedMode=kFALSE) override
Generate the specified number of events with nEvents>0 and and return a dataset containing the genera...
void initGenerator(const RooArgSet &theEvent) override
One-time initialization of generator contex.
Bool_t _expectedData
Asimov?
void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const override
Print the details of the context.
void attach(const RooArgSet ¶ms) override
Attach given set of variables to internal p.d.f. clone.
RooArgSet * _pdfSet
Set owned all nodes of internal clone of p.d.f.
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.
const RooArgSet * get(Int_t index) const override
Return RooArgSet with coordinates of event 'index'.
void add(const RooArgSet &row, Double_t weight=1.0, Double_t weightError=0) override
Add one ore more rows of data.
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.
const char * GetName() const override
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)
RVec< PromoteType< T > > abs(const RVec< T > &v)