Integrate 2D histo


a simple question: How to integrate a TH2D histogram? I try
histo->Integral(1,10,1,10) but get 0.

I thought one could do
Integral(binx1,binx2,biny1,biny2) but that does not seem to be right?


Could you send the shortest possible RUNNING example showing your problem?
and also identify your version of ROOT?


I am just doing it on the command line. I am using Root version 5.14.

I have a 2D histogram in a root-file, and draw it. Then I try to integrate.

If I just do
I get the total amount of entries. But if I try to specify binx1, binx2, biny1, biny2, I get 0.

Could the reason be the way the histogram is drawn? It seems that if I draw with the box option I do manage to integrate?
El_EtaPt_notmatched_prim_su3_box.C (247 KB)
El_EtaPt_notmatched_su3.C (310 KB)

I do not see any call to TH1::Integral in your scripts.
When I call Integral from the command line, I do not see any problem.

Root [2] hEl_EtaPt_notmatched_scaled.Integral() (const Double_t)5.23392441060029432e+03 Root [3] hEl_EtaPt_notmatched_scaled.Integral(1,12,1,12) (const Double_t)2.63054640000000139e+00 Root [4]

Root [3] hEl_EtaPt_notmatched_prim_scaled.Integral() (const Double_t)6.65378039000001081e+02 Root [4] hEl_EtaPt_notmatched_prim_scaled.Integral(1,12,1,12) (const Double_t)5.63688300000000031e-01