Logo ROOT  
Reference Guide
RooCollectionProxy< RooCollection_t > Class Template Reference

template<class RooCollection_t>
class RooCollectionProxy< RooCollection_t >

RooCollectionProxy is the concrete proxy for RooArgSet or RooArgList objects.

A RooCollectionProxy is the general mechanism to store a RooArgSet or RooArgList with RooAbsArgs in a RooAbsArg. Creating a RooCollectionProxy adds all members of the proxied RooArgSet to the proxy owners server list (thus receiving value/shape dirty flags from it) and registers itself with the owning class. The latter allows the owning class to update the pointers of RooArgSet or RooArgList contents to reflect the serverRedirect changes.

Definition at line 40 of file RooCollectionProxy.h.

Public Member Functions

 RooCollectionProxy ()
 
 RooCollectionProxy (const char *inName, const char *, RooAbsArg *owner, bool defValueServer=true, bool defShapeServer=false)
 Construct proxy with given name and description, with given owner The default value and shape dirty propagation of the set contents to the set owner is controlled by flags defValueServer and defShapeServer. More...
 
 RooCollectionProxy (const char *inName, RooAbsArg *owner, const RooCollectionProxy &other)
 Copy constructor. More...
 
 ~RooCollectionProxy () override
 
bool add (const RooAbsArg &var, bool silent=false) override
 Overloaded RooCollection_t::add() method inserts 'var' into set and registers 'var' as server to owner with default value and shape dirty flag propagation. More...
 
bool add (const RooAbsArg &var, bool valueServer, bool shapeServer, bool silent)
 Overloaded RooCollection_t::add() method insert object into set and registers object as server to owner with given value and shape dirty flag propagation requests. More...
 
virtual Bool_t add (const RooAbsArg &var, Bool_t silent=kFALSE)
 Add the specified argument to list. More...
 
bool add (const RooAbsCollection &list, bool silent=kFALSE)
 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)
 
RooAbsArgaddClone (const RooAbsArg &var, bool silent=false) override
 Overloaded RooCollection_t::addClone() method insert clone of object into owning set and registers cloned object as server to owner with default value and shape dirty flag propagation. More...
 
virtual RooAbsArgaddClone (const RooAbsArg &var, Bool_t silent=kFALSE)
 Add a clone of the specified argument to list. More...
 
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. More...
 
virtual bool addOwned (const RooAbsCollection &list, bool silent=false)
 for each element in the source collection. More...
 
bool addOwned (RooAbsArg &var, bool silent=false) override
 Overloaded RooCollection_t::addOwned() method insert object into owning set and registers object as server to owner with default value and shape dirty flag propagation. More...
 
virtual Bool_t addOwned (RooAbsArg &var, Bool_t silent=kFALSE)
 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...
 
TClassIsA () const override
 
const char * name () const override
 
RooCollectionProxyoperator= (const RooCollection_t &other)
 Assign values of arguments on other set to arguments in this set. More...
 
void print (std::ostream &os, bool addContents=false) const override
 Printing name of proxy on ostream. More...
 
bool remove (const RooAbsArg &var, bool silent=false, bool matchByNameOnly=false) override
 Remove object 'var' from set and deregister 'var' as server to owner. More...
 
bool remove (const RooAbsCollection &list, bool silent=false, bool matchByNameOnly=false)
 Remove each argument in the input list from our list using remove(const RooAbsArg&). More...
 
void removeAll () override
 Remove all argument inset using remove(const RooAbsArg&). More...
 
bool replace (const RooAbsArg &var1, const RooAbsArg &var2) override
 Replace object 'var1' in set with 'var2'. More...
 
void Streamer (TBuffer &) override
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- Public Member Functions inherited from RooAbsProxy
 RooAbsProxy ()
 Constructor. More...
 
 RooAbsProxy (const char *name, const RooAbsProxy &other)
 Copy constructor. More...
 
virtual ~RooAbsProxy ()
 
virtual TClassIsA () const
 
virtual const char * name () const
 
const RooArgSetnset () const
 
virtual void print (std::ostream &os, Bool_t addContents=kFALSE) const
 Print proxy name. 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 RooAbsProxy
static TClassClass ()
 
static const char * Class_Name ()
 
static Version_t Class_Version ()
 
static const char * DeclFileName ()
 

Private Member Functions

bool changePointer (const RooAbsCollection &newServerSet, bool nameChange=false, bool factoryInitMode=false) override
 Process server change operation on owner. More...
 
void checkValid () const
 

Private Attributes

bool _defShapeServer = false
 
bool _defValueServer = false
 
RooAbsArg_owner = nullptr
 

Additional Inherited Members

- Protected Member Functions inherited from RooAbsProxy
virtual void changeNormSet (const RooArgSet *newNormSet)
 Destructor. More...
 
virtual Bool_t changePointer (const RooAbsCollection &newServerSet, Bool_t nameChange=kFALSE, Bool_t factoryInitMode=kFALSE)=0
 
- Protected Attributes inherited from RooAbsProxy
RooArgSet_nset = nullptr
 ! Normalization set to be used for evaluation of RooAbsPdf contents More...
 

#include <RooCollectionProxy.h>

Inheritance diagram for RooCollectionProxy< RooCollection_t >:
[legend]

Constructor & Destructor Documentation

◆ RooCollectionProxy() [1/3]

Definition at line 43 of file RooCollectionProxy.h.

◆ RooCollectionProxy() [2/3]

template<class RooCollection_t >
RooCollectionProxy< RooCollection_t >::RooCollectionProxy ( const char *  inName,
const char *  ,
RooAbsArg owner,
bool  defValueServer = true,
bool  defShapeServer = false 
)
inline

Construct proxy with given name and description, with given owner The default value and shape dirty propagation of the set contents to the set owner is controlled by flags defValueServer and defShapeServer.

Definition at line 48 of file RooCollectionProxy.h.

◆ RooCollectionProxy() [3/3]

template<class RooCollection_t >
RooCollectionProxy< RooCollection_t >::RooCollectionProxy ( const char *  inName,
RooAbsArg owner,
const RooCollectionProxy< RooCollection_t > &  other 
)
inline

Copy constructor.

Definition at line 56 of file RooCollectionProxy.h.

◆ ~RooCollectionProxy()

template<class RooCollection_t >
RooCollectionProxy< RooCollection_t >::~RooCollectionProxy ( )
inlineoverride

Definition at line 63 of file RooCollectionProxy.h.

Member Function Documentation

◆ add() [1/5]

template<class RooCollection_t >
bool RooCollectionProxy< RooCollection_t >::add ( const RooAbsArg var,
bool  silent = false 
)
inlineoverride

Overloaded RooCollection_t::add() method inserts 'var' into set and registers 'var' as server to owner with default value and shape dirty flag propagation.

Definition at line 78 of file RooCollectionProxy.h.

◆ add() [2/5]

template<class RooCollection_t >
bool RooCollectionProxy< RooCollection_t >::add ( const RooAbsArg var,
bool  valueServer,
bool  shapeServer,
bool  silent 
)

Overloaded RooCollection_t::add() method insert object into set and registers object as server to owner with given value and shape dirty flag propagation requests.

Definition at line 140 of file RooCollectionProxy.h.

◆ add() [3/5]

template<class RooCollection_t >
bool RooAbsCollection::add ( const RooAbsArg var,
Bool_t  silent = kFALSE 
)

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).

Definition at line 112 of file RooAbsCollection.cxx.

◆ add() [4/5]

template<class RooCollection_t >
bool RooAbsCollection::add ( const RooAbsCollection list,
bool  silent = kFALSE 
)
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() [5/5]

template<class RooCollection_t >
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/3]

template<class RooCollection_t >
RooAbsArg * RooCollectionProxy< RooCollection_t >::addClone ( const RooAbsArg var,
bool  silent = false 
)
override

Overloaded RooCollection_t::addClone() method insert clone of object into owning set and registers cloned object as server to owner with default value and shape dirty flag propagation.

Definition at line 172 of file RooCollectionProxy.h.

◆ addClone() [2/3]

template<class RooCollection_t >
RooAbsCollection::addClone ( const RooAbsArg var,
Bool_t  silent = kFALSE 
)

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.

Definition at line 115 of file RooAbsCollection.cxx.

◆ addClone() [3/3]

template<class RooCollection_t >
void RooAbsCollection::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.

Definition at line 139 of file RooAbsCollection.cxx.

◆ addOwned() [1/5]

template<class RooCollection_t >
bool RooAbsCollection::addOwned ( const RooAbsCollection list,
bool  silent = false 
)

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()

Definition at line 137 of file RooAbsCollection.cxx.

◆ addOwned() [2/5]

template<class RooCollection_t >
bool RooCollectionProxy< RooCollection_t >::addOwned ( RooAbsArg var,
bool  silent = false 
)
override

Overloaded RooCollection_t::addOwned() method insert object into owning set and registers object as server to owner with default value and shape dirty flag propagation.

Definition at line 156 of file RooCollectionProxy.h.

◆ addOwned() [3/5]

template<class RooCollection_t >
RooAbsCollection::addOwned ( RooAbsArg var,
Bool_t  silent = kFALSE 
)

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.

Definition at line 113 of file RooAbsCollection.cxx.

◆ addOwned() [4/5]

template<class RooCollection_t >
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 138 of file RooAbsCollection.cxx.

◆ addOwned() [5/5]

template<class RooCollection_t >
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 114 of file RooAbsCollection.cxx.

◆ changePointer()

template<class RooCollection_t >
bool RooCollectionProxy< RooCollection_t >::changePointer ( const RooAbsCollection newServerList,
bool  nameChange = false,
bool  factoryInitMode = false 
)
overrideprivatevirtual

Process server change operation on owner.

Replace elements in set with equally named objects in 'newServerList'

Implements RooAbsProxy.

Definition at line 235 of file RooCollectionProxy.h.

◆ checkValid()

template<class RooCollection_t >
void RooCollectionProxy< RooCollection_t >::checkValid ( ) const
inlineprivate

Definition at line 122 of file RooCollectionProxy.h.

◆ Class()

template<class RooCollection_t >
static TClass * RooCollectionProxy< RooCollection_t >::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

template<class RooCollection_t >
static const char * RooCollectionProxy< RooCollection_t >::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

template<class RooCollection_t >
static Version_t RooCollectionProxy< RooCollection_t >::Class_Version ( )
inlinestatic
Returns
Version of this class

Definition at line 131 of file RooCollectionProxy.h.

◆ DeclFileName()

template<class RooCollection_t >
static const char * RooCollectionProxy< RooCollection_t >::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 131 of file RooCollectionProxy.h.

◆ IsA()

template<class RooCollection_t >
TClass * RooCollectionProxy< RooCollection_t >::IsA ( ) const
inlineoverridevirtual
Returns
TClass describing current object

Reimplemented from RooAbsProxy.

Definition at line 131 of file RooCollectionProxy.h.

◆ name()

template<class RooCollection_t >
const char * RooCollectionProxy< RooCollection_t >::name ( ) const
inlineoverridevirtual

Reimplemented from RooAbsProxy.

Definition at line 69 of file RooCollectionProxy.h.

◆ operator=()

template<class RooCollection_t >
RooCollectionProxy & RooCollectionProxy< RooCollection_t >::operator= ( const RooCollection_t other)
inline

Assign values of arguments on other set to arguments in this set.

Definition at line 108 of file RooCollectionProxy.h.

◆ print()

template<class RooCollection_t >
void RooCollectionProxy< RooCollection_t >::print ( std::ostream &  os,
bool  addContents = false 
) const
overridevirtual

Printing name of proxy on ostream.

If addContents is true also print names of objects in set

Reimplemented from RooAbsProxy.

Definition at line 264 of file RooCollectionProxy.h.

◆ remove() [1/2]

template<class RooCollection_t >
bool RooCollectionProxy< RooCollection_t >::remove ( const RooAbsArg var,
bool  silent = false,
bool  matchByNameOnly = false 
)
override

Remove object 'var' from set and deregister 'var' as server to owner.

Definition at line 203 of file RooCollectionProxy.h.

◆ remove() [2/2]

template<class RooCollection_t >
bool RooCollectionProxy< RooCollection_t >::remove ( const RooAbsCollection list,
bool  silent = false,
bool  matchByNameOnly = false 
)
inline

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

and remove each argument as server to owner

Definition at line 94 of file RooCollectionProxy.h.

◆ removeAll()

template<class RooCollection_t >
void RooCollectionProxy< RooCollection_t >::removeAll
override

Remove all argument inset using remove(const RooAbsArg&).

and remove each argument as server to owner

Definition at line 217 of file RooCollectionProxy.h.

◆ replace()

template<class RooCollection_t >
bool RooCollectionProxy< RooCollection_t >::replace ( const RooAbsArg var1,
const RooAbsArg var2 
)
override

Replace object 'var1' in set with 'var2'.

Deregister var1 as server from owner and register var2 as server to owner with default value and shape dirty propagation flags

Definition at line 188 of file RooCollectionProxy.h.

◆ Streamer()

template<class RooCollection_t >
void RooCollectionProxy< RooCollection_t >::Streamer ( TBuffer )
overridevirtual

Reimplemented from RooAbsProxy.

◆ StreamerNVirtual()

template<class RooCollection_t >
void RooCollectionProxy< RooCollection_t >::StreamerNVirtual ( TBuffer ClassDef_StreamerNVirtual_b)
inline

Definition at line 131 of file RooCollectionProxy.h.

Member Data Documentation

◆ _defShapeServer

template<class RooCollection_t >
bool RooCollectionProxy< RooCollection_t >::_defShapeServer = false
private

Definition at line 117 of file RooCollectionProxy.h.

◆ _defValueServer

template<class RooCollection_t >
bool RooCollectionProxy< RooCollection_t >::_defValueServer = false
private

Definition at line 116 of file RooCollectionProxy.h.

◆ _owner

template<class RooCollection_t >
RooAbsArg* RooCollectionProxy< RooCollection_t >::_owner = nullptr
private

Definition at line 115 of file RooCollectionProxy.h.


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