Logo ROOT  
Reference Guide
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.

PyROOT

Some member functions of RooAbsCollection that take a RooCmdArg as argument also support keyword arguments. So far, this applies to RooAbsCollection::printLatex. For example, the following code is equivalent in PyROOT:

# Directly passing a RooCmdArg:
params.printLatex(ROOT.RooFit.Sibling(initParams), ROOT.RooFit.Columns(2))
# With keyword arguments:
params.printLatex(Sibling=initParams, Columns =2)

Definition at line 64 of file RooAbsCollection.h.

Classes

struct  RooAbsArgPtrOrDouble
 

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 = (1ULL << ( 0 )) , kOverwrite = (1ULL << ( 1 )) , kWriteDelete = (1ULL << ( 2 )) }
 
enum  EDeprecatedStatusBits { kObjInCanvas = (1ULL << ( 3 )) }
 
enum  EStatusBits {
  kCanDelete = (1ULL << ( 0 )) , kMustCleanup = (1ULL << ( 3 )) , kIsReferenced = (1ULL << ( 4 )) , kHasUUID = (1ULL << ( 5 )) ,
  kCannotPick = (1ULL << ( 6 )) , kNoContextMenu = (1ULL << ( 8 )) , kInvalidObject = (1ULL << ( 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. More...
 
 RooAbsCollection (const char *name)
 Empty collection constructor. More...
 
 RooAbsCollection (const RooAbsCollection &other, const char *name="")
 Copy constructor. More...
 
 RooAbsCollection (RooAbsCollection &&other)
 Move constructor. More...
 
 ~RooAbsCollection () override
 Destructor. More...
 
virtual bool add (const RooAbsArg &var, bool silent=false)
 Add the specified argument to list. More...
 
bool add (const RooAbsCollection &list, bool silent=false)
 Add a collection of arguments to this collection by calling add() for each element in the source collection. More...
 
template<typename Iterator_t , typename value_type = typename std::remove_pointer<typename std::iterator_traits<Iterator_t>::value_type>, typename = std::enable_if<std::is_convertible<const value_type*, const RooAbsArg*>::value>>
bool add (Iterator_t beginIt, Iterator_t endIt, bool silent=false)
 
virtual RooAbsArgaddClone (const RooAbsArg &var, bool silent=false)
 Add a clone of the specified argument to list. More...
 
virtual void addClone (const RooAbsCollection &list, bool silent=false)
 Add a collection of arguments to this collection by calling addOwned() for each element in the source collection. More...
 
virtual bool addOwned (const RooAbsCollection &list, bool silent=false)
 for each element in the source collection. More...
 
virtual bool addOwned (RooAbsArg &var, bool silent=false)
 Add an argument and transfer the ownership to the collection. More...
 
bool addOwned (RooAbsCollection &&list, bool silent=false)
 Add a collection of arguments to this collection by calling addOwned() for each element in the source collection. More...
 
bool addOwned (std::unique_ptr< RooAbsArg > var, bool silent=false)
 Add an argument and transfer the ownership to the collection from a std::unique_ptr. More...
 
bool allInRange (const char *rangeSpec) const
 Return true if all contained object report to have their value inside the specified range. More...
 
void assign (const RooAbsCollection &other) const
 Sets the value, cache and constant attribute of any argument in our set that also appears in the other set. More...
 
void assignFast (const RooAbsCollection &other, bool setValDirty=true) const
 Functional equivalent of assign() but assumes this and other collection have same layout. More...
 
RooAbsCollectionassignValueOnly (const RooAbsCollection &other, bool forceIfSizeOne=false)
 Sets the value of any argument in our set that also appears in the other set. More...
 
const_iterator begin () const
 
void clear ()
 Clear contents. If the collection is owning, it will also delete the contents. More...
 
virtual TObjectclone (const char *newname) const =0
 
TObjectClone (const char *newname=0) const override
 Make a clone of an object using the Streamer facility. More...
 
bool contains (const RooAbsArg &var) const
 Check if collection contains an argument with the same name as var. More...
 
virtual bool containsInstance (const RooAbsArg &var) const
 Check if this exact instance is in this collection. More...
 
std::string contentsString () const
 Return comma separated list of contained object names as STL string. More...
 
virtual TObjectcreate (const char *newname) const =0
 
TIteratorcreateIterator (bool dir=kIterForward) const
 TIterator-style iteration over contained elements. More...
 
Int_t defaultPrintContents (Option_t *opt) const override
 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. More...
 
void dump () const
 Base contents dumper for debugging purposes. More...
 
bool empty () const
 
const_iterator end () const
 
bool equals (const RooAbsCollection &otherColl) const
 Check if this and other collection have identically-named contents. More...
 
RooAbsArgfind (const char *name) const
 Find object with given name in list. More...
 
RooAbsArgfind (const RooAbsArg &) const
 Find object with given name in list. More...
 
TObjectFindObject (const char *name) const override
 Find object by name in the collection. More...
 
TObjectFindObject (const TObject *obj) const override
 Find object in the collection, Note: matching by object name, like the find() method. More...
 
RooAbsArgfirst () const
 
RooFIter fwdIterator () const
 One-time forward iterator. More...
 
Storage_t const & get () const
 Const access to the underlying stl container. More...
 
Int_t getCatIndex (const char *name, Int_t defVal=0, bool verbose=false) const
 Get index value of a RooAbsCategory stored in set with given name. More...
 
const char * getCatLabel (const char *name, const char *defVal="", bool verbose=false) const
 Get state name of a RooAbsCategory stored in set with given name. More...
 
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. More...
 
const char * GetName () const override
 Returns name of object. More...
 
double getRealValue (const char *name, double defVal=0, bool verbose=false) const
 Get value of a RooAbsReal stored in set with given name. More...
 
Int_t getSize () const
 Return the number of elements in the collection. More...
 
const char * getStringValue (const char *name, const char *defVal="", bool verbose=false) const
 Get string value of a RooStringVar stored in set with given name. More...
 
bool hasSameLayout (const RooAbsCollection &other) const
 Check that all entries where the collections overlap have the same name. More...
 
Int_t index (const char *name) const
 Return index of item with given name, or -1 in case it's not in the collection. More...
 
Int_t index (const RooAbsArg &arg) const
 Returns index of given arg, or -1 if arg is not in the collection. More...
 
Int_t index (const RooAbsArg *arg) const
 Returns index of given arg, or -1 if arg is not in the collection. More...
 
TClassIsA () const override
 
bool isOwning () const
 
RooLinkedListIter iterator (bool dir=kIterForward) const
 TIterator-style iteration over contained elements. More...
 
RooAbsCollectionoperator= (const RooAbsCollection &other)
 Assign values from the elements in other to our elements. More...
 
RooAbsArgoperator[] (Storage_t::size_type i) const
 
bool overlaps (const RooAbsCollection &otherColl) const
 Check if this and other collection have common entries. More...
 
template<typename Iterator_t , typename value_type = typename std::remove_pointer<typename std::iterator_traits<Iterator_t>::value_type>, typename = std::enable_if<std::is_convertible<const value_type*, const RooAbsArg*>::value>>
bool overlaps (Iterator_t otherCollBegin, Iterator_t otherCollEnd) const
 
void Print (Option_t *options=0) const override
 This method must be overridden when a class wants to print itself. More...
 
void printClassName (std::ostream &os) const override
 Return collection class name. More...
 
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. More...
 
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. More...
 
void printMultiline (std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
 Implement multiline printing of collection, one line for each contained object showing the requested content. More...
 
void printName (std::ostream &os) const override
 Return collection name. More...
 
void printTitle (std::ostream &os) const override
 Return collection title. More...
 
void printValue (std::ostream &os) const override
 Print value of collection, i.e. More...
 
Storage_t::const_reverse_iterator rbegin () const
 
void RecursiveRemove (TObject *obj) override
 If one of the TObject we have a referenced to is deleted, remove the reference. More...
 
void releaseOwnership ()
 
virtual bool remove (const RooAbsArg &var, bool silent=false, bool matchByNameOnly=false)
 Remove the specified argument from our list. More...
 
bool remove (const RooAbsCollection &list, bool silent=false, bool matchByNameOnly=false)
 Remove each argument in the input list from our list. More...
 
template<class forwardIt >
void remove (forwardIt rangeBegin, forwardIt rangeEnd, bool silent=false, bool matchByNameOnly=false)
 
virtual void removeAll ()
 Remove all arguments from our set, deleting them if we own them. More...
 
Storage_t::const_reverse_iterator rend () const
 
virtual bool replace (const RooAbsArg &var1, const RooAbsArg &var2)
 Replace var1 with var2 and return true for success. More...
 
bool replace (const RooAbsCollection &other)
 Replace any args in our set with args of the same name from the other set and return true for success. More...
 
void reserve (Storage_t::size_type count)
 
RooAbsCollectionselectByAttrib (const char *name, bool value) const
 Create a subset of the current collection, consisting only of those elements with the specified attribute set. More...
 
RooAbsCollectionselectByName (const char *nameList, bool verbose=false) 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. More...
 
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. More...
 
bool selectCommon (const RooAbsCollection &refColl, RooAbsCollection &outColl) const
 Create a subset of the current collection, consisting only of those elements that are contained as well in the given reference collection. More...
 
void setAttribAll (const Text_t *name, bool value=true)
 Set given attribute in each element of the collection by calling each elements setAttribute() function. More...
 
bool setCatIndex (const char *name, Int_t newVal=0, bool verbose=false)
 Set index value of a RooAbsCategoryLValue stored in set with given name to newVal. More...
 
bool setCatLabel (const char *name, const char *newVal="", bool verbose=false)
 Set state name of a RooAbsCategoryLValue stored in set with given name to newVal. More...
 
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. More...
 
void setName (const char *name)
 
bool setRealValue (const char *name, double newVal=0, bool verbose=false)
 Set value of a RooAbsRealLValye stored in set with given name to newVal No error messages are printed unless the verbose flag is set. More...
 
bool setStringValue (const char *name, const char *newVal="", bool verbose=false)
 Set string value of a RooStringVar stored in set with given name to newVal. More...
 
Storage_t::size_type size () const
 
RooAbsCollectionsnapshot (bool deepCopy=true) const
 Take a snap shot of current collection contents. More...
 
bool snapshot (RooAbsCollection &output, bool deepCopy=true) const
 Take a snap shot of current collection contents: A collection that owns its elements is returned containing clones of. More...
 
void sort (bool reverse=false)
 Sort collection using std::sort and name comparison. More...
 
void sortTopologically ()
 Sort collection topologically: the servers of any RooAbsArg will be before that RooAbsArg in the collection. More...
 
void Streamer (TBuffer &) override
 Stream an object of class TObject. More...
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
void takeOwnership ()
 
void useHashMapForFind (bool flag) const
 
- Public Member Functions inherited from TObject
 TObject ()
 TObject constructor. More...
 
 TObject (const TObject &object)
 TObject copy ctor. More...
 
virtual ~TObject ()
 TObject destructor. More...
 
void AbstractMethod (const char *method) const
 Use this method to implement an "abstract" method that you don't want to leave purely abstract. More...
 
virtual void AppendPad (Option_t *option="")
 Append graphics object to current pad. More...
 
virtual void Browse (TBrowser *b)
 Browse object. May be overridden for another default action. More...
 
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. More...
 
virtual const char * ClassName () const
 Returns name of class to which the object belongs. More...
 
virtual void Clear (Option_t *="")
 
virtual TObjectClone (const char *newname="") const
 Make a clone of an object using the Streamer facility. More...
 
virtual Int_t Compare (const TObject *obj) const
 Compare abstract method. More...
 
virtual void Copy (TObject &object) const
 Copy this to obj. More...
 
virtual void Delete (Option_t *option="")
 Delete this object. More...
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 Computes distance from point (px,py) to the object. More...
 
virtual void Draw (Option_t *option="")
 Default Draw method for all objects. More...
 
virtual void DrawClass () const
 Draw class inheritance tree of the class to which this object belongs. More...
 
virtual TObjectDrawClone (Option_t *option="") const
 Draw a clone of this object in the current selected pad for instance with: gROOT->SetSelectedPad(gPad). More...
 
virtual void Dump () const
 Dump contents of object on stdout. More...
 
virtual void Error (const char *method, const char *msgfmt,...) const
 Issue error message. More...
 
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. More...
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=0)
 Execute method on this object with parameters stored in the TObjArray. More...
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 Execute action corresponding to an event at (px,py). More...
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 Issue fatal error message. More...
 
virtual TObjectFindObject (const char *name) const
 Must be redefined in derived classes. More...
 
virtual TObjectFindObject (const TObject *obj) const
 Must be redefined in derived classes. More...
 
virtual Option_tGetDrawOption () const
 Get option used by the graphics system to draw this object. More...
 
virtual const char * GetIconName () const
 Returns mime type name of object. More...
 
virtual const char * GetName () const
 Returns name of object. More...
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 Returns string containing info about the object at position (px,py). More...
 
virtual Option_tGetOption () const
 
virtual const char * GetTitle () const
 Returns title of object. More...
 
virtual UInt_t GetUniqueID () const
 Return the unique object id. More...
 
virtual Bool_t HandleTimer (TTimer *timer)
 Execute action in response of a timer timing out. More...
 
virtual ULong_t Hash () const
 Return hash value for this object. More...
 
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. More...
 
virtual void Info (const char *method, const char *msgfmt,...) const
 Issue info message. More...
 
virtual Bool_t InheritsFrom (const char *classname) const
 Returns kTRUE if object inherits from class "classname". More...
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 Returns kTRUE if object inherits from TClass cl. More...
 
virtual void Inspect () const
 Dump contents of this object in a graphics canvas. More...
 
void InvertBit (UInt_t f)
 
virtual TClassIsA () const
 
virtual Bool_t IsEqual (const TObject *obj) const
 Default equal comparison (objects are equal if they have the same address in memory). More...
 
virtual Bool_t IsFolder () const
 Returns kTRUE in case object contains browsable objects (like containers or lists of other objects). More...
 
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. More...
 
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). More...
 
virtual Bool_t Notify ()
 This method must be overridden to handle object notification. More...
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 Use this method to declare a method obsolete. More...
 
void operator delete (void *ptr)
 Operator delete. More...
 
void operator delete[] (void *ptr)
 Operator delete []. More...
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *vp)
 
void * operator new[] (size_t sz)
 
void * operator new[] (size_t sz, void *vp)
 
TObjectoperator= (const TObject &rhs)
 TObject assignment operator. More...
 
virtual void Paint (Option_t *option="")
 This method must be overridden if a class wants to paint itself. More...
 
virtual void Pop ()
 Pop on object drawn in a pad to the top of the display list. More...
 
virtual void Print (Option_t *option="") const
 This method must be overridden when a class wants to print itself. More...
 
virtual Int_t Read (const char *name)
 Read contents of object with specified name from the current directory. More...
 
virtual void RecursiveRemove (TObject *obj)
 Recursively remove this object from a list. More...
 
void ResetBit (UInt_t f)
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 Save this object in the file specified by filename. More...
 
virtual void SavePrimitive (std::ostream &out, Option_t *option="")
 Save a primitive as a C++ statement(s) on output stream "out". More...
 
void SetBit (UInt_t f)
 
void SetBit (UInt_t f, Bool_t set)
 Set or unset the user status bits as specified in f. More...
 
virtual void SetDrawOption (Option_t *option="")
 Set drawing option for object. More...
 
virtual void SetUniqueID (UInt_t uid)
 Set the unique object id. More...
 
virtual void Streamer (TBuffer &)
 Stream an object of class TObject. More...
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 Issue system error message. More...
 
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. More...
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 Issue warning message. More...
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0)
 Write this object to the current directory. More...
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const
 Write this object to the current directory. More...
 
- Public Member Functions inherited from RooPrintable
 RooPrintable ()
 
virtual ~RooPrintable ()
 
virtual Int_t defaultPrintContents (Option_t *opt) const
 Default choice of contents to be printed (name and value) More...
 
virtual StyleOption defaultPrintStyle (Option_t *opt) const
 
virtual TClassIsA () const
 
virtual void printAddress (std::ostream &os) const
 Print class name of object. More...
 
virtual void printArgs (std::ostream &os) const
 Interface for printing of object arguments. More...
 
virtual void printClassName (std::ostream &os) const
 Print class name of object. More...
 
virtual void printExtras (std::ostream &os) const
 Interface to print extras of object. More...
 
virtual void printMultiline (std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const
 Interface for detailed printing of object. More...
 
virtual void printName (std::ostream &os) const
 Print name of object. More...
 
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'. More...
 
virtual void printTitle (std::ostream &os) const
 Print title of object. More...
 
virtual void printTree (std::ostream &os, TString indent="") const
 Interface for tree structure printing of object. More...
 
virtual void printValue (std::ostream &os) const
 Interface to print value of object. More...
 
virtual void Streamer (TBuffer &)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 

Static Public Member Functions

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

Protected Types

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

Protected Member Functions

bool addServerClonesToList (const RooAbsArg &var)
 Add clones of servers of given argument to end of list. More...
 
virtual bool canBeAdded (const RooAbsArg &arg, bool silent) const =0
 Determine whether it's possible to add a given RooAbsArg to the collection or not. More...
 
void clearStructureTags ()
 
void deleteList ()
 Delete contents of the list. More...
 
void makeStructureTag ()
 
void makeTypedStructureTag ()
 
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). More...
 
void MakeZombie ()
 

Static Protected Member Functions

template<class T >
static void assert_is_no_temporary (T &&)
 

Protected Attributes

bool _allRRV = true
 All contents are RRV. More...
 
Storage_t _list
 Actual object storage. More...
 
TString _name
 Our name. More...
 
bool _ownCont = false
 Flag to identify a list that owns its contents. More...
 
TNamed_structureTag {nullptr}
 ! Structure tag More...
 
TNamed_typedStructureTag {nullptr}
 ! Typed structure tag More...
 

Private Types

using HashAssistedFind = RooFit::Detail::HashAssistedFind
 

Private Member Functions

void insert (RooAbsArg *)
 Insert an element into the owned collections. More...
 
std::unique_ptr< LegacyIterator_tmakeLegacyIterator (bool forward=true) const
 Factory for legacy iterators. More...
 

Private Attributes

std::unique_ptr< HashAssistedFind_hashAssistedFind
 ! More...
 
std::size_t _sizeThresholdForMapSearch = 100
 ! More...
 

Additional Inherited Members

- 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 67 of file RooAbsCollection.h.

◆ HashAssistedFind

◆ LegacyIterator_t

◆ Storage_t

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

Definition at line 66 of file RooAbsCollection.h.

Constructor & Destructor Documentation

◆ RooAbsCollection() [1/4]

RooAbsCollection::RooAbsCollection ( )

Default constructor.

Definition at line 117 of file RooAbsCollection.cxx.

◆ RooAbsCollection() [2/4]

RooAbsCollection::RooAbsCollection ( const char *  name)

Empty collection constructor.

Definition at line 127 of file RooAbsCollection.cxx.

◆ ~RooAbsCollection()

RooAbsCollection::~RooAbsCollection ( )
override

Destructor.

Definition at line 176 of file RooAbsCollection.cxx.

◆ RooAbsCollection() [3/4]

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 140 of file RooAbsCollection.cxx.

◆ RooAbsCollection() [4/4]

RooAbsCollection::RooAbsCollection ( RooAbsCollection &&  other)

Move constructor.

Definition at line 161 of file RooAbsCollection.cxx.

Member Function Documentation

◆ add() [1/3]

bool RooAbsCollection::add ( const RooAbsArg var,
bool  silent = false 
)
virtual

Add the specified argument to list.

Returns true if successful, or else false 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 RooCollectionProxy< RooArgList >, RooCollectionProxy< RooArgSet >, RooCollectionProxy< RooArgList >, and RooCollectionProxy< RooArgSet >.

Definition at line 498 of file RooAbsCollection.cxx.

◆ add() [2/3]

bool RooAbsCollection::add ( const RooAbsCollection list,
bool  silent = false 
)
inline

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

Definition at line 134 of file RooAbsCollection.h.

◆ add() [3/3]

template<typename Iterator_t , typename value_type = typename std::remove_pointer<typename std::iterator_traits<Iterator_t>::value_type>, typename = std::enable_if<std::is_convertible<const value_type*, const RooAbsArg*>::value>>
bool RooAbsCollection::add ( Iterator_t  beginIt,
Iterator_t  endIt,
bool  silent = false 
)
inline

Definition at line 123 of file RooAbsCollection.h.

◆ addClone() [1/2]

RooAbsCollection::addClone ( const RooAbsArg var,
bool  silent = false 
)
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.

PyROOT

The RooAbsCollection::addClone() function is pythonized with the command argument pythonization. The keywords must correspond to the CmdArgs of the function.

Reimplemented in RooCollectionProxy< RooArgList >, RooCollectionProxy< RooArgSet >, RooCollectionProxy< RooArgList >, and RooCollectionProxy< RooArgSet >.

Definition at line 471 of file RooAbsCollection.cxx.

◆ addClone() [2/2]

void RooAbsCollection::addClone ( const RooAbsCollection list,
bool  silent = false 
)
virtual

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

Reimplemented in RooCollectionProxy< RooArgList >, and RooCollectionProxy< RooArgSet >.

Definition at line 584 of file RooAbsCollection.cxx.

◆ addOwned() [1/4]

bool RooAbsCollection::addOwned ( const RooAbsCollection list,
bool  silent = false 
)
virtual

for each element in the source collection.

The input list can't be an owning collection itself, otherwise the arguments would be owned by two collections.

If you want to transfer arguments from one owning collection to another, you have two options:

  1. std::move the input collection and use RooAbsCollection::addOwned(RooAbsCollection&&, bool) (preferred)
  2. release the ownership of the input collection first, using RooAbsCollection::releaseOwnership()

Reimplemented in RooCollectionProxy< RooArgList >, and RooCollectionProxy< RooArgSet >.

Definition at line 528 of file RooAbsCollection.cxx.

◆ addOwned() [2/4]

RooAbsCollection::addOwned ( RooAbsArg var,
bool  silent = false 
)
virtual

Add an argument and transfer the ownership to the collection.

Returns true if successful, or false if the argument could not be added to the collection (e.g. in the RooArgSet case when an argument with 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).

If the argument you want to add is owned by a std::unique_ptr, you should prefer RooAbsCollection::addOwned(std::unique_ptr<RooAbsArg>, bool).

PyROOT

The RooAbsCollection::addOwned() function is pythonized with the command argument pythonization. The keywords must correspond to the CmdArgs of the function.

Reimplemented in RooCollectionProxy< RooArgList >, RooCollectionProxy< RooArgSet >, RooCollectionProxy< RooArgList >, and RooCollectionProxy< RooArgSet >.

Definition at line 424 of file RooAbsCollection.cxx.

◆ addOwned() [3/4]

bool RooAbsCollection::addOwned ( RooAbsCollection &&  list,
bool  silent = false 
)

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

Unlike RooAbsCollection::addOwned(const RooAbsCollection&, bool), this function also accepts owning source collections because their content will be moved out.

Definition at line 556 of file RooAbsCollection.cxx.

◆ addOwned() [4/4]

bool RooAbsCollection::addOwned ( std::unique_ptr< RooAbsArg var,
bool  silent = false 
)

Add an argument and transfer the ownership to the collection from a std::unique_ptr.

Always returns true. If the argument can not be added to the collection (e.g. in the RooArgSet case when an argument with the same name is already in the list), a std::runtime_exception will be thrown, as nobody is owning the argument anymore. 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).

If you want to pass an argument that is not owned by a std::unique_ptr, you can use RooAbsCollection::addOwned(RooAbsArg&, bool).

Definition at line 453 of file RooAbsCollection.cxx.

◆ addServerClonesToList()

bool RooAbsCollection::addServerClonesToList ( const RooAbsArg var)
protected

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

Definition at line 298 of file RooAbsCollection.cxx.

◆ allInRange()

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

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

Definition at line 1500 of file RooAbsCollection.cxx.

◆ assert_is_no_temporary()

template<class T >
static void RooAbsCollection::assert_is_no_temporary ( T &&  )
inlinestaticprotected

Definition at line 384 of file RooAbsCollection.h.

◆ assign()

void RooAbsCollection::assign ( const RooAbsCollection other) const

Sets the value, cache and constant attribute of any argument in our set that also appears in the other set.

Note that this function changes the values of the elements in this collection, but is still marked const as it does not change which elements this collection points to.

Definition at line 340 of file RooAbsCollection.cxx.

◆ assignFast()

void RooAbsCollection::assignFast ( const RooAbsCollection other,
bool  setValDirty = true 
) const

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

Also no attributes are copied

Definition at line 388 of file RooAbsCollection.cxx.

◆ assignValueOnly()

RooAbsCollection & RooAbsCollection::assignValueOnly ( const RooAbsCollection other,
bool  forceIfSizeOne = false 
)

Sets the value of any argument in our set that also appears in the other set.

Parameters
[in]otherCollection holding the arguments to syncronize values with.
[in]forceIfSizeOneIf set to true and both our collection and the other collection have a size of one, the arguments are always syncronized without checking if they have the same name.

Definition at line 362 of file RooAbsCollection.cxx.

◆ begin()

const_iterator RooAbsCollection::begin ( ) const
inline

Definition at line 233 of file RooAbsCollection.h.

◆ canBeAdded()

virtual bool RooAbsCollection::canBeAdded ( const RooAbsArg arg,
bool  silent 
) const
protectedpure virtual

Determine whether it's possible to add a given RooAbsArg to the collection or not.

Implemented in RooArgSet, and RooArgList.

◆ Class()

static TClass * RooAbsCollection::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

static const char * RooAbsCollection::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

static Version_t RooAbsCollection::Class_Version ( )
inlinestatic
Returns
Version of this class

Definition at line 401 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 262 of file RooAbsCollection.h.

◆ clearStructureTags()

void RooAbsCollection::clearStructureTags ( )
inlineprotected

Definition at line 375 of file RooAbsCollection.h.

◆ clone()

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

Implemented in RooArgList, and RooArgSet.

◆ Clone()

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

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 75 of file RooAbsCollection.h.

◆ contains()

bool 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 178 of file RooAbsCollection.h.

◆ containsInstance()

virtual bool RooAbsCollection::containsInstance ( const RooAbsArg var) const
inlinevirtual

Check if this exact instance is in this collection.

Reimplemented in RooArgSet.

Definition at line 182 of file RooAbsCollection.h.

◆ contentsString()

std::string RooAbsCollection::contentsString ( ) const

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

Definition at line 1164 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  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 213 of file RooAbsCollection.h.

◆ DeclFileName()

static const char * RooAbsCollection::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 401 of file RooAbsCollection.h.

◆ defaultPrintContents()

Int_t RooAbsCollection::defaultPrintContents ( Option_t opt) const
overridevirtual

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 1215 of file RooAbsCollection.cxx.

◆ deleteList()

void RooAbsCollection::deleteList ( )
protected

Delete contents of the list.

The RooAbsArg destructor ensures clients and servers can be deleted in any order. Also cleans the hash-map for fast lookups if present.

Definition at line 191 of file RooAbsCollection.cxx.

◆ dump()

void RooAbsCollection::dump ( ) const

Base contents dumper for debugging purposes.

Definition at line 1294 of file RooAbsCollection.cxx.

◆ empty()

bool RooAbsCollection::empty ( ) const
inline

Definition at line 253 of file RooAbsCollection.h.

◆ end()

const_iterator RooAbsCollection::end ( ) const
inline

Definition at line 237 of file RooAbsCollection.h.

◆ equals()

bool RooAbsCollection::equals ( const RooAbsCollection otherColl) const

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

Definition at line 903 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 938 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 963 of file RooAbsCollection.cxx.

◆ FindObject() [1/2]

TObject * RooAbsCollection::FindObject ( const char *  name) const
inlineoverridevirtual

Find object by name in the collection.

Reimplemented from TObject.

Definition at line 171 of file RooAbsCollection.h.

◆ FindObject() [2/2]

TObject * RooAbsCollection::FindObject ( const TObject obj) const
inlineoverridevirtual

Find object in the collection, Note: matching by object name, like the find() method.

Reimplemented from TObject.

Definition at line 174 of file RooAbsCollection.h.

◆ first()

RooAbsArg * RooAbsCollection::first ( ) const
inline

Definition at line 271 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 228 of file RooAbsCollection.h.

◆ get()

Storage_t const & RooAbsCollection::get ( ) const
inline

Const access to the underlying stl container.

Definition at line 109 of file RooAbsCollection.h.

◆ getCatIndex()

Int_t RooAbsCollection::getCatIndex ( const char *  name,
Int_t  defVal = 0,
bool  verbose = false 
) 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 1080 of file RooAbsCollection.cxx.

◆ getCatLabel()

const char * RooAbsCollection::getCatLabel ( const char *  name,
const char *  defVal = "",
bool  verbose = false 
) 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 1037 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 104 of file RooAbsCollection.h.

◆ GetName()

const char * RooAbsCollection::GetName ( ) const
inlineoverridevirtual

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 322 of file RooAbsCollection.h.

◆ getRealValue()

double RooAbsCollection::getRealValue ( const char *  name,
double  defVal = 0,
bool  verbose = false 
) 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 994 of file RooAbsCollection.cxx.

◆ getSize()

Int_t RooAbsCollection::getSize ( ) const
inline

Return the number of elements in the collection.

Definition at line 267 of file RooAbsCollection.h.

◆ getStringValue()

const char * RooAbsCollection::getStringValue ( const char *  name,
const char *  defVal = "",
bool  verbose = false 
) 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 1123 of file RooAbsCollection.cxx.

◆ hasSameLayout()

bool RooAbsCollection::hasSameLayout ( const RooAbsCollection other) const

Check that all entries where the collections overlap have the same name.

Definition at line 1643 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 981 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 289 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 283 of file RooAbsCollection.h.

◆ insert()

void RooAbsCollection::insert ( RooAbsArg item)
private

Insert an element into the owned collections.

Definition at line 1620 of file RooAbsCollection.cxx.

◆ IsA()

TClass * RooAbsCollection::IsA ( ) const
inlineoverridevirtual
Returns
TClass describing current object

Reimplemented from TObject.

Reimplemented in RooArgList, RooArgSet, RooCollectionProxy< RooArgList >, and RooCollectionProxy< RooArgSet >.

Definition at line 401 of file RooAbsCollection.h.

◆ isOwning()

bool RooAbsCollection::isOwning ( ) const
inline

Definition at line 326 of file RooAbsCollection.h.

◆ iterator()

RooLinkedListIter RooAbsCollection::iterator ( bool  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 221 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 1610 of file RooAbsCollection.cxx.

◆ makeStructureTag()

void RooAbsCollection::makeStructureTag ( )
inlineprotected

Definition at line 377 of file RooAbsCollection.h.

◆ makeTypedStructureTag()

void RooAbsCollection::makeTypedStructureTag ( )
inlineprotected

Definition at line 378 of file RooAbsCollection.h.

◆ operator=()

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

Assign values from the elements in other to our elements.

Warning
This is not a conventional assignment operator. To avoid confusion, prefer using RooAbsCollection::assign().

Definition at line 327 of file RooAbsCollection.cxx.

◆ operator[]()

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

Definition at line 277 of file RooAbsCollection.h.

◆ overlaps() [1/2]

bool RooAbsCollection::overlaps ( const RooAbsCollection otherColl) const
inline

Check if this and other collection have common entries.

Definition at line 206 of file RooAbsCollection.h.

◆ overlaps() [2/2]

template<typename Iterator_t , typename value_type = typename std::remove_pointer<typename std::iterator_traits<Iterator_t>::value_type>, typename = std::enable_if<std::is_convertible<const value_type*, const RooAbsArg*>::value>>
bool RooAbsCollection::overlaps ( Iterator_t  otherCollBegin,
Iterator_t  otherCollEnd 
) const
inline

Definition at line 195 of file RooAbsCollection.h.

◆ Print()

void RooAbsCollection::Print ( Option_t option = 0) const
inlineoverridevirtual

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

Reimplemented from TObject.

Definition at line 295 of file RooAbsCollection.h.

◆ printClassName()

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

Return collection class name.

Reimplemented from RooPrintable.

Definition at line 1202 of file RooAbsCollection.cxx.

◆ printLatex() [1/2]

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 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:2400
RooCmdArg VerbatimName(bool flag=true)
RooCmdArg AutoPrecision(Int_t ndigit=2)
RooCmdArg Columns(Int_t ncol)

PyROOT

The RooAbsCollection::printLatex() function is pythonized with the command argument pythonization. The keywords must correspond to the CmdArgs of the function.

Definition at line 1336 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 1393 of file RooAbsCollection.cxx.

◆ printMultiline()

void RooAbsCollection::printMultiline ( std::ostream &  os,
Int_t  contents,
bool  verbose = false,
TString  indent = "" 
) const
overridevirtual

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

Reimplemented from RooPrintable.

Definition at line 1259 of file RooAbsCollection.cxx.

◆ printName()

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

Return collection name.

Reimplemented from RooPrintable.

Definition at line 1182 of file RooAbsCollection.cxx.

◆ printTitle()

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

Return collection title.

Reimplemented from RooPrintable.

Definition at line 1192 of file RooAbsCollection.cxx.

◆ printValue()

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

Print value of collection, i.e.

a comma separated list of contained object names

Reimplemented from RooPrintable.

Definition at line 1234 of file RooAbsCollection.cxx.

◆ rbegin()

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

Definition at line 241 of file RooAbsCollection.h.

◆ RecursiveRemove()

void RooAbsCollection::RecursiveRemove ( TObject obj)
overridevirtual

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

Reimplemented from TObject.

Definition at line 1545 of file RooAbsCollection.cxx.

◆ releaseOwnership()

void RooAbsCollection::releaseOwnership ( )
inline

Definition at line 335 of file RooAbsCollection.h.

◆ remove() [1/3]

bool RooAbsCollection::remove ( const RooAbsArg var,
bool  silent = false,
bool  matchByNameOnly = false 
)
virtual

Remove the specified argument from our list.

Return false 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 RooCollectionProxy< RooArgList >, and RooCollectionProxy< RooArgSet >.

Definition at line 674 of file RooAbsCollection.cxx.

◆ remove() [2/3]

bool RooAbsCollection::remove ( const RooAbsCollection list,
bool  silent = false,
bool  matchByNameOnly = false 
)

Remove each argument in the input list from 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 items, it will delete them. Return false in case of problems.

Definition at line 718 of file RooAbsCollection.cxx.

◆ remove() [3/3]

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

Definition at line 143 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 RooCollectionProxy< RooArgList >, and RooCollectionProxy< RooArgSet >.

Definition at line 773 of file RooAbsCollection.cxx.

◆ rend()

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

Definition at line 245 of file RooAbsCollection.h.

◆ replace() [1/2]

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

Replace var1 with var2 and return true 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 RooCollectionProxy< RooArgList >, and RooCollectionProxy< RooArgSet >.

Definition at line 624 of file RooAbsCollection.cxx.

◆ replace() [2/2]

bool RooAbsCollection::replace ( const RooAbsCollection other)

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

Fails if this list is a copy of another.

Definition at line 599 of file RooAbsCollection.cxx.

◆ reserve()

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

Definition at line 257 of file RooAbsCollection.h.

◆ selectByAttrib()

RooAbsCollection * RooAbsCollection::selectByAttrib ( const char *  name,
bool  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 807 of file RooAbsCollection.cxx.

◆ selectByName()

RooAbsCollection * RooAbsCollection::selectByName ( const char *  nameList,
bool  verbose = false 
) 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 864 of file RooAbsCollection.cxx.

◆ selectCommon() [1/2]

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 851 of file RooAbsCollection.cxx.

◆ selectCommon() [2/2]

bool RooAbsCollection::selectCommon ( const RooAbsCollection refColl,
RooAbsCollection outColl 
) const

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

Returns true only if something went wrong. The complement of this function is getParameters().

Parameters
[in]refCollThe collection to check for common elements.
[out]outCollOutput collection.

Definition at line 831 of file RooAbsCollection.cxx.

◆ setAttribAll()

void RooAbsCollection::setAttribAll ( const Text_t name,
bool  value = true 
)

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

Definition at line 792 of file RooAbsCollection.cxx.

◆ setCatIndex()

bool RooAbsCollection::setCatIndex ( const char *  name,
Int_t  newVal = 0,
bool  verbose = false 
)

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 1101 of file RooAbsCollection.cxx.

◆ setCatLabel()

bool RooAbsCollection::setCatLabel ( const char *  name,
const char *  newVal = "",
bool  verbose = false 
)

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 1058 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 99 of file RooAbsCollection.h.

◆ setName()

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

Definition at line 318 of file RooAbsCollection.h.

◆ setRealValue()

bool RooAbsCollection::setRealValue ( const char *  name,
double  newVal = 0,
bool  verbose = false 
)

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 1015 of file RooAbsCollection.cxx.

◆ setStringValue()

bool RooAbsCollection::setStringValue ( const char *  name,
const char *  newVal = "",
bool  verbose = false 
)

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 1145 of file RooAbsCollection.cxx.

◆ size()

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

Definition at line 249 of file RooAbsCollection.h.

◆ snapshot() [1/2]

RooAbsCollection * RooAbsCollection::snapshot ( bool  deepCopy = true) 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 220 of file RooAbsCollection.cxx.

◆ snapshot() [2/2]

bool RooAbsCollection::snapshot ( RooAbsCollection output,
bool  deepCopy = true 
) 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 254 of file RooAbsCollection.cxx.

◆ sort()

void RooAbsCollection::sort ( bool  reverse = false)

Sort collection using std::sort and name comparison.

Definition at line 1553 of file RooAbsCollection.cxx.

◆ sortTopologically()

void RooAbsCollection::sortTopologically ( )

Sort collection topologically: the servers of any RooAbsArg will be before that RooAbsArg in the collection.

Will throw an exception if servers are missing in the collection.

Definition at line 1578 of file RooAbsCollection.cxx.

◆ Streamer()

void RooAbsCollection::Streamer ( TBuffer R__b)
overridevirtual

Stream an object of class TObject.

Reimplemented from TObject.

Reimplemented in RooArgList, RooArgSet, RooCollectionProxy< RooArgList >, and RooCollectionProxy< RooArgSet >.

◆ StreamerNVirtual()

void RooAbsCollection::StreamerNVirtual ( TBuffer ClassDef_StreamerNVirtual_b)
inline

Definition at line 401 of file RooAbsCollection.h.

◆ structureTag()

TNamed * RooAbsCollection::structureTag ( )
inlineprotected

Definition at line 369 of file RooAbsCollection.h.

◆ takeOwnership()

void RooAbsCollection::takeOwnership ( )
inline

Definition at line 336 of file RooAbsCollection.h.

◆ typedStructureTag()

TNamed * RooAbsCollection::typedStructureTag ( )
inlineprotected

Definition at line 370 of file RooAbsCollection.h.

◆ useHashMapForFind()

void RooAbsCollection::useHashMapForFind ( bool  flag) const
Parameters
[in]flagSwitch hash map on or off.

Definition at line 1635 of file RooAbsCollection.cxx.

Member Data Documentation

◆ _allRRV

bool RooAbsCollection::_allRRV = true
protected

All contents are RRV.

Definition at line 362 of file RooAbsCollection.h.

◆ _hashAssistedFind

std::unique_ptr<HashAssistedFind> RooAbsCollection::_hashAssistedFind
mutableprivate

!

Definition at line 396 of file RooAbsCollection.h.

◆ _list

Storage_t RooAbsCollection::_list
protected

Actual object storage.

Definition at line 357 of file RooAbsCollection.h.

◆ _name

TString RooAbsCollection::_name
protected

Our name.

Definition at line 361 of file RooAbsCollection.h.

◆ _ownCont

bool RooAbsCollection::_ownCont = false
protected

Flag to identify a list that owns its contents.

Definition at line 360 of file RooAbsCollection.h.

◆ _sizeThresholdForMapSearch

std::size_t RooAbsCollection::_sizeThresholdForMapSearch = 100
private

!

Definition at line 397 of file RooAbsCollection.h.

◆ _structureTag

TNamed* RooAbsCollection::_structureTag {nullptr}
mutableprotected

! Structure tag

Definition at line 372 of file RooAbsCollection.h.

◆ _typedStructureTag

TNamed* RooAbsCollection::_typedStructureTag {nullptr}
mutableprotected

! Typed structure tag

Definition at line 373 of file RooAbsCollection.h.

Libraries for RooAbsCollection:
[legend]

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