ref["t#bar{t} incl."] = ref["t#bar{t}"] ref["W(#rightarrow l #nu) + jets"] = 418873 ref["QCD (MC)"] = 8090 ref["t-channel"] = 10828 previous = previous * Cut("met > 45") mc_amount(previous, weight, 12210, ref=ref) print print "1 tight b-tag" ref = dict() ref["t#bar{t}"] = 18779 ref["t#bar{t} incl."] = ref["t#bar{t}"] ref["W(#rightarrow l #nu) + jets"] = 6304 ref["QCD (MC)"] = 601 ref["t-channel"] = 4060 previous = previous * Cuts.n_tags(1) mc_amount(previous, weight, 12210, ref=ref) print print "jet rms < 0.025" ref = dict() ref["t#bar{t}"] = 14960 ref["t#bar{t} incl."] = ref["t#bar{t}"] ref["W(#rightarrow l #nu) + jets"] = 5134 ref["QCD (MC)"] = 447 ref["t-channel"] = 4412 previous = previous * Cuts.rms_lj mc_amount(previous, weight, 12210, ref=ref) print #cut = Cuts.mt_mu*Cuts.n_jets(2)*Cuts.n_tags(1)
#fname = "/Users/joosep/Documents/stpol/data/step3_trees_Mar28/T_t.root" sample = Sample.fromFile(args.infile) # ev_ids = dict() # for ev in sample.tree: # evid = int(ev.event_id) # if evid not in ev_ids.keys(): # ev_ids[evid] = 1 # else: # ev_ids[evid] += 1 cuts = dict() cuts["MT_mu"] = Cuts.mt_mu cuts["2J"] = Cuts.n_jets(2) cuts["1T"] = Cuts.n_tags(1) #cuts["eta_lj"] = Cuts.eta_lj cuts["rms_lj"] = Cuts.rms_lj cuts["eta_jet"] = Cuts.eta_jet cuts["top_mass_sig"] = Cuts.top_mass_sig def makeSequences(cutsD): cuts = cutsD.values() cut_sequences = [cuts[0]] for cut in cuts[1:]: new_sequence = cut_sequences[-1]*cut cut_sequences.append(new_sequence) return cut_sequences sequences = makeSequences(cuts)
x_label="N_{tags}", weight="pu_weight") ret2 = stack_plot( "n_tags", Cuts.mt_mu * Cuts.n_jets(3), #weight="pu_weight", name="n_tags_plot_3J", title="N_{tags} in mu, 3J, PUw.", do_log_y=False, x_label="N_{tags}", weight="pu_weight") ret3 = stack_plot( "top_mass", Cuts.mt_mu * Cuts.n_jets(2) * Cuts.n_tags(1) * Cuts.eta_lj, name="top_mass_plot_2J1T", title= "M_{bl#nu} in mu, M_{t}(W)>50 GeV, M_{t}(W)>50 GeV, 2J1T, #eta_{lj}>2.5, PUw., Bw.", x_label="M_{bl#nu} [GeV]", #skip_samples=["QCD (MC)"], weight="pu_weight*b_weight_nominal") ret4 = stack_plot( "cos_theta", Cuts.mt_mu * Cuts.n_jets(2) * Cuts.n_tags(1) * Cuts.eta_lj * Cuts.top_mass_sig, name="cos_theta_plot_2J1T", title= "cos #theta_{lj} in mu, M_{t}(W)>50 GeV, 2J1T, #eta_{lj}>2.5, M_{bl#nu} #in [130, 220] GeV", x_label="cos #theta_{lj}",
if __name__=="__main__": parser = argparse.ArgumentParser() args = parser.parse_args() #fname = "/Users/joosep/Documents/stpol/data/step3_trees_Mar28/T_t.root" fnames = [ "/Users/joosep/Documents/stpol/data/T_t.root", "/Users/joosep/Documents/stpol/data/step3_trees_Apr04/iso/mc/T_t.root", "/Users/joosep/Documents/stpol/data/step3_trees_Apr05_noPuClean/iso/mc/T_t.root", ] samples = [Sample.fromFile(f) for f in fnames] sample_names = ["Apr16 (fixed norm)", "Apr04", "Apr05 (no PU cl.)"] samps = zip(samples, sample_names) cut = Cuts.mt_mu*Cuts.n_jets(2)*Cuts.n_tags(1)*Cuts.eta_lj*Cuts.top_mass_sig hists = [] for sample, name in samps: hist = sample.drawHistogram("cos_theta", cut.cut_str, plot_range=[40, -1, 1]) #normalize to 20/fb hist.normalize_lumi(20000) hist.hist.SetName(name) hist.hist.SetTitle("%s: %.3E" % (name, hist.hist.Integral())) hist.update() hists.append(hist) print "%s: %.3E" % (name, hist.hist.Integral())
do_log_y=False, x_label="N_{tags}", weight="pu_weight" ) ret2 = stack_plot("n_tags", Cuts.mt_mu*Cuts.n_jets(3), #weight="pu_weight", name="n_tags_plot_3J", title="N_{tags} in mu, 3J, PUw.", do_log_y=False, x_label="N_{tags}", weight="pu_weight" ) ret3 = stack_plot("top_mass", Cuts.mt_mu*Cuts.n_jets(2)*Cuts.n_tags(1)*Cuts.eta_lj, name="top_mass_plot_2J1T", title="M_{bl#nu} in mu, M_{t}(W)>50 GeV, M_{t}(W)>50 GeV, 2J1T, #eta_{lj}>2.5, PUw., Bw.", x_label="M_{bl#nu} [GeV]", #skip_samples=["QCD (MC)"], weight="pu_weight*b_weight_nominal" ) ret4 = stack_plot("cos_theta", Cuts.mt_mu*Cuts.n_jets(2)*Cuts.n_tags(1)*Cuts.eta_lj*Cuts.top_mass_sig, name="cos_theta_plot_2J1T", title="cos #theta_{lj} in mu, M_{t}(W)>50 GeV, 2J1T, #eta_{lj}>2.5, M_{bl#nu} #in [130, 220] GeV", x_label="cos #theta_{lj}", #skip_samples=["QCD (MC)"], weight="pu_weight" )
# fname = "/Users/joosep/Documents/stpol/data/step3_trees_Mar28/T_t.root" sample = Sample.fromFile(args.infile) # ev_ids = dict() # for ev in sample.tree: # evid = int(ev.event_id) # if evid not in ev_ids.keys(): # ev_ids[evid] = 1 # else: # ev_ids[evid] += 1 cuts = dict() cuts["MT_mu"] = Cuts.mt_mu cuts["2J"] = Cuts.n_jets(2) cuts["1T"] = Cuts.n_tags(1) # cuts["eta_lj"] = Cuts.eta_lj cuts["rms_lj"] = Cuts.rms_lj cuts["eta_jet"] = Cuts.eta_jet cuts["top_mass_sig"] = Cuts.top_mass_sig def makeSequences(cutsD): cuts = cutsD.values() cut_sequences = [cuts[0]] for cut in cuts[1:]: new_sequence = cut_sequences[-1] * cut cut_sequences.append(new_sequence) return cut_sequences sequences = makeSequences(cuts)