-
Notifications
You must be signed in to change notification settings - Fork 1
/
EnergyDependencePlot.py
212 lines (202 loc) · 7.81 KB
/
EnergyDependencePlot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
import ROOT
import numpy as np
ROOT.gStyle.SetOptStat(0)
root_s_NuclPhysA772 = [2.7, 3.32, 3.84, 4.30, 4.85, 8.76, 12.3, 17.3, 130., 200.]
root_s_PhysRevC96 = [7.7, 11.5, 19.6, 27.0, 39.0, 62.4, 200.]
root_s_PhysLettB738 = [11.5, 19.6, 27., 39., 62.4, 200.]
root_s_Nature561 = [2760.]
root_s_ThisWork = [5020.]
root_s_err_NuclPhysA772 = [0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]
root_s_err_PhysRevC96 = [0., 0., 0., 0., 0., 0., 0.]
root_s_err_PhysLettB738 = [0., 0., 0., 0., 0., 0.]
root_s_err_Nature561 = [0.]
root_s_err_ThisWork = [0.]
mu_b_NuclPhysA772 = [760., 670., 615., 580., 537., 403., 298., 240., 38., 20.]
mu_b_PhysRevC96 = [398.2, 287.3, 187.9, 144.4, 103.2, 69.8, 28.4]
mu_b_PhysLettB738 = [326.7, 192.5, 140.4, 99.9, 66.4, 24.3]
mu_b_Nature561 = [0.7]
mu_b_ThisWork = [0.71]
mu_b_err_NuclPhysA772 = [20., 16., 8., 11., 10., 16., 19., 18., 11., 4.]
mu_b_err_PhysRevC96 = [16.4, 12.5, 8.6, 7.2, 7.4, 5.6, 5.8]
mu_b_err_PhysLettB738 = [25.9, 3.9, 1.4, 1.4, 0.6, 0.6]
mu_b_err_Nature561 = [3.8]
mu_b_err_ThisWork = [0.45]
param = ROOT.TF1("param", "[0]/(1.+[1]*x)", 1., 10000.)
param.SetParameter(0, 1307.5)
param.SetParameter(1, 0.288)
param.SetLineColor(ROOT.kBlack)
frame = ROOT.TH2D("frame", ";#sqrt{#it{s}_{NN}} (GeV);#it{#mu}_{B} (MeV)", 1, 2., 9000., 1, -50, 850.)
g1 = ROOT.TGraphErrors(10, np.array(root_s_NuclPhysA772), np.array(mu_b_NuclPhysA772), np.array(root_s_err_NuclPhysA772), np.array(mu_b_err_NuclPhysA772))
g3 = ROOT.TGraphErrors(7, np.array(root_s_PhysRevC96), np.array(mu_b_PhysRevC96), np.array(root_s_err_PhysRevC96), np.array(mu_b_err_PhysRevC96))
g2 = ROOT.TGraphErrors(6, np.array(root_s_PhysLettB738), np.array(mu_b_PhysLettB738), np.array(root_s_err_PhysLettB738), np.array(mu_b_err_PhysLettB738))
g4 = ROOT.TGraphErrors(1, np.array(root_s_Nature561), np.array(mu_b_Nature561), np.array(root_s_err_Nature561), np.array(mu_b_err_Nature561))
g5 = ROOT.TGraphErrors(1, np.array(root_s_ThisWork), np.array(mu_b_ThisWork), np.array(root_s_err_ThisWork), np.array(mu_b_err_ThisWork))
g1.SetMarkerStyle(53)
g3.SetMarkerStyle(54)
g2.SetMarkerStyle(56)
g4.SetMarkerStyle(57)
g5.SetMarkerStyle(20)
g1.SetMarkerSize(1.)
g3.SetMarkerSize(1.)
g2.SetMarkerSize(1.)
g4.SetMarkerSize(1.)
g5.SetMarkerSize(1.)
g1.SetLineWidth(2)
g3.SetLineWidth(2)
g2.SetLineWidth(2)
g4.SetLineWidth(2)
g5.SetLineWidth(2)
g1.SetMarkerColor(ROOT.kGreen+2)
g3.SetMarkerColor(ROOT.kOrange+7)
g2.SetMarkerColor(ROOT.kAzure-3)
g4.SetMarkerColor(ROOT.kViolet+1)
g5.SetMarkerColor(ROOT.kRed)
g1.SetLineColor(ROOT.kGreen+2)
g3.SetLineColor(ROOT.kOrange+7)
g2.SetLineColor(ROOT.kAzure-3)
g4.SetLineColor(ROOT.kViolet+1)
g5.SetLineColor(ROOT.kRed)
frame2 = ROOT.TH2D("frame2", ";#sqrt{#it{s}_{NN}} (GeV);", 1, 2., 9000., 1, -35., 35.)
g1_compare = ROOT.TGraphErrors(10, np.array(root_s_NuclPhysA772), np.array(mu_b_NuclPhysA772), np.array(root_s_err_NuclPhysA772), np.array(mu_b_err_NuclPhysA772))
g3_compare = ROOT.TGraphErrors(7, np.array(root_s_PhysRevC96), np.array(mu_b_PhysRevC96), np.array(root_s_err_PhysRevC96), np.array(mu_b_err_PhysRevC96))
g2_compare = ROOT.TGraphErrors(6, np.array(root_s_PhysLettB738), np.array(mu_b_PhysLettB738), np.array(root_s_err_PhysLettB738), np.array(mu_b_err_PhysLettB738))
g4_compare = ROOT.TGraphErrors(1, np.array(root_s_Nature561), np.array(mu_b_Nature561), np.array(root_s_err_Nature561), np.array(mu_b_err_Nature561))
g5_compare = ROOT.TGraphErrors(1, np.array(root_s_ThisWork), np.array(mu_b_ThisWork), np.array(root_s_err_ThisWork), np.array(mu_b_err_ThisWork))
gTot = ROOT.TGraphErrors()
for g in zip([g1_compare, g3_compare, g2_compare, g4_compare, g5_compare],[g1, g3, g2, g4, g5]):
for i_p in range(g[0].GetN()):
par = param.Eval(g[0].GetPointX(i_p))
g[0].SetPointY(i_p,g[0].GetPointY(i_p)-par)
gTot.AddPoint(g[0].GetPointX(i_p),g[0].GetPointY(i_p))
gTot.SetPointError(gTot.GetN()-1,g[0].GetErrorX(i_p),g[0].GetErrorY(i_p))
g[0].SetMarkerStyle(g[1].GetMarkerStyle())
g[0].SetMarkerSize(g[1].GetMarkerSize())
g[0].SetMarkerColor(g[1].GetMarkerColor())
g[0].SetLineColor(g[1].GetLineColor())
g[0].SetLineWidth(g[1].GetLineWidth())
c = ROOT.TCanvas("c", "c", 500, 500)
pad1 = ROOT.TPad("pad1", "pad1", 0.0, 0., 1.0, 1.0, 0)
pad1.SetFillColor(0)
pad1.SetFrameBorderMode(0)
pad1.SetLeftMargin(0.15)
pad1.SetTopMargin(0.02)
pad1.SetRightMargin(0.02)
pad1.SetLogx()
#pad1.SetLogy()
pad1.Draw()
frame.GetYaxis().SetTitleFont(44)
frame.GetYaxis().SetTitleSize(25)
frame.GetYaxis().SetTitleOffset(1.4)
frame.GetYaxis().SetLabelFont(44)
frame.GetYaxis().SetLabelSize(20)
frame.GetYaxis().SetLabelOffset(0.008)
frame.GetXaxis().SetTitleFont(44)
frame.GetXaxis().SetTitleSize(25)
frame.GetXaxis().SetTitleOffset(1.)
frame.GetXaxis().SetLabelFont(44)
frame.GetXaxis().SetLabelSize(20)
frame.GetXaxis().SetLabelOffset(0.002)
pad2 = ROOT.TPad("pad2", "pad2", 0.0, 0.0, 1.0, 0.3, 0)
pad2.SetLogx()
pad2.SetFillColor(0)
pad2.SetFrameBorderMode(0)
pad2.SetFillColor(0)
pad2.SetFrameBorderMode(0)
pad2.SetTopMargin(0.0)
pad2.SetBottomMargin(0.25)
pad2.SetRightMargin(0.02)
frame2.GetXaxis().SetTitleFont(44)
frame2.GetXaxis().SetTitleSize(20)
frame2.GetXaxis().SetTitleOffset(0.6)
frame2.GetYaxis().SetTitleFont(44)
frame2.GetYaxis().SetTitleSize(17)
frame2.GetYaxis().SetTitleOffset(1.2)
frame2.GetYaxis().CenterTitle()
frame2.GetYaxis().SetNdivisions(210)
frame2.GetYaxis().SetTickLength(0.04)
frame2.GetXaxis().SetTickLength(0.07)
frame2.GetXaxis().SetLabelFont(44)
frame2.GetXaxis().SetLabelSize(17)
frame2.GetYaxis().SetLabelFont(44)
frame2.GetYaxis().SetLabelSize(16)
frame2.GetYaxis().SetLabelOffset(0.008)
pad2.SetGridy()
# pad2.Draw()
pad1.cd()
l = ROOT.TLegend(0.3,0.6,0.7,0.95)
l.SetTextFont(44)
l.SetTextSize(18)
frame.Draw()
#g1.Fit(param)
pad1.cd()
pad3 = ROOT.TPad("pad3", "pad3", 0.4, 0.18, 0.93, 0.57)
pad3.SetFillColor(0)
pad3.SetFrameBorderMode(0)
pad3.SetFillColor(0)
pad3.SetFrameBorderMode(0)
pad3.SetLeftMargin(0.2)
pad3.SetTopMargin(0.02)
pad3.SetBottomMargin(0.34)
pad3.SetRightMargin(0.02)
pad3.Draw()
pad1.cd()
param.Draw("lsame")
g1.Draw("pesame")
g3.Draw("pesame")
g2.Draw("pesame")
g4.Draw("pesame")
g5.Draw("pesame")
l.AddEntry(g1, "Nucl. Phys. A 772, 167-199 (2006)", "pe")
l.AddEntry(g2, "Phys. Lett. B 738, 305-310 (2014)", "pe")
l.AddEntry(g3, "Phys. Rev. C 96, 044904 (2017)", "pe")
l.AddEntry(g4, "Nature 561, 321-330 (2018)", "pe")
l.AddEntry(g5, "ALICE, Pb#minusPb, #sqrt{#it{s}_{NN}} = 5.02 TeV", "pe")
l.AddEntry(param, "Param., Nature 561, 321-330 (2018)", "l")
l.Draw("same")
# pad2.cd()
# frame2.Draw()
# g1_compare.Draw("pesame")
# g3_compare.Draw("pesame")
# g2_compare.Draw("pesame")
# g4_compare.Draw("pesame")
# g5_compare.Draw("pesame")
# ytitle = ROOT.TLatex()
# ytitle.SetTextFont(44)
# ytitle.SetTextSize(19)
# ytitle.SetTextAngle(90.)
# ytitle.SetNDC()
# ytitle.DrawLatex(0.045, .08, "dat. - par. (MeV)")
#gTot.Fit("pol0")
#gTot.Draw("pesame")
pad3.cd()
frame3 = ROOT.TH2D("frame3", ";#sqrt{#it{s}_{NN}} (TeV);#it{#mu}_{B} (MeV)", 1, 2., 6., 1, -3.5, 5.)
g4_cpy = ROOT.TGraphErrors(g4)
g4_cpy.SetPointX(0, g4_cpy.GetPointX(0)*1.e-3)
g5_cpy = ROOT.TGraphErrors(g5)
g5_cpy.SetPointX(0, g5_cpy.GetPointX(0)*1.e-3)
param_cpy = ROOT.TF1(param)
param_cpy.SetParameter(1, param_cpy.GetParameter(1)*1.e3)
frame3.GetXaxis().SetTitleFont(44)
frame3.GetXaxis().SetTitleSize(20)
frame3.GetXaxis().SetTitleOffset(1.1)
frame3.GetYaxis().SetTitleFont(44)
frame3.GetYaxis().SetTitleSize(20)
frame3.GetYaxis().SetTitleOffset(1.05)
frame3.GetYaxis().SetNdivisions(5)
frame3.GetXaxis().SetNdivisions(10)
frame3.GetYaxis().SetTickLength(0.04)
frame3.GetXaxis().SetTickLength(0.05)
frame3.GetXaxis().SetLabelFont(44)
frame3.GetXaxis().SetLabelOffset(0.015)
frame3.GetYaxis().SetLabelOffset(0.015)
frame3.GetXaxis().SetLabelSize(16)
frame3.GetYaxis().SetLabelFont(44)
frame3.GetYaxis().SetLabelSize(16)
frame3.Draw()
param_cpy.Draw("lsame")
g4_cpy.Draw("pesame")
g5_cpy.Draw("pesame")
c.Print("MuBvsSqrtS.pdf")
fo = ROOT.TFile("C.root", "recreate")
c.Write()
fo.Close()