RooFit: RooRealVar::plotMin(), etc.

From: Arthur E. Snyder <snyder_at_slac.stanford.edu>
Date: Mon, 8 Sep 2008 11:44:36 -0700

I have a problem that |plotMin| and |plotMax| to not return me min and max of a |RooRealVar|:

Code is:

#include "rootLib/RooMapMaker.hh"
TH2D* convolTest() {

   RooRealVar x("x","x",0.0,-25.0,25.0);    RooRealVar xmean("xmean","xmean",0.0,-100.0,100.0);

   Int_t nx=x.getPlotBins();
   Double_t xmin=x.getPlotMin();
   Double_t xmax=x.getPlotMax();

   cout << "nx:" << nx
        << " xmin:" << xmin
        << " xmax:" << xmax
        << endl;


   RooRealVar s0("s0","s0",1.0,0.0,10.0);    RooRealVar s1("s1","s1",1.0.0,-10.0,10.0);    RooFormulaVar err
     ("sigma","sigma","@0+@1*sqrt(@2)",RooArgList(s0,s1,xmean));

   cout << "err(1):" << err.getVal() << endl;

   RooGaussian G("G","G",x,xmean,err);

   RooPlot* plot=x.frame();
   G.plotOn(plot,RooFit::LineColor(2));
   plot->Draw();

   xmean.setVal(10);
   cout << "err(2):" << err.getVal() << endl;

   G.plotOn(plot,RooFit::LineColor(3));
   plot->Draw();

   RooMapMaker* maker=new RooMapMaker("GMap","GMap",G,xmean,x);

   return maker->map();

}

Running this macro I get:

root [0] .L convolTest.C
root [1] convolTest()
nx:100 xmin:0 xmax:0

and yet the plot has the range specified (-25->+25):

see http:/www.slac.stanford.edu/~snyder/convolTest.gif

--so why don't |plotMin()| and |plotMax()| work?

--and how do I get the plot range I specified in constructor for the
|RooRealVar|?

A.E. Snyder, Group EC                        \!c*p?/
SLAC Mail Stop #95                          ((.   .))
Box 4349                                        |
Stanford, Ca, USA, 94309                      '\|/`
e-mail:snyder_at_slac.stanford.edu                 o
phone:650-926-2701                              _
http://www.slac.stanford.edu/~snyder          BaBar
FAX:650-926-2657                          Collaboration
Received on Mon Sep 08 2008 - 20:44:43 CEST

This archive was generated by hypermail 2.2.0 : Tue Sep 09 2008 - 05:50:03 CEST