ax.set_xlim((0.0, 450.0)) ax.set_ylim((0.0, 1.1)) helpers.add_labels(fig, ax, xlabel='offline $p_T^{\mathrm{jet}}$ [GeV]', ylabel='Trigger Efficiency - Differential') helpers.add_description(fig, ax, align='br', strings=[helpers.dataSetStr, helpers.seedCutStr, helpers.noiseCutStr, helpers.towerThrStr, tJetEtThrStr, '$\mathrm{{Shift:}}\ {:0.4f}\ \mathrm{{GeV}}$'.format(eff_curve_shift)]) helpers.add_legend(fig, ax, loc='lower left') helpers.add_grid(fig, ax) pickle.dump(pl_eff_diff, file(helpers.write_file('plots/pickle/matched_differential_%s_trigger%d_region%s.pkl' % (filename_id, tJetEt_cut, i)), 'w+')) helpers.to_file(fig, ax, 'plots/differential/{}_trigger{:0.0f}_region{}.png'.format(filename_id, tJetEt_cut, i)) pl.close(fig) # buildin plots for rho print "rho histograms" fig, ax = pl.subplots(figsize=helpers.figsize) ax.hist(data['offline_rho'], bins=bins_rho, stacked=True, fill=False, histtype='step', color='b', label=r'offline Kt4LCTopo', linewidth=helpers.linewidth) ax.hist(data['gFEX_rho_all'], bins=bins_rho, stacked=True, fill=False, histtype='step', color='r', label=helpers.region_legend('all'), linewidth=helpers.linewidth) ax.hist(data['gFEX_rho_1'], bins=bins_rho, stacked=True, fill=False, histtype='step', color='c', label=helpers.region_legend(1), linewidth=helpers.linewidth) ax.hist(data['gFEX_rho_2'], bins=bins_rho, stacked=True, fill=False, histtype='step', color='m', label=helpers.region_legend(2), linewidth=helpers.linewidth) ax.hist(data['gFEX_rho_3'], bins=bins_rho, stacked=True, fill=False, histtype='step', color='y', label=helpers.region_legend(3), linewidth=helpers.linewidth) ax.hist(data['gFEX_rho_4'], bins=bins_rho, stacked=True, fill=False, histtype='step', color='k', label=helpers.region_legend(4), linewidth=helpers.linewidth) helpers.add_legend(fig, ax) helpers.add_labels(fig, ax, xlabel=r'$\rho$ [GeV]', ylabel=r'count') helpers.add_grid(fig, ax) helpers.add_description(fig, ax, align='br', strings=[helpers.dataSetStr, helpers.towerThrStr]) helpers.to_file(fig, ax, "plots/pileup/{}_rho.png".format(filename_id)) pl.close(fig) print "delta rho histograms" fig, ax = pl.subplots(figsize=helpers.figsize) diff21 = data['gFEX_rho_2'] - data['gFEX_rho_1'] diff43 = data['gFEX_rho_4'] - data['gFEX_rho_3']