ROOT logo
ROOT » ROOFIT » ROOFITCORE » RooCustomizer

class RooCustomizer: public TNamed, public RooPrintable


 RooCustomizer is a factory class to produce clones
 of a prototype composite PDF object with the same structure but
 different leaf servers (parameters or dependents)

 RooCustomizer supports two kinds of modifications:

 -> replace(leaf_arg,repl_arg)
 replaces each occurence of leaf_arg with repl_arg in the composite pdf.

 -> split(split_arg)
 is used when building multiple clones of the same prototype. Each
 occurrence of split_arg is replaceed with a clone of split_arg
 named split_arg_[MCstate], where [MCstate] is the name of the
 'master category state' that indexes the clones to be built.


 [Example]

 Splitting is particularly useful when building simultaneous fits to
 subsets of the data sample with different background properties.
 In such a case, the user builds a single prototype PDF representing
 the structure of the signal and background and splits the dataset
 into categories with different background properties. Using
 RooCustomizer a PDF for each subfit can be constructed from the
 prototype that has same structure and signal parameters, but
 different instances of the background parameters: e.g.


     RooExponential bg("bg","background",x,alpha) ;
     RooGaussian sig("sig","signal",x,mean,sigma) ;
     RooAddPdf pdf("pdf","pdf",sig,bg,sigfrac) ;

     RooDataSet data("data","dataset",RooArgSet(x,runblock),...)

     RooCategory runblock("runblock","run block") ;
     runblock.defineType("run1") ;
     runblock.defineType("run2") ;

     RooArgSet splitLeafs
     RooCustomizer cust(pdf,runblock,splitLeafs)
     cust.split(alpha,runblock)

     RooAbsPdf* pdf_run1 = cust.build("run1") ;
     RooAbsPdf* pdf_run2 = cust.build("run2") ;

     RooSimultaneous simpdf("simpdf","simpdf",RooArgSet(*pdf_run1,*pdf_run2))

 If the master category state is a super category, leafs may be split
 by any subset of that master category. E.g. if the master category
 is 'A x B', leafs may be split by A, B or AxB.

 In addition to replacing leaf nodes, RooCustomizer clones all branch
 nodes that depend directly or indirectly on modified leaf nodes, so
 that the input pdf is untouched by each build operation.

 The customizer owns all the branch nodes including the returned top
 level node, so the customizer should live as longs as the cloned
 composites are needed.

 Any leaf nodes that are created by the customizer will be put into
 the leaf list that is passed into the customizers constructor (splitLeafs in
 the above example. The list owner is responsible for deleting these leaf
 nodes after the customizer is deleted.


 [Advanced techniques]

 By default the customizer clones the prototype leaf node when splitting a leaf,
 but the user can feed pre-defined split leafs in leaf list. These leafs
 must have the name <split_leaf>_<splitcat_label> to be picked up. The list
 of pre-supplied leafs may be partial, any missing split leafs will be auto
 generated.

 Another common construction is to have two prototype PDFs, each to be customized
 by a separate customizer instance, that share parameters. To ensure that
 the customized clones also share their respective split leafs, i.e.

   PDF1(x,y;A) and PDF2(z,A)   ---> PDF1_run1(x,y,A_run1) and PDF2_run1(x,y,A_run1)
                                    PDF1_run2(x,y,A_run2) and PDF2_run2(x,y,A_run2)

 feed the same split leaf list into both customizers. In that case the second customizer
 will pick up the split leafs instantiated by the first customizer and the link between
 the two PDFs is retained


Function Members (Methods)

public:
RooCustomizer(const RooAbsArg& pdf, const char* name)
RooCustomizer(const RooAbsArg& pdf, const RooAbsCategoryLValue& masterCat, RooArgSet& splitLeafListOwned, RooArgSet* splitLeafListAll = 0)
virtual~RooCustomizer()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
RooAbsArg*build(Bool_t verbose = kFALSE)
RooAbsArg*build(const char* masterCatState, Bool_t verbose = kFALSE)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
const RooArgSet&cloneBranchList() const
const RooArgSet&cloneLeafList() const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
virtual Int_tRooPrintable::defaultPrintContents(Option_t* opt) const
static ostream&RooPrintable::defaultPrintStream(ostream* os = 0)
virtual RooPrintable::StyleOptionRooPrintable::defaultPrintStyle(Option_t* opt) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
static voidRooPrintable::nameFieldLength(Int_t newLen)
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TNamed&TNamed::operator=(const TNamed& rhs)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint(Option_t* options = 0) const
virtual voidRooPrintable::printAddress(ostream& os) const
virtual voidprintArgs(ostream& os) const
virtual voidprintClassName(ostream& os) const
virtual voidRooPrintable::printExtras(ostream& os) const
virtual voidprintMultiline(ostream& os, Int_t content, Bool_t verbose = kFALSE, TString indent = "") const
virtual voidprintName(ostream& os) const
virtual voidRooPrintable::printStream(ostream& os, Int_t contents, RooPrintable::StyleOption style, TString indent = "") const
virtual voidprintTitle(ostream& os) const
virtual voidRooPrintable::printTree(ostream& os, TString indent = "") const
virtual voidRooPrintable::printValue(ostream& os) const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidreplaceArg(const RooAbsArg& orig, const RooAbsArg& subst)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidsetCloneBranchSet(RooArgSet& cloneBranchSet)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
voidsetOwning(Bool_t flag)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp)
virtual Int_tTNamed::Sizeof() const
voidsplitArg(const RooAbsArg& arg, const RooAbsCategory& splitCat)
voidsplitArgs(const RooArgSet& argSet, const RooAbsCategory& splitCat)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
RooCustomizer(const RooCustomizer&)
RooAbsArg*doBuild(const char* masterCatState, Bool_t verbose)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidinitialize()
voidTObject::MakeZombie()

Data Members

protected:
RooArgSet*_cloneBranchListPointer to list of cloned branches used
RooArgSet*_cloneNodeListAllList of all cloned nodes
RooArgSet*_cloneNodeListOwnedList of owned cloned nodes
RooArgSet_internalCloneBranchListList of branches of internal clone
RooArgSet_masterBranchListList of branch nodes
TIterator*_masterBranchListIterIterator over branch list
RooAbsCategoryLValue*_masterCatPointer to input master category
RooArgSet_masterLeafListList of leaf nodes
TIterator*_masterLeafListIterIterator over leaf list
RooAbsArg*_masterPdfPointer to input p.d.f
TString_nameName of this object
static Int_tRooPrintable::_nameLength
Bool_t_owningIf true we own all created components
TList_replaceArgListList of RooAbsArgs to be replaced
TList_replaceSubListList of replacement RooAbsArgs
TList_splitArgListList of RooAbsArgs to be split
TList_splitCatListList of categories to be used for above splits
Bool_t_sterileIf true we do not have as associated master category
TStringTNamed::fNameobject identifier
TStringTNamed::fTitleobject title

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

RooCustomizer(const RooAbsArg& pdf, const RooAbsCategoryLValue& masterCat, RooArgSet& splitLeafListOwned, RooArgSet* splitLeafListAll = 0)
 Constructor with a prototype and masterCat index category.
 Customizers created by this constructor offer offer both the
 replaceArg() and splitArg() functionality. All nodes created in
 the customization process are added to the splitLeafs set.
 If the customizer is owning, the splitLeafs set will become
 owner of all created objects by the customizer

RooCustomizer(const RooAbsArg& pdf, const char* name)
 Sterile Constructor. Customizers created by this constructor
 offer only the replace() method. The supplied 'name' is used as
 suffix for any cloned branch nodes
void initialize()
 Initialize the customizer
~RooCustomizer()
 Destructor
void splitArgs(const RooArgSet& argSet, const RooAbsCategory& splitCat)
 Split all arguments in 'set' into individualized clones for each
 defined state of 'splitCat'. The 'splitCats' category must be
 subset of or equal to the master category supplied in the
 customizer constructor.

 Splitting is only available on customizers created with a master index category
void splitArg(const RooAbsArg& arg, const RooAbsCategory& splitCat)
 Split all argument 'arg' into individualized clones for each
 defined state of 'splitCat'. The 'splitCats' category must be
 subset of or equal to the master category supplied in the
 customizer constructor.

 Splitting is only available on customizers created with a master index category
void replaceArg(const RooAbsArg& orig, const RooAbsArg& subst)
 Replace any occurence of arg 'orig' with arg 'subst'
RooAbsArg* build(Bool_t verbose = kFALSE)
 Build a clone of the prototype executing all registered 'replace' rules
 If verbose is set a message is printed for each leaf or branch node
 modification. The returned head node owns all cloned branch nodes
 that were created in the cloning proces
RooAbsArg* build(const char* masterCatState, Bool_t verbose = kFALSE)
 Build a clone of the prototype executing all registered 'replace'
 rules and 'split' rules for the masterCat state named
 'masterCatState'.  If verbose is set a message is printed for
 each leaf or branch node modification. The returned composite arg
 is owned by the customizer.  This function cannot be called on
 customizer build with the sterile constructor.
RooAbsArg* doBuild(const char* masterCatState, Bool_t verbose)
 Back-end implementation of the p.d.f building functionality
void printName(ostream& os) const
 Print name of customizer
void printTitle(ostream& os) const
 Print title of customizer
void printClassName(ostream& os) const
 Print class name of customizer
void printArgs(ostream& os) const
 Print arguments of customizer, i.e. input p.d.f and input master category (if any)
void printMultiline(ostream& os, Int_t content, Bool_t verbose = kFALSE, TString indent = "") const
 Print customizer configuration details
void setCloneBranchSet(RooArgSet& cloneBranchSet)
 Install the input RooArgSet as container in which all cloned branches
 will be stored
RooCustomizer(const RooAbsArg& pdf, const RooAbsCategoryLValue& masterCat, RooArgSet& splitLeafListOwned, RooArgSet* splitLeafListAll = 0)
 Constructors, assignment etc
void setOwning(Bool_t flag)
 If flag is true, make customizer own all created components
const RooArgSet& cloneBranchList() const
 Return list of cloned branch nodes
const RooArgSet& cloneLeafList() const
 Return list of cloned leaf nodes
void Print(Option_t* options = 0) const
 Printing interface