コード例 #1
0
width_efficiency = np.array(
    [x - bins_efficiency[i - 1] for i, x in enumerate(bins_efficiency)][1:])
bins_multiplicity = np.arange(0.0, 1024.0, 32.0)

bins_rho = np.arange(0., 70., 0.5)
bins_vertices = np.arange(0., 100., 1.)

startTime_wall = time.time()
startTime_processor = time.clock()

try:
    print "gTower multiplicity"
    # multiplicity on gTowers
    fig, ax = pl.subplots(figsize=helpers.figsize)

    where = np.where(helpers.btwn(data['oJet.pt'], 0., None))
    ax.plot(
        bins_multiplicity[:-1],
        np.cumsum(
            np.sum(
                data['gTower_distribution'][where]).astype(float)[::-1])[::-1]
        / where[0].size,
        linestyle='steps-post',
        alpha=0.75,
        color=helpers.colors[0],
        label='no cuts\n{:d} events'.format(where[0].size),
        linewidth=helpers.linewidth)

    where = np.where(helpers.btwn(data['oJet.pt'], 100., 150.))
    ax.plot(
        bins_multiplicity[:-1],
コード例 #2
0
    helpers.to_file(fig, ax, 'plots/resolution/{}_resolution_PtOffline_withRhoSubtraction_region{}.png'.format(filename_id, i))
    pl.close(fig)
  except:
    print "\t", "Error for {}: could not make resolution correlation (with Rho subtraction)".format(region)
    pl.close(fig)
    pass

  print "\t", "making y-projection of resolution plots"
  try:
    print "\t"*2, "y-projection slices of resolution"
    # y projection slices
    pl_res_proj = {}
    fig, ax = pl.subplots(figsize=helpers.figsize)
    for oJetPt_cuts in [(170., 180.), (200., 220.), (300., 350.)]:
      oJetPt_cut = helpers.btwn(data['oJet.pt'], oJetPt_cuts[0], oJetPt_cuts[1])
      hist, bins = np.histogram(resolution[np.where(cut & oJetPt_cut & tJet_exists_subtracted)], bins=100, density=True)
      fwhm = helpers.FWHM(bins, hist)
      ax.plot(bins[:-1], hist, linestyle='steps-post', alpha=0.75, color='b', label=r'${:0.0f}\ \mathrm{{GeV}} < p_T^\mathrm{{oJet}} <\ {:0.0f}\ \mathrm{{GeV}}$\nFWHM = {:0.4f}'.format(oJetPt_cuts[0], oJetPt_cuts[1], fwhm), linewidth=helpers.linewidth)

      pl_res_proj['{:0.0f}to{:0.0f}'.format(oJetPt_cuts[0], oJetPt_cuts[1])] = resolution[np.where(cut & oJetPt_cut & tJet_exists_subtracted)]

    helpers.add_legend(fig, ax)
    helpers.add_labels(fig, ax, xlabel=r'resolution $\frac{E_T^\mathrm{gFEX} - p_T^\mathrm{offline}}{p_T^\mathrm{offline}}$', ylabel='normalized counts', title='Y-Axis Projections of Resolution')
    helpers.add_description(fig, ax, align='br', strings=[helpers.dataSetStr, helpers.seedCutStr, helpers.noiseCutStr, helpers.towerThrStr])
    ax.set_xlim((-1.0, 1.0))
    helpers.add_grid(fig, ax)
    pickle.dump(pl_res_proj, file(helpers.write_file('plots/pickle/{}_resolution_PtOffline_projection_region{}.pkl'.format(filename_id, i)), 'w+'))
    helpers.to_file(fig, ax, 'plots/resolution/{}_resolution_PtOffline_projection_region{}.png'.format(filename_id, i))
    pl.close(fig)
  except:
コード例 #3
0
bins_efficiency = np.arange(0., 2000., 10.)
width_efficiency = np.array([x - bins_efficiency[i-1] for i, x in enumerate(bins_efficiency)][1:])
bins_multiplicity = np.arange(0.0, 1024.0, 32.0)

bins_rho = np.arange(0., 70., 0.5)
bins_vertices = np.arange(0., 100., 1.)

startTime_wall = time.time()
startTime_processor = time.clock()

try:
  print "gTower multiplicity"
  # multiplicity on gTowers
  fig, ax = pl.subplots(figsize=helpers.figsize)

  where = np.where(helpers.btwn(data['oJet.pt'], 0., None))
  ax.plot(bins_multiplicity[:-1], np.cumsum(np.sum(data['gTower_distribution'][where]).astype(float)[::-1])[::-1]/where[0].size,
          linestyle='steps-post',
          alpha=0.75,
          color=helpers.colors[0],
          label='no cuts\n{:d} events'.format(where[0].size),
          linewidth=helpers.linewidth)

  where = np.where(helpers.btwn(data['oJet.pt'], 100., 150.))
  ax.plot(bins_multiplicity[:-1], np.cumsum(np.sum(data['gTower_distribution'][where]).astype(float)[::-1])[::-1]/where[0].size,
          linestyle='steps-post',
          alpha=0.75,
          color=helpers.colors[1],
          label='$100 < p_T^\mathrm{{oJet}} < 150$\n{:d} events'.format(where[0].size),
          linewidth=helpers.linewidth)