#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt from filval.result_set import ResultSet from filval.histogram import hist, hist_integral, hist2d, hist2d_percent_contour from filval.plotting import (decl_plot, render_plots, hist_plot, hist2d_plot, Plot, generate_dashboard, simple_plot) def center_text(x, y, txt, **kwargs): plt.text(x, y, txt, horizontalalignment='center', verticalalignment='center', transform=plt.gca().transAxes, **kwargs) def hist_integral_ratio(num, den): num_int = hist_integral(num, times_bin_width=False) den_int = hist_integral(den, times_bin_width=False) ratio = num_int / den_int error = np.sqrt(den_int) / den_int # TODO: Check this definition of error return ratio, error @decl_plot def plot_residuals(rs, layer, hit, variable, subdet, plot_cuts=True, cut_sel='tight'): matching_cuts = { 'extra-narrow': [ dict( dPhiMaxHighEt=0.025, dPhiMaxHighEtThres=20.0, dPhiMaxLowEtGrad=-0.002, dRzMaxHighEt=9999.0, dRzMaxHighEtThres=0.0, dRzMaxLowEtGrad=0.0, ), dict( dPhiMaxHighEt=0.0015, dPhiMaxHighEtThres=0.0, dPhiMaxLowEtGrad=0.0, dRzMaxHighEt=0.025, dRzMaxHighEtThres=30.0, dRzMaxLowEtGrad=-0.002, ), dict( dPhiMaxHighEt=0.0015, dPhiMaxHighEtThres=0.0, dPhiMaxLowEtGrad=0.0, dRzMaxHighEt=0.025, dRzMaxHighEtThres=30.0, dRzMaxLowEtGrad=-0.002, ) ], 'narrow': [ dict( dPhiMaxHighEt=0.05, dPhiMaxHighEtThres=20.0, dPhiMaxLowEtGrad=-0.002, dRzMaxHighEt=9999.0, dRzMaxHighEtThres=0.0, dRzMaxLowEtGrad=0.0, ), dict( dPhiMaxHighEt=0.003, dPhiMaxHighEtThres=0.0, dPhiMaxLowEtGrad=0.0, dRzMaxHighEt=0.05, dRzMaxHighEtThres=30.0, dRzMaxLowEtGrad=-0.002, ), dict( dPhiMaxHighEt=0.003, dPhiMaxHighEtThres=0.0, dPhiMaxLowEtGrad=0.0, dRzMaxHighEt=0.05, dRzMaxHighEtThres=30.0, dRzMaxLowEtGrad=-0.002, ) ], 'wide': [ dict( dPhiMaxHighEt=0.10, dPhiMaxHighEtThres=20.0, dPhiMaxLowEtGrad=-0.002, dRzMaxHighEt=9999.0, dRzMaxHighEtThres=0.0, dRzMaxLowEtGrad=0.0, ), dict( dPhiMaxHighEt=0.006, dPhiMaxHighEtThres=0.0, dPhiMaxLowEtGrad=0.0, dRzMaxHighEt=0.10, dRzMaxHighEtThres=30.0, dRzMaxLowEtGrad=-0.002, ), dict( dPhiMaxHighEt=0.006, dPhiMaxHighEtThres=0.0, dPhiMaxLowEtGrad=0.0, dRzMaxHighEt=0.10, dRzMaxHighEtThres=30.0, dRzMaxLowEtGrad=-0.002, ) ], 'extra-wide': [ dict( dPhiMaxHighEt=0.15, dPhiMaxHighEtThres=20.0, dPhiMaxLowEtGrad=-0.002, dRzMaxHighEt=9999.0, dRzMaxHighEtThres=0.0, dRzMaxLowEtGrad=0.0, ), dict( dPhiMaxHighEt=0.009, dPhiMaxHighEtThres=0.0, dPhiMaxLowEtGrad=0.0, dRzMaxHighEt=0.15, dRzMaxHighEtThres=30.0, dRzMaxLowEtGrad=-0.002, ), dict( dPhiMaxHighEt=0.009, dPhiMaxHighEtThres=0.0, dPhiMaxLowEtGrad=0.0, dRzMaxHighEt=0.15, dRzMaxHighEtThres=30.0, dRzMaxLowEtGrad=-0.002, ) ] } h = hist2d(getattr(rs, f'{variable}_{subdet}_L{layer}_H{hit}_v_Et')) def calc_window(et): idx = min(hit-1, 2) cuts = matching_cuts[cut_sel] high_et = cuts[idx][f'{variable}MaxHighEt'] high_et_thres = cuts[idx][f'{variable}MaxHighEtThres'] low_et_grad = cuts[idx][f'{variable}MaxLowEtGrad'] return high_et + min(0, et-high_et_thres)*low_et_grad hist2d_plot(h, colorbar=True) xs, ys = hist2d_percent_contour(h, .90, 'x') plt.plot(xs, ys, color='green', label='90\% contour') xs, ys = hist2d_percent_contour(h, .995, 'x') plt.plot(xs, ys, color='darkgreen', label='99.5\% contour') if plot_cuts: ets = h[3][:, 0] cuts = [calc_window(et) for et in ets] plt.plot(cuts, ets, color='red', label='Cut Value') plt.legend(loc='upper right') plt.xlabel({'dPhi': r'$\delta \phi$ (rads)', 'dRz': r'$\delta R/z$ (cm)'}[variable]) plt.ylabel('$E_T$ (GeV)') @decl_plot def plot_seed_eff(rs): r"""## ECAL-Driven Seeding Efficiency The proportion of gen-level electrons originating in the luminous region that have an associated Seed, matched via rechit-simhit associations in the pixel detector. Cuts are on simtrack quantities. """ ax_pt = plt.subplot(221) ax_eta = plt.subplot(222) ax_phi = plt.subplot(223) errors = True plt.sca(ax_pt) hist_plot(hist(rs.seed_eff_v_pt), include_errors=errors) center_text(0.5, 0.3, r'$|\eta|<2.4$') plt.xlabel(r"Sim-Track $p_T$") plt.ylim((0, 1.1)) plt.sca(ax_eta) hist_plot(hist(rs.seed_eff_v_eta), include_errors=errors) center_text(0.5, 0.3, r'$p_T>20$') plt.xlabel(r"Sim-Track $\eta$") plt.ylim((0, 1.1)) plt.sca(ax_phi) hist_plot(hist(rs.seed_eff_v_phi), include_errors=errors) center_text(0.5, 0.3, r'$p_T>20$ and $|\eta|<2.4$') plt.xlabel(r"Sim-Track $\phi$") plt.ylim((0, 1.1)) @decl_plot def plot_tracking_eff(rs): r"""## GSF Tracking Efficiency The proportion of electrons origination in the luminous region from the that have an associated GSF track. Cuts are on simtrack quantities. """ ax_pt = plt.subplot(221) ax_eta = plt.subplot(222) ax_phi = plt.subplot(223) ax_eta_pt = plt.subplot(224) errors = True plt.sca(ax_pt) hist_plot(hist(rs.tracking_eff_v_pt), include_errors=errors) center_text(0.5, 0.3, r'$|\eta|<2.4$') plt.xlabel(r"Sim-Track $p_T$") plt.ylim((0, 1.1)) plt.sca(ax_eta) hist_plot(hist(rs.tracking_eff_v_eta), include_errors=errors) center_text(0.5, 0.3, r'$p_T>20$') plt.xlabel(r"Sim-Track $\eta$") plt.ylim((0, 1.1)) plt.sca(ax_phi) hist_plot(hist(rs.tracking_eff_v_phi), include_errors=errors) center_text(0.5, 0.3, r'$p_T>20$ and $|\eta|<2.4$') plt.xlabel(r"Sim-Track $\phi$") plt.ylim((0, 1.1)) plt.sca(ax_eta_pt) hist2d_plot(hist2d(rs.tracking_eff_v_eta_pt)) plt.xlabel(r"Sim-Track $\eta$") plt.ylabel(r"Sim-Track $p_T$") plt.colorbar() @decl_plot def plot_seed_purity(rs, ext=""): r"""## ECAL-Driven Seed Purity The proportion of ECAL-driven seeds that have a matched gen-level electron originating in the luminous region. Cuts are on seed quantities. """ ax_pt = plt.subplot(221) ax_eta = plt.subplot(222) ax_phi = plt.subplot(223) def get_hist(base_name): return hist(getattr(rs, base_name+ext)) errors = True plt.sca(ax_pt) hist_plot(get_hist("seed_pur_v_pt"), include_errors=errors) center_text(0.5, 0.3, r'$|\eta|<2.4$') plt.xlabel(r"Seed $p_T$") if not ext: plt.ylim((0, 1.1)) plt.sca(ax_eta) hist_plot(get_hist("seed_pur_v_eta"), include_errors=errors) center_text(0.5, 0.3, r'$p_T>20$') plt.xlabel(r"Seed $\eta$") if not ext: plt.ylim((0, 1.1)) plt.sca(ax_phi) hist_plot(get_hist("seed_pur_v_phi"), include_errors=errors) center_text(0.5, 0.3, r'$p_T>20$ and $|\eta|<2.4$') plt.xlabel(r"Seed $\phi$") if not ext: plt.ylim((0, 1.1)) @decl_plot def plot_track_purity(rs, ext=""): r"""## GSF Track Purity The proportion of GSF-tracks w\ ECAL-driven seeds that have a matched gen-level electron originating in the luminous region. Cuts are on GSF track quantities. """ ax_pt = plt.subplot(221) ax_eta = plt.subplot(222) ax_phi = plt.subplot(223) def get_hist( base_name): return hist(getattr(rs, base_name+ext)) errors = True plt.sca(ax_pt) hist_plot(get_hist("tracking_pur_v_pt"), include_errors=errors) center_text(0.5, 0.3, r'$|\eta|<2.4$') plt.xlabel(r"GSF-Track $p_T$") plt.ylim((0, 1.1)) plt.sca(ax_eta) hist_plot(get_hist("tracking_pur_v_eta"), include_errors=errors) center_text(0.5, 0.3, r'$p_T>20$') plt.xlabel(r"GSF-Track $\eta$") plt.ylim((0, 1.1)) plt.sca(ax_phi) hist_plot(get_hist("tracking_pur_v_phi"), include_errors=errors) center_text(0.5, 0.3, r'$p_T>20$ and $|\eta|<2.4$') plt.xlabel(r"GSF-Track $\phi$") plt.ylim((0, 1.1)) @decl_plot def plot_hit_vs_layer(rs, region): h = hist2d(getattr(rs, f'hit_vs_layer_{region}')) hist2d_plot(h, txt_format='{:2.0f}') plt.xlabel('Layer \#') plt.ylabel('Hit \#') def single_cut_plots(cut_sel): rs = ResultSet(f'{cut_sel}-window', f'../hists/{cut_sel}-window.root') seed_eff = plot_seed_eff, (rs,) tracking_eff = plot_tracking_eff, (rs,) seed_pur = plot_seed_purity, (rs,) track_pur = plot_track_purity, (rs,) track_pur_seed_match = plot_track_purity, (rs,), dict(ext='2') BPIX_residuals_L1_H1_dPhi = plot_residuals, (rs, 1, 1, 'dPhi', 'BPIX'), dict(cut_sel=cut_sel) BPIX_residuals_L2_H2_dPhi = plot_residuals, (rs, 2, 2, 'dPhi', 'BPIX'), dict(cut_sel=cut_sel) BPIX_residuals_L3_H3_dPhi = plot_residuals, (rs, 3, 3, 'dPhi', 'BPIX'), dict(cut_sel=cut_sel) BPIX_residuals_L1_H1_dRz = plot_residuals, (rs, 1, 1, 'dRz', 'BPIX'), {'plot_cuts': False} BPIX_residuals_L2_H2_dRz = plot_residuals, (rs, 2, 2, 'dRz', 'BPIX'), dict(cut_sel=cut_sel) BPIX_residuals_L3_H3_dRz = plot_residuals, (rs, 3, 3, 'dRz', 'BPIX'), dict(cut_sel=cut_sel) FPIX_residuals_L1_H1_dPhi = plot_residuals, (rs, 1, 1, 'dPhi', 'FPIX'), dict(cut_sel=cut_sel) FPIX_residuals_L2_H2_dPhi = plot_residuals, (rs, 2, 2, 'dPhi', 'FPIX'), dict(cut_sel=cut_sel) FPIX_residuals_L3_H3_dPhi = plot_residuals, (rs, 3, 3, 'dPhi', 'FPIX'), dict(cut_sel=cut_sel) FPIX_residuals_L1_H1_dRz = plot_residuals, (rs, 1, 1, 'dRz', 'FPIX'), {'plot_cuts': False} FPIX_residuals_L2_H2_dRz = plot_residuals, (rs, 2, 2, 'dRz', 'FPIX'), dict(cut_sel=cut_sel) FPIX_residuals_L3_H3_dRz = plot_residuals, (rs, 3, 3, 'dRz', 'FPIX'), dict(cut_sel=cut_sel) FPIX_residuals_L1_H2_dPhi = plot_residuals, (rs, 1, 2, 'dPhi', 'FPIX'), dict(cut_sel=cut_sel) FPIX_residuals_L1_H3_dPhi = plot_residuals, (rs, 1, 3, 'dPhi', 'FPIX'), dict(cut_sel=cut_sel) FPIX_residuals_L2_H3_dPhi = plot_residuals, (rs, 2, 3, 'dPhi', 'FPIX'), dict(cut_sel=cut_sel) FPIX_residuals_L1_H2_dRz = plot_residuals, (rs, 1, 2, 'dPhi', 'FPIX'), dict(cut_sel=cut_sel) FPIX_residuals_L1_H3_dRz = plot_residuals, (rs, 1, 3, 'dPhi', 'FPIX'), dict(cut_sel=cut_sel) FPIX_residuals_L2_H3_dRz = plot_residuals, (rs, 2, 3, 'dPhi', 'FPIX'), dict(cut_sel=cut_sel) hit_vs_layer_barrel = plot_hit_vs_layer, (rs, 'barrel') hit_vs_layer_forward = plot_hit_vs_layer, (rs, 'forward') plots = [ Plot(BPIX_residuals_L1_H1_dPhi, 'Phi Residuals Layer 1 Hit 1 - BPIX'), Plot(BPIX_residuals_L2_H2_dPhi, 'Phi Residuals Layer 2 Hit 2 - BPIX'), Plot(BPIX_residuals_L3_H3_dPhi, 'Phi Residuals Layer 3 Hit 3 - BPIX'), Plot(BPIX_residuals_L1_H1_dRz, 'dZ Residuals Layer 1 Hit 1 w/o cuts - BPIX'), Plot(BPIX_residuals_L2_H2_dRz, 'dZ Residuals Layer 2 Hit 2 - BPIX'), Plot(BPIX_residuals_L3_H3_dRz, 'dZ Residuals Layer 3 Hit 3 - BPIX'), Plot(FPIX_residuals_L1_H1_dPhi, 'Phi Residuals Layer 1 Hit 1 - FPIX'), Plot(FPIX_residuals_L2_H2_dPhi, 'Phi Residuals Layer 2 Hit 2 - FPIX'), Plot(FPIX_residuals_L3_H3_dPhi, 'Phi Residuals Layer 3 Hit 3 - FPIX'), Plot(FPIX_residuals_L1_H1_dRz, 'dR Residuals Layer 1 Hit 1 w/o cuts - FPIX'), Plot(FPIX_residuals_L2_H2_dRz, 'dR Residuals Layer 2 Hit 2 - FPIX'), Plot(FPIX_residuals_L3_H3_dRz, 'dR Residuals Layer 3 Hit 3 - FPIX'), Plot(FPIX_residuals_L1_H2_dPhi, 'Phi Residuals Layer 1 Hit 2 - FPIX'), Plot(FPIX_residuals_L1_H3_dPhi, 'Phi Residuals Layer 1 Hit 3 - FPIX'), Plot(FPIX_residuals_L2_H3_dPhi, 'Phi Residuals Layer 2 Hit 3 - FPIX'), Plot(FPIX_residuals_L1_H2_dRz, 'dR Residuals Layer 1 Hit 2 - FPIX'), Plot(FPIX_residuals_L1_H3_dRz, 'dR Residuals Layer 1 Hit 3 - FPIX'), Plot(FPIX_residuals_L2_H3_dRz, 'dR Residuals Layer 2 Hit 3 - FPIX'), Plot(seed_eff, 'ECAL-Driven Seeding Efficiency'), Plot(tracking_eff, 'GSF Tracking Efficiency'), Plot(hit_vs_layer_barrel, 'Hit vs Layer - Barrel'), Plot(hit_vs_layer_forward, 'Hit vs Layer - Forward'), Plot(seed_pur, 'ECAL-Driven Seeding Purity'), Plot(track_pur, 'GSF Track Purity'), Plot(track_pur_seed_match , 'GSF Track Purity (Seed Truth Match)'), simple_plot(rs.gsf_tracks_nmatch_sim_tracks, log='y'), ] render_plots(plots, to_disk=False) generate_dashboard(plots, 'Seeding Efficiency', output=f'{rs.sample_name}.html', source=__file__, config=rs.config) @decl_plot def plot_seed_roc_curve(rss): def get_num_den(rs, basename): num = hist(getattr(rs, f'{basename}_num')) den = hist(getattr(rs, f'{basename}_den')) return hist_integral_ratio(num, den) for rs in rss: eff, eff_err = get_num_den(rs, 'seed_eff_v_phi') pur, pur_err = get_num_den(rs, 'seed_pur_v_phi') plt.errorbar([pur], [eff], xerr=[pur_err], yerr=[eff_err], label=rs.sample_name) center_text(0.5, 0.3, r'$p_T>20$ and $|\eta|<2.4$') plt.axis('equal') plt.xlim((0.8, 1.0)) plt.ylim((0.8, 1.0)) plt.xlabel('ECAL-Driven Seeding Purity') plt.ylabel('ECAL-Driven Seeding Efficiency') plt.grid() plt.legend() @decl_plot def plot_seed_eff_all(rss): ax_pt = plt.subplot(221) ax_eta = plt.subplot(222) ax_phi = plt.subplot(223) errors = True for rs in rss: plt.sca(ax_pt) hist_plot(hist(rs.seed_eff_v_pt), include_errors=errors, label=rs.sample_name) plt.sca(ax_eta) hist_plot(hist(rs.seed_eff_v_eta), include_errors=errors, label=rs.sample_name) plt.sca(ax_phi) hist_plot(hist(rs.seed_eff_v_phi), include_errors=errors, label=rs.sample_name) plt.sca(ax_pt) center_text(0.5, 0.3, r'$|\eta|<2.4$') plt.xlabel(r"Sim-Track $p_T$") plt.ylim((0, 1.1)) plt.sca(ax_eta) center_text(0.5, 0.3, r'$p_T>20$') plt.xlabel(r"Sim-Track $\eta$") plt.ylim((0, 1.1)) plt.legend(loc='lower right') plt.sca(ax_phi) center_text(0.5, 0.3, r'$p_T>20$ and $|\eta|<2.4$') plt.xlabel(r"Sim-Track $\phi$") plt.ylim((0, 1.1)) @decl_plot def plot_seed_pur_all(rss): ax_pt = plt.subplot(221) ax_eta = plt.subplot(222) ax_phi = plt.subplot(223) errors = True for rs in rss: plt.sca(ax_pt) hist_plot(hist(rs.seed_pur_v_pt), include_errors=errors, label=rs.sample_name) plt.sca(ax_eta) hist_plot(hist(rs.seed_pur_v_eta), include_errors=errors, label=rs.sample_name) plt.sca(ax_phi) hist_plot(hist(rs.seed_pur_v_phi), include_errors=errors, label=rs.sample_name) plt.sca(ax_pt) center_text(0.5, 0.3, r'$|\eta|<2.4$') plt.xlabel(r"Seed $p_T$") plt.ylim((0, 1.1)) plt.sca(ax_eta) center_text(0.5, 0.3, r'$p_T>20$') plt.xlabel(r"Seed $\eta$") plt.ylim((0, 1.1)) plt.legend(loc='lower right') plt.sca(ax_phi) center_text(0.5, 0.3, r'$p_T>20$ and $|\eta|<2.4$') plt.xlabel(r"Seed $\phi$") plt.ylim((0, 1.1)) @decl_plot def plot_tracking_roc_curve(rss, ext=''): def get_num_den(rs, basename): num = hist(getattr(rs, f'{basename}{ext}_num')) den = hist(getattr(rs, f'{basename}{ext}_den')) return hist_integral_ratio(num, den) for rs in rss: eff, eff_err = get_num_den(rs, 'tracking_eff_v_phi') pur, pur_err = get_num_den(rs, 'tracking_pur_v_phi') plt.errorbar([pur], [eff], xerr=[pur_err], yerr=[eff_err], label=rs.sample_name) center_text(0.5, 0.3, r'$p_T>20$ and $|\eta|<2.4$') plt.axis('equal') plt.xlim((0.8, 1.0)) plt.ylim((0.8, 1.0)) plt.xlabel('GSF-Track Purity') plt.ylabel('GSF-Track Efficiency') plt.grid() plt.legend() @decl_plot def plot_tracking_eff_all(rss, ext=''): ax_pt = plt.subplot(221) ax_eta = plt.subplot(222) ax_phi = plt.subplot(223) errors = True for rs in rss: plt.sca(ax_pt) hist_plot(hist(getattr(rs, f'tracking_eff_v_pt{ext}')), include_errors=errors, label=rs.sample_name) plt.sca(ax_eta) hist_plot(hist(getattr(rs, f'tracking_eff_v_eta{ext}')), include_errors=errors, label=rs.sample_name) plt.sca(ax_phi) hist_plot(hist(getattr(rs, f'tracking_eff_v_phi{ext}')), include_errors=errors, label=rs.sample_name) plt.sca(ax_pt) center_text(0.5, 0.3, r'$|\eta|<2.4$') plt.xlabel(r"Sim-Track $p_T$") plt.ylim((0, 1.1)) plt.sca(ax_eta) center_text(0.5, 0.3, r'$p_T>20$') plt.xlabel(r"Sim-Track $\eta$") plt.ylim((0, 1.1)) plt.legend(loc='lower right') plt.sca(ax_phi) center_text(0.5, 0.3, r'$p_T>20$ and $|\eta|<2.4$') plt.xlabel(r"Sim-Track $\phi$") plt.ylim((0, 1.1)) @decl_plot def plot_tracking_pur_all(rss, ext=''): ax_pt = plt.subplot(221) ax_eta = plt.subplot(222) ax_phi = plt.subplot(223) errors = True for rs in rss: plt.sca(ax_pt) hist_plot(hist(getattr(rs, f'tracking_pur_v_pt{ext}')), include_errors=errors, label=rs.sample_name) plt.sca(ax_eta) hist_plot(hist(getattr(rs, f'tracking_pur_v_eta{ext}')), include_errors=errors, label=rs.sample_name) plt.sca(ax_phi) hist_plot(hist(getattr(rs, f'tracking_pur_v_phi{ext}')), include_errors=errors, label=rs.sample_name) plt.sca(ax_pt) center_text(0.5, 0.3, r'$|\eta|<2.4$') plt.xlabel(r"GSF-Track $p_T$") plt.ylim((0, 1.1)) plt.sca(ax_eta) center_text(0.5, 0.3, r'$p_T>20$') plt.xlabel(r"GSF-Track $\eta$") plt.ylim((0, 1.1)) plt.legend(loc='lower right') plt.sca(ax_phi) center_text(0.5, 0.3, r'$p_T>20$ and $|\eta|<2.4$') plt.xlabel(r"GSF-Track $\phi$") plt.ylim((0, 1.1)) @decl_plot def plot_ecal_rel_res(rss): for rs in rss: hist_plot(hist(rs.ecal_energy_resolution), label=rs.sample_name) plt.xlabel(r"ECAL $E_T$ relative error") plt.legend() def all_cut_plots(cuts): rss = [ResultSet(f'{cut_sel}-window', f'../hists/{cut_sel}-window.root') for cut_sel in cuts] tracking_roc_curve = plot_tracking_roc_curve, (rss,) tracking_eff_all = plot_tracking_eff_all, (rss,) tracking_pur_all = plot_tracking_pur_all, (rss,) tracking_roc_curve2 = plot_tracking_roc_curve, (rss, '2') tracking_eff_all2 = plot_tracking_eff_all, (rss, '2') tracking_pur_all2 = plot_tracking_pur_all, (rss, '2') seed_roc_curve = plot_seed_roc_curve, (rss,) seed_eff_all = plot_seed_eff_all, (rss,) seed_pur_all = plot_seed_pur_all, (rss,) ecal_rel_res = plot_ecal_rel_res, (rss,) plots = [ Plot(tracking_roc_curve, 'Tracking ROC Curve'), Plot(tracking_eff_all, 'Tracking Efficiency'), Plot(tracking_pur_all, 'Tracking Purity'), Plot(tracking_roc_curve2, 'Tracking ROC Curve (Seed Matched)'), Plot(tracking_eff_all2, 'Tracking Efficiency (Seed Matched)'), Plot(tracking_pur_all2, 'Tracking Purity (Seed Matched)'), Plot(seed_roc_curve, 'Seeding ROC Curve'), Plot(seed_eff_all, 'ECAL-Driven Seeding Efficiency'), Plot(seed_pur_all, 'ECAL-Driven Seeding Purity'), Plot(ecal_rel_res, 'ECAL ET Relative Resolution'), ] render_plots(plots, to_disk=False) generate_dashboard(plots, 'Comparisons', output='comparisons.html', source=__file__, config=rss[0].config) if __name__ == '__main__': cuts = ['extra-narrow', 'narrow', 'wide', 'extra-wide'] all_cut_plots(cuts) for cut in cuts: single_cut_plots(cut)