Re: Normalizing and dividing the same variable from two different MCs

From: Arthur E. Snyder <snyder_at_slac.stanford.edu>
Date: Thu, 23 Apr 2009 12:29:11 -0700


Should you do the sumw2's before you divide or do anything else? I think so ..

I think you need to explicit normalize each histogram to get what I thing you want.

h1->Scale(1/h1->Integral());

same for h2

then divided.

This will give you normalized h2 divided by normalized h1, if that's what you want.

-Art S.

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



On Thu, 23 Apr 2009, Kadir Ocalan wrote:

>
> *
>
> Hello ROOT Experts,
>
> I would like to normalize and obtain the "the normalized ratio" of the same variable from two different MCs. For that, I issue the following script:
>
> TH1::AddDirectory(kFALSE);
>
> TFile *f1 = TFile::Open("file1.root");
>
> TFile *f2 = TFile::Open("file2.root");
>
> TH1 *h1 = (TH1*)f1->Get("var1");
>
> TH1 *h2 = (TH1*)f2->Get("var1");
>
> h1->Divide(h2);
>
> h1->Sumw2();
>
> h2->Sumw2();
>
> h1->DrawNormalized();
>
> The problem is that the ratio plot turns out to be absolute ratio rather than normalized one. Can you please assist in finding the right scripts for that kind of plots (Maybe something very basic)? The ROOT version that i use is 5.17.
>
> Best, Kadir
>
Received on Thu Apr 23 2009 - 21:29:17 CEST

This archive was generated by hypermail 2.2.0 : Thu Apr 23 2009 - 23:50:02 CEST