The fill options must be set in the function and not the RooPlot which is just a container of plowable objects.
So you should pass the fill color and style in the RooAbsPdf::plotOn command. You must also indicate that you want to plot the RooAbsPdf with the option “F”. At the end it will be plotted as a RooCurve, which his a TGraph and in order to get a filled Graph you need to use the drawing option “F”
This is a known issue when making filled region of TGraph’curves. The filled region is obtained from the first and last point of the curve.
An alternative is instead of using the option “F” is to use the option “B”. In that case you might need to increase the number of function sampling point by decreasing the default precision. You could do in this case:
I have tried to just plot the original function and then plot it again with the ranges and (“B”) as you suggest. The problem I am seeing is that the ranged function has a higher Y value than the original. This should not be the case. Just because I fill in a given range it should not affect the count number, right?
I defined the range by setting the range on my measured RooRealVar mes. Frame is also defined using mes.
So I found a comment in a forum about PDF normalisation and since they always default to normalise to 1 it caused the ranged PDF to be larger than the original. I integrated the range on the original PDF and set the new PDF to have that as its normalization value.