When I use plotOn(frame) I get a nice scan on the variable on the x axis but is there a way to find out which values of x are actually evaluated?
Related to this, what does the following mean (from RooAbsReal)?
Precision(Double_t eps) – Control precision of drawn curve w.r.t to scale of plot, default is 1e-3. Higher precision will result in more and more densely spaced curve points
Does this mean that by default there will be a thousand points?
A plotOn() call will initially scan a function at 100 points (or whatever the default number of bins is associated with a variable). Next, it will evaluate the function at each midpoint between this scan.
If the position of a straight line that connects the existing points deviates more than a certain value from the actual value of the function, that point is added to the curve, and the division procedure is recursed.
The tolerance to decide on a subdivision is ‘Precision()’ times the scale of the Y axis on the plot. Thus the default aim is to construct a curve which follows the function with a precision of 1e-3 relative to the Y axis scale.
Sometimes a higher precision is desirable (especially if you want to
be able to zoom in a lot of a plot without apparent loss of precision),
but also a Precision(1) call can be useful, e.g. when you plot an expensive
function like a profile likelihood. (One can further decrease the minimum number of calls if desired by choosing a coarser binning in the plot,
or choose to speed up the profile likelihood calculation by adding a NumCPU(n) call to the construction of the likelihood object of which the
profile is calculated.
PS: In ROOT 5.25.02 you can add a ShowProgress() argument to plotOn, which will print a ‘.’ on stdout for each function evaluation.
Thanks for your explanation. I would actually want more than a ‘.’ about the fit, namely the actual value of x. There is no way to obtain this? I need this because I get an anomalous fit result for a few values out of the whole range and it seems that it is very specific to that particular value.
You can retrieve the RooCurve object from the RooPlot after you have created it through getCurve() [ no argument required if there is only one curve in the plot ]. As a RooCurve inherits from TGraph you can use
that interface to get the list of (x,y) points it contains (use e.g. GetPoint() or GetX()).