print "Making subjet efficiency studies" for gJetEt_cut in [200., 250., 300., 350.]: print "\t" * 1, "gJetEt_cut = {}".format(gJetEt_cut) # add storage by gJetEt cut dataStorage['gJetEtCut_{:0.0f}'.format(gJetEt_cut)] = {} # create trigger cut triggerCut = (data['tJet.et'] >= gJetEt_cut)[np.where(tJet_exists)] gJetEtCutLabel = '$E_T^\mathrm{{gFEX\ jet}} \geq {:0.2f}\ \mathrm{{GeV}}$'.format( gJetEt_cut) fig, ax = pl.subplots(figsize=helpers.figsize) x, y, e, n, w = helpers.add_turnon( fig, ax, data=data['oJet.pt'][np.where(tJet_exists)], den_cut=MassCut, num_cut=(data['tJet.et'][np.where(tJet_exists)] > gJetEt_cut), label='no subt., no shift', p0=(1., 50., gJetEt_cut, 0.5)) 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='tl',
points_x, mean_y, err_y = helpers.profile_y(np.arange(0., 1500., 10.), data['tJet.et'][region_cut], tJetEt_correction[region_cut]) f = interp1d(points_x, mean_y, bounds_error=False, fill_value=0., kind='cubic') print "\t", "efficiency curves using tJet Et cut in numerator" for tJetEt_cut in [100., 120., 140., 160., 180., 200., 220., 240., 260., 280., 300.]: # ADD IN np.interp(tJetEt_cut, trigger_Et, rho*A) and shift subtracted eff curves eff_curve_shift = f([tJetEt_cut])[0] print "\t"*2, "tJetEt_cut = {}, eff_curve_shift = {}".format(tJetEt_cut, eff_curve_shift) # eff_curve_shift = np.interp(tJetEt_cut, trigger_jet_Et[region], trigger_jet_Et_correction[region]) tJetEtThrStr = r'$E_T^\mathrm{{gFEX\ jet}} >\ {:0.2f}\ \mathrm{{GeV}}$'.format(tJetEt_cut) pl_eff_diff = {'eff_curve_shift': eff_curve_shift} fig, ax = pl.subplots(figsize=helpers.figsize) # helpers.add_turnon() returns xpoints_efficiency, hist_eff_curve, errors_eff, nonzero_bins, w x, y, e, n, w = helpers.add_turnon(fig, ax, data=data['oJet.pt'], den_cut=cut, num_cut=(data['tJet.et'] > tJetEt_cut + eff_curve_shift), label='no subtraction', p0=(1., 50., tJetEt_cut, 0.5)) pl_eff_diff['xdata'] = x pl_eff_diff['ydata'] = y pl_eff_diff['xerr'] = 1.0 pl_eff_diff['yerr'] = e pl_eff_diff['nonzero_bins'] = n pl_eff_diff['fit'] = w x, y, e, n, w = helpers.add_turnon(fig, ax, data=data['oJet.pt'], den_cut=cut, num_cut=(data['tJet.et'] > tJetEt_cut), label='no subt., no shift', p0=(1., 50., tJetEt_cut, 0.5)) pl_eff_diff['xdata_noShift'] = x pl_eff_diff['ydata_noShift'] = y pl_eff_diff['xerr_noShift'] = 1.0 pl_eff_diff['yerr_noShift'] = e pl_eff_diff['nonzero_bins_noShift'] = n pl_eff_diff['fit_noShift'] = w x, y, e, n, w = helpers.add_turnon(fig, ax, data=data['oJet.pt'], den_cut=cut, num_cut=(tJetEt_subtracted > tJetEt_cut), label='with subtraction', p0=(1., 50., tJetEt_cut, 0.5)) pl_eff_diff['xdata_subtracted'] = x
offlineCuts = [NoCut, PtCut, PtCut & MassCut] dataStorage = {} print "Making subjet efficiency studies" for gJetEt_cut in [200., 250., 300., 350.]: print "\t"*1, "gJetEt_cut = {}".format(gJetEt_cut) # add storage by gJetEt cut dataStorage['gJetEtCut_{:0.0f}'.format(gJetEt_cut)] = {} # create trigger cut triggerCut = (data['tJet.et'] >= gJetEt_cut)[np.where(tJet_exists)] gJetEtCutLabel = '$E_T^\mathrm{{gFEX\ jet}} \geq {:0.2f}\ \mathrm{{GeV}}$'.format(gJetEt_cut) fig, ax = pl.subplots(figsize=helpers.figsize) x, y, e, n, w = helpers.add_turnon(fig, ax, data=data['oJet.pt'][np.where(tJet_exists)], den_cut=MassCut, num_cut=(data['tJet.et'][np.where(tJet_exists)] > gJetEt_cut), label='no subt., no shift', p0=(1., 50., gJetEt_cut, 0.5)) 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='tl', strings=[helpers.dataSetStr, 'iso., $\Delta R(\mathrm{gJet},\mathrm{oJet})\leq 1$', helpers.seedCutStr, helpers.noiseCutStr, MassCutLabel]) helpers.add_legend(fig, ax, loc='lower left') helpers.add_grid(fig, ax) helpers.to_file(fig, ax, 'plots/subjets/{}_differential_gJetEt{:0.0f}{}.png'.format(filename_id, gJetEt_cut, '_100oJetM220')) pl.close(fig) for offlineCut, offlineLabel, filenameEnd in zip(offlineCuts, [r'', PtCutLabel, "{}{}".format(PtCutLabel, MassCutLabel)], ['', '_250oJetPt500', '_250oJetPt500_100oJetM220']): print "\t"*2, filenameEnd # add storage by offline cut