ROOT logo
ROOT » ROOFIT » ROOFITCORE » RooArgSet

class RooArgSet: public RooAbsCollection


 RooArgSet is a container object that can hold multiple RooAbsArg objects.
 The container has set semantics which means that:

  - Every object it contains must have a unique name returned by GetName().

  - Contained objects are not ordered, although the set can be traversed
    using an iterator returned by createIterator(). The iterator does not
    necessarily follow the object insertion order.

  - Objects can be retrieved by name only, and not by index.


 Ownership of contents.

 Unowned objects are inserted with the add() method. Owned objects
 are added with addOwned() or addClone(). A RooArgSet either owns all
 of it contents, or none, which is determined by the first <add>
 call. Once an ownership status is selected, inappropriate <add> calls
 will return error status. Clearing the list via removeAll() resets the
 ownership status. Arguments supplied in the constructor are always added
 as unowned elements.


Function Members (Methods)

public:
RooArgSet()
RooArgSet(const RooArgList& list)
RooArgSet(const char* name)
RooArgSet(const RooArgList& list, const RooAbsArg* var1)
RooArgSet(const TCollection& tcoll, const char* name = "")
RooArgSet(const RooAbsArg& var1, const char* name = "")
RooArgSet(const RooArgSet& other, const char* name = "")
RooArgSet(const RooArgSet& set1, const RooArgSet& set2, const char* name = "")
RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2, const char* name = "")
RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2, const RooAbsArg& var3, const char* name = "")
RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2, const RooAbsArg& var3, const RooAbsArg& var4, const char* name = "")
RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2, const RooAbsArg& var3, const RooAbsArg& var4, const RooAbsArg& var5, const char* name = "")
RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2, const RooAbsArg& var3, const RooAbsArg& var4, const RooAbsArg& var5, const RooAbsArg& var6, const char* name = "")
RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2, const RooAbsArg& var3, const RooAbsArg& var4, const RooAbsArg& var5, const RooAbsArg& var6, const RooAbsArg& var7, const char* name = "")
RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2, const RooAbsArg& var3, const RooAbsArg& var4, const RooAbsArg& var5, const RooAbsArg& var6, const RooAbsArg& var7, const RooAbsArg& var8, const char* name = "")
RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2, const RooAbsArg& var3, const RooAbsArg& var4, const RooAbsArg& var5, const RooAbsArg& var6, const RooAbsArg& var7, const RooAbsArg& var8, const RooAbsArg& var9, const char* name = "")
virtual~RooArgSet()
voidTObject::AbstractMethod(const char* method) const
virtual Bool_tadd(const RooAbsArg& var, Bool_t silent = kFALSE)
virtual Bool_tadd(const RooAbsCollection& list, Bool_t silent = kFALSE)
virtual RooAbsArg*addClone(const RooAbsArg& var, Bool_t silent = kFALSE)
virtual voidaddClone(const RooAbsCollection& list, Bool_t silent = kFALSE)
virtual Bool_taddOwned(RooAbsArg& var, Bool_t silent = kFALSE)
virtual Bool_taddOwned(const RooAbsCollection& list, Bool_t silent = kFALSE)
Bool_tRooAbsCollection::allInRange(const char* rangeSpec) const
virtual voidTObject::AppendPad(Option_t* option = "")
RooAbsCollection&RooAbsCollection::assignFast(const RooAbsCollection& other)
RooAbsCollection&RooAbsCollection::assignValueOnly(const RooAbsCollection& other, Bool_t oneSafe = kFALSE)
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
static voidcleanup()
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*clone(const char* newname) const
virtual TObject*RooAbsCollection::Clone(const char* newname = 0) const
virtual Int_tTObject::Compare(const TObject* obj) const
Bool_tRooAbsCollection::contains(const RooAbsArg& var) const
Bool_tRooAbsCollection::containsInstance(const RooAbsArg& var) const
stringRooAbsCollection::contentsString() const
virtual voidTObject::Copy(TObject& object) const
virtual TObject*create(const char* newname) const
TIterator*RooAbsCollection::createIterator(Bool_t dir = kIterForward) const
virtual Int_tRooAbsCollection::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
voidRooAbsCollection::dump() const
virtual voidTObject::Dump() constMENU
Bool_tRooAbsCollection::equals(const RooAbsCollection& otherColl) const
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
RooAbsArg*RooAbsCollection::find(const char* name) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
RooAbsArg*RooAbsCollection::first() const
Int_tgetCatIndex(const char* name, Int_t defVal = 0, Bool_t verbose = kFALSE) const
const char*getCatLabel(const char* name, const char* defVal = "", Bool_t verbose = kFALSE) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
Int_tRooAbsCollection::getHashTableSize() const
virtual const char*TObject::GetIconName() const
virtual const char*RooAbsCollection::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
Double_tgetRealValue(const char* name, Double_t defVal = 0, Bool_t verbose = kFALSE) const
Int_tRooAbsCollection::getSize() const
const char*getStringValue(const char* name, const char* defVal = "", Bool_t verbose = kFALSE) const
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::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_tisInRange(const char* rangeSpec)
Bool_tTObject::IsOnHeap() const
Bool_tRooAbsCollection::isOwning() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
RooLinkedListIterRooAbsCollection::iterator(Bool_t dir = kIterForward) const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
static voidRooPrintable::nameFieldLength(Int_t newLen)
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static voidoperator delete(void* ptr)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*operator new(size_t bytes)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
RooArgSet&operator=(const RooArgSet& other)
RooAbsArg&operator[](const char* name) const
Bool_tRooAbsCollection::overlaps(const RooAbsCollection& otherColl) const
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidRooAbsCollection::Print(Option_t* options = 0) const
virtual voidRooPrintable::printAddress(ostream& os) const
virtual voidRooPrintable::printArgs(ostream& os) const
virtual voidRooAbsCollection::printClassName(ostream& os) const
virtual voidRooPrintable::printExtras(ostream& os) const
voidRooAbsCollection::printLatex(ostream& ofs, Int_t ncol, const char* option = "NEYU", Int_t sigDigit = 1, const RooLinkedList& siblingLists = RooLinkedList(), const RooCmdArg* formatCmd = 0) const
voidRooAbsCollection::printLatex(const RooCmdArg& arg1 = RooCmdArg(), const RooCmdArg& arg2 = RooCmdArg(), const RooCmdArg& arg3 = RooCmdArg(), const RooCmdArg& arg4 = RooCmdArg(), const RooCmdArg& arg5 = RooCmdArg(), const RooCmdArg& arg6 = RooCmdArg(), const RooCmdArg& arg7 = RooCmdArg(), const RooCmdArg& arg8 = RooCmdArg()) const
virtual voidRooAbsCollection::printMultiline(ostream& os, Int_t contents, Bool_t verbose = kFALSE, TString indent = "") const
virtual voidRooAbsCollection::printName(ostream& os) const
virtual voidRooPrintable::printStream(ostream& os, Int_t contents, RooPrintable::StyleOption style, TString indent = "") const
virtual voidRooAbsCollection::printTitle(ostream& os) const
virtual voidRooPrintable::printTree(ostream& os, TString indent = "") const
virtual voidRooAbsCollection::printValue(ostream& os) const
virtual Int_tTObject::Read(const char* name)
Bool_treadFromFile(const char* fileName, const char* flagReadAtt = 0, const char* section = 0, Bool_t verbose = kFALSE)
virtual Bool_treadFromStream(istream& is, Bool_t compact, Bool_t verbose = kFALSE)
Bool_treadFromStream(istream& is, Bool_t compact, const char* flagReadAtt, const char* section, Bool_t verbose = kFALSE)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidRooAbsCollection::releaseOwnership()
virtual Bool_tRooAbsCollection::remove(const RooAbsArg& var, Bool_t silent = kFALSE, Bool_t matchByNameOnly = kFALSE)
Bool_tRooAbsCollection::remove(const RooAbsCollection& list, Bool_t silent = kFALSE, Bool_t matchByNameOnly = kFALSE)
virtual voidRooAbsCollection::removeAll()
Bool_tRooAbsCollection::replace(const RooAbsCollection& other)
virtual Bool_tRooAbsCollection::replace(const RooAbsArg& var1, const RooAbsArg& var2)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
RooAbsCollection*RooAbsCollection::selectByAttrib(const char* name, Bool_t value) const
RooAbsCollection*RooAbsCollection::selectByName(const char* nameList, Bool_t verbose = kFALSE) const
RooAbsCollection*RooAbsCollection::selectCommon(const RooAbsCollection& refColl) const
voidRooAbsCollection::setAttribAll(const Text_t* name, Bool_t value = kTRUE)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
Bool_tsetCatIndex(const char* name, Int_t newVal = 0, Bool_t verbose = kFALSE)
Bool_tsetCatLabel(const char* name, const char* newVal = "", Bool_t verbose = kFALSE)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidRooAbsCollection::setHashTableSize(Int_t i)
voidRooAbsCollection::setName(const char* name)
static voidTObject::SetObjectStat(Bool_t stat)
Bool_tsetRealValue(const char* name, Double_t newVal = 0, Bool_t verbose = kFALSE)
Bool_tsetStringValue(const char* name, const char* newVal = "", Bool_t verbose = kFALSE)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp)
RooAbsCollection*RooAbsCollection::snapshot(Bool_t deepCopy = kTRUE) const
Bool_tRooAbsCollection::snapshot(RooAbsCollection& output, Bool_t deepCopy = kTRUE) const
voidRooAbsCollection::sort(Bool_t ascend = kTRUE)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
voidRooAbsCollection::takeOwnership()
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
voidwriteToFile(const char* fileName) const
virtual voidwriteToStream(ostream& os, Bool_t compact, const char* section = 0) const
protected:
Bool_tRooAbsCollection::addServerClonesToList(const RooAbsArg& var)
Bool_tcheckForDup(const RooAbsArg& arg, Bool_t silent) const
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
voidRooAbsCollection::safeDeleteList()

Data Members

protected:
RooLinkedListRooAbsCollection::_listActual object store
TStringRooAbsCollection::_nameOur name.
static Int_tRooPrintable::_nameLength
Bool_tRooAbsCollection::_ownContFlag to identify a list that owns its contents.
static char*_poolBegin! Start of memory pool
static char*_poolCur! Next free slot in memory pool
static char*_poolEnd! End of memory pool

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

void cleanup()
 Clear memoery pool on exit to avoid reported memory leaks
void* operator new(size_t bytes)
 Overloaded new operator guarantees that all RooArgSets allocated with new
 have a unique address, a property that is exploited in several places
 in roofit to quickly index contents on normalization set pointers.
 The memory pool only allocates space for the class itself. The elements
 stored in the set are stored outside the pool.
void operator delete(void* ptr)
 Memory is owned by pool, we need to do nothing to release it
RooArgSet()
 Default constructor
RooArgSet(const RooArgList& list)
 Constructor from a RooArgList. If the list contains multiple
 objects with the same name, only the first is store in the set.
 Warning messages will be printed for dropped items.
RooArgSet(const RooArgList& list, const RooAbsArg* var1)
 Constructor from a RooArgList. If the list contains multiple
 objects with the same name, only the first is store in the set.
 Warning messages will be printed for dropped items.
RooArgSet(const char* name)
 Empty set constructor
RooArgSet(const RooArgSet& set1, const RooArgSet& set2, const char* name = "")
 Construct a set from two existing sets
RooArgSet(const RooAbsArg& var1, const char* name = "")
 Constructor for set containing 1 initial object
RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2, const char* name = "")
 Constructor for set containing 2 initial objects
RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2, const RooAbsArg& var3, const char* name = "")
 Constructor for set containing 3 initial objects
RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2, const RooAbsArg& var3, const RooAbsArg& var4, const char* name = "")
 Constructor for set containing 4 initial objects
RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2, const RooAbsArg& var3, const RooAbsArg& var4, const RooAbsArg& var5, const char* name = "")
 Constructor for set containing 5 initial objects
RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2, const RooAbsArg& var3, const RooAbsArg& var4, const RooAbsArg& var5, const RooAbsArg& var6, const char* name = "")
 Constructor for set containing 6 initial objects
RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2, const RooAbsArg& var3, const RooAbsArg& var4, const RooAbsArg& var5, const RooAbsArg& var6, const RooAbsArg& var7, const char* name = "")
 Constructor for set containing 7 initial objects
RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2, const RooAbsArg& var3, const RooAbsArg& var4, const RooAbsArg& var5, const RooAbsArg& var6, const RooAbsArg& var7, const RooAbsArg& var8, const char* name = "")
 Constructor for set containing 8 initial objects
RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2, const RooAbsArg& var3, const RooAbsArg& var4, const RooAbsArg& var5, const RooAbsArg& var6, const RooAbsArg& var7, const RooAbsArg& var8, const RooAbsArg& var9, const char* name = "")
 Constructor for set containing 9 initial objects
RooArgSet(const TCollection& tcoll, const char* name = "")
 Constructor from a root TCollection. Elements in the collection that
 do not inherit from RooAbsArg will be skipped. A warning message
 will be printed for every skipped item.
RooArgSet(const RooArgSet& other, const char* name = "")
 Copy constructor. Note that a copy of a set is always non-owning,
 even the source set is owning. To create an owning copy of
 a set (owning or not), use the snaphot() method.
~RooArgSet()
 Destructor
Bool_t add(const RooAbsArg& var, Bool_t silent = kFALSE)
 Add element to non-owning set. The operation will fail if
 a similarly named object already exists in the set, or
 the set is specified to own its elements. Eventual error messages
 can be suppressed with the silent flag
Bool_t addOwned(RooAbsArg& var, Bool_t silent = kFALSE)
 Add element to an owning set. The operation will fail if
 a similarly named object already exists in the set, or
 the set is not specified to own its elements. Eventual error messages
 can be suppressed with the silent flag
RooAbsArg* addClone(const RooAbsArg& var, Bool_t silent = kFALSE)
 Add clone of specified element to an owning set. If sucessful, the
 set will own the clone, not the original. The operation will fail if
 a similarly named object already exists in the set, or
 the set is not specified to own its elements. Eventual error messages
 can be suppressed with the silent flag
RooAbsArg& operator[](const char* name) const
 Array operator. Named element must exist in set, otherwise
 code will abort.

 When used as lvalue in assignment operations, the element contained in
 the list will not be changed, only the value of the existing element!
Bool_t checkForDup(const RooAbsArg& arg, Bool_t silent) const
 Check if element with var's name is already in set
Double_t getRealValue(const char* name, Double_t defVal = 0, Bool_t verbose = kFALSE) const
 Get value of a RooAbsReal stored in set with given name. If none is found, value of defVal is returned.
 No error messages are printed unless the verbose flag is set
Bool_t setRealValue(const char* name, Double_t newVal = 0, Bool_t verbose = kFALSE)
 Set value of a RooAbsRealLValye stored in set with given name to newVal
 No error messages are printed unless the verbose flag is set
const char* getCatLabel(const char* name, const char* defVal = "", Bool_t verbose = kFALSE) const
 Get state name of a RooAbsCategory stored in set with given name. If none is found, value of defVal is returned.
 No error messages are printed unless the verbose flag is set
Bool_t setCatLabel(const char* name, const char* newVal = "", Bool_t verbose = kFALSE)
 Set state name of a RooAbsCategoryLValue stored in set with given name to newVal.
 No error messages are printed unless the verbose flag is set
Int_t getCatIndex(const char* name, Int_t defVal = 0, Bool_t verbose = kFALSE) const
 Get index value of a RooAbsCategory stored in set with given name. If none is found, value of defVal is returned.
 No error messages are printed unless the verbose flag is set
Bool_t setCatIndex(const char* name, Int_t newVal = 0, Bool_t verbose = kFALSE)
 Set index value of a RooAbsCategoryLValue stored in set with given name to newVal.
 No error messages are printed unless the verbose flag is set
const char* getStringValue(const char* name, const char* defVal = "", Bool_t verbose = kFALSE) const
 Get string value of a RooAbsString stored in set with given name. If none is found, value of defVal is returned.
 No error messages are printed unless the verbose flag is set
Bool_t setStringValue(const char* name, const char* newVal = "", Bool_t verbose = kFALSE)
 Set string value of a RooStringVar stored in set with given name to newVal.
 No error messages are printed unless the verbose flag is set
void writeToFile(const char* fileName) const
 Write contents of the argset to specified file.
 See writeToStream() for details
Bool_t readFromFile(const char* fileName, const char* flagReadAtt = 0, const char* section = 0, Bool_t verbose = kFALSE)
 Read contents of the argset from specified file.
 See readFromStream() for details
void writeToStream(ostream& os, Bool_t compact, const char* section = 0) const
 Write the contents of the argset in ASCII form to given stream.

 A line is written for each element contained in the form
 <argName> = <argValue>

 The <argValue> part of each element is written by the arguments'
 writeToStream() function.
Bool_t readFromStream(istream& is, Bool_t compact, const char* flagReadAtt, const char* section, Bool_t verbose = kFALSE)
 Read the contents of the argset in ASCII form from given stream.

 The stream is read to end-of-file and each line is assumed to be
 of the form

 <argName> = <argValue>

 Lines starting with argNames not matching any element in the list
 will be ignored with a warning message. In addition limited C++ style
 preprocessing and flow control is provided. The following constructions
 are recognized:

 > #include "include.file"

 Include given file, recursive inclusion OK

 > if (<boolean_expression>)
 >   <name> = <value>
 >   ....
 > else if (<boolean_expression>)

 > else

 > endif

 All expressions are evaluated by RooFormula, and may involve any of
 the sets variables.

 > echo <Message>

 Print console message while reading from stream

 > abort

 Force termination of read sequence with error status

 The value of each argument is read by the arguments readFromStream
 function.
Bool_t isInRange(const char* rangeSpec)
TObject* clone(const char* newname) const
{ return new RooArgSet(*this,newname); }
TObject* create(const char* newname) const
{ return new RooArgSet(newname); }
RooArgSet& operator=(const RooArgSet& other)
{ RooAbsCollection::operator=(other) ; return *this ;}
Bool_t add(const RooAbsArg& var, Bool_t silent = kFALSE)
Bool_t addOwned(RooAbsArg& var, Bool_t silent = kFALSE)
RooAbsArg * addClone(const RooAbsArg& var, Bool_t silent = kFALSE)
Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose = kFALSE)
 I/O streaming interface (machine readable)