-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Labels
Comments
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. |
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
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
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.
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
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".
The text was updated successfully, but these errors were encountered: