IRF Metric's internal histograms have unexpected variances
e.g. for AngularResIRFMetric
:
a1 = ... # load up an AngularResIRFMetric
>>> a1._storage.storage_type
boost_histogram.storage.Double
>>> hist.storage.Double?
Weighted storage without variance type (fast but simple)
>>> a1._storage.variances()
array([0.24406664, 0.26334521, 0.23175559, 0.22379109, 0.21994569,
0.21352003, 0.20218295, 0.18362609, 0.16469986, 0.14577109,
0.12940544, 0.11756362, 0.10544799, 0.09715785, 0.08898548,
0.0843119 , 0.07775229, 0.07275688, 0.06797002, 0.06301087,
0.06034233, 0.05881095, 0.05792537, 0.05268056, 0.05233414,
0.0512827 , 0.05047398, 0.05290496, 0.05051981, 0.04626735,
0.05344508, 0.05019424, 0.05740542, 0.0583624 , 0.06181614,
0.06165905, 0.070627 , 0.06297697, 0.06771721, 0.09050114])
These variances are incorrect, and are clearly nothing to do with the data, so where are they coming from? I would expect variances to get set automatically if h.fill()
is called, but these ones are constructed from existing arrays, so why do they have variances? Also If we had proper error bars on the values in the IRFs, we should set those as the variances, but that is not done currently.
The issue is then plotting this you get:
a1.plot(histtype="errorbar")
Which is incorrect
Edited by Karl Kosack