According to the documentation, option “A” in THnSparse::Projection
does:
- “A” ranges of the taget axes will be ignored.
However, it does not appear to do anything; the projected histogram is truncated just as before. Am I missing something? Demonstration follows.
I have a THnSparse with 10,897,521 entries and axis 2 has a range from -12 to 12:
In [5]: htest.GetAxis(2).GetXmin(), htest.GetAxis(2).GetXmax()
Out[5]: (-12.0, 12.0)
In [6]: htest.GetEntries()
Out[6]: 10897521.0
If I restrict the range of axis 2 and project, I get the expected result (reduced entries):
In [4]: htest.GetAxis(2).SetRangeUser(3, 4)
In [5]: hproj = htest.Projection(1)
In [6]: hproj.GetEntries()
Out[6]: 2652305.0
However, I get the same result even if I tell it to ignore the axis range with option 'A'
:
In [8]: htest.Projection(1, 'A').GetEntries()
Out[8]: 2652305.0
FYI, without setting the axis range, Projection
appears to work as expected:
In [4]: hproj = htest.Projection(1)
In [5]: hproj.GetEntries()
Out[5]: 10897521.0
ROOT Version: 6.19/01
Platform: macOS
Compiler: Not Provided