Hi all,
I have been trying to divide, in a for loop, two 1D histograms in the following way:
these are the 1D histograms filled in the for loop:
TH1D *H1[const_size];
TH1D *H2[const_size];
TH1D *ratio[const_size];
Inside the for loop:
[...]
ratio[i] = (TH1D*)H2[i]->Clone(Form("ratio_%d",i));
ratio[i]->Divide(H1[i]));
ratio[i]->SetTitle(Form("ratio_%d", i));
ratio[i]->Write(Form("ratio_%d", i));
Assuming that this is the right way to proceed (is it?), I do not know why, it keeps on plotting on the Y axis the ratio value times ** 10^{-9}**, which is the Y order of magnitude of both H1 and H2 histograms.
I also picked up two histograms from H1 and H2 to divide them outside the for loop and indeed that 10^{-9} does not show up and the ratio value is correct.
What am I doing wrong in the for loop?
Moreover, what is the difference in doing:
ratio[i]->Divide(H1[i]));
and
ratio[i]->Divide(H1[i], H2[i]));
?
Thanks in advance!