Exemplo n.º 1
0
        profiles[label.replace(' ', '_')] = {
            'x': mean_x,
            'y': points_y,
            'e': err_x
        }
        ax.scatter(mean_x,
                   points_y,
                   s=80,
                   facecolor='w',
                   edgecolor='k',
                   marker='o',
                   linewidth=2)

        ticks = np.logspace(0, np.log10(np.max(counts)), 10)
        cbar = fig.colorbar(im, ticks=ticks, format=helpers.label_formatter)
        helpers.format_cbar(cbar)

        helpers.add_description(
            fig,
            ax,
            align='br',
            strings=[helpers.dataSetStr, helpers.seedCutStr])
        helpers.add_labels(
            fig,
            ax,
            xlabel=r'$E_T^\mathrm{{{}}}$'.format(label),
            ylabel='offline jet\'s number of subjets (cut at 6)',
            title=label)

        ax.set_xlim((0.0, 100.0))
        ax.set_ylim((1.0, 6.0))
Exemplo n.º 2
0

profiles = {}
profiles_scaled = {}

for datapts, label in zip(all_gTower_Et, ['gTower 0', 'gTower 1', 'gTower 2', 'gTower 3']):
  try:
    fig, ax = pl.subplots(figsize=helpers.figsize)
    counts, edges_x, edges_y, im = ax.hist2d(datapts, data['oJet.nsj'][valid_gJets], bins=(np.arange(0., 100., 2.5), np.arange(1, 7, 1)), norm=LogNorm(), alpha=0.75, cmap=helpers.cmap, weights=data['weight'][np.where(tJet_exists)])
    points_y, mean_x, err_x = helpers.profile_x(edges_y, data['oJet.nsj'][valid_gJets], datapts)
    profiles[label.replace(' ', '_')] = {'x': mean_x, 'y': points_y, 'e': err_x}
    ax.scatter(mean_x, points_y, s=80, facecolor='w', edgecolor='k', marker='o', linewidth=2)

    ticks = np.logspace(0, np.log10(np.max(counts)), 10)
    cbar = fig.colorbar(im, ticks=ticks, format=helpers.label_formatter)
    helpers.format_cbar(cbar)

    helpers.add_description(fig, ax, align='br', strings=[helpers.dataSetStr, helpers.seedCutStr])
    helpers.add_labels(fig, ax, xlabel=r'$E_T^\mathrm{{{}}}$'.format(label), ylabel='offline jet\'s number of subjets (cut at 6)', title=label)

    ax.set_xlim((0.0, 100.0))
    ax.set_ylim((1.0, 6.0))
    helpers.add_grid(fig, ax)
    helpers.to_file(fig, ax, 'plots/gTowers/{}_{}.png'.format(filename_id, label.replace(' ', '_')))
    pl.close(fig)

    fig, ax = pl.subplots(figsize=helpers.figsize)
    counts, edges_x, edges_y, im = ax.hist2d(datapts/data['tJet.et'][valid_gJets], data['oJet.nsj'][valid_gJets], bins=(np.arange(0., 1., 0.05), np.arange(1, 7, 1)), norm=LogNorm(), alpha=0.75, cmap=helpers.cmap, weights=data['weight'][np.where(tJet_exists)])
    points_y, mean_x, err_x = helpers.profile_x(edges_y, data['oJet.nsj'][valid_gJets], datapts/data['tJet.et'][valid_gJets])
    profiles_scaled[label.replace(' ', '_')] = {'x': mean_x, 'y': points_y, 'e': err_x}
    ax.scatter(mean_x, points_y, s=80, facecolor='w', edgecolor='k', marker='o', linewidth=2)