Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
radgen_event.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file radgen_event.f
1 
2  subroutine radgen_event
3 
4  implicit none
5 
6  include "mc_set.inc"
7  include "mconsp.inc"
8  include "phiout.inc"
9  include "tailcom.inc"
10  include "cmpcom.inc"
11  include "radgen.inc"
12  include "mcRadCor.inc"
13 
14  common/pypars/mstp(200),parp(200),msti(200),pari(200)
15  INTEGER mstp,msti
16  REAL parp,pari
17  SAVE /pypars/
18 
19  real phrad(4),q2true,nutrue,radweight
20  real nu,q2,phi,yys,xxs
21 
22 ! calculate radiative corrections
23  nu=sngl(gennu)
24  q2=sngl(genq2)
25  phi=sngl(genphi)
26  yys=sngl(geny)
27  xxs=sngl(genx)
28  call radgen(mcset_enebeam,q2,nu,yys,xxs,phi,phrad,q2true,nutrue,
29  + radweight)
30 
31 ! fill mcRadCor WCB with ...
32 
33  mcradcor_id=1
34 
35 ! ... true kinematics
36 
37 * by definition we calculate xbj using the proton mass
38 * ---> xbj for elastic events is A
39 * mcRadCor_XTrue=q2true/(2.0d0*amp*nutrue)
40  mcradcor_nutrue=nutrue
41  mcradcor_q2true=q2true
42  mcradcor_ytrue=nutrue/mcset_enebeam
43  mcradcor_xtrue=q2true/mcradcor_ytrue/(4.*ebeam*pbeam)
44  mcradcor_w2true=amp2 + (q2true*(1./mcradcor_xtrue-1.))
45 ! mcRadCor_XTrue=q2true/(2.0d0*0.938272d0*nutrue)
46 ! mcRadCor_W2True=amp2 - q2true + 2.*amp*nutrue
47 
48 ! ... kinematics of real photon
49  mcradcor_ebrems=phrad(4)
50  mcradcor_thetabrems=0.
51  if(phrad(4).gt.0.)
52  + mcradcor_thetabrems = acos(phrad(3)/phrad(4))
53  mcradcor_phibrems=0.
54  if (.not.(phrad(1).eq.0..and.phrad(2).eq.0.)) then
55  mcradcor_phibrems = atan2(phrad(2),phrad(1))
56  if (mcradcor_phibrems.lt.0.)
57  + mcradcor_phibrems = mcradcor_phibrems + twopi
58  endif
59 
60 c...if we would like to have the TSAI system angles for the real gamma than
61 c mcRadCor_ThetaBrems = dthg
62 c mcRadCor_PhiBrems = dphig
63 
64 ! ... radiative contributions
65 
66  mcradcor_sigrad=sigrad
67  mcradcor_sigcor=sigcor
68  mcradcor_sigcorerr=0.
69  mcradcor_tailine=tine
70  mcradcor_tailela=tpro
71  mcradcor_tailcoh=tnuc
72  mcradcor_vacuum=vac
73  mcradcor_vertex=vertex
74  mcradcor_small=small
75  mcradcor_redfac=redfac
76 
77 ! ... radiative correction type
78 
79  if (ita.eq.2) then
80  mcradcor_ctype='elas'
81  else if (ita.eq.3) then
82  mcradcor_ctype='qela'
83  else
84  mcradcor_ctype='inel'
85  endif
86 
87  end