Example #1
0
startTime_processor = time.clock()

filename_id = "seed{:0.0f}_noise{:0.0f}_signal{:0.0f}_digitization{:0.0f}".format(args.seedEt_thresh, args.noise_filter, args.tower_thresh, args.digitization)
filename = "data/seed{:0.0f}/leading_jets_{}.pkl".format(args.seedEt_thresh, filename_id)
data = pickle.load(file(filename))

endTime_wall      = time.time()
endTime_processor = time.clock()
print "Finished reading in data:\n\t Wall time: %0.2f s \n\t Clock Time: %0.2f s" % ((endTime_wall - startTime_wall), (endTime_processor - startTime_processor))

dataSetStr  = plotConfigs.dataSetStr
seedCutStr  = '$E_T^\mathrm{seed} >\ %d\ \mathrm{GeV}$' % args.seedEt_thresh
noiseCutStr = '$E_T^\mathrm{tower} >\ %d\ \mathrm{GeV}$' % args.noise_filter
towerThrStr = '$\\rho\left(E_T^\mathrm{tower} <\ %d\ \mathrm{GeV}\\right)$' % args.tower_thresh

helpers = PlotHelpers(dataSetStr=dataSetStr, seedCutStr=seedCutStr, noiseCutStr=noiseCutStr, towerThrStr=towerThrStr)

tJetEt_correction = np.zeros(data.size)
tJetEt_subtracted = np.zeros(data.size)
# 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)
  regions[region] = region_cut

  if region not in [1, 2, 3, 4]:
    region_parsed = int(region[0])
  else:
    region_parsed = region
Example #2
0
filename_id = "seed{:0.0f}_noise{:0.0f}_signal{:0.0f}_digitization{:0.0f}".format(args.seedEt_thresh, args.noise_filter, args.tower_thresh, args.digitization)
filename = "plots/subjets/{}.pkl".format(filename_id)

signal = pickle.load(file('../ttbar/{}'.format(filename)))
background = pickle.load(file('../dijets/{}'.format(filename)))

endTime_wall      = time.time()
endTime_processor = time.clock()
print "Finished reading in data:\n\t Wall time: %0.2f s \n\t Clock Time: %0.2f s" % ((endTime_wall - startTime_wall), (endTime_processor - startTime_processor))

dataSetStr  = plotConfigs.dataSetStr
seedCutStr  = '$E_T^\mathrm{seed} >\ %d\ \mathrm{GeV}$' % args.seedEt_thresh
noiseCutStr = '$E_T^\mathrm{tower} >\ %d\ \mathrm{GeV}$' % args.noise_filter
towerThrStr = '$\\rho\left(E_T^\mathrm{tower} <\ %d\ \mathrm{GeV}\\right)$' % args.tower_thresh

helpers = PlotHelpers(dataSetStr=dataSetStr, seedCutStr=seedCutStr, noiseCutStr=noiseCutStr, towerThrStr=towerThrStr, labelsize=28)

PtCutLabel = "$250\ \mathrm{GeV}\ \leq P_T^\mathrm{oJet} \leq\ 500\ \mathrm{GeV}$"
MassCutLabel = "$100\ \mathrm{GeV}\ \leq m^\mathrm{oJet} \leq\ 220\ \mathrm{GeV}$"

dataStorage = {}


def rescaleY(y, option="fake rate"):
  validOptions = ["fake rate", "rejection", "purity"]
  if option == "fake rate":
    return y
  elif option == "rejection":
    return 1./y
  elif option == "purity":
    return 1.-y
Example #3
0
signal = pickle.load(file('../ttbar/{}'.format(filename)))
background = pickle.load(file('../dijets/{}'.format(filename)))

endTime_wall = time.time()
endTime_processor = time.clock()
print "Finished reading in data:\n\t Wall time: %0.2f s \n\t Clock Time: %0.2f s" % (
    (endTime_wall - startTime_wall), (endTime_processor - startTime_processor))

dataSetStr = plotConfigs.dataSetStr
seedCutStr = '$E_T^\mathrm{seed} >\ %d\ \mathrm{GeV}$' % args.seedEt_thresh
noiseCutStr = '$E_T^\mathrm{tower} >\ %d\ \mathrm{GeV}$' % args.noise_filter
towerThrStr = '$\\rho\left(E_T^\mathrm{tower} <\ %d\ \mathrm{GeV}\\right)$' % args.tower_thresh

helpers = PlotHelpers(dataSetStr=dataSetStr,
                      seedCutStr=seedCutStr,
                      noiseCutStr=noiseCutStr,
                      towerThrStr=towerThrStr,
                      labelsize=28)

PtCutLabel = "$250\ \mathrm{GeV}\ \leq P_T^\mathrm{oJet} \leq\ 500\ \mathrm{GeV}$"
MassCutLabel = "$100\ \mathrm{GeV}\ \leq m^\mathrm{oJet} \leq\ 220\ \mathrm{GeV}$"

dataStorage = {}


def rescaleY(y, option="fake rate"):
    validOptions = ["fake rate", "rejection", "purity"]
    if option == "fake rate":
        return y
    elif option == "rejection":
        return 1. / y
Example #4
0
    args.seedEt_thresh, filename_id)
data = pickle.load(file(filename))

endTime_wall = time.time()
endTime_processor = time.clock()
print "Finished reading in data:\n\t Wall time: %0.2f s \n\t Clock Time: %0.2f s" % (
    (endTime_wall - startTime_wall), (endTime_processor - startTime_processor))

dataSetStr = plotConfigs.dataSetStr
seedCutStr = '$E_T^\mathrm{seed} >\ %d\ \mathrm{GeV}$' % args.seedEt_thresh
noiseCutStr = '$E_T^\mathrm{tower} >\ %d\ \mathrm{GeV}$' % args.noise_filter
towerThrStr = '$\\rho\left(E_T^\mathrm{tower} <\ %d\ \mathrm{GeV}\\right)$' % args.tower_thresh

helpers = PlotHelpers(dataSetStr=dataSetStr,
                      seedCutStr=seedCutStr,
                      noiseCutStr=noiseCutStr,
                      towerThrStr=towerThrStr,
                      labelsize=28)

tJet_exists = data['tJet.et'] > 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()
Example #5
0
startTime_processor = time.clock()

filename_id = "seed{:0.0f}_noise{:0.0f}_signal{:0.0f}_digitization{:0.0f}".format(args.seedEt_thresh, args.noise_filter, args.tower_thresh, args.digitization)
filename = "data/seed{:0.0f}/leading_jets_{}.pkl".format(args.seedEt_thresh, filename_id)
data = pickle.load(file(filename))

endTime_wall      = time.time()
endTime_processor = time.clock()
print "Finished reading in data:\n\t Wall time: %0.2f s \n\t Clock Time: %0.2f s" % ((endTime_wall - startTime_wall), (endTime_processor - startTime_processor))

dataSetStr  = plotConfigs.dataSetStr
seedCutStr  = '$E_T^\mathrm{seed} >\ %d\ \mathrm{GeV}$' % args.seedEt_thresh
noiseCutStr = '$E_T^\mathrm{tower} >\ %d\ \mathrm{GeV}$' % args.noise_filter
towerThrStr = '$\\rho\left(E_T^\mathrm{tower} <\ %d\ \mathrm{GeV}\\right)$' % args.tower_thresh

helpers = PlotHelpers(dataSetStr=dataSetStr, seedCutStr=seedCutStr, noiseCutStr=noiseCutStr, towerThrStr=towerThrStr)

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

# buildin plots for pt
print "pt combined"
fig, ax = pl.subplots(figsize=helpers.figsize)
n, bins, weightedPatches = ax.hist(data['oJet.pt'], weights=data['weight'], bins=np.arange(0, 500, 2), stacked=True, fill=False, histtype='step', color='b', label=r'weighted', linewidth=helpers.linewidth, alpha=0.75)
axt = ax.twinx()
n, bins, unweightedPatches = axt.hist(data['oJet.pt'], bins=np.arange(0, 500, 2), stacked=True, fill=False, histtype='step', color='r', label=r'unweighted', linewidth=helpers.linewidth, alpha=0.75)

# http://matplotlib.org/examples/api/two_scales.html
for tl in ax.get_yticklabels():
  tl.set_color('b')
startTime_processor = time.clock()

filename_id = "seed{:0.0f}_noise{:0.0f}_signal{:0.0f}_digitization{:0.0f}".format(args.seedEt_thresh, args.noise_filter, args.tower_thresh, args.digitization)
filename = "data/seed{:0.0f}/leading_jets_{}.pkl".format(args.seedEt_thresh, filename_id)
data = pickle.load(file(filename))

endTime_wall      = time.time()
endTime_processor = time.clock()
print "Finished reading in data:\n\t Wall time: %0.2f s \n\t Clock Time: %0.2f s" % ((endTime_wall - startTime_wall), (endTime_processor - startTime_processor))

dataSetStr  = plotConfigs.dataSetStr
seedCutStr  = '$E_T^\mathrm{seed} >\ %d\ \mathrm{GeV}$' % args.seedEt_thresh
noiseCutStr = '$E_T^\mathrm{tower} >\ %d\ \mathrm{GeV}$' % args.noise_filter
towerThrStr = '$\\rho\left(E_T^\mathrm{tower} <\ %d\ \mathrm{GeV}\\right)$' % args.tower_thresh

helpers = PlotHelpers(dataSetStr=dataSetStr, seedCutStr=seedCutStr, noiseCutStr=noiseCutStr, towerThrStr=towerThrStr)

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

# standard kinematic plots
fig, ax = pl.subplots(figsize=helpers.figsize)
n, bins, unweightedPatches = ax.hist(data['oJet.pt'], bins=np.arange(0, 500, 2), label='unweighted', stacked=True, fill=False, histtype='step', alpha=0.75, color='r')
axt = ax.twinx()
n, bins, weightedPatches = axt.hist(data['oJet.pt'], weights=data['weight'], bins=np.arange(0, 500, 2), label='weighted', stacked=True, fill=False, histtype='step', alpha=0.75, color='b')
# http://matplotlib.org/examples/api/two_scales.html
for tl in ax.get_yticklabels():
  tl.set_color('r')
for tl in axt.get_yticklabels():
  tl.set_color('b')
Example #7
0
filename = "data/seed{:0.0f}/leading_jets_{}.pkl".format(
    args.seedEt_thresh, filename_id)
data = pickle.load(file(filename))

endTime_wall = time.time()
endTime_processor = time.clock()
print "Finished reading in data:\n\t Wall time: %0.2f s \n\t Clock Time: %0.2f s" % (
    (endTime_wall - startTime_wall), (endTime_processor - startTime_processor))

dataSetStr = plotConfigs.dataSetStr
seedCutStr = '$E_T^\mathrm{seed} >\ %d\ \mathrm{GeV}$' % args.seedEt_thresh
noiseCutStr = '$E_T^\mathrm{tower} >\ %d\ \mathrm{GeV}$' % args.noise_filter
towerThrStr = '$\\rho\left(E_T^\mathrm{tower} <\ %d\ \mathrm{GeV}\\right)$' % args.tower_thresh

helpers = PlotHelpers(dataSetStr=dataSetStr,
                      seedCutStr=seedCutStr,
                      noiseCutStr=noiseCutStr,
                      towerThrStr=towerThrStr)

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

# buildin plots for pt
print "pt combined"
fig, ax = pl.subplots(figsize=helpers.figsize)
n, bins, weightedPatches = ax.hist(data['oJet.pt'],
                                   weights=data['weight'],
                                   bins=np.arange(0, 500, 2),
                                   stacked=True,
                                   fill=False,
                                   histtype='step',
                                   color='b',
startTime_processor = time.clock()

filename_id = "seed{:0.0f}_noise{:0.0f}_signal{:0.0f}_digitization{:0.0f}".format(args.seedEt_thresh, args.noise_filter, args.tower_thresh, args.digitization)
filename = "data/seed{:0.0f}/leading_jets_{}.pkl".format(args.seedEt_thresh, filename_id)
data = pickle.load(file(filename))

endTime_wall      = time.time()
endTime_processor = time.clock()
print "Finished reading in data:\n\t Wall time: %0.2f s \n\t Clock Time: %0.2f s" % ((endTime_wall - startTime_wall), (endTime_processor - startTime_processor))

dataSetStr  = plotConfigs.dataSetStr
seedCutStr  = '$E_T^\mathrm{seed} >\ %d\ \mathrm{GeV}$' % args.seedEt_thresh
noiseCutStr = '$E_T^\mathrm{tower} >\ %d\ \mathrm{GeV}$' % args.noise_filter
towerThrStr = '$\\rho\left(E_T^\mathrm{tower} <\ %d\ \mathrm{GeV}\\right)$' % args.tower_thresh

helpers = PlotHelpers(dataSetStr=dataSetStr, seedCutStr=seedCutStr, noiseCutStr=noiseCutStr, towerThrStr=towerThrStr, labelsize=28)

tJet_exists = data['tJet.et'] > 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"