iceplot¶
Advanced histogram visualization functions.
iceplot.iceplot¶
- chi2_cost(h_mc, h_data, vartype: str = 'hybrid', rho: float = 0.0, return_nbins: bool = False)[source]¶
Chi2 cost function between two histograms
- Parameters:
h_mc – mc histogram object
h_data – data histogram object
vartype –
‘hybrid’: MC model (+) Data variance included, both inexact
’pearson’: MC model variance only included, data assumed exact
’neyman’: Data variance only included, model assumed exact
rho – correlation coefficient between histograms (scalar or np.ndarray), used with vartype = ‘hybrid’
- create_axes(xlabel='$x$', ylabel='Counts', ylabel_ratio='Ratio', xlim=(0, 1), ylim=None, ratio_plot=True, figsize=(5, 4), fontsize=8, units={'x': '', 'y': ''}, **kwargs)[source]¶
Axes creator.
- ess_metric(h)[source]¶
Return the effective sample size per histogram bin.
- Returns:
ESS per bin Entries (unweighted fills) per bin
- hist_to_density(counts, errs, bins)[source]¶
Normalize to unit integral density function over the visible histogram range
- hist_to_density_fullspace(counts, errs, bins, totalweight)[source]¶
Normalize histogram to a unit integral density function over total sum of event weights (not just the visible histogram range mass)
- histhepdata(hepdata, all_obs, scale=None, density=False, MC_XS_SCALE=1000000000000.0, label='Data', style={'histtype': 'step', 'ls': '-', 'lw': 1, 'zorder': 0})[source]¶
- histmc(mcdata, all_obs, density=False, scale=None, color=(0, 0, 1), label='none', style={'histtype': 'step', 'ls': '-', 'lw': 1, 'zorder': 0})[source]¶
Over all observables of an MC sample
- class hobj(counts=0, errs=0, bins=0, cbins=0, entries=0, binscale=1.0)[source]¶
Minimal histogram data object.
- ordered_legend(ax=None, order=None, frameon=False, unique=False, **kwargs)[source]¶
Ordered legends.
- plot_horizontal_line(ax, ypos=1.0, color=(0.5, 0.5, 0.5), linewidth=0.9)[source]¶
For the ratio plot
- ratioerr(A, B, sigma_A, sigma_B, sigma_AB=0, EPS=1e-15)[source]¶
Ratio f(A,B) = A/B error, by Taylor expansion of f.
- set_global_style(dpi=120, figsize=(4, 3.75), font='serif', font_size=8, legend_fontsize=7, legend_handlelength=1)[source]¶
Set global plot style.