TH2::ProjectionY("",bin,bin+1) problem

Dear experts,
the attached simple macro shows a problem with TH2::ProjectionY("",bin,bin+1).
Namely, the number of entries of TH2 is smaller than the sum of entries of the
Projections in Y (or X). h2proj1.C (682 Bytes)

Could you please suggest a solution?
Thanks and best regards,

for (int i=0;i<n;i++) { hbins[i] = h2->ProjectionY(Form("bin%d",i),i+1,i+1); } 

See: TH2::ProfileY

The projection is made from the channels along the X axis ranging from firstxbin to lastxbin INCLUDED.

Dear Wile, thank you very much!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.