56 RooAbsGenContext(model,vars,prototype,auxProto,verbose), _pdf(&model), _protoData(0)
63 if (prototype) allPdfVars.
add(*prototype->
get(),
kTRUE) ;
71 <<
" generate the index category" << endl ;
91 if (anyServer && !allServers) {
93 <<
" generate all components of a derived index category" << endl ;
107 <<
" or prototype data to calculate number of events per category" << endl ;
150 oocoutE(
_pdf,
Generation) <<
"RooSimGenContext::RooSimGenContext(" <<
GetName() <<
") Couldn't deep-clone index category, abort," << endl ;
151 throw std::string(
"RooSimGenContext::RooSimGenContext() Couldn't deep-clone index category, abort") ;
186 (*iter)->attach(args) ;
209 (*iter)->initGenerator(theEvent) ;
227 map<string,RooAbsData*> dmap ;
233 std::string sliceName =
Form(
"%s_slice_%s",name,state->
GetName()) ;
234 std::string sliceTitle =
Form(
"%s (index slice %s)",title,state->
GetName()) ;
236 dmap[state->
GetName()] = dset ;
268 if (
_gcIndex[i]==cidx) { gidx = i ; break ; }
274 oocoutW(
_pdf,
Generation) <<
"RooSimGenContext::generateEvent: WARNING, no PDF to generate event of type " << cidx << endl ;
337 (*iter)->setProtoDataOrder(lut) ;
348 os << indent <<
"--- RooSimGenContext ---" << endl ;
349 os << indent <<
"Using PDF ";
351 os << indent <<
"List of component generators" << endl ;
357 (*iter)->printMultiline(os,content,verbose,indent2);
RooCategoryProxy _indexCat
virtual Bool_t isDerived() const
TIterator * serverIterator() const
virtual ~RooSimGenContext()
Destructor. Delete all owned subgenerator contexts.
RooDataSet * createDataSet(const char *name, const char *title, const RooArgSet &obs)
Create an empty dataset to hold the events that will be generated.
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, which is interpreted as an OR of 'enum ContentsOptions' values and in the style given by 'enum StyleOption'.
virtual Int_t getIndex() const
Return index number of current state.
virtual void SetName(const char *name)
Change (i.e.
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
RooCmdArg Link(const char *state, RooAbsData &data)
Bool_t contains(const RooAbsArg &var) const
virtual const char * name() const
virtual void setIndexFast(Int_t index)
RooAbsPdf * getPdf(const char *catName) const
Return the p.d.f associated with the given index category name.
RooArgSet _allVarsPdf
Prototype dataset.
virtual Double_t expectedEvents(const RooArgSet *nset) const
Return expected number of events from this p.d.f for use in extended likelihood calculations.
Iterator abstract base class.
void updateFractions()
No action needed if we have a proto index.
virtual void generateEvent(RooArgSet &theEvent, Int_t remaining)
Generate event appropriate for current index state.
std::map< std::string, std::string >::const_iterator iter
TString & Append(const char *cs)
RooSimGenContext(const RooSimultaneous &model, const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t _verbose=kFALSE)
Constructor of specialized generator context for RooSimultaneous p.d.f.s.
virtual void attach(const RooArgSet ¶ms)
Attach the index category clone to the given event buffer.
std::vector< int > _gcIndex
RooAbsArg * find(const char *name) const
Find object with given name in list.
ClassImp(RooSimGenContext)
char * Form(const char *fmt,...)
virtual void generateEvent(RooArgSet &theEvent, Int_t remaining)=0
RooAbsArg * absArg() const
virtual const char * GetName() const
Returns name of object.
virtual void initGenerator(const RooArgSet &theEvent)
Perform one-time initialization of generator context.
static void indent(ostringstream &buf, int indent_level)
RooCmdArg Index(RooCategory &icat)
virtual Int_t GetSize() const
virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
Detailed printing interface.
static Double_t uniform(TRandom *generator=randomGenerator())
Return a number uniformly distributed from (0,1)
Bool_t canBeExtended() const
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Interface for multi-line printing.
virtual void setProtoDataOrder(Int_t *lut)
Set the traversal order of prototype data to that in the lookup tables passed as argument.
const RooSimultaneous * _pdf
std::vector< RooAbsGenContext * > _gcList
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
virtual TObject * Next()=0
RooAbsCategoryLValue * _idxCat
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const
Return a list iterator.
const RooAbsCategory & arg() const
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Bool_t recursiveRedirectServers(const RooAbsCollection &newServerList, Bool_t mustReplaceAll=kFALSE, Bool_t nameChange=kFALSE, Bool_t recurseInNewSet=kTRUE)
virtual void setProtoDataOrder(Int_t *lut)
Set the traversal order of the prototype data to that in the given lookup table.
virtual const RooArgSet * get(Int_t index) const
Return RooArgSet with coordinates of event 'index'.
virtual const Text_t * GetName() const
Returns name of object.
TIterator * typeIterator() const
Return iterator over all defined states.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add element to non-owning set.
virtual RooAbsGenContext * genContext(const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t verbose=kFALSE) const
Interface function to create a generator context from a p.d.f.
const RooCatType * lookupType(Int_t index, Bool_t printError=kFALSE) const
Find our type corresponding to the specified index, or return 0 for no match.