Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooAbsCollection Class Referenceabstract

RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.

Collections are ordered and can contain multiple objects of the same name, (but a derived implementation can enforce unique names). The storage of objects is implemented using the container denoted by RooAbsCollection::Storage_t.

Definition at line 31 of file RooAbsCollection.h.

Public Types

using const_iterator = Storage_t::const_iterator
 
using Storage_t = std::vector< RooAbsArg * >
 
- Public Types inherited from TObject
enum  {
  kIsOnHeap = 0x01000000 , kNotDeleted = 0x02000000 , kZombie = 0x04000000 , kInconsistent = 0x08000000 ,
  kBitMask = 0x00ffffff
}
 
enum  { kSingleKey = BIT(0) , kOverwrite = BIT(1) , kWriteDelete = BIT(2) }
 
enum  EDeprecatedStatusBits { kObjInCanvas = BIT(3) }
 
enum  EStatusBits {
  kCanDelete = BIT(0) , kMustCleanup = BIT(3) , kIsReferenced = BIT(4) , kHasUUID = BIT(5) ,
  kCannotPick = BIT(6) , kNoContextMenu = BIT(8) , kInvalidObject = BIT(13)
}
 
- Public Types inherited from RooPrintable
enum  ContentsOption {
  kName =1 , kClassName =2 , kValue =4 , kArgs =8 ,
  kExtras =16 , kAddress =32 , kTitle =64 , kCollectionHeader =128
}
 
enum  StyleOption {
  kInline =1 , kSingleLine =2 , kStandard =3 , kVerbose =4 ,
  kTreeStructure =5
}
 

Public Member Functions

 RooAbsCollection ()
 Default constructor.
 
 RooAbsCollection (const char *name)
 Empty collection constructor.
 
 RooAbsCollection (const RooAbsCollection &other, const char *name="")
 Copy constructor.
 
virtual ~RooAbsCollection ()
 Destructor.
 
virtual Bool_t add (const RooAbsArg &var, Bool_t silent=kFALSE)
 Add the specified argument to list.
 
virtual Bool_t add (const RooAbsCollection &list, Bool_t silent=kFALSE)
 Add a collection of arguments to this collection by calling add() for each element in the source collection.
 
virtual RooAbsArgaddClone (const RooAbsArg &var, Bool_t silent=kFALSE)
 Add a clone of the specified argument to list.
 
virtual void addClone (const RooAbsCollection &list, Bool_t silent=kFALSE)
 Add a collection of arguments to this collection by calling addOwned() for each element in the source collection.
 
virtual Bool_t addOwned (const RooAbsCollection &list, Bool_t silent=kFALSE)
 Add a collection of arguments to this collection by calling addOwned() for each element in the source collection.
 
virtual Bool_t addOwned (RooAbsArg &var, Bool_t silent=kFALSE)
 Add the specified argument to list.
 
Bool_t allInRange (const char *rangeSpec) const
 Return true if all contained object report to have their value inside the specified range.
 
void assignFast (const RooAbsCollection &other, Bool_t setValDirty=kTRUE)
 Functional equivalent of operator=() but assumes this and other collection have same layout.
 
RooAbsCollectionassignValueOnly (const RooAbsCollection &other, Bool_t oneSafe=kFALSE)
 The assignment operator sets the value of any argument in our set that also appears in the other set.
 
const_iterator begin () const
 
void clear ()
 Clear contents. If the collection is owning, it will also delete the contents.
 
virtual TObjectclone (const char *newname) const =0
 
virtual TObjectClone (const char *newname=0) const
 Make a clone of an object using the Streamer facility.
 
Bool_t contains (const RooAbsArg &var) const
 Check if collection contains an argument with the same name as var.
 
Bool_t containsInstance (const RooAbsArg &var) const
 Check if this exact instance is in this collection.
 
std::string contentsString () const
 Return comma separated list of contained object names as STL string.
 
virtual TObjectcreate (const char *newname) const =0
 
TIteratorcreateIterator (Bool_t dir=kIterForward) const
 TIterator-style iteration over contained elements.
 
virtual Int_t defaultPrintContents (Option_t *opt) const
 Define default RooPrinable print options for given Print() flag string For inline printing only show value of objects, for default print show name,class name value and extras of each object.
 
void dump () const
 Base contents dumper for debugging purposes.
 
bool empty () const
 
const_iterator end () const
 
Bool_t equals (const RooAbsCollection &otherColl) const
 Check if this and other collection have identically-named contents.
 
RooAbsArgfind (const char *name) const
 Find object with given name in list.
 
RooAbsArgfind (const RooAbsArg &) const
 Find object with given name in list.
 
RooAbsArgfirst () const
 
RooFIter fwdIterator () const
 One-time forward iterator.
 
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.
 
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.
 
Int_t getHashTableSize () const
 Query the size at which the collection will automatically start using an extra lookup table instead of performing a linear search.
 
const char * GetName () const
 Returns name of object.
 
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.
 
Int_t getSize () const
 
const char * getStringValue (const char *name, const char *defVal="", Bool_t verbose=kFALSE) const
 Get string value of a RooStringVar stored in set with given name.
 
Int_t index (const char *name) const
 Return index of item with given name, or -1 in case it's not in the collection.
 
Int_t index (const RooAbsArg &arg) const
 Returns index of given arg, or -1 if arg is not in the collection.
 
Int_t index (const RooAbsArg *arg) const
 Returns index of given arg, or -1 if arg is not in the collection.
 
Bool_t isOwning () const
 
RooLinkedListIter iterator (Bool_t dir=kIterForward) const
 TIterator-style iteration over contained elements.
 
RooAbsCollectionoperator= (const RooAbsCollection &other)
 The assignment operator sets the value of any argument in our set that also appears in the other set.
 
RooAbsArgoperator[] (Storage_t::size_type i) const
 
Bool_t overlaps (const RooAbsCollection &otherColl) const
 Check if this and other collection have common entries.
 
virtual void Print (Option_t *options=0) const
 This method must be overridden when a class wants to print itself.
 
virtual void printClassName (std::ostream &os) const
 Return collection class name.
 
void 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
 Output content of collection as LaTex table.
 
void printLatex (std::ostream &ofs, Int_t ncol, const char *option="NEYU", Int_t sigDigit=1, const RooLinkedList &siblingLists=RooLinkedList(), const RooCmdArg *formatCmd=0) const
 Internal implementation function of printLatex.
 
virtual void printMultiline (std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
 Implement multiline printing of collection, one line for each contained object showing the requested content.
 
virtual void printName (std::ostream &os) const
 Return collection name.
 
virtual void printTitle (std::ostream &os) const
 Return collection title.
 
virtual void printValue (std::ostream &os) const
 Print value of collection, i.e.
 
Storage_t::const_reverse_iterator rbegin () const
 
virtual void RecursiveRemove (TObject *obj)
 If one of the TObject we have a referenced to is deleted, remove the reference.
 
void releaseOwnership ()
 
virtual Bool_t remove (const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
 Remove the specified argument from our list.
 
Bool_t remove (const RooAbsCollection &list, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
 Remove each argument in the input list from our list using remove(const RooAbsArg&).
 
template<class forwardIt >
void remove (forwardIt rangeBegin, forwardIt rangeEnd, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
 
virtual void removeAll ()
 Remove all arguments from our set, deleting them if we own them.
 
Storage_t::const_reverse_iterator rend () const
 
virtual Bool_t replace (const RooAbsArg &var1, const RooAbsArg &var2)
 Replace var1 with var2 and return kTRUE for success.
 
Bool_t replace (const RooAbsCollection &other)
 Replace any args in our set with args of the same name from the other set and return kTRUE for success.
 
void reserve (Storage_t::size_type count)
 
RooAbsCollectionselectByAttrib (const char *name, Bool_t value) const
 Create a subset of the current collection, consisting only of those elements with the specified attribute set.
 
RooAbsCollectionselectByName (const char *nameList, Bool_t verbose=kFALSE) const
 Create a subset of the current collection, consisting only of those elements with names matching the wildcard expressions in nameList, supplied as a comma separated list.
 
RooAbsCollectionselectCommon (const RooAbsCollection &refColl) const
 Create a subset of the current collection, consisting only of those elements that are contained as well in the given reference collection.
 
void setAttribAll (const Text_t *name, Bool_t value=kTRUE)
 Set given attribute in each element of the collection by calling each elements setAttribute() function.
 
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.
 
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.
 
void setHashTableSize (Int_t number)
 Set the size at which the collection will automatically start using an extra lookup table instead of performing a linear search.
 
void setName (const char *name)
 
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.
 
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.
 
Storage_t::size_type size () const
 
RooAbsCollectionsnapshot (Bool_t deepCopy=kTRUE) const
 Take a snap shot of current collection contents.
 
Bool_t snapshot (RooAbsCollection &output, Bool_t deepCopy=kTRUE) const
 Take a snap shot of current collection contents: A collection that owns its elements is returned containing clones of.
 
void sort (Bool_t reverse=false)
 Sort collection using std::sort and name comparison.
 
void takeOwnership ()
 
void useHashMapForFind (bool flag) const
 Install an internal hash map for fast finding of elements by name.
 
- Public Member Functions inherited from TObject
 TObject ()
 TObject constructor.
 
 TObject (const TObject &object)
 TObject copy ctor.
 
virtual ~TObject ()
 TObject destructor.
 
void AbstractMethod (const char *method) const
 Use this method to implement an "abstract" method that you don't want to leave purely abstract.
 
virtual void AppendPad (Option_t *option="")
 Append graphics object to current pad.
 
virtual void Browse (TBrowser *b)
 Browse object. May be overridden for another default action.
 
ULong_t CheckedHash ()
 Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object.
 
virtual const char * ClassName () const
 Returns name of class to which the object belongs.
 
virtual void Clear (Option_t *="")
 
virtual Int_t Compare (const TObject *obj) const
 Compare abstract method.
 
virtual void Copy (TObject &object) const
 Copy this to obj.
 
virtual void Delete (Option_t *option="")
 Delete this object.
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 Computes distance from point (px,py) to the object.
 
virtual void Draw (Option_t *option="")
 Default Draw method for all objects.
 
virtual void DrawClass () const
 Draw class inheritance tree of the class to which this object belongs.
 
virtual TObjectDrawClone (Option_t *option="") const
 Draw a clone of this object in the current selected pad for instance with: gROOT->SetSelectedPad(gPad).
 
virtual void Dump () const
 Dump contents of object on stdout.
 
virtual void Error (const char *method, const char *msgfmt,...) const
 Issue error message.
 
virtual void Execute (const char *method, const char *params, Int_t *error=0)
 Execute method on this object with the given parameter string, e.g.
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=0)
 Execute method on this object with parameters stored in the TObjArray.
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 Execute action corresponding to an event at (px,py).
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 Issue fatal error message.
 
virtual TObjectFindObject (const char *name) const
 Must be redefined in derived classes.
 
virtual TObjectFindObject (const TObject *obj) const
 Must be redefined in derived classes.
 
virtual Option_tGetDrawOption () const
 Get option used by the graphics system to draw this object.
 
virtual const char * GetIconName () const
 Returns mime type name of object.
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 Returns string containing info about the object at position (px,py).
 
virtual Option_tGetOption () const
 
virtual const char * GetTitle () const
 Returns title of object.
 
virtual UInt_t GetUniqueID () const
 Return the unique object id.
 
virtual Bool_t HandleTimer (TTimer *timer)
 Execute action in response of a timer timing out.
 
virtual ULong_t Hash () const
 Return hash value for this object.
 
Bool_t HasInconsistentHash () const
 Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e.
 
virtual void Info (const char *method, const char *msgfmt,...) const
 Issue info message.
 
virtual Bool_t InheritsFrom (const char *classname) const
 Returns kTRUE if object inherits from class "classname".
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 Returns kTRUE if object inherits from TClass cl.
 
virtual void Inspect () const
 Dump contents of this object in a graphics canvas.
 
void InvertBit (UInt_t f)
 
virtual Bool_t IsEqual (const TObject *obj) const
 Default equal comparison (objects are equal if they have the same address in memory).
 
virtual Bool_t IsFolder () const
 Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
 
R__ALWAYS_INLINE Bool_t IsOnHeap () const
 
virtual Bool_t IsSortable () const
 
R__ALWAYS_INLINE Bool_t IsZombie () const
 
virtual void ls (Option_t *option="") const
 The ls function lists the contents of a class on stdout.
 
void MayNotUse (const char *method) const
 Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary).
 
virtual Bool_t Notify ()
 This method must be overridden to handle object notification.
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 Use this method to declare a method obsolete.
 
void operator delete (void *ptr)
 Operator delete.
 
void operator delete[] (void *ptr)
 Operator delete [].
 
voidoperator new (size_t sz)
 
voidoperator new (size_t sz, void *vp)
 
voidoperator new[] (size_t sz)
 
voidoperator new[] (size_t sz, void *vp)
 
TObjectoperator= (const TObject &rhs)
 TObject assignment operator.
 
virtual void Paint (Option_t *option="")
 This method must be overridden if a class wants to paint itself.
 
virtual void Pop ()
 Pop on object drawn in a pad to the top of the display list.
 
virtual Int_t Read (const char *name)
 Read contents of object with specified name from the current directory.
 
void ResetBit (UInt_t f)
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 Save this object in the file specified by filename.
 
virtual void SavePrimitive (std::ostream &out, Option_t *option="")
 Save a primitive as a C++ statement(s) on output stream "out".
 
void SetBit (UInt_t f)
 
void SetBit (UInt_t f, Bool_t set)
 Set or unset the user status bits as specified in f.
 
virtual void SetDrawOption (Option_t *option="")
 Set drawing option for object.
 
virtual void SetUniqueID (UInt_t uid)
 Set the unique object id.
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 Issue system error message.
 
R__ALWAYS_INLINE Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
virtual void UseCurrentStyle ()
 Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked.
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 Issue warning message.
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0)
 Write this object to the current directory.
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const
 Write this object to the current directory.
 
- Public Member Functions inherited from RooPrintable
 RooPrintable ()
 
virtual ~RooPrintable ()
 
virtual StyleOption defaultPrintStyle (Option_t *opt) const
 
virtual void printAddress (std::ostream &os) const
 Print class name of object.
 
virtual void printArgs (std::ostream &os) const
 Interface for printing of object arguments.
 
virtual void printExtras (std::ostream &os) const
 Interface to print extras 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'.
 
virtual void printTree (std::ostream &os, TString indent="") const
 Interface for tree structure printing of object.
 

Protected Types

using LegacyIterator_t = TIteratorToSTLInterface< Storage_t >
 
- Protected Types inherited from TObject
enum  { kOnlyPrepStep = BIT(3) }
 

Protected Member Functions

Bool_t addServerClonesToList (const RooAbsArg &var)
 Add clones of servers of given argument to end of list.
 
void clearStructureTags ()
 Typed structure tag.
 
void makeStructureTag ()
 
void makeTypedStructureTag ()
 
void safeDeleteList ()
 Examine client server dependencies in list and delete contents in safe order: any client is deleted before a server is deleted.
 
TNamedstructureTag ()
 
TNamedtypedStructureTag ()
 
- Protected Member Functions inherited from TObject
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 Interface to ErrorHandler (protected).
 
void MakeZombie ()
 

Protected Attributes

Bool_t _allRRV
 
Storage_t _list
 
TString _name
 
Bool_t _ownCont
 
TNamed_structureTag {nullptr}
 
TNamed_typedStructureTag {nullptr}
 Structure tag.
 

Private Member Functions

void insert (RooAbsArg *)
 Insert an element into the owned collections.
 
std::unique_ptr< LegacyIterator_tmakeLegacyIterator (bool forward=true) const
 Factory for legacy iterators.
 
RooAbsArgtryFastFind (const TNamed *namePtr) const
 Perform a search in a hash map.
 

Private Attributes

std::unique_ptr< std::unordered_map< const TNamed *, Storage_t::value_type > > _nameToItemMap
 
std::size_t _sizeThresholdForMapSearch
 

Additional Inherited Members

- Static Public Member Functions inherited from TObject
static Long_t GetDtorOnly ()
 Return destructor only flag.
 
static Bool_t GetObjectStat ()
 Get status of object stat flag.
 
static void SetDtorOnly (void *obj)
 Set destructor only flag.
 
static void SetObjectStat (Bool_t stat)
 Turn on/off tracking of objects in the TObjectTable.
 
- Static Public Member Functions inherited from RooPrintable
static std::ostream & defaultPrintStream (std::ostream *os=0)
 Return a reference to the current default stream to use in Print().
 
static void nameFieldLength (Int_t newLen)
 Set length of field reserved from printing name of RooAbsArgs in multi-line collection printing to given amount.
 
- Static Protected Attributes inherited from RooPrintable
static Int_t _nameLength
 

#include <RooAbsCollection.h>

Inheritance diagram for RooAbsCollection:
[legend]

Member Typedef Documentation

◆ const_iterator

using RooAbsCollection::const_iterator = Storage_t::const_iterator

Definition at line 34 of file RooAbsCollection.h.

◆ LegacyIterator_t

◆ Storage_t

using RooAbsCollection::Storage_t = std::vector<RooAbsArg*>

Definition at line 33 of file RooAbsCollection.h.

Constructor & Destructor Documentation

◆ RooAbsCollection() [1/3]

RooAbsCollection::RooAbsCollection ( )

Default constructor.

Definition at line 70 of file RooAbsCollection.cxx.

◆ RooAbsCollection() [2/3]

RooAbsCollection::RooAbsCollection ( const char *  name)

Empty collection constructor.

Definition at line 85 of file RooAbsCollection.cxx.

◆ ~RooAbsCollection()

RooAbsCollection::~RooAbsCollection ( )
virtual

Destructor.

Definition at line 126 of file RooAbsCollection.cxx.

◆ RooAbsCollection() [3/3]

RooAbsCollection::RooAbsCollection ( const RooAbsCollection other,
const char *  name = "" 
)

Copy constructor.

Note that a copy of a collection is always non-owning, even the source collection is owning. To create an owning copy of a collection (owning or not), use the snapshot() method.

Definition at line 102 of file RooAbsCollection.cxx.

Member Function Documentation

◆ add() [1/2]

Bool_t RooAbsCollection::add ( const RooAbsArg var,
Bool_t  silent = kFALSE 
)
virtual

Add the specified argument to list.

Returns kTRUE if successful, or else kFALSE if a variable of the same name is already in the list or the list owns its variables (in this case, try addClone() or addOwned() instead).

Reimplemented in RooArgSet, RooListProxy, RooSetProxy, RooArgSet, RooListProxy, and RooSetProxy.

Definition at line 437 of file RooAbsCollection.cxx.

◆ add() [2/2]

Bool_t RooAbsCollection::add ( const RooAbsCollection list,
Bool_t  silent = kFALSE 
)
virtual

Add a collection of arguments to this collection by calling add() for each element in the source collection.

Reimplemented in RooArgSet, RooListProxy, and RooSetProxy.

Definition at line 457 of file RooAbsCollection.cxx.

◆ addClone() [1/2]

RooAbsArg * RooAbsCollection::addClone ( const RooAbsArg var,
Bool_t  silent = kFALSE 
)
virtual

Add a clone of the specified argument to list.

Returns a pointer to the clone if successful, or else zero if a variable of the same name is already in the list or the list does not own its variables (in this case, try add() instead.) Calling addClone() on an empty list forces it to take ownership of all its subsequent variables.

Reimplemented in RooArgSet, RooSetProxy, RooArgSet, and RooSetProxy.

Definition at line 412 of file RooAbsCollection.cxx.

◆ addClone() [2/2]

void RooAbsCollection::addClone ( const RooAbsCollection list,
Bool_t  silent = kFALSE 
)
virtual

Add a collection of arguments to this collection by calling addOwned() for each element in the source collection.

Reimplemented in RooArgSet, and RooSetProxy.

Definition at line 493 of file RooAbsCollection.cxx.

◆ addOwned() [1/2]

Bool_t RooAbsCollection::addOwned ( const RooAbsCollection list,
Bool_t  silent = kFALSE 
)
virtual

Add a collection of arguments to this collection by calling addOwned() for each element in the source collection.

Reimplemented in RooArgSet, RooListProxy, and RooSetProxy.

Definition at line 475 of file RooAbsCollection.cxx.

◆ addOwned() [2/2]

Bool_t RooAbsCollection::addOwned ( RooAbsArg var,
Bool_t  silent = kFALSE 
)
virtual

Add the specified argument to list.

Returns kTRUE if successful, or else kFALSE if a variable of the same name is already in the list. This method can only be called on a list that is flagged as owning all of its contents, or else on an empty list (which will force the list into that mode).

Reimplemented in RooArgSet, RooListProxy, RooSetProxy, RooArgSet, RooListProxy, and RooSetProxy.

Definition at line 389 of file RooAbsCollection.cxx.

◆ addServerClonesToList()

Bool_t RooAbsCollection::addServerClonesToList ( const RooAbsArg var)
protected

Add clones of servers of given argument to end of list.

Definition at line 281 of file RooAbsCollection.cxx.

◆ allInRange()

Bool_t RooAbsCollection::allInRange ( const char *  rangeSpec) const

Return true if all contained object report to have their value inside the specified range.

Definition at line 1369 of file RooAbsCollection.cxx.

◆ assignFast()

void RooAbsCollection::assignFast ( const RooAbsCollection other,
Bool_t  setValDirty = kTRUE 
)

Functional equivalent of operator=() but assumes this and other collection have same layout.

Also no attributes are copied

Definition at line 356 of file RooAbsCollection.cxx.

◆ assignValueOnly()

RooAbsCollection & RooAbsCollection::assignValueOnly ( const RooAbsCollection other,
Bool_t  oneSafe = kFALSE 
)

The assignment operator sets the value of any argument in our set that also appears in the other set.

Definition at line 330 of file RooAbsCollection.cxx.

◆ begin()

const_iterator RooAbsCollection::begin ( ) const
inline

Definition at line 149 of file RooAbsCollection.h.

◆ clear()

void RooAbsCollection::clear ( )
inline

Clear contents. If the collection is owning, it will also delete the contents.

Definition at line 178 of file RooAbsCollection.h.

◆ clearStructureTags()

void RooAbsCollection::clearStructureTags ( )
inlineprotected

Typed structure tag.

Definition at line 278 of file RooAbsCollection.h.

◆ clone()

virtual TObject * RooAbsCollection::clone ( const char *  newname) const
pure virtual

Implemented in RooArgList, and RooArgSet.

◆ Clone()

virtual TObject * RooAbsCollection::Clone ( const char *  newname = 0) const
inlinevirtual

Make a clone of an object using the Streamer facility.

If the object derives from TNamed, this function is called by TNamed::Clone. TNamed::Clone uses the optional argument to set a new name to the newly created object.

If the object class has a DirectoryAutoAdd function, it will be called at the end of the function with the parameter gDirectory. This usually means that the object will be appended to the current ROOT directory.

Reimplemented from TObject.

Definition at line 42 of file RooAbsCollection.h.

◆ contains()

Bool_t RooAbsCollection::contains ( const RooAbsArg var) const
inline

Check if collection contains an argument with the same name as var.

To check for a specific instance, use containsInstance().

Definition at line 113 of file RooAbsCollection.h.

◆ containsInstance()

Bool_t RooAbsCollection::containsInstance ( const RooAbsArg var) const
inline

Check if this exact instance is in this collection.

Definition at line 117 of file RooAbsCollection.h.

◆ contentsString()

string RooAbsCollection::contentsString ( ) const

Return comma separated list of contained object names as STL string.

Definition at line 1026 of file RooAbsCollection.cxx.

◆ create()

virtual TObject * RooAbsCollection::create ( const char *  newname) const
pure virtual

Implemented in RooArgList, and RooArgSet.

◆ createIterator()

TIterator * RooAbsCollection::createIterator ( Bool_t  dir = kIterForward) const
inline

TIterator-style iteration over contained elements.

Note
These iterators are slow. Use begin() and end() or range-based for loop instead.

Definition at line 129 of file RooAbsCollection.h.

◆ defaultPrintContents()

Int_t RooAbsCollection::defaultPrintContents ( Option_t opt) const
virtual

Define default RooPrinable print options for given Print() flag string For inline printing only show value of objects, for default print show name,class name value and extras of each object.

In verbose mode also add object adress, argument and title

Reimplemented from RooPrintable.

Definition at line 1077 of file RooAbsCollection.cxx.

◆ dump()

void RooAbsCollection::dump ( ) const

Base contents dumper for debugging purposes.

Definition at line 1156 of file RooAbsCollection.cxx.

◆ empty()

bool RooAbsCollection::empty ( ) const
inline

Definition at line 169 of file RooAbsCollection.h.

◆ end()

const_iterator RooAbsCollection::end ( ) const
inline

Definition at line 153 of file RooAbsCollection.h.

◆ equals()

Bool_t RooAbsCollection::equals ( const RooAbsCollection otherColl) const

Check if this and other collection have identically-named contents.

Definition at line 763 of file RooAbsCollection.cxx.

◆ find() [1/2]

RooAbsArg * RooAbsCollection::find ( const char *  name) const

Find object with given name in list.

A null pointer is returned if no object with the given name is found.

Definition at line 813 of file RooAbsCollection.cxx.

◆ find() [2/2]

RooAbsArg * RooAbsCollection::find ( const RooAbsArg arg) const

Find object with given name in list.

A null pointer is returned if no object with the given name is found.

Definition at line 832 of file RooAbsCollection.cxx.

◆ first()

RooAbsArg * RooAbsCollection::first ( ) const
inline

Definition at line 187 of file RooAbsCollection.h.

◆ fwdIterator()

RooFIter RooAbsCollection::fwdIterator ( ) const
inline

One-time forward iterator.

Note
Use begin() and end() or range-based for loop instead.

Definition at line 144 of file RooAbsCollection.h.

◆ getCatIndex()

Int_t RooAbsCollection::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

Definition at line 942 of file RooAbsCollection.cxx.

◆ getCatLabel()

const char * RooAbsCollection::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

Definition at line 899 of file RooAbsCollection.cxx.

◆ getHashTableSize()

Int_t RooAbsCollection::getHashTableSize ( ) const
inline

Query the size at which the collection will automatically start using an extra lookup table instead of performing a linear search.

Definition at line 66 of file RooAbsCollection.h.

◆ GetName()

const char * RooAbsCollection::GetName ( ) const
inlinevirtual

Returns name of object.

This default method returns the class name. Classes that give objects a name should override this method.

Reimplemented from TObject.

Definition at line 237 of file RooAbsCollection.h.

◆ getRealValue()

Double_t RooAbsCollection::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

Definition at line 856 of file RooAbsCollection.cxx.

◆ getSize()

Int_t RooAbsCollection::getSize ( ) const
inline

Definition at line 182 of file RooAbsCollection.h.

◆ getStringValue()

const char * RooAbsCollection::getStringValue ( const char *  name,
const char *  defVal = "",
Bool_t  verbose = kFALSE 
) const

Get string value of a RooStringVar 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

Definition at line 985 of file RooAbsCollection.cxx.

◆ index() [1/3]

Int_t RooAbsCollection::index ( const char *  name) const

Return index of item with given name, or -1 in case it's not in the collection.

Definition at line 843 of file RooAbsCollection.cxx.

◆ index() [2/3]

Int_t RooAbsCollection::index ( const RooAbsArg arg) const
inline

Returns index of given arg, or -1 if arg is not in the collection.

Definition at line 204 of file RooAbsCollection.h.

◆ index() [3/3]

Int_t RooAbsCollection::index ( const RooAbsArg arg) const
inline

Returns index of given arg, or -1 if arg is not in the collection.

Definition at line 198 of file RooAbsCollection.h.

◆ insert()

void RooAbsCollection::insert ( RooAbsArg item)
private

Insert an element into the owned collections.

Definition at line 1471 of file RooAbsCollection.cxx.

◆ isOwning()

Bool_t RooAbsCollection::isOwning ( ) const
inline

Definition at line 241 of file RooAbsCollection.h.

◆ iterator()

RooLinkedListIter RooAbsCollection::iterator ( Bool_t  dir = kIterForward) const
inline

TIterator-style iteration over contained elements.

Note
This iterator is slow. Use begin() and end() or range-based for loop instead.

Definition at line 137 of file RooAbsCollection.h.

◆ makeLegacyIterator()

std::unique_ptr< RooAbsCollection::LegacyIterator_t > RooAbsCollection::makeLegacyIterator ( bool  forward = true) const
private

Factory for legacy iterators.

Definition at line 1461 of file RooAbsCollection.cxx.

◆ makeStructureTag()

void RooAbsCollection::makeStructureTag ( )
protected

Definition at line 1415 of file RooAbsCollection.cxx.

◆ makeTypedStructureTag()

void RooAbsCollection::makeTypedStructureTag ( )
protected

Definition at line 1422 of file RooAbsCollection.cxx.

◆ operator=()

RooAbsCollection & RooAbsCollection::operator= ( const RooAbsCollection other)

The assignment operator sets the value of any argument in our set that also appears in the other set.

Definition at line 310 of file RooAbsCollection.cxx.

◆ operator[]()

RooAbsArg * RooAbsCollection::operator[] ( Storage_t::size_type  i) const
inline

Definition at line 192 of file RooAbsCollection.h.

◆ overlaps()

Bool_t RooAbsCollection::overlaps ( const RooAbsCollection otherColl) const

Check if this and other collection have common entries.

Definition at line 784 of file RooAbsCollection.cxx.

◆ Print()

virtual void RooAbsCollection::Print ( Option_t option = 0) const
inlinevirtual

This method must be overridden when a class wants to print itself.

Reimplemented from TObject.

Definition at line 210 of file RooAbsCollection.h.

◆ printClassName()

void RooAbsCollection::printClassName ( std::ostream &  os) const
virtual

Return collection class name.

Reimplemented from RooPrintable.

Definition at line 1064 of file RooAbsCollection.cxx.

◆ printLatex() [1/2]

void RooAbsCollection::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

Output content of collection as LaTex table.

By default a table with two columns is created: the left column contains the name of each variable, the right column the value.

The following optional named arguments can be used to modify the default behavior

Argument Effect
Columns(Int_t ncol) Fold table into multiple columns, i.e. ncol=3 will result in 3 x 2 = 6 total columns
Sibling(const RooAbsCollection& other) Define sibling list. The sibling list is assumed to have objects with the same name in the same order. If this is not the case warnings will be printed. If a single sibling list is specified, 3 columns will be output: the (common) name, the value of this list and the value in the sibling list. Multiple sibling lists can be specified by repeating the Sibling() command.
Format(const char* str) Classic format string, provided for backward compatibility
Format() Formatting arguments.
const char* what Controls what is shown. "N" adds name, "E" adds error, "A" shows asymmetric error, "U" shows unit, "H" hides the value
FixedPrecision(int n) Controls precision, set fixed number of digits
AutoPrecision(int n) Controls precision. Number of shown digits is calculated from error and n specified additional digits (1 is sensible default)
VerbatimName(Bool_t flag) Put variable name in a \verb+ + clause.
OutputFile(const char* fname)

Send output to file with given name rather than standard output

Example use:

list.printLatex(Columns(2), Format("NEU",AutoPrecision(1),VerbatimName()) );
static char * Format(const char *format, va_list ap)
Format a string in a circular formatting buffer (using a printf style format descriptor).
Definition TString.cxx:2395

Definition at line 1198 of file RooAbsCollection.cxx.

◆ printLatex() [2/2]

void RooAbsCollection::printLatex ( std::ostream &  ofs,
Int_t  ncol,
const char *  option = "NEYU",
Int_t  sigDigit = 1,
const RooLinkedList siblingLists = RooLinkedList(),
const RooCmdArg formatCmd = 0 
) const

Internal implementation function of printLatex.

Definition at line 1255 of file RooAbsCollection.cxx.

◆ printMultiline()

void RooAbsCollection::printMultiline ( std::ostream &  os,
Int_t  contents,
Bool_t  verbose = kFALSE,
TString  indent = "" 
) const
virtual

Implement multiline printing of collection, one line for each contained object showing the requested content.

Reimplemented from RooPrintable.

Definition at line 1121 of file RooAbsCollection.cxx.

◆ printName()

void RooAbsCollection::printName ( std::ostream &  os) const
virtual

Return collection name.

Reimplemented from RooPrintable.

Definition at line 1044 of file RooAbsCollection.cxx.

◆ printTitle()

void RooAbsCollection::printTitle ( std::ostream &  os) const
virtual

Return collection title.

Reimplemented from RooPrintable.

Definition at line 1054 of file RooAbsCollection.cxx.

◆ printValue()

void RooAbsCollection::printValue ( std::ostream &  os) const
virtual

Print value of collection, i.e.

a comma separated list of contained object names

Reimplemented from RooPrintable.

Definition at line 1096 of file RooAbsCollection.cxx.

◆ rbegin()

Storage_t::const_reverse_iterator RooAbsCollection::rbegin ( ) const
inline

Definition at line 157 of file RooAbsCollection.h.

◆ RecursiveRemove()

void RooAbsCollection::RecursiveRemove ( TObject obj)
virtual

If one of the TObject we have a referenced to is deleted, remove the reference.

Reimplemented from TObject.

Definition at line 1430 of file RooAbsCollection.cxx.

◆ releaseOwnership()

void RooAbsCollection::releaseOwnership ( )
inline

Definition at line 250 of file RooAbsCollection.h.

◆ remove() [1/3]

Bool_t RooAbsCollection::remove ( const RooAbsArg var,
Bool_t  silent = kFALSE,
Bool_t  matchByNameOnly = kFALSE 
)
virtual

Remove the specified argument from our list.

Return kFALSE if the specified argument is not found in our list. An exact pointer match is required, not just a match by name. If matchByNameOnly is set, items will be looked up by name. In this case, if the collection also owns the item, it will delete it.

Reimplemented in RooListProxy, and RooSetProxy.

Definition at line 584 of file RooAbsCollection.cxx.

◆ remove() [2/3]

Bool_t RooAbsCollection::remove ( const RooAbsCollection list,
Bool_t  silent = kFALSE,
Bool_t  matchByNameOnly = kFALSE 
)

Remove each argument in the input list from our list using remove(const RooAbsArg&).

Return kFALSE in case of problems.

Definition at line 625 of file RooAbsCollection.cxx.

◆ remove() [3/3]

template<class forwardIt >
void RooAbsCollection::remove ( forwardIt  rangeBegin,
forwardIt  rangeEnd,
Bool_t  silent = kFALSE,
Bool_t  matchByNameOnly = kFALSE 
)
inline

Definition at line 84 of file RooAbsCollection.h.

◆ removeAll()

void RooAbsCollection::removeAll ( )
virtual

Remove all arguments from our set, deleting them if we own them.

This effectively restores our object to the state it would have just after calling the RooAbsCollection(const char*) constructor.

Reimplemented in RooListProxy, and RooSetProxy.

Definition at line 643 of file RooAbsCollection.cxx.

◆ rend()

Storage_t::const_reverse_iterator RooAbsCollection::rend ( ) const
inline

Definition at line 161 of file RooAbsCollection.h.

◆ replace() [1/2]

Bool_t RooAbsCollection::replace ( const RooAbsArg var1,
const RooAbsArg var2 
)
virtual

Replace var1 with var2 and return kTRUE for success.

Fails if this list is a copy of another, if var1 is not already in this set, or if var2 is already in this set. var1 and var2 do not need to have the same name.

Reimplemented in RooListProxy, and RooSetProxy.

Definition at line 533 of file RooAbsCollection.cxx.

◆ replace() [2/2]

Bool_t RooAbsCollection::replace ( const RooAbsCollection other)

Replace any args in our set with args of the same name from the other set and return kTRUE for success.

Fails if this list is a copy of another.

Definition at line 508 of file RooAbsCollection.cxx.

◆ reserve()

void RooAbsCollection::reserve ( Storage_t::size_type  count)
inline

Definition at line 173 of file RooAbsCollection.h.

◆ safeDeleteList()

void RooAbsCollection::safeDeleteList ( )
protected

Examine client server dependencies in list and delete contents in safe order: any client is deleted before a server is deleted.

Definition at line 140 of file RooAbsCollection.cxx.

◆ selectByAttrib()

RooAbsCollection * RooAbsCollection::selectByAttrib ( const char *  name,
Bool_t  value 
) const

Create a subset of the current collection, consisting only of those elements with the specified attribute set.

The caller is responsibe for deleting the returned collection

Definition at line 677 of file RooAbsCollection.cxx.

◆ selectByName()

RooAbsCollection * RooAbsCollection::selectByName ( const char *  nameList,
Bool_t  verbose = kFALSE 
) const

Create a subset of the current collection, consisting only of those elements with names matching the wildcard expressions in nameList, supplied as a comma separated list.

Definition at line 723 of file RooAbsCollection.cxx.

◆ selectCommon()

RooAbsCollection * RooAbsCollection::selectCommon ( const RooAbsCollection refColl) const

Create a subset of the current collection, consisting only of those elements that are contained as well in the given reference collection.

The caller is responsible for deleting the returned collection

Definition at line 700 of file RooAbsCollection.cxx.

◆ setAttribAll()

void RooAbsCollection::setAttribAll ( const Text_t name,
Bool_t  value = kTRUE 
)

Set given attribute in each element of the collection by calling each elements setAttribute() function.

Definition at line 662 of file RooAbsCollection.cxx.

◆ setCatIndex()

Bool_t RooAbsCollection::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

Definition at line 963 of file RooAbsCollection.cxx.

◆ setCatLabel()

Bool_t RooAbsCollection::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

Definition at line 920 of file RooAbsCollection.cxx.

◆ setHashTableSize()

void RooAbsCollection::setHashTableSize ( Int_t  number)
inline

Set the size at which the collection will automatically start using an extra lookup table instead of performing a linear search.

Definition at line 61 of file RooAbsCollection.h.

◆ setName()

void RooAbsCollection::setName ( const char *  name)
inline

Definition at line 233 of file RooAbsCollection.h.

◆ setRealValue()

Bool_t RooAbsCollection::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.

Definition at line 877 of file RooAbsCollection.cxx.

◆ setStringValue()

Bool_t RooAbsCollection::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

Definition at line 1007 of file RooAbsCollection.cxx.

◆ size()

Storage_t::size_type RooAbsCollection::size ( ) const
inline

Definition at line 165 of file RooAbsCollection.h.

◆ snapshot() [1/2]

RooAbsCollection * RooAbsCollection::snapshot ( Bool_t  deepCopy = kTRUE) const

Take a snap shot of current collection contents.

An owning collection is returned containing clones of

  • Elements in this collection
  • External dependents of all elements and recursively any dependents of those dependents (if deepCopy flag is set)

This is useful to save the values of variables or parameters. It doesn't require deep copying if the parameters are direct members of the collection.

If deepCopy is specified, the client-server links between the cloned list elements and the cloned external dependents are reconnected to each other, making the snapshot a completely self-contained entity.

Definition at line 201 of file RooAbsCollection.cxx.

◆ snapshot() [2/2]

Bool_t RooAbsCollection::snapshot ( RooAbsCollection output,
Bool_t  deepCopy = kTRUE 
) const

Take a snap shot of current collection contents: A collection that owns its elements is returned containing clones of.

  • Elements in this collection
  • External dependents of those elements and recursively any dependents of those dependents (if deepCopy flag is set)

If deepCopy is specified, the client-server links between the cloned list elements and the cloned external dependents are reconnected to each other, making the snapshot a completely self-contained entity.

Definition at line 236 of file RooAbsCollection.cxx.

◆ sort()

void RooAbsCollection::sort ( Bool_t  reverse = false)

Sort collection using std::sort and name comparison.

Definition at line 1438 of file RooAbsCollection.cxx.

◆ structureTag()

TNamed * RooAbsCollection::structureTag ( )
inlineprotected

Definition at line 272 of file RooAbsCollection.h.

◆ takeOwnership()

void RooAbsCollection::takeOwnership ( )
inline

Definition at line 251 of file RooAbsCollection.h.

◆ tryFastFind()

RooAbsArg * RooAbsCollection::tryFastFind ( const TNamed namePtr) const
private

Perform a search in a hash map.

This only happens if this collection is larger than _sizeThresholdForMapSearch. This search is not guaranteed to find an existing element because elements can be renamed while being stored in the collection.

Definition at line 1506 of file RooAbsCollection.cxx.

◆ typedStructureTag()

TNamed * RooAbsCollection::typedStructureTag ( )
inlineprotected

Definition at line 273 of file RooAbsCollection.h.

◆ useHashMapForFind()

void RooAbsCollection::useHashMapForFind ( bool  flag) const

Install an internal hash map for fast finding of elements by name.

Definition at line 1486 of file RooAbsCollection.cxx.

Member Data Documentation

◆ _allRRV

Bool_t RooAbsCollection::_allRRV
protected

Definition at line 265 of file RooAbsCollection.h.

◆ _list

Storage_t RooAbsCollection::_list
protected

Definition at line 260 of file RooAbsCollection.h.

◆ _name

TString RooAbsCollection::_name
protected

Definition at line 264 of file RooAbsCollection.h.

◆ _nameToItemMap

std::unique_ptr<std::unordered_map<const TNamed*, Storage_t::value_type> > RooAbsCollection::_nameToItemMap
mutableprivate

Definition at line 285 of file RooAbsCollection.h.

◆ _ownCont

Bool_t RooAbsCollection::_ownCont
protected

Definition at line 263 of file RooAbsCollection.h.

◆ _sizeThresholdForMapSearch

std::size_t RooAbsCollection::_sizeThresholdForMapSearch
private

Definition at line 286 of file RooAbsCollection.h.

◆ _structureTag

TNamed* RooAbsCollection::_structureTag {nullptr}
mutableprotected

Definition at line 275 of file RooAbsCollection.h.

◆ _typedStructureTag

TNamed* RooAbsCollection::_typedStructureTag {nullptr}
mutableprotected

Structure tag.

Definition at line 276 of file RooAbsCollection.h.

Libraries for RooAbsCollection:

The documentation for this class was generated from the following files: