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) |
RooAbsArg * | 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. More... | |
virtual RooAbsArg * | addClone (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... | |
TClass * | IsA () const override |
const char * | name () const override |
RooCollectionProxy & | operator= (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) |
![]() | |
RooAbsProxy () | |
Constructor. More... | |
RooAbsProxy (const char *name, const RooAbsProxy &other) | |
Copy constructor. More... | |
virtual | ~RooAbsProxy () |
virtual TClass * | IsA () const |
virtual const char * | name () const |
const RooArgSet * | nset () 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 TClass * | Class () |
static const char * | Class_Name () |
static Version_t | Class_Version () |
static const char * | DeclFileName () |
![]() | |
static TClass * | Class () |
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 | |
![]() | |
virtual void | changeNormSet (const RooArgSet *newNormSet) |
Destructor. More... | |
virtual Bool_t | changePointer (const RooAbsCollection &newServerSet, Bool_t nameChange=kFALSE, Bool_t factoryInitMode=kFALSE)=0 |
![]() | |
RooArgSet * | _nset = nullptr |
! Normalization set to be used for evaluation of RooAbsPdf contents More... | |
#include <RooCollectionProxy.h>
|
inline |
Definition at line 43 of file RooCollectionProxy.h.
|
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.
|
inline |
Copy constructor.
Definition at line 56 of file RooCollectionProxy.h.
|
inlineoverride |
Definition at line 63 of file RooCollectionProxy.h.
|
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.
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.
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.
|
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.
|
inline |
Definition at line 123 of file RooAbsCollection.h.
|
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.
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.
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.
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.
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:
std::move
the input collection and use RooAbsCollection::addOwned(RooAbsCollection&&, bool) (preferred)Definition at line 137 of file RooAbsCollection.cxx.
|
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.
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).
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.
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.
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.
|
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.
|
inlineprivate |
Definition at line 122 of file RooCollectionProxy.h.
|
static |
|
static |
|
inlinestatic |
Definition at line 131 of file RooCollectionProxy.h.
|
inlinestatic |
Definition at line 131 of file RooCollectionProxy.h.
|
inlineoverridevirtual |
Reimplemented from RooAbsProxy.
Definition at line 131 of file RooCollectionProxy.h.
|
inlineoverridevirtual |
Reimplemented from RooAbsProxy.
Definition at line 69 of file RooCollectionProxy.h.
|
inline |
Assign values of arguments on other set to arguments in this set.
Definition at line 108 of file RooCollectionProxy.h.
|
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.
|
override |
Remove object 'var' from set and deregister 'var' as server to owner.
Definition at line 203 of file RooCollectionProxy.h.
|
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.
|
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.
|
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.
|
overridevirtual |
Reimplemented from RooAbsProxy.
|
inline |
Definition at line 131 of file RooCollectionProxy.h.
|
private |
Definition at line 117 of file RooCollectionProxy.h.
|
private |
Definition at line 116 of file RooCollectionProxy.h.
|
private |
Definition at line 115 of file RooCollectionProxy.h.