Skip to content

[RF] Renaming dataset fails when total number of dataset in workspace reached 10 #11414

@AlkaidCheng

Description

@AlkaidCheng
  • Checked for duplicates

Describe the bug

If the number of dataset in a workspace is larger than or equal to 10. Renaming a dataset inside the workspace will not work in the sense that calling ws.data(<new_dataset_name>) will return nil and calling ws.data(<old_dataset_name>) will return the correct dataset but with the name changed.

To Reproduce

import ROOT

ROOT.RooMsgService.instance().getStream(1).removeTopic(ROOT.RooFit.ObjectHandling)

ws = ROOT.RooWorkspace()
ws.factory("Gaussian::pdf(x[0,10],mu[4,0,10],sigma[1.0,0.1,10.0])")
pdf = ws.pdf("pdf")
x = ws.var("x")
n_dataset = 10
for i in range(n_dataset):
	dataset= pdf.generate(ROOT.RooArgSet(x), ROOT.RooFit.NumEvents(1000), ROOT.RooFit.Name(f"asimovData_{i}"))
	ws.Import(dataset)
ws.data("asimovData_0").SetName("combData")
# this gives nil
print(ws.data("combData"))
# this gives "combData"
print(ws.data("asimovData_0").GetName())

If n_dataset is changed to 9, ws.data("combData") will give the correct dataset and ws.data("asimovData_0") will give nil

Setup

ROOT 6.24, 6.26 (from LCG)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions