This macro is an example of graphs in log scales with annotations.
The presented results are predictions of invariant cross-section of Direct Photons produced at RHIC energies, based on the universality of scaling function H(z).
These Figures were published in JINR preprint E2-98-64, Dubna, 1998 and submitted to CPC.
3 from array
import array
6 Z = array(
'f', [0.]*NMAX )
7 HZ = array(
'f', [0.]*NMAX )
8 PT = array(
'f', [0.]*NMAX )
9 INVSIG = array(
'f', [0.]*NMAX )
15 def hz_calc( ENERG, DENS, TGRAD, PTMIN, PTMAX, DELP ):
16 from math
import sin, cos, sqrt
18 global Z, HZ, PT, INVSIG
43 NLOOP = int((PTMAX-PTMIN)/DELP)
45 for I
in range(NLOOP):
47 PTOT = PT[I]/
sin(THET)
49 ETOT =
sqrt(M1*M1 + PTOT*PTOT)
50 PB1 =
sqrt(EB1*EB1 - MB1*MB1)
51 PB2 =
sqrt(EB2*EB2 - MB2*MB2)
52 P2P3 = EB2*ETOT+PB2*PTOT*
cos(THET)
53 P1P2 = EB2*EB1+PB2*PB1
54 P1P3 = EB1*ETOT-PB1*PTOT*
cos(THET)
58 Y1 = X1+
sqrt(X1*X2*(1.-X1)/(1.-X2))
59 Y2 = X2+
sqrt(X1*X2*(1.-X2)/(1.-X1))
61 S = (MB1*MB1)+2.*P1P2+(MB2*MB2)
62 SMIN = 4.*((MB1*MB1)*(X1*X1) +2.*X1*X2*P1P2+(MB2*MB2)*(X2*X2))
63 SX1 = 4.*( 2*(MB1*MB1)*X1+2*X2*P1P2)
64 SX2 = 4.*( 2*(MB2*MB2)*X2+2*X1*P1P2)
66 DELM =
pow((1.-Y1)*(1.-Y2),ALX)
68 Z[I] =
sqrt(SMIN)/DELM/
pow(DNDETA,BETA)
70 Y1X1 = 1. +X2*(1-2.*X1)/(2.*(Y1-X1)*(1.-X2))
71 Y1X2 = X1*(1-X1)/(2.*(Y1-X1)*(1.-X2)*(1.-X2))
72 Y2X1 = X2*(1-X2)/(2.*(Y2-X2)*(1.-X1)*(1.-X1))
73 Y2X2 = 1. +X1*(1-2.*X2)/(2.*(Y2-X2)*(1.-X1))
74 Y2X1X2= Y2X1*( (1.-2.*X2)/(X2*(1-X2)) -( Y2X2-1.)/(Y2-X2))
75 Y1X1X2= Y1X2*( (1.-2.*X1)/(X1*(1-X1)) -( Y1X1-1.)/(Y1-X1))
77 KX1=-DELM*(Y1X1*ALX/(1.-Y1) + Y2X1*ALX/(1.-Y2))
78 KX2=-DELM*(Y2X2*ALX/(1.-Y2) + Y1X2*ALX/(1.-Y1))
79 ZX1=Z[I]*(SX1/(2.*SMIN)-KX1/DELM)
80 ZX2=Z[I]*(SX2/(2.*SMIN)-KX2/DELM)
84 HZ[I]=KF1/
pow(Z[I],KF2)
85 INVSIG[I]=(HZ[I]*H1*16.)/S
90 from array
import array
92 global Z, HZ, PT, INVSIG
97 c1 = ROOT.TCanvas(
'zdemo',
'Monte Carlo Study of Z scaling', 10, 40, 800, 600 )
98 c1.Range( 0, 0, 25, 18 )
102 pl = ROOT.TPaveLabel( 1, 16.3, 24, 17.5,
103 'Z-scaling of Direct Photon Productions in pp Collisions at RHIC Energies',
'br' )
115 t.DrawLatex( 3.1, 15.5,
'M.Tokarev, E.Potrebenikova ')
116 t.DrawLatex( 14., 15.5,
'JINR preprint E2-98-64, Dubna, 1998 ')
119 pad1 = ROOT.TPad(
'pad1',
'This is pad1', 0.02, 0.02, 0.48, 0.83, 33 )
120 pad2 = ROOT.TPad(
'pad2',
'This is pad2', 0.52, 0.02, 0.98, 0.83, 33 )
125 saves[
'pad1' ] = pad1; saves[
'pad2' ] = pad2
136 hz_calc( energ, dens, tgrad, ptmin, ptmax, delp )
138 pad1.Range( -0.255174, -19.25, 2.29657, -6.75 )
143 pad1.DrawFrame( 1, 1e-18, 110, 1e-8 )
149 t.SetTextSize( 0.08 )
151 t.DrawLatex( 0.6, 0.85,
'p - p' )
153 t.SetTextSize( 0.05 )
154 t.DrawLatex( 0.6, 0.79,
'Direct #gamma' )
155 t.DrawLatex( 0.6, 0.75,
'#theta = 90^{o}' )
157 t.DrawLatex( 0.20, 0.45,
'Ed^{3}#sigma/dq^{3}' )
158 t.DrawLatex( 0.18, 0.40,
'(barn/Gev^{2})' )
160 t.SetTextSize( 0.045 )
161 t.SetTextColor( ROOT.kBlue )
162 t.DrawLatex( 0.22, 0.260,
'#sqrt{s} = 63(GeV)' )
163 t.SetTextColor( ROOT.kRed )
164 t.DrawLatex( 0.22, 0.205,
'#sqrt{s} = 200(GeV)' )
166 t.DrawLatex( 0.22, 0.15,
'#sqrt{s} = 500(GeV)' )
168 t.SetTextSize( 0.05 )
170 t.DrawLatex( 0.6, 0.06,
'q_{T} (Gev/c)' )
173 gr1 = ROOT.TGraph( NLOOP, PT, INVSIG )
175 gr1.SetLineColor( 38 )
176 gr1.SetMarkerColor( ROOT.kBlue )
177 gr1.SetMarkerStyle( 21 )
178 gr1.SetMarkerSize( 1.1 )
192 hz_calc( energ, dens, tgrad, ptmin, ptmax, delp )
194 gr2 = ROOT.TGraph( NLOOP, PT, INVSIG )
195 gr2.SetLineColor( 38 )
196 gr2.SetMarkerColor( ROOT.kRed )
197 gr2.SetMarkerStyle( 29 )
198 gr2.SetMarkerSize( 1.5 )
211 hz_calc( energ, dens, tgrad, ptmin, ptmax, delp )
213 gr3 = ROOT.TGraph( NLOOP, PT, INVSIG )
215 gr3.SetLineColor( 38 )
216 gr3.SetMarkerColor( 6 )
217 gr3.SetMarkerStyle( 8 )
218 gr3.SetMarkerSize( 1.1 )
222 dum = array(
'f', [0.] )
223 graph = ROOT.TGraph( 1, dum, dum )
224 graph.SetMarkerColor( ROOT.kBlue )
225 graph.SetMarkerStyle( 21 )
226 graph.SetMarkerSize( 1.1 )
227 graph.SetPoint( 0, 1.7, 1.e-16 )
229 saves[
'graph' ] = graph
231 graph = ROOT.TGraph( 1, dum, dum )
232 graph.SetMarkerColor( ROOT.kRed )
233 graph.SetMarkerStyle( 29 )
234 graph.SetMarkerSize( 1.5 )
235 graph.SetPoint( 0, 1.7, 2.e-17 )
237 saves[
'graph2' ] = graph
239 graph = ROOT.TGraph( 1, dum, dum )
240 graph.SetMarkerColor( 6 )
241 graph.SetMarkerStyle( 8 )
242 graph.SetMarkerSize( 1.1 )
243 graph.SetPoint( 0, 1.7, 4.e-18)
245 saves[
'graph3' ] = graph
248 pad2.Range( -0.43642, -23.75, 3.92778, -6.25 )
252 pad2.DrawFrame( 1, 1e-22, 3100, 1e-8 )
255 gr = ROOT.TGraph( NLOOP, Z, HZ )
256 gr.SetTitle(
'HZ vs Z' )
257 gr.SetFillColor( 19 )
259 gr.SetMarkerColor( 50 )
260 gr.SetMarkerStyle( 29 )
261 gr.SetMarkerSize( 1.5 )
269 t.SetTextSize( 0.08 )
271 t.DrawLatex( 0.6, 0.85,
'p - p' )
273 t.SetTextSize( 0.05 )
274 t.DrawLatex( 0.6, 0.79,
'Direct #gamma' )
275 t.DrawLatex( 0.6, 0.75,
'#theta = 90^{o}' )
277 t.DrawLatex( 0.70, 0.55,
'H(z)' )
278 t.DrawLatex( 0.68, 0.50,
'(barn)' )
280 t.SetTextSize( 0.045 )
282 t.DrawLatex( 0.20, 0.30,
'#sqrt{s}, GeV' )
283 t.DrawLatex( 0.22, 0.26,
'63' )
284 t.DrawLatex( 0.22, 0.22,
'200' )
285 t.DrawLatex( 0.22, 0.18,
'500' )
287 t.SetTextSize( 0.05 )
289 t.DrawLatex( 0.88, 0.06,
'z' )
296 if __name__ ==
'__main__':