# Rooplot contour

Dear experts,
I would like to increase the number of points of a contour plot (default=50). Is this possible?
I’m using the following code:

RooMinimizer m(nll);
RooPlot
cont=m.contour(*w->var(“k_lambda”),*w->var(“k_t”),1,2,3);

Thanks,
Eleonora

@StephanH, can you please take a look? Thanks!

Hi Eleonora,

unfortunately, it’s hard-coded. I will change that, but it will take some time until this appears in the next ROOT release. If you really depend on it, you could test our nightly builds tomorrow or on Wednesday.
Let me know if you need it.

Hi Stephan,
it is not so urgent but it would be really useful! Please let me know when it will be available in a nightly and in which nightly.
Thanks again,
Eleonora

Try (tomorrow)

ssh lxplus7.cern.ch
source /cvmfs/sft-nightlies.cern.ch/lcg/views/dev3/latest/x86_64-centos7-gcc8-opt/setup.sh


and use root to run the fit.

The new function looks like this:

/// Create and draw a TH2 with the error contours in the parameters var1 and var2.
/// \param[in] var1 The first parameter (x axis).
/// \param[in] var2 The second parameter (y axis).
/// \param[in] n1 First contour.
/// \param[in] n2 Optional contour. 0 means don't draw.
/// \param[in] n3 Optional contour. 0 means don't draw.
/// \param[in] n4 Optional contour. 0 means don't draw.
/// \param[in] n5 Optional contour. 0 means don't draw.
/// \param[in] n6 Optional contour. 0 means don't draw.
/// \param[in] npoints Number of points for evaluating the contour.
///
/// Up to six contours can be drawn using the arguments n1 to n6 to request the desired
/// coverage in units of \f$\sigma = n^2 \cdot \mathrm{ErrorDef} \f$.
/// See ROOT::Math::Minimizer::ErrorDef().

RooPlot* RooMinimizer::contour(RooRealVar& var1, RooRealVar& var2,
Double_t n1, Double_t n2, Double_t n3,
Double_t n4, Double_t n5, Double_t n6, unsigned int npoints)


To not break existing code, the number of points has to be the last argument after the six contour definitions. If you don’t need six contours, just set the first two to 1. and 2. (sigma), and set all others to zero.

Hi Stephan,
your root version works on lxplus7 (SL7) but I must use a particular version of root, due to the fact that I’m working with singleHiggs combination(6.04.16-HiggsComb-x86_64-slc6-gcc49-opt)… when I try to use “your root” on the combined workspace it doesn’t find some functions that I need to make the fit.
Do you have any idea to solve my problem?
Thanks,
Eleonora

Hi Eleonora,

I understand your problem, but I cannot help you. We are 6 ROOT versions ahead of your version, and we only have the people to support two versions in parallel (6.14 & 6.16). You could fit, save the fit result, and read this with a new ROOT.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.