コード例 #1
0
for i, cut in regions.iteritems():
  region = 'region_%s' % i
  region_cut = np.where(cut)
  print region
  try:
    print "\t", "correction Et versus tJetEt"
    # make a correlation of corrected Et versus trigger jet Et
    x = data['tJet.et'][region_cut]
    y = tJetEt_correction[region_cut]
    bins_x = bins_y = np.arange(0., 1500., 10.)
    xlim = (0., 1000.)
    ylim = (0., 200.)
    label_x = r'$E_T^{\mathrm{gJet}}$ [GeV]'
    label_y = r'$\rho*A^\mathrm{gJet}$ [GeV]'

    fig, ax = helpers.corr2d(x, y, bins_x, bins_y, label_x, label_y, xlim=xlim, ylim=ylim, profile_y=True, align='tr',
                             strings=[helpers.dataSetStr, helpers.seedCutStr, helpers.noiseCutStr, helpers.towerThrStr])

    helpers.to_file(fig, ax, 'plots/trigger_jet_Et_correction/{}_trigger_jet_Et_correction_region{}.png'.format(filename_id, i))

    pl.close(fig)
  except:
    print "\t", "Error for {}: could not make correlation of corrected Et versus trigger jet Et".format(region)
    pl.close(fig)
    pass

  try:
    print "\t", "oJetPt versus tJetEt"
    x = data['oJet.pt'][np.where(tJet_exists & cut)]
    y = data['tJet.et'][np.where(tJet_exists & cut)]
    bins_x = bins_y = np.arange(0., 1500., 10.)
    xlim = ylim = (0., 1000.)
コード例 #2
0
fig, ax = pl.subplots(figsize=helpers.figsize)
ax.hist(data['weight'], bins=100, fill=False, alpha=0.75, linewidth=helpers.linewidth)
helpers.add_labels(fig, ax, xlabel=r'$\omega_{event} * \sigma * \varepsilon_{filter} / N_{events}$', ylabel='counts')
helpers.add_description(fig, ax, align='cr', strings=[helpers.dataSetStr, helpers.seedCutStr, helpers.noiseCutStr, helpers.towerThrStr])
helpers.add_grid(fig, ax)
helpers.to_file(fig, ax, 'plots/offline_jet_kinematics/%s_weights.png' % (filename_id))
pl.close(fig)

# spatial correlations
x = data['oJet.eta']
y = data['oJet.phi']
bins_x = np.arange(-2.7, 2.7, 0.2)
bins_y = np.arange(-3.2, 3.2, 0.2)
label_x = r'$\eta^\mathrm{oJet}$'
label_y = r'$\phi^\mathrm{oJet}$'
fig, ax = helpers.corr2d(x, y, bins_x, bins_y, label_x, label_y, profile_x=True, profile_y=True, align='tl',
                         strings=[helpers.dataSetStr, helpers.seedCutStr, helpers.noiseCutStr, helpers.towerThrStr])
helpers.to_file(fig, ax, 'plots/offline_jet_kinematics/%s_angular_positions.png' % (filename_id))
pl.close(fig)

# y projection slices
fig, ax = pl.subplots(figsize=helpers.figsize)
selections = {'left':   np.where((-1.9 < data['oJet.eta']) & (data['oJet.eta'] < -1.5)),
              'middle': np.where((-0.2 < data['oJet.eta']) & (data['oJet.eta'] < 0.2)),
              'right':  np.where((1.5 < data['oJet.eta']) & (data['oJet.eta'] < 1.9))}
ax.hist(data['oJet.phi'][selections['left']], bins=100, weights=data['weight'][selections['left']], stacked=True, fill=False, histtype='step', linewidth=helpers.linewidth, alpha=0.75, color='b', label='$-1.9\ < \eta^\mathrm{oJet} <\ -1.5$')
ax.hist(data['oJet.phi'][selections['middle']], bins=100, weights=data['weight'][selections['middle']], stacked=True, fill=False, histtype='step', linewidth=helpers.linewidth, alpha=0.75, color='c', label='$-0.2\ < \eta^\mathrm{oJet} <\ 0.2$')
ax.hist(data['oJet.phi'][selections['right']], bins=100, weights=data['weight'][selections['right']], stacked=True, fill=False, histtype='step', linewidth=helpers.linewidth, alpha=0.75, color='r', label='$1.5\ < \eta^\mathrm{oJet} <\ 1.9$')
helpers.add_legend(fig, ax)
helpers.add_labels(fig, ax, xlabel=r'$\eta^\mathrm{oJet}$', ylabel='weighted counts', title='Y-Axis Projections of $\phi^\mathrm{oJet}$')
helpers.add_description(fig, ax, align='cr', strings=[helpers.dataSetStr, helpers.seedCutStr, helpers.noiseCutStr, helpers.towerThrStr])
ax.set_yscale('log', nonposy='clip')
コード例 #3
0
    x = np.array([el[0] for el in data['oJet.subjetsPt'][valid_gJets]])
    weights = data['weight'][np.where(tJet_exists)]
    bins_x = np.arange(0., 200., 4.)
    bins_y = np.arange(0., 100., 2.)
    xlim = (0., 200.)
    ylim = (0., 100.)
    label_y = r'leading $E_T^{\mathrm{gTower}}$/2 GeV [GeV]'
    label_x = r'leading $P_T^{\mathrm{oJet\ subjet}}$/4 GeV [GeV]'
    fig, ax = helpers.corr2d(x,
                             y,
                             bins_x,
                             bins_y,
                             label_x,
                             label_y,
                             xlim=xlim,
                             ylim=ylim,
                             profile_x=True,
                             align='tl',
                             strings=[
                                 helpers.dataSetStr, helpers.seedCutStr,
                                 helpers.noiseCutStr, helpers.towerThrStr
                             ],
                             weights=weights)

    ax.plot((0., 200.), (args.seedEt_thresh, args.seedEt_thresh),
            'k-',
            linewidth=helpers.linewidth,
            zorder=0)

    helpers.to_file(
        fig, ax,
コード例 #4
0
# subjet studies comparing leading gTowers with offline subjet Pts
try:
  print "subjet studies comparing leading gTowers with leading offline subjet Pts"
  fig, ax = pl.subplots(figsize=helpers.figsize)
  # make a correlation of corrected Et versus trigger jet Et
  y = all_gTower_Et[0]
  x = np.array([el[0] for el in data['oJet.subjetsPt'][valid_gJets]])
  weights = data['weight'][np.where(tJet_exists)]
  bins_x = np.arange(0., 200., 4.)
  bins_y = np.arange(0., 100., 2.)
  xlim = (0., 200.)
  ylim = (0., 100.)
  label_y = r'leading $E_T^{\mathrm{gTower}}$/2 GeV [GeV]'
  label_x = r'leading $P_T^{\mathrm{oJet\ subjet}}$/4 GeV [GeV]'
  fig, ax = helpers.corr2d(x, y, bins_x, bins_y, label_x, label_y, xlim=xlim, ylim=ylim, profile_x=True, align='tl',
                           strings=[helpers.dataSetStr, helpers.seedCutStr, helpers.noiseCutStr, helpers.towerThrStr], weights=weights)

  ax.plot((0., 200.), (args.seedEt_thresh, args.seedEt_thresh), 'k-', linewidth=helpers.linewidth, zorder=0)

  helpers.to_file(fig, ax, 'plots/subjets/{}_gTower_oJetSubjetPt.png'.format(filename_id))

  pl.close(fig)
except:
  print "Error for {}: could not make correlation plot between leading gTower and offline subjet Pt".format("first subjet")
  raise

# the new regions aren't working because there are not enough jets in them!!!
regions = {1: '', 2: '', 3: '', 4: '', '3a': '', '3b': '', '3c': '', '4a': '', '4b': '', '4c': ''}

for region in regions.keys():
  region_cut = helpers.region_cut(data['tJet.eta'], region)