TProfile::Add

From: Margar Simonyan <margar.simonyan_at_gmail.com>
Date: Wed, 7 Apr 2010 14:54:05 +0200


Hello

I don't understand what TProfile::Add is doing. According to the documentation it calls TProfileHelper::Add, but I don't see TProfileHelper in the documentation. I am expecting to get sum of bin contents but I don't.

TProfile * h1 = new TProfile("h1", "h1", 10, 0, 10) TProfile * h2 = new TProfile("h2", "h2", 10, 0, 10) h1.Fill(5, 1)
h2.Fill(5, 3)
TProfile * clone = (TProfile *)h1->Clone("clone") clone.Add(h1, h2, -1, 1)
clone.GetBinContent(6) returns 1, why?

another attempt

h1->ResetBit(TH1::kIsAverage)
h2->ResetBit(TH1::kIsAverage)
clone.Add(h1, h2, -1, 1)
clone.GetBinContent(6), the same

one more try
clone->TH1D::Add((TH1D *)h1, (TH1D *)h2, -1, 1) clone.GetBinContent(6), no luck

Could you please explain what is happening.

Thanks,

       Margar

P.S. I tried with ROOT 5.26 and 5.22 Received on Wed Apr 07 2010 - 14:54:12 CEST

This archive was generated by hypermail 2.2.0 : Wed Apr 07 2010 - 17:50:02 CEST