Problem with ProjectionX/Y Function

Hi,

I have a two dimensional histogram that I create using the ratio funtion (using 2 2D hists as arguments). The values in the 2D ratio hist are always < or =1 (they are efficiencies). I then get a ID profile by doing:

TH1D * proj_1 = h_Ratio1->ProjectionY(“proj_1”, 1,max," ");

This gives me the right shape but the values on the Y axis are no longer less than 1, it seems that the projection funtion is summing all the values in my bins 1 to max but not then dividing by the number of bins. Is this a bug? How can I get a 1D projection of a 2D hist and it gives me the average values of the bins rather than the totals?

Thanks, Claire

Hello,

if you want the average values and not the global sum, you have to project on a TProfile, by using TH2::ProfileY

Cheers

Lorenzo