57 RooAbsGenContext(model,vars,prototype,auxProto,verbose), _pdf(&model), _protoData(0)
64 if (prototype) allPdfVars.
add(*prototype->
get(),
kTRUE) ;
72 <<
" generate the index category" << endl ;
92 if (anyServer && !allServers) {
94 <<
" generate all components of a derived index category" << endl ;
108 <<
" or prototype data to calculate number of events per category" << endl ;
151 oocoutE(
_pdf,
Generation) <<
"RooSimGenContext::RooSimGenContext(" <<
GetName() <<
") Couldn't deep-clone index category, abort," << endl ;
152 throw std::string(
"RooSimGenContext::RooSimGenContext() Couldn't deep-clone index category, abort") ;
167 for (vector<RooAbsGenContext*>::iterator iter =
_gcList.begin() ; iter!=
_gcList.end() ; ++iter) {
186 for (vector<RooAbsGenContext*>::iterator iter =
_gcList.begin() ; iter!=
_gcList.end() ; ++iter) {
187 (*iter)->attach(args) ;
209 for (vector<RooAbsGenContext*>::iterator iter =
_gcList.begin() ; iter!=
_gcList.end() ; ++iter) {
210 (*iter)->initGenerator(theEvent) ;
228 map<string,RooAbsData*> dmap ;
234 std::string sliceName =
Form(
"%s_slice_%s",name,state->
GetName()) ;
235 std::string sliceTitle =
Form(
"%s (index slice %s)",title,state->
GetName()) ;
237 dmap[state->
GetName()] = dset ;
269 if (
_gcIndex[i]==cidx) { gidx = i ; break ; }
275 oocoutW(
_pdf,
Generation) <<
"RooSimGenContext::generateEvent: WARNING, no PDF to generate event of type " << cidx << endl ;
337 for (vector<RooAbsGenContext*>::iterator iter =
_gcList.begin() ; iter!=
_gcList.end() ; ++iter) {
338 (*iter)->setProtoDataOrder(lut) ;
349 os << indent <<
"--- RooSimGenContext ---" << endl ;
350 os << indent <<
"Using PDF ";
352 os << indent <<
"List of component generators" << endl ;
354 TString indent2(indent) ;
355 indent2.Append(
" ") ;
357 for (vector<RooAbsGenContext*>::const_iterator iter =
_gcList.begin() ; iter!=
_gcList.end() ; ++iter) {
358 (*iter)->printMultiline(os,content,verbose,indent2);
virtual const char * GetName() const
Returns name of object.
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'.
RooCategoryProxy _indexCat
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
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.
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
virtual void SetName(const char *name)
Set the name of the TNamed.
RooCmdArg Link(const char *state, RooAbsData &data)
virtual void setIndexFast(Int_t index)
virtual Int_t getIndex() const
Return index number of current state.
RooArgSet _allVarsPdf
Prototype dataset.
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.
const RooAbsCategory & arg() const
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.
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state...
virtual void attach(const RooArgSet ¶ms)
Attach the index category clone to the given event buffer.
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
RooAbsCategoryLValue is the common abstract base class for objects that represent a discrete value th...
virtual Double_t expectedEvents(const RooArgSet *nset) const
Return expected number of events from this p.d.f for use in extended likelihood calculations.
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const
Return a list iterator.
virtual const char * name() const
std::vector< int > _gcIndex
RooSimGenContext is an efficient implementation of the generator context specific for RooSimultaneous...
TIterator * typeIterator() const
Return iterator over all defined states.
virtual const Text_t * GetName() const
Returns name of object.
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.
char * Form(const char *fmt,...)
RooAbsArg * absArg() const
virtual void generateEvent(RooArgSet &theEvent, Int_t remaining)=0
virtual void initGenerator(const RooArgSet &theEvent)
Perform one-time initialization of generator context.
static void indent(ostringstream &buf, int indent_level)
RooDataSet is a container class to hold unbinned data.
RooCategory represents a fundamental (non-derived) discrete value object.
Bool_t canBeExtended() const
TIterator * serverIterator() const
virtual const RooArgSet * get(Int_t index) const
Return RooArgSet with coordinates of event 'index'.
RooCmdArg Index(RooCategory &icat)
static Double_t uniform(TRandom *generator=randomGenerator())
Return a number uniformly distributed from (0,1)
RooAbsArg * find(const char *name) const
Find object with given name in list.
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.
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
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Interface for multi-line printing.
virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
Detailed printing interface.
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 * getPdf(const char *catName) const
Return the p.d.f associated with the given index category name.
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
virtual Bool_t isDerived() const
virtual TObject * Next()=0
RooAbsCategoryLValue * _idxCat
RooAbsCategory is the common abstract base class for objects that represent a discrete value with a f...
RooRealProxy is the concrete proxy for RooAbsReal objects A RooRealProxy is the general mechanism to ...
Bool_t contains(const RooAbsArg &var) const
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
virtual Int_t GetSize() const
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.
RooSimultaneous facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset...