root2yoda always divides by bin width
The yoda2root
script always divides the content by the width of the bin, regardless of whether the flag is set.
Originally reported as #21 (closed), closed without resolution.
Version: 1.9.7, as contained in the hepstore/rivet:3.1.7
Docker image.
Investigation:
I cannot find why this is happening, just as @agbuckley did not two years ago. yoda2root
appears to collect the command-line argument and pass it correctly to to_root
, which passes it to _H1toTH1D
, which passes it to toTH1D
, which uses it to determine how to scale the bin contents.
Nonetheless, it is happening and it is a bug, and one that appears to have persisted for at least 4 years.
Reproducer:
Consider test.yoda
with the following contents:
BEGIN YODA_HISTO1D_V2 /test/test
Path: /test/test
Title:
Type: Histo1D
---
# Mean: 1.099526e+01
# Area: 4.893005e+02
# ID ID sumw sumw2 sumwx sumwx2 numEntries
Total Total 4.893005e+02 3.069697e+00 5.379985e+03 7.123431e+04 8.443100e+04
Underflow Underflow 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
Overflow Overflow 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
# xlow xhigh sumw sumw2 sumwx sumwx2 numEntries
0.000000e+00 5.000000e+00 2.228550e+01 1.419540e-01 9.291495e+01 4.008877e+02 3.943000e+03
5.000000e+00 1.000000e+01 2.166911e+02 1.372746e+00 1.663797e+03 1.318626e+04 3.708300e+04
1.000000e+01 1.500000e+01 1.718931e+02 1.079517e+00 2.099302e+03 2.597814e+04 2.965000e+04
1.500000e+01 2.000000e+01 5.475423e+01 3.281875e-01 9.265233e+02 1.578354e+04 9.613000e+03
2.000000e+01 2.500000e+01 1.513190e+01 9.649349e-02 3.333429e+02 7.373635e+03 2.635000e+03
2.500000e+01 3.000000e+01 5.012980e+00 2.971554e-02 1.358567e+02 3.691511e+03 8.840000e+02
3.000000e+01 3.500000e+01 2.044720e+00 1.210848e-02 6.571328e+01 2.115989e+03 3.580000e+02
3.500000e+01 4.000000e+01 7.585200e-01 4.507126e-03 2.822527e+01 1.051815e+03 1.390000e+02
4.000000e+01 4.500000e+01 3.721800e-01 2.291829e-03 1.552338e+01 6.480890e+02 6.200000e+01
4.500000e+01 5.000000e+01 1.519300e-01 8.974443e-04 7.202579e+00 3.417096e+02 2.700000e+01
5.000000e+01 5.500000e+01 9.080000e-02 5.400492e-04 4.740410e+00 2.476094e+02 1.800000e+01
5.500000e+01 6.000000e+01 6.410000e-02 4.211648e-04 3.645262e+00 2.073602e+02 1.100000e+01
6.000000e+01 6.500000e+01 3.806000e-02 2.525634e-04 2.396734e+00 1.510156e+02 6.000000e+00
6.500000e+01 7.000000e+01 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
7.000000e+01 7.500000e+01 1.134000e-02 6.446600e-05 8.022378e-01 5.675396e+01 2.000000e+00
7.500000e+01 8.000000e+01 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
8.000000e+01 8.500000e+01 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
8.500000e+01 9.000000e+01 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
9.000000e+01 9.500000e+01 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
9.500000e+01 1.000000e+02 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
END YODA_HISTO1D_V2
I expect the first bin to have a height of 22.3, the second bin 216.7, etc. I then call
yoda2root test.yoda test.root
from the command line. Browsing test.root
, I find the first bin has a height of 4.46, the second bin 43.34, etc.
The result is the same if I call yoda2root test.yoda test.root -d
.