import ROOT
import os
import glob
%jsroot on
f = ROOT.TFile('../../HF-jets/ana_results/iter2/LHC15n/AnalysisResults.root')
t = ROOT.gROOT.FindObject('JetTree_AliAnalysisTaskJetExtractor_Jet_AKTChargedR040_tracks_pT0150_E_scheme_allJets')
# ROOT.gROOT.Reset()
c1 = ROOT.TCanvas( 'c1', 'Example', 200, 10, 700, 500 )
c1.Draw()
h_jet_phi = ROOT.TH1D('h_jet_phi', 'h_jet_phi', 100, 0, 6.283)
h_jet_phi.GetXaxis().SetTitle('jet phi')
t.Draw('Jet_Phi >> h_jet_phi', '', 'e1x0')
# h_jet_phi.DrawCopy()
ROOT.gROOT.Reset()
c1_2 = ROOT.TCanvas( 'c1_2', '', 200, 10, 700, 500 )
c1_2.Draw()
h_track_phi = ROOT.TH1D('h_track_phi', 'h_track_phi', 100, 0, 6.283)
h_track_phi.GetXaxis().SetTitle('track phi')
t.Draw('Jet_Track_Phi >> h_track_phi', '', 'e1x0')
# h_phi.GetYaxis().SetRangeUser(6000,8000)
# c1.Draw()
f_old = ROOT.TFile('../../HF-jets/ana_results/iter1/LHC15n_v2/AnalysisResults.root')
t_old = ROOT.gROOT.FindObject('JetTree_AliAnalysisTaskJetExtractor_Jet_AKTChargedR040_tracks_pT0150_E_scheme_allJets')
c1 = ROOT.TCanvas( 'c1', 'Example', 200, 10, 700, 500 )
c1.Draw()
h_jet_phi = ROOT.TH1D('h_jet_phi', 'h_jet_phi', 100, 0, 6.283)
h_jet_phi.GetXaxis().SetTitle('jet phi')
t_old.Draw('Jet_Phi >> h_jet_phi', '', 'e1x0')
c1_2 = ROOT.TCanvas( 'c1_2', '', 200, 10, 700, 500 )
c1_2.Draw()
h_track_phi = ROOT.TH1D('h_track_phi', 'h_track_phi', 100, 0, 6.283)
h_track_phi.GetXaxis().SetTitle('track phi')
t_old.Draw('Jet_Track_Phi >> h_track_phi','','e1x0')
canvases = []
data_files = glob.glob('../../HF-jets/ana_results/iter2/LHC15n/myOutputDir/*/AnalysisResults.root')
for i,run_file in enumerate(data_files):
ROOT.gROOT.Reset()
print(f'{run_file}, {i+1}/{len(data_files)}')
run = run_file.split('/')[-2]
f_run = ROOT.TFile(run_file)
t_run = ROOT.gROOT.FindObject('JetTree_AliAnalysisTaskJetExtractor_Jet_AKTChargedR040_tracks_pT0150_E_scheme_allJets')
c = ROOT.TCanvas( 'c_'+run, 'c_'+run, 200, 10, 950, 400 )
c.Draw()
pad1 = ROOT.TPad("pad1"+run, "pad1"+run, 0, 0, 0.5, 1)
# pad1.SetGridx()
pad1.Draw()
# Lower ratio plot is pad2
c.cd() # returns to main canvas before defining pad2
pad2 = ROOT.TPad("pad2"+run, "pad2"+run, 0.5, 0, 1, 1)
# pad2.SetBottomMargin(0.2)
# pad2.SetGridx()
pad2.Draw()
pad1.cd()
h_jet_phi = ROOT.TH1D('h_jet_phi', 'h_jet_phi', 100, 0, 6.283)
h_jet_phi.SetTitle(run)
h_jet_phi.GetXaxis().SetTitle('jet phi')
t_run.Draw('Jet_Phi >> h_jet_phi', '', 'goff')
h_jet_phi.DrawCopy('e1x0')
# c2 = ROOT.TCanvas( 'c_2_'+run, 'c_2_'+run, 200, 10, 700, 500 )
# c2.Draw()
pad2.cd()
h_track_phi = ROOT.TH1D('h_track_phi', 'h_track_phi', 100, 0, 6.283)
h_track_phi.SetTitle(run)
h_track_phi.GetXaxis().SetTitle('track phi')
t_run.Draw('Jet_Track_Phi >> h_track_phi', '', 'goff')
h_track_phi.DrawCopy('e1x0')
print('done')
# canvases.append(c)
# canvases.append(c2)
# ROOT.gROOT.GetListOfCanvases().Draw()
nothing suspicious in $\eta\;\mathrm{vs}\;\phi$ and $p_T$ distributions
canvases = []
data_files = glob.glob('../../HF-jets/ana_results/iter2/LHC15n/myOutputDir/*/AnalysisResults.root')
for i,run_file in enumerate(data_files):
# ROOT.gROOT.Reset()
print(f'{run_file}, {i+1}/{len(data_files)}')
run = run_file.split('/')[-2]
f_run = ROOT.TFile(run_file)
t_run = ROOT.gROOT.FindObject('JetTree_AliAnalysisTaskJetExtractor_Jet_AKTChargedR040_tracks_pT0150_E_scheme_allJets')
c = ROOT.TCanvas( 'c_'+run, 'c_'+run, 200, 10, 950, 400 )
c.Draw()
pad1 = ROOT.TPad("pad1"+run, "pad1"+run, 0, 0, 0.5, 1)
# pad1.SetGridx()
pad1.Draw()
# Lower ratio plot is pad2
c.cd() # returns to main canvas before defining pad2
pad2 = ROOT.TPad("pad2"+run, "pad2"+run, 0.5, 0, 1, 1)
# pad2.SetBottomMargin(0.2)
# pad2.SetGridx()
pad2.Draw()
cut = 'Jet_Pt > 5'
pad1.cd()
h_jet_phi_eta = ROOT.TH2D('h_jet_phi_eta', 'h_jet_phi_eta', 12, -0.6, 0.6, 50, 0, 6.283)
h_jet_phi_eta.SetTitle(run)
h_jet_phi_eta.GetXaxis().SetTitle('jet eta')
h_jet_phi_eta.GetYaxis().SetTitle('jet phi')
t_run.Draw('Jet_Phi:Jet_Eta >> h_jet_phi_eta', cut, 'goff')
h_jet_phi_eta.DrawCopy('colz')
# c2 = ROOT.TCanvas( 'c_2_'+run, 'c_2_'+run, 200, 10, 700, 500 )
# c2.Draw()
pad2.cd()
pad2.SetLogy(1)
h_jet_pt = ROOT.TH1D('h_jet_pt', 'h_jet_pt', 100, 0, 100)
h_jet_pt.SetTitle(run)
h_jet_pt.GetXaxis().SetTitle('jet pt')
t_run.Draw('Jet_Pt >> h_jet_pt', cut, 'goff')
h_jet_pt.DrawCopy()
print('done')
f_run.Close()
# canvases.append(c)
# canvases.append(c2)
# ROOT.gROOT.GetListOfCanvases().Draw()
%jsroot off
# f = ROOT.TFile('../../HF-jets/ana_results/iter2/LHC15n/myOutputDir/000244484/AnalysisResults.root')
f = ROOT.TFile('../../HF-jets/ana_results/iter2/LHC15n/AnalysisResults.root')
t = ROOT.gROOT.FindObject('JetTree_AliAnalysisTaskJetExtractor_Jet_AKTChargedR040_tracks_pT0150_E_scheme_allJets')
c1 = ROOT.TCanvas( 'c1', 'Example', 800,600 )
var = 'Jet_Track_IPd'
args = 100, -1, 1
histtype = ROOT.TH1D
h_bump = histtype('h_bump' , 'h_bump' , *args)
h_center = histtype('h_center', 'h_center', *args)
h_tail = histtype('h_tail' , 'h_tail' , *args)
h_neg = histtype('h_neg' , 'h_neg' , *args)
h_all = histtype('h_all' , 'h_all' , *args)
# h_all.GetYaxis().SetRangeUser(0,1000000)
h_all.SetLineColor(ROOT.kBlack)
h_center.SetLineColor(ROOT.kBlue)
h_tail.SetLineColor(ROOT.kGreen)
h_neg.SetLineColor(ROOT.kMagenta)
h_bump.SetLineColor(ROOT.kRed)
h_bump.SetLineWidth(3)
# h_all.SetFillColor(ROOT.kBlack)
h_center.SetFillColor(ROOT.kBlue)
h_tail.SetFillColor(ROOT.kGreen)
h_neg.SetFillColor(ROOT.kMagenta)
h_bump.SetFillColor(ROOT.kRed)
t.Draw(f'{var} >> h_all' , 'Jet_Pt > 10 & Jet_Pt < 50' , 'goff')
t.Draw(f'{var} >> h_bump' , 'Jet_Pt > 10 & Jet_Pt < 50 & Jet_Track_IPd > 0.2 & Jet_Track_IPd < 0.3' , 'goff')
t.Draw(f'{var} >> h_neg' , 'Jet_Pt > 10 & Jet_Pt < 50 & Jet_Track_IPd < -0.2 & Jet_Track_IPd > -0.3', 'goff')
t.Draw(f'{var} >> h_center', 'Jet_Pt > 10 & Jet_Pt < 50 & abs(Jet_Track_IPd) < 0.05' , 'goff')
t.Draw(f'{var} >> h_tail' , 'Jet_Pt > 10 & Jet_Pt < 50 & abs(Jet_Track_IPd) > 0.4' , 'goff')
print(f'num. entries: \n\t all: \t{h_all.GetEntries()} \n\t center:\t{h_center.GetEntries()}\n\t tail: \t{h_tail.GetEntries()}\n\t neg: \t{h_neg.GetEntries()}\n\t bump: \t{h_bump.GetEntries()}')
%jsroot on
c1 = ROOT.TCanvas( 'c1', 'c1', 600,400 )
c1.Draw()
c1.GetPad(0).SetLogy(1)
h_all.Draw()
# c2 = ROOT.TCanvas( 'c2', 'c2', 600,400 )
h_center.Draw('same')
# c3 = ROOT.TCanvas( 'c3', 'c3', 600,400 )
h_tail.Draw('same')
# c4 = ROOT.TCanvas( 'c4', 'c4', 600,400 )
h_neg.Draw('same')
# c5 = ROOT.TCanvas( 'c5', 'c5', 600,400 )
h_bump.Draw('same')
# f = ROOT.TFile('../../HF-jets/ana_results/iter2/LHC15n/myOutputDir/000244484/AnalysisResults.root')
f = ROOT.TFile('../../HF-jets/ana_results/iter2/LHC15n/AnalysisResults.root')
t = ROOT.gROOT.FindObject('JetTree_AliAnalysisTaskJetExtractor_Jet_AKTChargedR040_tracks_pT0150_E_scheme_allJets')
c1 = ROOT.TCanvas( 'c1', 'Example', 800,600 )
var = 'Jet_Track_Phi : Jet_Track_Eta'
args = 15, -1, 1, 50, 0, 6.283
histtype=ROOT.TH2D
h_bump = histtype('h_bump' , 'h_bump' , *args)
h_center = histtype('h_center', 'h_center', *args)
h_tail = histtype('h_tail' , 'h_tail' , *args)
h_neg = histtype('h_neg' , 'h_neg' , *args)
h_all = histtype('h_all' , 'h_all' , *args)
# h_all.GetYaxis().SetRangeUser(0,1000000)
h_all.SetLineColor(ROOT.kBlack)
h_center.SetLineColor(ROOT.kBlue)
h_tail.SetLineColor(ROOT.kGreen)
h_neg.SetLineColor(ROOT.kMagenta)
h_bump.SetLineColor(ROOT.kRed)
h_bump.SetLineWidth(3)
t.Draw(f'{var} >> h_all' , 'Jet_Pt > 10 & Jet_Pt < 50' , 'goff')
t.Draw(f'{var} >> h_bump' , 'Jet_Pt > 10 & Jet_Pt < 50 & Jet_Track_IPd > 0.2 & Jet_Track_IPd < 0.3' , 'goff')
t.Draw(f'{var} >> h_neg' , 'Jet_Pt > 10 & Jet_Pt < 50 & Jet_Track_IPd < -0.2 & Jet_Track_IPd > -0.3', 'goff')
t.Draw(f'{var} >> h_center', 'Jet_Pt > 10 & Jet_Pt < 50 & abs(Jet_Track_IPd) < 0.05' , 'goff')
t.Draw(f'{var} >> h_tail' , 'Jet_Pt > 10 & Jet_Pt < 50 & abs(Jet_Track_IPd) > 0.4' , 'goff')
print(f'num. entries: \n\t all: \t{h_all.GetEntries()} \n\t center:\t{h_center.GetEntries()}\n\t tail: \t{h_tail.GetEntries()}\n\t neg: \t{h_neg.GetEntries()}\n\t bump: \t{h_bump.GetEntries()}')
c1 = ROOT.TCanvas( 'c1', 'c1', 600,400 )
h_all.Draw('colz')
c2 = ROOT.TCanvas( 'c2', 'c2', 600,400 )
h_center.Draw('colz')
c3 = ROOT.TCanvas( 'c3', 'c3', 600,400 )
h_tail.Draw('colz')
c4 = ROOT.TCanvas( 'c4', 'c4', 600,400 )
h_neg.Draw('colz')
c5 = ROOT.TCanvas( 'c5', 'c5', 600,400 )
h_bump.Draw('colz')
c1.Draw()
c2.Draw()
c3.Draw()
c4.Draw()
c5.Draw()
# f = ROOT.TFile('../../HF-jets/ana_results/iter2/LHC15n/myOutputDir/000244484/AnalysisResults.root')
f = ROOT.TFile('../../HF-jets/ana_results/iter2/LHC15n/AnalysisResults.root')
t = ROOT.gROOT.FindObject('JetTree_AliAnalysisTaskJetExtractor_Jet_AKTChargedR040_tracks_pT0150_E_scheme_allJets')
c1 = ROOT.TCanvas( 'c1', 'Example', 800,600 )
var = 'Jet_Track_Phi'
args = 100, 0, 6.283
histtype = ROOT.TH1D
h_bump = histtype('h_bump' , 'h_bump' , *args)
h_center = histtype('h_center', 'h_center', *args)
h_tail = histtype('h_tail' , 'h_tail' , *args)
h_neg = histtype('h_neg' , 'h_neg' , *args)
h_all = histtype('h_all' , 'h_all' , *args)
# h_all.GetYaxis().SetRangeUser(0,1000000)
h_all.SetLineColor(ROOT.kBlack)
h_center.SetLineColor(ROOT.kBlue)
h_tail.SetLineColor(ROOT.kGreen)
h_neg.SetLineColor(ROOT.kMagenta)
h_bump.SetLineColor(ROOT.kRed)
h_bump.SetLineWidth(3)
t.Draw(f'{var} >> h_all' , 'Jet_Pt > 10 & Jet_Pt < 50' , 'goff')
t.Draw(f'{var} >> h_bump' , 'Jet_Pt > 10 & Jet_Pt < 50 & Jet_Track_IPd > 0.2 & Jet_Track_IPd < 0.3' , 'goff')
t.Draw(f'{var} >> h_neg' , 'Jet_Pt > 10 & Jet_Pt < 50 & Jet_Track_IPd < -0.2 & Jet_Track_IPd > -0.3', 'goff')
t.Draw(f'{var} >> h_center', 'Jet_Pt > 10 & Jet_Pt < 50 & abs(Jet_Track_IPd) < 0.05' , 'goff')
t.Draw(f'{var} >> h_tail' , 'Jet_Pt > 10 & Jet_Pt < 50 & abs(Jet_Track_IPd) > 0.4' , 'goff')
print(f'num. entries: \n\t all: \t{h_all.GetEntries()} \n\t center:\t{h_center.GetEntries()}\n\t tail: \t{h_tail.GetEntries()}\n\t neg: \t{h_neg.GetEntries()}\n\t bump: \t{h_bump.GetEntries()}')
c1 = ROOT.TCanvas( 'c1', 'c1', 600,400 )
h_all.Draw('colz')
c2 = ROOT.TCanvas( 'c2', 'c2', 600,400 )
h_center.Draw('colz')
c3 = ROOT.TCanvas( 'c3', 'c3', 600,400 )
h_tail.Draw('colz')
c4 = ROOT.TCanvas( 'c4', 'c4', 600,400 )
h_neg.Draw('colz')
c5 = ROOT.TCanvas( 'c5', 'c5', 600,400 )
h_bump.Draw('colz')
c1.Draw()
c2.Draw()
c3.Draw()
c4.Draw()
c5.Draw()
# f = ROOT.TFile('../../HF-jets/ana_results/iter2/LHC15n/myOutputDir/000244484/AnalysisResults.root')
f = ROOT.TFile('../../HF-jets/ana_results/iter2/LHC15n/AnalysisResults.root')
t = ROOT.gROOT.FindObject('JetTree_AliAnalysisTaskJetExtractor_Jet_AKTChargedR040_tracks_pT0150_E_scheme_allJets')
c1 = ROOT.TCanvas( 'c1', 'Example', 800,600 )
var = 'Jet_Track_Pt'
args = 50, 0, 25
histtype = ROOT.TH1D
# var = 'Jet_Track_Phi : Jet_Track_Eta'
# args = 25, -1, 1, 25, 0, 6.283
# histtype=ROOT.TH2D
h_bump = histtype('h_bump' , 'h_bump' , *args)
h_center = histtype('h_center', 'h_center', *args)
h_tail = histtype('h_tail' , 'h_tail' , *args)
h_neg = histtype('h_neg' , 'h_neg' , *args)
h_all = histtype('h_all' , 'h_all' , *args)
# h_all.GetYaxis().SetRangeUser(0,1000000)
h_all.SetLineColor(ROOT.kBlack)
h_center.SetLineColor(ROOT.kBlue)
h_tail.SetLineColor(ROOT.kGreen)
h_neg.SetLineColor(ROOT.kMagenta)
h_bump.SetLineColor(ROOT.kRed)
h_bump.SetLineWidth(3)
t.Draw(f'{var} >> h_all' , 'Jet_Pt > 10 & Jet_Pt < 50' , 'goff')
t.Draw(f'{var} >> h_bump' , 'Jet_Pt > 10 & Jet_Pt < 50 & Jet_Track_IPd > 0.2 & Jet_Track_IPd < 0.3' , 'goff')
t.Draw(f'{var} >> h_neg' , 'Jet_Pt > 10 & Jet_Pt < 50 & Jet_Track_IPd < -0.2 & Jet_Track_IPd > -0.3', 'goff')
t.Draw(f'{var} >> h_center', 'Jet_Pt > 10 & Jet_Pt < 50 & abs(Jet_Track_IPd) < 0.05' , 'goff')
t.Draw(f'{var} >> h_tail' , 'Jet_Pt > 10 & Jet_Pt < 50 & abs(Jet_Track_IPd) > 0.4' , 'goff')
print(f'num. entries: \n\t all: \t{h_all.GetEntries()} \n\t center:\t{h_center.GetEntries()}\n\t tail: \t{h_tail.GetEntries()}\n\t neg: \t{h_neg.GetEntries()}\n\t bump: \t{h_bump.GetEntries()}')
c1 = ROOT.TCanvas( 'c1', 'c1', 600,400 )
h_all.Draw('colz')
c2 = ROOT.TCanvas( 'c2', 'c2', 600,400 )
h_center.Draw('colz')
c3 = ROOT.TCanvas( 'c3', 'c3', 600,400 )
h_tail.Draw('colz')
c4 = ROOT.TCanvas( 'c4', 'c4', 600,400 )
h_neg.Draw('colz')
c5 = ROOT.TCanvas( 'c5', 'c5', 600,400 )
h_bump.Draw('colz')
c1.GetPad(0).SetLogy(1)
c2.GetPad(0).SetLogy(1)
c3.GetPad(0).SetLogy(1)
c4.GetPad(0).SetLogy(1)
c5.GetPad(0).SetLogy(1)
c1.Draw()
c2.Draw()
c3.Draw()
c4.Draw()
c5.Draw()