Skip to content

[RF] Implement a Pythonisation for RooAbsCollection.addOwned() #8120

@hageboeck

Description

@hageboeck
  • [ x] Checked for duplicates

Describe the bug

Docs
When using addOwned, the collection takes ownership of the object. When called from Python, ownership remains with PyROOT, though, so there's two owners now.

A Pythonisation should be added to avoid this. It should include a call such as:
ROOT.SetOwnership(obj, False)

Expected behavior

Ownership is transferred to the collection.

To Reproduce

Something like

coll = ROOT.RooArgSet()
if True:
   x = ROOT.RooRealVar('x', 'x', -10, 10)
   coll.addOwned(x)
   # Similarly:
   coll.addOwned(ROOT.RooRealVar('y', ...))

# Now should be able to touch x in coll without problems

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions