Issue #22 resolved

Bug: list index out of range

ajabberwok
created an issue

I am getting the following error

{{{

!bash

$ rootplotmpl rootplotmpl_Eff_config.py --ratio-split=1 -m --title="Efficiency of photon Iso ID" -e pdf --ymin=0.55 --ymax=1.0

...

File "/Users/michaelanderson/Documents/Work/rootplot/lib/rootplot/core.py", line 1200, in plot_hists_mpl plot_ratio_mpl(objects['axes'][1], hists, options) File "/Users/michaelanderson/Documents/Work/rootplot/lib/rootplot/core.py", line 1528, in plot_ratio_mpl ratio_index)): File "/Users/michaelanderson/Documents/Work/rootplot/lib/rootplot/core.py", line 1474, in make_ratio_hists ratios = [hist.divide(denom) for hist in hists] File "/Users/michaelanderson/Documents/Work/rootplot/lib/rootplot/utilities.py", line 276, in divide if denominator[i] == 0 or self[i] == 0: File "/Users/michaelanderson/Documents/Work/rootplot/lib/rootplot/utilities.py", line 183, in getitem return self.y[index] IndexError: list index out of range }}}

I have attached the config file and the root file that can trigger this.

Comments (1)

  1. Jeff Klukas repo owner

    You were attempting to divide histograms with different numbers of bins. I have added a new check in Hist.divide that raises a descriptive error when this happens.

  2. Log in to comment