Last active
July 28, 2023 16:39
-
-
Save jmduarte/c1cad6e4a842a38de848410ff8c16c67 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
llp_values = [] | |
for a in range(int(eventNum)): | |
tree.GetEntry(a) | |
# grab the LLP pt for each event | |
for b in range(len(tree.gen)): | |
if (tree.gen[b][1] == 1000006) or ((tree.gen[b][1] == -1000006)): | |
llp_pt = tree.gen[b][0].Pt() | |
# initialize pass triggger boolean to false | |
pass_trigger = False | |
for c in range(len(eventjets[a])): | |
if (eventjets[a][c].Pt() > 180) and (abs(eventjets[a][c].Eta()) < 2.4): | |
pass_trigger = True | |
break | |
llp_values.append((pass_trigger, llp_pt)) | |
h_all = r.TH1F(name="h_all", title='LLP gen pT', nbinsx=100, xlow=0, xup=2000) | |
h_trigger = r.TH1F(name="h_trigger", title='LLP gen pT', nbinsx=100, xlow=0, xup=2000) | |
h_effic = r.TEfficiency(name="h_effic", title='Single Jet Trigger Effic', nbinsx=100, xlow=0, xup=2000) | |
for i in range(len(llp_values)): | |
h_all.Fill(llp_values[i][1]) | |
if llp_values[i][0]: h_trigger.Fill(llp_values[i][1]) | |
h_effic.Fill(llp_values[i][0], llp_values[i][1]) | |
c = r.TCanvas() | |
h_all.SetLineColor(r.kBlack) | |
h_all.SetFillColor(r.kRed) | |
h_all.SetTitle('Full genLLP pT') | |
h_all.GetXaxis().SetTitle('pT [GeV]') | |
h_all.GetYaxis().SetTitle('Events') | |
h_all.Draw() | |
c.Draw() | |
c.SaveAs('full_llp_pT.png') | |
c.Clear() | |
h_trigger.SetLineColor(r.kBlue) | |
h_trigger.SetTitle('SingleJet + genLLP pT') | |
h_trigger.GetXaxis().SetTitle('pT [GeV]') | |
h_trigger.GetYaxis().SetTitle('Events') | |
h_trigger.Draw() | |
c.Draw() | |
c.SaveAs('singleJet_llp_pT.png') | |
c.Clear | |
h_effic.SetLineColor(r.kGreen) | |
h_effic.SetTitle('SingleJet Efficiency') | |
h_effic.GetXaxis().SetTitle('pT [GeV]') | |
h_effic.GetYaxis().SetTitle('Efficiency') | |
h_effic.GetXaxis().SetRangeUser(0, 200) | |
h_effic.Draw() | |
c.Draw() | |
c.SaveAs('singleJet_effic.png') | |
c.Clear |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment