20 from array
import array
23 Z = array(
'f', [0.]*NMAX )
24 HZ = array(
'f', [0.]*NMAX )
25 PT = array(
'f', [0.]*NMAX )
26 INVSIG = array(
'f', [0.]*NMAX )
32 def hz_calc( ENERG, DENS, TGRAD, PTMIN, PTMAX, DELP ):
33 from math
import sin, cos, sqrt
35 global Z, HZ, PT, INVSIG
60 NLOOP = int((PTMAX-PTMIN)/DELP)
62 for I
in range(NLOOP):
64 PTOT = PT[I]/
sin(THET)
66 ETOT =
sqrt(M1*M1 + PTOT*PTOT)
67 PB1 =
sqrt(EB1*EB1 - MB1*MB1)
68 PB2 =
sqrt(EB2*EB2 - MB2*MB2)
69 P2P3 = EB2*ETOT+PB2*PTOT*
cos(THET)
70 P1P2 = EB2*EB1+PB2*PB1
71 P1P3 = EB1*ETOT-PB1*PTOT*
cos(THET)
75 Y1 = X1+
sqrt(X1*X2*(1.-X1)/(1.-X2))
76 Y2 = X2+
sqrt(X1*X2*(1.-X2)/(1.-X1))
78 S = (MB1*MB1)+2.*P1P2+(MB2*MB2)
79 SMIN = 4.*((MB1*MB1)*(X1*X1) +2.*X1*X2*P1P2+(MB2*MB2)*(X2*X2))
80 SX1 = 4.*( 2*(MB1*MB1)*X1+2*X2*P1P2)
81 SX2 = 4.*( 2*(MB2*MB2)*X2+2*X1*P1P2)
83 DELM =
pow((1.-Y1)*(1.-Y2),ALX)
85 Z[I] =
sqrt(SMIN)/DELM/
pow(DNDETA,BETA)
87 Y1X1 = 1. +X2*(1-2.*X1)/(2.*(Y1-X1)*(1.-X2))
88 Y1X2 = X1*(1-X1)/(2.*(Y1-X1)*(1.-X2)*(1.-X2))
89 Y2X1 = X2*(1-X2)/(2.*(Y2-X2)*(1.-X1)*(1.-X1))
90 Y2X2 = 1. +X1*(1-2.*X2)/(2.*(Y2-X2)*(1.-X1))
91 Y2X1X2= Y2X1*( (1.-2.*X2)/(X2*(1-X2)) -( Y2X2-1.)/(Y2-X2))
92 Y1X1X2= Y1X2*( (1.-2.*X1)/(X1*(1-X1)) -( Y1X1-1.)/(Y1-X1))
94 KX1=-DELM*(Y1X1*ALX/(1.-Y1) + Y2X1*ALX/(1.-Y2))
95 KX2=-DELM*(Y2X2*ALX/(1.-Y2) + Y1X2*ALX/(1.-Y1))
96 ZX1=Z[I]*(SX1/(2.*SMIN)-KX1/DELM)
97 ZX2=Z[I]*(SX2/(2.*SMIN)-KX2/DELM)
101 HZ[I]=KF1/
pow(Z[I],KF2)
102 INVSIG[I]=(HZ[I]*H1*16.)/S
107 from array
import array
109 global Z, HZ, PT, INVSIG
114 c1 = ROOT.TCanvas(
'zdemo',
'Monte Carlo Study of Z scaling', 10, 40, 800, 600 )
115 c1.Range( 0, 0, 25, 18 )
116 c1.SetFillColor( 40 )
119 pl = ROOT.TPaveLabel( 1, 16.3, 24, 17.5,
120 'Z-scaling of Direct Photon Productions in pp Collisions at RHIC Energies',
'br' )
132 t.DrawLatex( 3.1, 15.5,
'M.Tokarev, E.Potrebenikova ')
133 t.DrawLatex( 14., 15.5,
'JINR preprint E2-98-64, Dubna, 1998 ')
136 pad1 = ROOT.TPad(
'pad1',
'This is pad1', 0.02, 0.02, 0.48, 0.83, 33 )
137 pad2 = ROOT.TPad(
'pad2',
'This is pad2', 0.52, 0.02, 0.98, 0.83, 33 )
142 saves[
'pad1' ] = pad1; saves[
'pad2' ] = pad2
153 hz_calc( energ, dens, tgrad, ptmin, ptmax, delp )
155 pad1.Range( -0.255174, -19.25, 2.29657, -6.75 )
160 pad1.DrawFrame( 1, 1e-18, 110, 1e-8 )
166 t.SetTextSize( 0.08 )
168 t.DrawLatex( 0.6, 0.85,
'p - p' )
170 t.SetTextSize( 0.05 )
171 t.DrawLatex( 0.6, 0.79,
'Direct #gamma' )
172 t.DrawLatex( 0.6, 0.75,
'#theta = 90^{o}' )
174 t.DrawLatex( 0.20, 0.45,
'Ed^{3}#sigma/dq^{3}' )
175 t.DrawLatex( 0.18, 0.40,
'(barn/Gev^{2})' )
177 t.SetTextSize( 0.045 )
178 t.SetTextColor( ROOT.kBlue )
179 t.DrawLatex( 0.22, 0.260,
'#sqrt{s} = 63(GeV)' )
180 t.SetTextColor( ROOT.kRed )
181 t.DrawLatex( 0.22, 0.205,
'#sqrt{s} = 200(GeV)' )
183 t.DrawLatex( 0.22, 0.15,
'#sqrt{s} = 500(GeV)' )
185 t.SetTextSize( 0.05 )
187 t.DrawLatex( 0.6, 0.06,
'q_{T} (Gev/c)' )
190 gr1 = ROOT.TGraph( NLOOP, PT, INVSIG )
192 gr1.SetLineColor( 38 )
193 gr1.SetMarkerColor( ROOT.kBlue )
194 gr1.SetMarkerStyle( 21 )
195 gr1.SetMarkerSize( 1.1 )
209 hz_calc( energ, dens, tgrad, ptmin, ptmax, delp )
211 gr2 = ROOT.TGraph( NLOOP, PT, INVSIG )
212 gr2.SetLineColor( 38 )
213 gr2.SetMarkerColor( ROOT.kRed )
214 gr2.SetMarkerStyle( 29 )
215 gr2.SetMarkerSize( 1.5 )
228 hz_calc( energ, dens, tgrad, ptmin, ptmax, delp )
230 gr3 = ROOT.TGraph( NLOOP, PT, INVSIG )
232 gr3.SetLineColor( 38 )
233 gr3.SetMarkerColor( 6 )
234 gr3.SetMarkerStyle( 8 )
235 gr3.SetMarkerSize( 1.1 )
239 dum = array(
'f', [0.] )
240 graph = ROOT.TGraph( 1, dum, dum )
241 graph.SetMarkerColor( ROOT.kBlue )
242 graph.SetMarkerStyle( 21 )
243 graph.SetMarkerSize( 1.1 )
244 graph.SetPoint( 0, 1.7, 1.e-16 )
246 saves[
'graph' ] = graph
248 graph = ROOT.TGraph( 1, dum, dum )
249 graph.SetMarkerColor( ROOT.kRed )
250 graph.SetMarkerStyle( 29 )
251 graph.SetMarkerSize( 1.5 )
252 graph.SetPoint( 0, 1.7, 2.e-17 )
254 saves[
'graph2' ] = graph
256 graph = ROOT.TGraph( 1, dum, dum )
257 graph.SetMarkerColor( 6 )
258 graph.SetMarkerStyle( 8 )
259 graph.SetMarkerSize( 1.1 )
260 graph.SetPoint( 0, 1.7, 4.e-18)
262 saves[
'graph3' ] = graph
265 pad2.Range( -0.43642, -23.75, 3.92778, -6.25 )
269 pad2.DrawFrame( 1, 1e-22, 3100, 1e-8 )
272 gr = ROOT.TGraph( NLOOP, Z, HZ )
273 gr.SetTitle(
'HZ vs Z' )
274 gr.SetFillColor( 19 )
276 gr.SetMarkerColor( 50 )
277 gr.SetMarkerStyle( 29 )
278 gr.SetMarkerSize( 1.5 )
286 t.SetTextSize( 0.08 )
288 t.DrawLatex( 0.6, 0.85,
'p - p' )
290 t.SetTextSize( 0.05 )
291 t.DrawLatex( 0.6, 0.79,
'Direct #gamma' )
292 t.DrawLatex( 0.6, 0.75,
'#theta = 90^{o}' )
294 t.DrawLatex( 0.70, 0.55,
'H(z)' )
295 t.DrawLatex( 0.68, 0.50,
'(barn)' )
297 t.SetTextSize( 0.045 )
299 t.DrawLatex( 0.20, 0.30,
'#sqrt{s}, GeV' )
300 t.DrawLatex( 0.22, 0.26,
'63' )
301 t.DrawLatex( 0.22, 0.22,
'200' )
302 t.DrawLatex( 0.22, 0.18,
'500' )
304 t.SetTextSize( 0.05 )
306 t.DrawLatex( 0.88, 0.06,
'z' )
313 if __name__ ==
'__main__':
double pow(double, double)