-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Is your feature request related to a problem? Please describe.
I wanted to fit my data with a uniform distribution (I know the simple analytical answer), but it turned out that it's not possible to set bounds for it. RooUniform creates a uniform distribution for the whole range of its variable (or many variables in the case of many dimensions).
On the forum @lmoneta writes in 2015: "You cannot really assign weights to a RooUniformPdf." (but probably this has already changed, because I see that it is a subclass of RooAbsPdf, like RooGaussian).
Describe the solution you'd like
Change the constructor to
RooUniform(const char *name, const char *title, RooAbsReal &x_low, RooAbsReal &x_up)
One- and multidimensional uniform distributions should become separate (like RooGaussian and RooMultiVarGaussian (note also a spurious line break in its docs)). Probably there is even no need for the multidimensional uniform distribution, since it's just a product of one-dimensional pdfs (if you don't model complicated support shapes).
The uniform (rectangular) distribution is just one of pdfs (see Wikipedia, Continuous uniform distribution). It is a normal pdf, and its parameters are its lower and upper bounds. They should be set like other pdf parameters in RooFit.
Describe alternatives you've considered
I think that there are no alternatives. No reason to model this with step functions or histograms. The uniform distribution is a simple and pretty basic probability distribution.
Additional context
I asked about this on the forum, but now as I better understand RooFit and as I see no answers for RooUniform, I think this is the only solution.
P.S. There is a spurious line break in RooUniform class description.