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. | |
template<class Other_t > | |
RooCollectionProxy (const char *inName, RooAbsArg *owner, const Other_t &other) | |
Copy constructor. | |
~RooCollectionProxy () override | |
virtual bool | add (const RooAbsArg &var, bool silent=false) |
Add the specified argument to list. | |
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. | |
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. | |
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. | |
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 RooAbsArg * | addClone (const RooAbsArg &var, bool silent=false) |
Add a clone of the specified argument to list. | |
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. | |
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. | |
virtual bool | addOwned (const RooAbsCollection &list, bool silent=false) |
for each element in the source collection. | |
virtual bool | addOwned (RooAbsArg &var, bool silent=false) |
Add an argument and transfer the ownership to the collection. | |
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. | |
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. | |
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 . | |
bool | defShapeServer () const |
bool | defValueServer () const |
template<class Other_t > | |
void | initializeAfterIOConstructor (RooAbsArg *owner, const Other_t &other) |
Initializes this RooCollection proxy from another proxy. | |
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. | |
RooCollectionProxy & | operator= (RooCollectionProxy &&other)=delete |
RooCollectionProxy & | operator= (RooCollectionProxy const &other)=delete |
void | print (std::ostream &os, bool addContents=false) const override |
Printing name of proxy on ostream. | |
bool | remove (const RooAbsArg &var, bool silent=false, bool matchByNameOnly=false) override |
Remove object 'var' from set and deregister 'var' as server to owner. | |
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&). | |
void | removeAll () override |
Remove all argument inset using remove(const RooAbsArg&). | |
bool | replace (const RooAbsArg &var1, const RooAbsArg &var2) override |
Replace object 'var1' in set with 'var2'. | |
void | Streamer (TBuffer &) override |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
Public Member Functions inherited from RooAbsProxy | |
RooAbsProxy () | |
Constructor. | |
RooAbsProxy (const char *name, const RooAbsProxy &other) | |
Copy constructor. | |
virtual | ~RooAbsProxy () |
const RooArgSet * | nset () const |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
Static Public Member Functions | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
Static Public Member Functions inherited from RooAbsProxy | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr 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. | |
bool | changePointer (std::unordered_map< RooAbsArg *, RooAbsArg * > const &replacements) override |
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. | |
Protected Attributes inherited from RooAbsProxy | |
RooArgSet * | _nset = nullptr |
! Normalization set to be used for evaluation of RooAbsPdf contents | |
#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 57 of file RooCollectionProxy.h.
|
inlineoverride |
Definition at line 97 of file RooCollectionProxy.h.
bool RooAbsCollection::add | ( | const RooAbsArg & | var, |
bool | silent = false |
||
) |
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 117 of file RooAbsCollection.cxx.
|
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 112 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 189 of file RooCollectionProxy.h.
|
inline |
Add a collection of arguments to this collection by calling add() for each element in the source collection.
Definition at line 148 of file RooAbsCollection.h.
|
inline |
Definition at line 137 of file RooAbsCollection.h.
RooAbsArg * RooAbsCollection::addClone | ( | const RooAbsArg & | var, |
bool | silent = false |
||
) |
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.
Definition at line 129 of file RooAbsCollection.cxx.
|
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 221 of file RooCollectionProxy.h.
void RooAbsCollection::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.
Definition at line 153 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 151 of file RooAbsCollection.cxx.
bool RooAbsCollection::addOwned | ( | RooAbsArg & | var, |
bool | silent = false |
||
) |
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).
Definition at line 124 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 205 of file RooCollectionProxy.h.
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 152 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 128 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 284 of file RooCollectionProxy.h.
|
overrideprivatevirtual |
Implements RooAbsProxy.
Definition at line 309 of file RooCollectionProxy.h.
|
inlineprivate |
Definition at line 171 of file RooCollectionProxy.h.
|
static |
|
static |
|
inlinestaticconstexpr |
Definition at line 180 of file RooCollectionProxy.h.
|
inlinestatic |
Definition at line 180 of file RooCollectionProxy.h.
|
inline |
Definition at line 159 of file RooCollectionProxy.h.
|
inline |
Definition at line 158 of file RooCollectionProxy.h.
|
inline |
Initializes this RooCollection proxy from another proxy.
Should not be considered part of the public interface, only to be used by IO.
Definition at line 69 of file RooCollectionProxy.h.
|
inlineoverridevirtual |
Reimplemented from RooAbsProxy.
Definition at line 180 of file RooCollectionProxy.h.
|
inlineoverridevirtual |
Reimplemented from RooAbsProxy.
Definition at line 103 of file RooCollectionProxy.h.
|
inline |
Assign values of arguments on other set to arguments in this set.
Definition at line 152 of file RooCollectionProxy.h.
|
delete |
|
delete |
|
overridevirtual |
Printing name of proxy on ostream.
If addContents is true also print names of objects in set
Reimplemented from RooAbsProxy.
Definition at line 327 of file RooCollectionProxy.h.
|
override |
Remove object 'var' from set and deregister 'var' as server to owner.
Definition at line 252 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 138 of file RooCollectionProxy.h.
|
override |
Remove all argument inset using remove(const RooAbsArg&).
and remove each argument as server to owner
Definition at line 266 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 237 of file RooCollectionProxy.h.
|
overridevirtual |
Reimplemented from RooAbsProxy.
|
inline |
Definition at line 180 of file RooCollectionProxy.h.
|
private |
Definition at line 164 of file RooCollectionProxy.h.
|
private |
Definition at line 163 of file RooCollectionProxy.h.
|
private |
Definition at line 162 of file RooCollectionProxy.h.