Hi Arthur,
Thanks for the reply. Your idea of scaling the variable from different MCs before plotting normalized ratio histos really worked here.
If I understood from the plot, there wont be any need for further calling h1.DrawNormalized();. It will enough for me to call h1.Draw(); after scaling.
Is not that so?
Well, i use square root of event weights for the error bars on my plots in order to compare shapes and obtain less uncertinities.
Best,
Kadir
Quoting "Arthur E. Snyder" <snyder_at_slac.stanford.edu>:
> 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 - 23:06:18 CEST
This archive was generated by hypermail 2.2.0 : Fri Apr 24 2009 - 05:50:03 CEST