Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task done
AlkaidCheng opened this issue Sep 22, 2022 · 0 comments · Fixed by #11417
Closed
1 task done

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

AlkaidCheng opened this issue Sep 22, 2022 · 0 comments · Fixed by #11417

Comments

@AlkaidCheng
Copy link

AlkaidCheng commented Sep 22, 2022

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

@guitargeek guitargeek self-assigned this Sep 22, 2022
guitargeek added a commit to guitargeek/root that referenced this issue Sep 22, 2022
When overriding `SetName` in RooDataHist and RooDataSet, we need to use
the function from the direct base class RooAbsData, because this one is
already overriding the TNamed function to deal with the RooNameReg
correctly.

Closes root-project#11414.
guitargeek added a commit that referenced this issue Sep 23, 2022
When overriding `SetName` in RooDataHist and RooDataSet, we need to use
the function from the direct base class RooAbsData, because this one is
already overriding the TNamed function to deal with the RooNameReg
correctly.

Closes #11414.
guitargeek added a commit to guitargeek/root that referenced this issue Sep 23, 2022
When overriding `SetName` in RooDataHist and RooDataSet, we need to use
the function from the direct base class RooAbsData, because this one is
already overriding the TNamed function to deal with the RooNameReg
correctly.

Closes root-project#11414.
@guitargeek guitargeek added this to Issues in Fixed in 6.28/00 via automation Sep 23, 2022
@guitargeek guitargeek added this to Issues in Fixed in 6.26/08 via automation Sep 23, 2022
guitargeek added a commit that referenced this issue Sep 24, 2022
When overriding `SetName` in RooDataHist and RooDataSet, we need to use
the function from the direct base class RooAbsData, because this one is
already overriding the TNamed function to deal with the RooNameReg
correctly.

Closes #11414.
vgvassilev pushed a commit to vgvassilev/root that referenced this issue Oct 1, 2022
When overriding `SetName` in RooDataHist and RooDataSet, we need to use
the function from the direct base class RooAbsData, because this one is
already overriding the TNamed function to deal with the RooNameReg
correctly.

Closes root-project#11414.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants