Re: TPaveStats and Divide (Users Guide)

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Sun, 20 Apr 2008 12:41:15 +0200


see: http://root.cern.ch/root/doc/RootDoc.html and try to play as much as possible with the tutorials at $ROOTSYS/tutorials.

Rene Brun

Amrendra Narayan wrote:
> Hi,
> I am a beginner in ROOT, and have earlier done computing in FORTRAN. I
> had started with PAW, but after learning the preliminaries in it, my
> advisor is pushing me to learn ROOT, as that is what everybody uses now.
> Since I have not worked with C++, so am having a bit of trouble
> understanding the general tutorial uploaded on the website.
> Can you suggest me a way out, is there a book for me to start with!
> or can somebody send me an example file which is good for someone to
> understand the very beginning.
>
> Thanks in Anticipation.
> Cheers,
> Amrendra
>
> On Sat, Apr 19, 2008 at 5:55 PM, Manuel Mussini
> <Manuel.Mussini_at_bo.infn.it <mailto:Manuel.Mussini_at_bo.infn.it>> wrote:
>
> Great! It works!
>
> Thanks!
>
> Bye...
>
> > -----Original Message-----
> > From: owner-roottalk_at_lxbuild091.cern.ch
> <mailto:owner-roottalk_at_lxbuild091.cern.ch> [mailto:owner-
> <mailto:owner->
> > roottalk_at_lxbuild091.cern.ch
> <mailto:roottalk_at_lxbuild091.cern.ch>] On Behalf Of Rene Brun
> > Sent: Saturday, April 19, 2008 14:48
> > To: Manuel Mussini
> > Cc: roottalk_at_lxbuild091.cern.ch <mailto:roottalk_at_lxbuild091.cern.ch>
> > Subject: Re: [ROOT] TPaveStats and Divide
> >
> > Do:
> >
> > fMCVerticesCanvas = new TCanvas("MCVerticesCanvas", "MC
> Vertices", 0, 0,
> > 1100, 1100);
> >
> > fMCVerticesCanvas->Divide(2, 2);
> >
> > fMCVerticesCanvas->cd(1);
> >
> > fMCVerticesCanvas->cd(1)->SetLogy();
> >
> > fVerticesClass->Draw();
> >
> > fMCVerticesCanvas->Update();
> > ((TPaveStats
> > *)fVerticesClass->GetListOfFunctions()->FindObject("stats"))-
> > >SetOptStat(1111);
> >
> >
> >
> > Rene
> >
> >
> >
> > Manuel Mussini wrote:
> > >
> > > Hi,
> > >
> > > I have a script that:
> > >
> > > - sets a global style using gStyle->SetOptStat(11)
> > >
> > > - opens a root file
> > >
> > > - gets some TH1D
> > >
> > > - creates a canvas
> > >
> > > - divides the canvas in 4 (2x2)
> > >
> > > - draws a histo in each subcanvas
> > >
> > > - saves the canvas in a eps file
> > >
> > > Now the problem! How to change the OptStat options only for
> the first
> > > histo?
> > >
> > > I've searched for it on the web site but this solution doesn't
> fix the
> > > problem in my script:
> > >
> > > fMCVerticesCanvas = new TCanvas("MCVerticesCanvas", "MC
> Vertices", 0,
> > > 0, 1100, 1100);
> > >
> > > fMCVerticesCanvas->Divide(2, 2);
> > >
> > > fMCVerticesCanvas->cd(1);
> > >
> > > fMCVerticesCanvas->cd(1)->SetLogy();
> > >
> > > fVerticesClass->Draw();
> > >
> > > ((TPaveStats
> > > *)fVerticesClass->GetListOfFunctions()->FindObject("stats"))-
> > >SetOptStat(1111);
> > >
> > > The tricky point is that if I try this interactively it works!!!
> > >
> > > Running from the script I get:
> > >
> > > Error: illegal pointer to class object
> > >
> (TPaveStats*)fVerticesClass->GetListOfFunctions()->FindObject("stats")
> > > 0x0 638 C:\root\ManuC\THeavyFlavoursAllPlots.C(198)
> > >
> > > I'm running 5.17.02 on WinXP!
> > >
> > > Bye.
> > >
>
>
>
>
>
> --
> Amrendra Narayan
> Graduate Student
> Hilbun Hall, Room # 045 B
> Mississppi State University
> Starkville, MS-39762
> ----------------------------------------------------
> "You know!, 'Bless You' need not be
> preceded by a sneeze" ... GOD
> ----------------------------------------------------
Received on Sun Apr 20 2008 - 12:41:27 CEST

This archive was generated by hypermail 2.2.0 : Sun Apr 20 2008 - 23:50:01 CEST