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] Allow to set nbins for RooPlot (or disallow) #7782

Closed
ynikitenko opened this issue Apr 4, 2021 · 1 comment · Fixed by #16085
Closed

[RF] Allow to set nbins for RooPlot (or disallow) #7782

ynikitenko opened this issue Apr 4, 2021 · 1 comment · Fixed by #16085

Comments

@ynikitenko
Copy link

ynikitenko commented Apr 4, 2021

Is your feature request related to a problem? Please describe.

I want to create a frame for a RooFormulaVar. Unfortunately, it doesn't have a method frame(), so I wanted to use a RooPlot constructor to create the frame, and later use the existing plotOn() method of RooFormulaVar.

However, it seems that RooPlot allows setting the number of bins only for RooAbsRealLValue, which is inconsistent. No method to set the number of bins is available. The underlying access to nbins is private.

Describe the solution you'd like

Allow to set the number of bins in all constructors.

Maybe there should be a separate method for that, but it may be dangerous if someone tries to change the number of bins in the middle of processing.

Describe alternatives you've considered

I already decided to use a new RooRealVar instead of RooFormulaVar, but I think that a plot should allow to set the number of bins.

UPD: no, there are no arguments to change the number of bins in plotOn. It seems it can be set only for the Plot.
It looks like I can set the number of bins during plotOn of RooFormulaVar. This is great. However, I think that in this case the number of bins in the constructor should be removed, to reduce code duplication. At least it should be made consistent in all constructors (see no reason for the otherwise, but I don't understand RooFit well yet).

P.S. There is also a typo in the RooPlot class description, "settting".

@ynikitenko
Copy link
Author

It seems that to plot RooFormulaVar is not very straightforward (https://root-forum.cern.ch/t/how-to-plot-a-rooformulavar/26480/2), and in that way it is possible to set the number of bins.
However, I'm not sure how this is related to this feature request (maybe to set the number of bins might be useful for other cases?)

@lmoneta lmoneta self-assigned this Apr 12, 2021
@guitargeek guitargeek changed the title Allow to set nbins for RooPlot (or disallow) [RF] Allow to set nbins for RooPlot (or disallow) Jun 22, 2022
@guitargeek guitargeek assigned guitargeek and unassigned lmoneta Aug 22, 2023
guitargeek added a commit to guitargeek/root that referenced this issue Jul 22, 2024
Closes root-project#7782, making the constructor that doesn't take a
RooAbsRealLValue consistent with the constructors that do.
guitargeek added a commit that referenced this issue Jul 23, 2024
Closes #7782, making the constructor that doesn't take a
RooAbsRealLValue consistent with the constructors that do.
@guitargeek guitargeek added this to the 6.32/02 milestone Jul 23, 2024
guitargeek added a commit to guitargeek/root that referenced this issue Jul 23, 2024
Closes root-project#7782, making the constructor that doesn't take a
RooAbsRealLValue consistent with the constructors that do.
guitargeek added a commit that referenced this issue Jul 23, 2024
Closes #7782, making the constructor that doesn't take a
RooAbsRealLValue consistent with the constructors that do.
@guitargeek guitargeek removed this from the 6.32/02 milestone Jul 24, 2024
@root-project root-project deleted a comment from github-actions bot Jul 24, 2024
silverweed pushed a commit to silverweed/root that referenced this issue Aug 19, 2024
Closes root-project#7782, making the constructor that doesn't take a
RooAbsRealLValue consistent with the constructors that do.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants