I noticed this strange (to me) behaviour. I wonder whether it’s a bug or something I’m not understanding,
I declare 3 TH1 with identical # of bins and range. I fill the first two and then call TH1::Divide() on the 3rd to put into it the divison bin by bin of the first 2.
Everything fine.
Then I want to normalize it and call TH1::Scale().
After this operation the # of bins is double and the range extented to twice the previous value (in other words the bin size is unchanged).
Of course if I scale the orignal 2 histos the issue is not there, I observe it only on histos which I fill with Divide().
I find it pretty peculiar but maybe there’s something I’m not understanding
Thank you
Davide
thanks for your answer.
ok, I investigated a little further and I have to say it’s not related to the use of TH1::Divide() but of TAxis::SetTimeDisplay();
this code should clarify what I mean.
thank you, it works.
though I don’t understand how a TAxis call can change the TH1, I though TAxis is only related to how the TH1 is displayed…
Anyhow, thank you
Davide
TAxis::SetTimeDisplay does not change itself the number of bins. This function indicates that the axis will be in time units. Later on (eg when calling TH1::Divide or any other function setting the bin contents) when the last bin is touched and it turns out that the end of the bin is above the latest nice time value, the system will automatically double the number of bins such that the last value is nicely within the time range. Of course, in your example, this should not happen, it is a matter of optimisation of many tiny cases like this example that makes our life (and yours too : more difficult.
there is one thing that would make everybody’s life much easier:
if every support service was so fast and effective like root’s one!
thank again
davide