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 ;
 
   53  if (prototype) 
ccxcoutI(Generation) << 
" with prototype data for " << *prototype->
get() ;
 
   54  if (auxProto && auxProto->
getSize()>0)  
ccxcoutI(Generation) << 
" with auxiliary prototypes " << *auxProto ;
 
   66      coefNSet.
add(*prototype->
get()) ;
 
   74  _hist = std::make_unique<RooDataHist>(
"genData",
"genData",*
_vars);
 
  120  double nEvents = nEvt ;
 
  124      coutE(InputArguments) << 
"RooAbsPdf::generateBinned(" << 
GetName()
 
  125             << 
") ERROR: No event count provided and p.d.f does not provide expected number of events" << endl ;
 
  143  vector<int> histOut(
_hist->numEntries()) ;
 
  145  Int_t histOutSum(0) ;
 
  146  for (
int i=0 ; i<
_hist->numEntries() ; i++) {
 
  151      double w=
_hist->weight()*nEvents ;
 
  154    } 
else if (extended) {
 
  164      if (
_hist->weight()>histMax) {
 
  165   histMax = 
_hist->weight() ;
 
  168      histOutSum += histOut[i] ;
 
  178    Int_t nEvtExtra = std::abs(
Int_t(nEvents)-histOutSum) ;
 
  179    Int_t wgt = (histOutSum>nEvents) ? -1 : 1 ;
 
  185      _hist->get(ibinRand) ;
 
  188      if (ranY<_hist->weight()) {
 
  190     histOut[ibinRand]++ ;
 
  193     if (histOut[ibinRand]>0) {
 
  194       histOut[ibinRand]-- ;
 
  204    for (
int i=0 ; i<
_hist->numEntries() ; i++) {
 
  206      wudata->
add(*
_hist->get(),histOut[i]) ;
 
  233  os << 
indent << 
"--- RooBinnedGenContext ---" << endl ;
 
  234  os << 
indent << 
"Using PDF ";
 
static void indent(ostringstream &buf, int indent_level)
 
bool recursiveRedirectServers(const RooAbsCollection &newServerList, bool mustReplaceAll=false, bool nameChange=false, bool recurseInNewSet=true)
Recursively replace all servers with the new servers in newSet.
 
void setOperMode(OperMode mode, bool recurseADirty=true)
Set the operation mode of this node.
 
RooFit::OwningPtr< RooArgSet > getObservables(const RooArgSet &set, bool valueOnly=true) const
Given a set of possible observables, return the observables that this PDF depends on.
 
Int_t getSize() const
Return the number of elements in the collection.
 
virtual bool add(const RooAbsArg &var, bool silent=false)
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.
 
RooArgSet _theEvent
Pointer to observable event being generated.
 
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Interface for multi-line printing.
 
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.
 
RooDataHist * fillDataHist(RooDataHist *hist, const RooArgSet *nset, double scaleFactor, bool correctForBinVolume=false, bool showProgress=false) const
Fill a RooDataHist with values sampled from this function at the bin centers.
 
virtual void fixAddCoefNormalization(const RooArgSet &addNormSet=RooArgSet(), bool force=true)
Fix the interpretation of the coefficient of any RooAddPdf component in the expression tree headed by...
 
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.
 
~RooBinnedGenContext() override
 
bool _expectedData
Asimov?
 
void generateEvent(RooArgSet &theEvent, Int_t remaining) override
this method is not implemented for this context
 
std::unique_ptr< RooDataHist > _hist
Histogram.
 
void printMultiline(std::ostream &os, Int_t content, bool verbose=false, TString indent="") const override
Print the details of the context.
 
RooArgSet _pdfSet
Set owned all nodes of internal clone of p.d.f.
 
RooBinnedGenContext(const RooAbsPdf &model, const RooArgSet &vars, const RooDataSet *prototype=nullptr, const RooArgSet *auxProto=nullptr, bool _verbose=false)
Constructor.
 
void setExpectedData(bool) override
 
std::unique_ptr< RooArgSet > _vars
 
void initGenerator(const RooArgSet &theEvent) override
One-time initialization of generator contex.
 
RooDataSet * generate(double nEvents=0.0, bool skipInit=false, bool extendedMode=false) override
Generate the specified number of events with nEvents>0 and and return a dataset containing the genera...
 
void attach(const RooArgSet ¶ms) override
Attach given set of variables to internal p.d.f. clone.
 
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 weight=1.0, double weightError=0.0) override
Add one ore more rows of data.
 
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.
 
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="weight", bool reinterpretAsWeight=false)