20 from array
import array
24 Z = array(
'f', [0.]*NMAX )
25 HZ = array(
'f', [0.]*NMAX )
26 PT = array(
'f', [0.]*NMAX )
27 INVSIG = array(
'f', [0.]*NMAX )
33 def hz_calc( ENERG, DENS, TGRAD, PTMIN, PTMAX, DELP ):
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
108 global Z, HZ, PT, INVSIG
112 c1 = ROOT.TCanvas(
'zdemo',
'Monte Carlo Study of Z scaling', 10, 40, 800, 600 )
113 c1.Range( 0, 0, 25, 18 )
114 c1.SetFillColor( 40 )
117 pl = ROOT.TPaveLabel( 1, 16.3, 24, 17.5,
118 'Z-scaling of Direct Photon Productions in pp Collisions at RHIC Energies',
'br' )
130 t.DrawLatex( 3.1, 15.5,
'M.Tokarev, E.Potrebenikova ')
131 t.DrawLatex( 14., 15.5,
'JINR preprint E2-98-64, Dubna, 1998 ')
134 pad1 = ROOT.TPad(
'pad1',
'This is pad1', 0.02, 0.02, 0.48, 0.83, 33 )
135 pad2 = ROOT.TPad(
'pad2',
'This is pad2', 0.52, 0.02, 0.98, 0.83, 33 )
140 saves[
'pad1' ] = pad1; saves[
'pad2' ] = pad2
151 hz_calc( energ, dens, tgrad, ptmin, ptmax, delp )
153 pad1.Range( -0.255174, -19.25, 2.29657, -6.75 )
158 pad1.DrawFrame( 1, 1e-18, 110, 1e-8 )
164 t.SetTextSize( 0.08 )
166 t.DrawLatex( 0.6, 0.85,
'p - p' )
168 t.SetTextSize( 0.05 )
169 t.DrawLatex( 0.6, 0.79,
'Direct #gamma' )
170 t.DrawLatex( 0.6, 0.75,
'#theta = 90^{o}' )
172 t.DrawLatex( 0.20, 0.45,
'Ed^{3}#sigma/dq^{3}' )
173 t.DrawLatex( 0.18, 0.40,
'(barn/Gev^{2})' )
175 t.SetTextSize( 0.045 )
176 t.SetTextColor( ROOT.kBlue )
177 t.DrawLatex( 0.22, 0.260,
'#sqrt{s} = 63(GeV)' )
178 t.SetTextColor( ROOT.kRed )
179 t.DrawLatex( 0.22, 0.205,
'#sqrt{s} = 200(GeV)' )
181 t.DrawLatex( 0.22, 0.15,
'#sqrt{s} = 500(GeV)' )
183 t.SetTextSize( 0.05 )
185 t.DrawLatex( 0.6, 0.06,
'q_{T} (Gev/c)' )
188 gr1 = ROOT.TGraph( NLOOP, PT, INVSIG )
190 gr1.SetLineColor( 38 )
191 gr1.SetMarkerColor( ROOT.kBlue )
192 gr1.SetMarkerStyle( 21 )
193 gr1.SetMarkerSize( 1.1 )
207 hz_calc( energ, dens, tgrad, ptmin, ptmax, delp )
209 gr2 = ROOT.TGraph( NLOOP, PT, INVSIG )
210 gr2.SetLineColor( 38 )
211 gr2.SetMarkerColor( ROOT.kRed )
212 gr2.SetMarkerStyle( 29 )
213 gr2.SetMarkerSize( 1.5 )
226 hz_calc( energ, dens, tgrad, ptmin, ptmax, delp )
228 gr3 = ROOT.TGraph( NLOOP, PT, INVSIG )
230 gr3.SetLineColor( 38 )
231 gr3.SetMarkerColor( 6 )
232 gr3.SetMarkerStyle( 8 )
233 gr3.SetMarkerSize( 1.1 )
237 dum = array(
'f', [0.] )
238 graph = ROOT.TGraph( 1, dum, dum )
239 graph.SetMarkerColor( ROOT.kBlue )
240 graph.SetMarkerStyle( 21 )
241 graph.SetMarkerSize( 1.1 )
242 graph.SetPoint( 0, 1.7, 1.e-16 )
244 saves[
'graph' ] = graph
246 graph = ROOT.TGraph( 1, dum, dum )
247 graph.SetMarkerColor( ROOT.kRed )
248 graph.SetMarkerStyle( 29 )
249 graph.SetMarkerSize( 1.5 )
250 graph.SetPoint( 0, 1.7, 2.e-17 )
252 saves[
'graph2' ] = graph
254 graph = ROOT.TGraph( 1, dum, dum )
255 graph.SetMarkerColor( 6 )
256 graph.SetMarkerStyle( 8 )
257 graph.SetMarkerSize( 1.1 )
258 graph.SetPoint( 0, 1.7, 4.e-18)
260 saves[
'graph3' ] = graph
263 pad2.Range( -0.43642, -23.75, 3.92778, -6.25 )
267 pad2.DrawFrame( 1, 1e-22, 3100, 1e-8 )
270 gr = ROOT.TGraph( NLOOP, Z, HZ )
271 gr.SetTitle(
'HZ vs Z' )
272 gr.SetFillColor( 19 )
274 gr.SetMarkerColor( 50 )
275 gr.SetMarkerStyle( 29 )
276 gr.SetMarkerSize( 1.5 )
284 t.SetTextSize( 0.08 )
286 t.DrawLatex( 0.6, 0.85,
'p - p' )
288 t.SetTextSize( 0.05 )
289 t.DrawLatex( 0.6, 0.79,
'Direct #gamma' )
290 t.DrawLatex( 0.6, 0.75,
'#theta = 90^{o}' )
292 t.DrawLatex( 0.70, 0.55,
'H(z)' )
293 t.DrawLatex( 0.68, 0.50,
'(barn)' )
295 t.SetTextSize( 0.045 )
297 t.DrawLatex( 0.20, 0.30,
'#sqrt{s}, GeV' )
298 t.DrawLatex( 0.22, 0.26,
'63' )
299 t.DrawLatex( 0.22, 0.22,
'200' )
300 t.DrawLatex( 0.22, 0.18,
'500' )
302 t.SetTextSize( 0.05 )
304 t.DrawLatex( 0.88, 0.06,
'z' )
311 if __name__ ==
'__main__':
double pow(double, double)