-
Hi I am very new to uproot from ROOT. I was wondering is there some recommended way to do histogram division in uproot? As in my previous ROOT workflow we frequently calculate ratio histograms by TH1.Divide(TH1), and store them for later usage(e.g. crazy ratio of ratio) or plotting. I am not sure how to adapt this workflow in uproot since I haven't find equivalent method in any hist or boost-histogram Hist object. I found the hist.plot_ratio is useful but not easy to generalized to, e.g. plot multiple ratios. So does anyone have some ideas on this or we may still need to import ROOT to handle the histogram division operation and finally convert to uproot-hist? I am using uproot4.2.0 shipped with scikit-hep v3.6.0. (Pls correct me if asked at a wrong place and many thanks) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi Qibin! I am not an expert, but as far as I understand the division of histograms in I am sure there are better ideas from the experts here, but maybe that's one way :) |
Beta Was this translation helpful? Give feedback.
Hi Qibin! I am not an expert, but as far as I understand the division of histograms in
boost_histogram
is not fully complete yet. AFAIK the division of weighted histograms is not done yet (see boost-histogrma issue). Possibly one way around this is to define your owndivide
function to divide the histogram values asnumpy
arrays then compute the error using the ratio_uncertainty method from scikit-hep/Hist ? You can then assign to the results to a boost-histogram/ Hist object.I am sure there are better ideas from the experts here, but maybe that's one way :)