Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
radgen_init.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file radgen_init.f
1 
2  subroutine radgen_init(bUseLUT,bGenLUT)
3 
4  implicit none
5 
6  include "mc_set.inc"
7  include "density.inc"
8  include "cmpcom.inc"
9  include "tailcom.inc"
10  include "radgen.inc"
11  include "radgenkeys.inc"
12 
13  logical buselut,bgenlut
14  CHARACTER*256 tname
15  common/pynucl/inumod,chanum,order
16  DOUBLE PRECISION inumod,chanum
17  INTEGER order
18 
19 ! ... force block data modules to be read
20  external radata
21 
22 * kill_elas_res =0, all rad corrections
23 * kill_elas_res =1, ???
24 * kill_elas_res =2, no rad corrections
25  kill_elas_res=0
26 
27 * initialise the rad. correction part !
28 * = 2 : fint cernlib extrapolation routine
29 * = 1 : 2dim spline
30 * = 0 : make lookuptable
31 * = -1 : do not lookup table , calculate all events
32  if( buselut ) then
33  if( bgenlut ) then
34  ixytest = 0
35  else
36  ixytest = 2
37  endif
38  else
39  ixytest = -1
40  endif
41 
42  if ((inumod.gt.1).and.(chanum.gt.1)) then
43  mcset_tara = inumod
44  mcset_tarz = chanum
45  endif
46 
47  write(*,*) mcset_tara, mcset_tarz
48 
49 *----------------------------
50 * ire is target 1,2,3
51 * add neutron target
52  if( mcset_tara .eq. 1 .and. mcset_tarz .eq. 0 ) then
53  ire = 0
54  elseif( mcset_tara .eq. 1 .and. mcset_tarz .eq. 1 ) then
55  ire = 1
56  elseif( mcset_tara .eq. 2 .and. mcset_tarz .eq. 1 ) then
57  ire = 2
58  elseif( mcset_tara .eq. 3 .and. mcset_tarz .eq. 2 ) then
59  ire = 3
60  elseif( mcset_tara .eq. 4 .and. mcset_tarz .eq. 2 ) then
61  ire = 4
62  elseif( mcset_tara .eq. 14 .and. mcset_tarz .eq. 7 ) then
63  ire = 14
64  elseif( mcset_tara .eq. 20 .and. mcset_tarz .eq. 10 ) then
65  ire = 20
66  elseif( mcset_tara .eq. 40 .and. mcset_tarz .eq. 20 ) then
67  ire = 40
68  elseif( mcset_tara .eq. 84 .and. mcset_tarz .eq. 36 ) then
69  ire = 84
70  elseif( mcset_tara .eq. 131 .and. mcset_tarz .eq. 54 ) then
71  ire = 131
72  elseif( mcset_tara .eq. 197 .and. mcset_tarz .eq. 79 ) then
73  ire = 197
74  elseif( mcset_tara .eq. 238 .and. mcset_tarz .gt. 92 ) then
75  ire = 238
76  else
77  write(*,*)( 'RADGEN_INIT: invalid target selection' )
78  endif
79 
80 C... Using radgen with Pythia the target and beam polarisation can be
81 C hardcoded to zero
82  plrun = 0.
83  pnrun = 0.
84  if(ire.lt.10) then
85  tname='radgen/xytab0unp.dat'
86  elseif (ire.lt.100) then
87  tname='radgen/xytab00unp.dat'
88  else
89  tname='radgen/xytab000unp.dat'
90  endif
91 
92  if (ire.lt.10) then
93  write(tname(13:13),'(i1)')ire
94  elseif (ire.lt.100) then
95  write(tname(13:14),'(i2)')ire
96  else
97  write(tname(13:15),'(i3)')ire
98  endif
99 
100 *----------------------------
101 * grid of important regions in theta (7*ntk)
102  ntk = 35
103 *----------------------------
104 * photonic energy grid
105  nrr = 100
106 *----------------------------
107 * min. energy in the calo (resolution parameter)
108  demin=0.10
109 
110 *----------------------------
111  ap=2.*amp
112  amp2=amp**2
113  ap2=2.*amp**2
114  if(kill_elas_res.eq.1) amc2=4d0
115 
116  if(ire.eq.0) then
117  amt=.939565d0
118  rtara=1d0
119  rtarz=0d0
120  fermom=0d0
121  elseif(ire.eq.1)then
122  amt=.938272d0
123  rtara=1d0
124  rtarz=1d0
125  fermom=0d0
126  elseif(ire.eq.2)then
127  amt=1.87561d0
128  rtara=2d0
129  rtarz=1d0
130  fermom=.07d0
131  elseif(ire.eq.3)then
132  amt=2.8161d0
133  rtara=3d0
134  rtarz=2d0
135  fermom=.087d0
136  elseif(ire.eq.4)then
137  amt=3.75567d0
138  rtara=4d0
139  rtarz=2d0
140  fermom=.087d0
141  elseif(ire.eq.14)then
142  amt=13.1447d0
143  rtara=14d0
144  rtarz=7d0
145  fermom=.100d0
146  call fordop
147  elseif(ire.eq.20)then
148  amt=18.7783d0
149  rtara=20d0
150  rtarz=10d0
151  fermom=.100d0
152  call fordop
153  elseif(ire.eq.40)then
154  amt=37.5567d0
155  rtara=40d0
156  rtarz=20d0
157  fermom=.100d0
158  call fordop
159  elseif(ire.eq.84)then
160  amt=78.8769d0
161  rtara=84d0
162  rtarz=36d0
163  fermom=.105d0
164  call fordop
165  elseif(ire.eq.131)then
166  amt=123.0132d0
167  rtara=131d0
168  rtarz=54d0
169  fermom=.105d0
170  call fordop
171  elseif(ire.eq.197)then
172  amt=184.9922d0
173  rtara=197d0
174  rtarz=79d0
175  fermom=.105d0
176  call fordop
177  elseif(ire.eq.207)then
178  amt=194.3839d0
179  rtara=207d0
180  rtarz=82d0
181  fermom=.105d0
182  call fordop
183  elseif(ire.eq.238)then
184  amt=223.4975d0
185  rtara=238d0
186  rtarz=92d0
187  fermom=.105d0
188  call fordop
189  endif
190 
191 *-----------------------------
192  if (mcset_xmin.ge. 1.e-05) then
193  ntx=ntdis
194  write(*,*)
195  & ('Radiative corrections for DIS kinematics (xmin=1.e-05')
196  elseif (mcset_xmin.ge. 1.e-09) then
197  ntx=ntpho
198  write(*,*)
199  & ('Radiative corrections for photoproduction (xmin=1.e-09)')
200  write(*,*)
201  & ('Elastic and quesielastric contributions set to ZERO !')
202  if(ixytest.gt.0 .and. mcset_xmin.lt.1.e-07) then
203  write(*,*)
204  & ('Xmin in lookup table = 1.e-07 --> extrapolation to 1.e-09')
205  endif
206  if(ixytest.eq.0 .and. mcset_xmin.lt.1.e-07) then
207  write(*,*)
208  & ('Xmin in lookup table = 1.e-07 --> change minimum x')
209  stop
210  endif
211  else
212  write(*,*)
213  & ('Minimum x value below minimum value of 10**-9 ! ')
214  stop
215  endif
216 
217 * initialize lookup table
218  if(ixytest.ge.0) then
219 
220 * number of x bins depending on x range desired
221 * finer grid at lower x values
222 * number of y bins = number of x bins (equidistant in y)
223 * (needed to avoid double loop - speed optimisation)
224  write(*,*) ('*********************************************')
225  write(*,*)
226  & ('Make sure that you did create the correct lookup table')
227  write(6,*) 'number of x bins in RC table = ',ntx
228  write(6,*) 'size of x bins in RC table depending on x'
229  nty=ntx
230  write(6,*) 'number of y bins in RC table = ',nty
231  write(6,*) 'size of y bins in RC table = ',
232  & (radgen_ymax-radgen_ymin)/(nty-1)
233  write(*,*) ('*********************************************')
234 
235  if(ixytest.eq.0) then
236  write(*,*)('RADGEN_INIT: Creating lookup table '//tname)
237  elseif (ixytest.eq.2) then
238  write(*,*)
239  + ('RADGEN_INIT: Loading lookup table '//tname)
240  endif
241  call xytabl(tname,mcset_enebeam,plrun,pnrun,ixytest,ire)
242  endif
243 
244  end