How to include underflow and overflow bins in TH2 Projection?

Hi,

I am using TH2 ProjectionX and trying to include underflow and overflow bins of X in the projected TH1D. But I failed to do this and wondered if it is possible to do that.

For example, I have 2D histogram h12, then
TH1D * h = h12->ProjectionX(“h”, 2, 5);
In the projected 1D histogram h, I want to include the underflow and overflow bins of X because I need to use the mean and error of h. I have tried to set TH1::StatOverflows() and TH2::StatOverflows(), but it does not work.

The root version I am using is 6.02.

Thanks.

Jian

It is my misunderstanding. It is resolved. And actually the underflow and overflow bins are included.