Re: fit a ntuple plot

From: OKUMURA, Akira <oxon_at_astro.isas.jaxa.jp>
Date: Wed, 15 Sep 2010 15:28:58 -0700


Hello Jeehoon,

> Is there any any to directly fit a ntuple plot?

> I would like to change a x-axis title in a ntuple plot.
> I tried "ntuple->GetXaxis()->SetTitle("my x axis")";
> ,but it didn't work.

You can play with the "htemp" histogram as explained in Suvayu's reply.

> myTNtuple->Draw("var1>>htemp");
> TH1F* histo = (TH1F*)gPad->GetPrimitive("htemp");

Set the X title of "htemp", and fit this histogram with any functions you like.

You can find many nice examples under $ROOTSYS/tutorials. They were really useful when I started using ROOT 5 years ago.

Two of them;
$ROOTSYS/tutorials/tree/cernstaff.C
$ROOTSYS/tutorials/tree/ntuple1.C
use the ">>" trick inside the scripts. It will be good examples for you.

Regards,

--
OKUMURA, Akira oxon@{astro.isas.jaxa.jp,stanford.edu}
Institute of Space and Astronautical Science (ISAS/JAXA)
Now at KIPAC/SLAC/Stanford
Varian Physics #306
382 Via Pueblo Mall, MC 406 Stanford, CA94305
TEL 650-736-0971/FAX 650-724-5065
Skype : okumura.akira

On 2010/09/15, at 12:29, <jhkim_at_physics.utexas.edu> <jhkim_at_physics.utexas.edu> wrote:


> Hi,
>
> Is there any any to directly fit a ntuple plot?
>
> Best,
>
> JK
>
Received on Thu Sep 16 2010 - 00:29:17 CEST

This archive was generated by hypermail 2.2.0 : Thu Sep 16 2010 - 05:50:01 CEST