17 from array
import array
21 Z = array(
'f', [0.]*NMAX )
22 HZ = array(
'f', [0.]*NMAX )
23 PT = array(
'f', [0.]*NMAX )
24 INVSIG = array(
'f', [0.]*NMAX )
32 global Z, HZ, PT, INVSIG
36 c1 = ROOT.TCanvas(
'zdemo',
'Monte Carlo Study of Z scaling', 10, 40, 800, 600 )
37 c1.Range( 0, 0, 25, 18 )
41 pl = ROOT.TPaveLabel( 1, 16.3, 24, 17.5,
42 'Z-scaling of Direct Photon Productions in pp Collisions at RHIC Energies',
'br' )
54 t.DrawLatex( 3.1, 15.5,
'M.Tokarev, E.Potrebenikova ')
55 t.DrawLatex( 14., 15.5,
'JINR preprint E2-98-64, Dubna, 1998 ')
58 pad1 = ROOT.TPad(
'pad1',
'This is pad1', 0.02, 0.02, 0.48, 0.83, 33 )
59 pad2 = ROOT.TPad(
'pad2',
'This is pad2', 0.52, 0.02, 0.98, 0.83, 33 )
64 saves[
'pad1' ] = pad1; saves[
'pad2' ] = pad2
75 hz_calc( energ, dens, tgrad, ptmin, ptmax, delp )
77 pad1.Range( -0.255174, -19.25, 2.29657, -6.75 )
82 pad1.DrawFrame( 1, 1e-18, 110, 1e-8 )
90 t.DrawLatex( 0.6, 0.85,
'p - p' )
93 t.DrawLatex( 0.6, 0.79,
'Direct #gamma' )
94 t.DrawLatex( 0.6, 0.75,
'#theta = 90^{o}' )
96 t.DrawLatex( 0.20, 0.45,
'Ed^{3}#sigma/dq^{3}' )
97 t.DrawLatex( 0.18, 0.40,
'(barn/Gev^{2})' )
99 t.SetTextSize( 0.045 )
100 t.SetTextColor( ROOT.kBlue )
101 t.DrawLatex( 0.22, 0.260,
'#sqrt{s} = 63(GeV)' )
102 t.SetTextColor( ROOT.kRed )
103 t.DrawLatex( 0.22, 0.205,
'#sqrt{s} = 200(GeV)' )
105 t.DrawLatex( 0.22, 0.15,
'#sqrt{s} = 500(GeV)' )
107 t.SetTextSize( 0.05 )
109 t.DrawLatex( 0.6, 0.06,
'q_{T} (Gev/c)' )
112 gr1 = ROOT.TGraph( NLOOP, PT, INVSIG )
114 gr1.SetLineColor( 38 )
115 gr1.SetMarkerColor( ROOT.kBlue )
116 gr1.SetMarkerStyle( 21 )
117 gr1.SetMarkerSize( 1.1 )
131 hz_calc( energ, dens, tgrad, ptmin, ptmax, delp )
133 gr2 = ROOT.TGraph( NLOOP, PT, INVSIG )
134 gr2.SetLineColor( 38 )
135 gr2.SetMarkerColor( ROOT.kRed )
136 gr2.SetMarkerStyle( 29 )
137 gr2.SetMarkerSize( 1.5 )
150 hz_calc( energ, dens, tgrad, ptmin, ptmax, delp )
152 gr3 = ROOT.TGraph( NLOOP, PT, INVSIG )
154 gr3.SetLineColor( 38 )
155 gr3.SetMarkerColor( 6 )
156 gr3.SetMarkerStyle( 8 )
157 gr3.SetMarkerSize( 1.1 )
161 dum = array(
'f', [0.] )
162 graph = ROOT.TGraph( 1, dum, dum )
163 graph.SetMarkerColor( ROOT.kBlue )
164 graph.SetMarkerStyle( 21 )
165 graph.SetMarkerSize( 1.1 )
166 graph.SetPoint( 0, 1.7, 1.e-16 )
168 saves[
'graph' ] = graph
170 graph = ROOT.TGraph( 1, dum, dum )
171 graph.SetMarkerColor( ROOT.kRed )
172 graph.SetMarkerStyle( 29 )
173 graph.SetMarkerSize( 1.5 )
174 graph.SetPoint( 0, 1.7, 2.e-17 )
176 saves[
'graph2' ] = graph
178 graph = ROOT.TGraph( 1, dum, dum )
179 graph.SetMarkerColor( 6 )
180 graph.SetMarkerStyle( 8 )
181 graph.SetMarkerSize( 1.1 )
182 graph.SetPoint( 0, 1.7, 4.e-18)
184 saves[
'graph3' ] = graph
187 pad2.Range( -0.43642, -23.75, 3.92778, -6.25 )
191 pad2.DrawFrame( 1, 1e-22, 3100, 1e-8 )
194 gr = ROOT.TGraph( NLOOP, Z, HZ )
195 gr.SetTitle(
'HZ vs Z' )
196 gr.SetFillColor( 19 )
198 gr.SetMarkerColor( 50 )
199 gr.SetMarkerStyle( 29 )
200 gr.SetMarkerSize( 1.5 )
208 t.SetTextSize( 0.08 )
210 t.DrawLatex( 0.6, 0.85,
'p - p' )
212 t.SetTextSize( 0.05 )
213 t.DrawLatex( 0.6, 0.79,
'Direct #gamma' )
214 t.DrawLatex( 0.6, 0.75,
'#theta = 90^{o}' )
216 t.DrawLatex( 0.70, 0.55,
'H(z)' )
217 t.DrawLatex( 0.68, 0.50,
'(barn)' )
219 t.SetTextSize( 0.045 )
221 t.DrawLatex( 0.20, 0.30,
'#sqrt{s}, GeV' )
222 t.DrawLatex( 0.22, 0.26,
'63' )
223 t.DrawLatex( 0.22, 0.22,
'200' )
224 t.DrawLatex( 0.22, 0.18,
'500' )
226 t.SetTextSize( 0.05 )
228 t.DrawLatex( 0.88, 0.06,
'z' )
235 def hz_calc( ENERG, DENS, TGRAD, PTMIN, PTMAX, DELP ):
237 global Z, HZ, PT, INVSIG
262 NLOOP = int((PTMAX-PTMIN)/DELP)
264 for I
in range(NLOOP):
266 PTOT = PT[I]/
sin(THET)
268 ETOT =
sqrt(M1*M1 + PTOT*PTOT)
269 PB1 =
sqrt(EB1*EB1 - MB1*MB1)
270 PB2 =
sqrt(EB2*EB2 - MB2*MB2)
271 P2P3 = EB2*ETOT+PB2*PTOT*
cos(THET)
272 P1P2 = EB2*EB1+PB2*PB1
273 P1P3 = EB1*ETOT-PB1*PTOT*
cos(THET)
277 Y1 = X1+
sqrt(X1*X2*(1.-X1)/(1.-X2))
278 Y2 = X2+
sqrt(X1*X2*(1.-X2)/(1.-X1))
280 S = (MB1*MB1)+2.*P1P2+(MB2*MB2)
281 SMIN = 4.*((MB1*MB1)*(X1*X1) +2.*X1*X2*P1P2+(MB2*MB2)*(X2*X2))
282 SX1 = 4.*( 2*(MB1*MB1)*X1+2*X2*P1P2)
283 SX2 = 4.*( 2*(MB2*MB2)*X2+2*X1*P1P2)
285 DELM =
pow((1.-Y1)*(1.-Y2),ALX)
287 Z[I] =
sqrt(SMIN)/DELM/
pow(DNDETA,BETA)
289 Y1X1 = 1. +X2*(1-2.*X1)/(2.*(Y1-X1)*(1.-X2))
290 Y1X2 = X1*(1-X1)/(2.*(Y1-X1)*(1.-X2)*(1.-X2))
291 Y2X1 = X2*(1-X2)/(2.*(Y2-X2)*(1.-X1)*(1.-X1))
292 Y2X2 = 1. +X1*(1-2.*X2)/(2.*(Y2-X2)*(1.-X1))
293 Y2X1X2= Y2X1*( (1.-2.*X2)/(X2*(1-X2)) -( Y2X2-1.)/(Y2-X2))
294 Y1X1X2= Y1X2*( (1.-2.*X1)/(X1*(1-X1)) -( Y1X1-1.)/(Y1-X1))
296 KX1=-DELM*(Y1X1*ALX/(1.-Y1) + Y2X1*ALX/(1.-Y2))
297 KX2=-DELM*(Y2X2*ALX/(1.-Y2) + Y1X2*ALX/(1.-Y1))
298 ZX1=Z[I]*(SX1/(2.*SMIN)-KX1/DELM)
299 ZX2=Z[I]*(SX2/(2.*SMIN)-KX2/DELM)
303 HZ[I]=KF1/
pow(Z[I],KF2)
304 INVSIG[I]=(HZ[I]*H1*16.)/S
308 if __name__ ==
'__main__':
double pow(double, double)