Skip to content

Commit

Permalink
Adding pi0 functionality (exclusive and semi-inclusive)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Gaskell committed Aug 13, 2024
1 parent 0d45a21 commit 79766ac
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 87 deletions.
184 changes: 118 additions & 66 deletions dbase.f
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ subroutine dbase_read(H)
! Added additional options for which_pion:
! which_pion = 2: gamma* p -> pi+ Delta0, gamma* D -> pi+ Delta0 n, or -> pi+ Delta- p
! which_pion = 3: gamma* p -> pi- Delta++, gamma* D -> pi- Delta++ n, or -> pi- Delta+ p
!
! More options for pi0:
! set "doing_pizero =1" in input file, then
! which_pion= 0( 1) gives pi0 production from proton (neutron)
! which_pion= 2: gamma* p -> pi0 Delta+
! which_pion= 3: gamma* n -> pi0 Delta0
! 4. doing_phsp:Generate acceptance with radiation and cross section disabled,
! use doing_kaon or doing_pion to set hadron mass, then
! set doing_eep,doing_kaon and doing_pion to FALSE.
Expand Down Expand Up @@ -129,15 +135,17 @@ subroutine dbase_read(H)
! ... dbase field experiment.
if (doing_pion) then
Mh=Mpi
if (nint(targ%A).eq.1 .and. which_pion.eq.1)
Mh=Mpi
if (doing_pizero) Mh=Mpi0
if (nint(targ%A).eq.1 .and. which_pion.eq.1 .and. .not. doing_pizero)
> stop 'Pi- production from Hydrogen not allowed!'
if (nint(targ%A).le.2 .and. which_pion.ge.10)
> stop 'Coherent production from Hydrogen/Deuterium not allowed!'
if (nint(targ%A).eq.3 .and. which_pion.eq.11)
> stop 'Coherent Pi- production from 3He not allowed!'
if (nint(targ%A).eq.4 .and. which_pion.ge.10)
> stop 'Coherent production from 4He not allowed!'
doing_hydpi = (nint(targ%A).eq.1)
doing_deutpi = (nint(targ%A).eq.2)
doing_hepi = (nint(targ%A).ge.3)
Expand Down Expand Up @@ -173,7 +181,8 @@ subroutine dbase_read(H)
else if (doing_delta) then
Mh=Mp
if (nint(targ%A).ge.2)
> write(6,*) 'WARNING: Delta cross section model only set up for proton target!'
> write(6,*) 'WARNING: Delta cross section model",
> " only set up for proton target!'
doing_hyddelta = (nint(targ%A).eq.1)
doing_deutdelta = (nint(targ%A).eq.2)
doing_hedelta = (nint(targ%A).ge.3)
Expand All @@ -182,6 +191,7 @@ subroutine dbase_read(H)
else if (doing_semi) then
if(doing_semipi) then
Mh=Mpi
if(doing_pizero) Mh=Mpi0
elseif(doing_semika) then
Mh=Mk
endif
Expand Down Expand Up @@ -315,34 +325,54 @@ subroutine dbase_read(H)
! ... A as target, with one n->p or p->n.

else if (doing_pion) then
if (which_pion .eq. 0) then
targ%Mtar_struck = Mp ! H(e,e'pi+)n or D(e,e'pi+)nn
targ%Mrec_struck = Mn
sign_hadron=1.0
else if (which_pion .eq. 1) then
targ%Mtar_struck = Mn ! D(e,e'pi-) pp
targ%Mrec_struck = Mp
sign_hadron=-1.0
else if (which_pion .eq. 2 ) then
targ%Mtar_struck = Mp ! H(e,e'pi+)Delta0, D(e,e'pi+)nDelta0, D(e,e'pi+)pDelta-
targ%Mrec_struck = MDelta
sign_hadron = 1.0
else if (which_pion .eq. 3) then
targ%Mtar_struck = Mp ! H(e,e'pi-)Delta++, D(e,e'pi-)nDelta++, D(e,e'pi-)pDelta+
targ%Mrec_struck = MDelta
sign_hadron = -1.0
else if (which_pion .eq. 10) then
targ%Mtar_struck = targ%M ! A(e,e'pi+)A'
targ%Mrec_struck = targ%Mrec
Mrec_guess = targ%M - Mp + Mn
sign_hadron=1.0
else if (which_pion .eq. 11) then
targ%Mtar_struck = targ%M ! A(e,e'pi-)A'
targ%Mrec_struck = targ%Mrec
Mrec_guess = targ%M - Mn + Mp
sign_hadron=-1.0
else
stop 'Bad value for which_pion'
if(doing_pizero) then
if (which_pion .eq. 0) then
targ%Mtar_struck = Mp ! H(e,e'pi0)p or D(e,e'p0)pn
targ%Mrec_struck = Mp
sign_hadron=1.0 ! only used for polarized target...
else if (which_pion .eq. 1) then
targ%Mtar_struck = Mn ! D(e,e'pi0) pn (from neutron)
targ%Mrec_struck = Mn
sign_hadron=-1.0
else if (which_pion .eq. 2 ) then
targ%Mtar_struck = Mp ! H(e,e'pi0)Delta+, D(e,e'pi0)nDelta+
targ%Mrec_struck = MDelta
sign_hadron = 1.0
else if (which_pion .eq. 3) then
targ%Mtar_struck = Mn ! D(e,e'pi0)pDelta0
targ%Mrec_struck = MDelta
sign_hadron = -1.0
endif
else
if (which_pion .eq. 0) then
targ%Mtar_struck = Mp ! H(e,e'pi+)n or D(e,e'pi+)nn
targ%Mrec_struck = Mn
sign_hadron=1.0
else if (which_pion .eq. 1) then
targ%Mtar_struck = Mn ! D(e,e'pi-) pp
targ%Mrec_struck = Mp
sign_hadron=-1.0
else if (which_pion .eq. 2 ) then
targ%Mtar_struck = Mp ! H(e,e'pi+)Delta0, D(e,e'pi+)nDelta0, D(e,e'pi+)pDelta-
targ%Mrec_struck = MDelta
sign_hadron = 1.0
else if (which_pion .eq. 3) then
targ%Mtar_struck = Mp ! H(e,e'pi-)Delta++, D(e,e'pi-)nDelta++, D(e,e'pi-)pDelta+
targ%Mrec_struck = MDelta
sign_hadron = -1.0
else if (which_pion .eq. 10) then
targ%Mtar_struck = targ%M ! A(e,e'pi+)A'
targ%Mrec_struck = targ%Mrec
Mrec_guess = targ%M - Mp + Mn
sign_hadron=1.0
else if (which_pion .eq. 11) then
targ%Mtar_struck = targ%M ! A(e,e'pi-)A'
targ%Mrec_struck = targ%Mrec
Mrec_guess = targ%M - Mn + Mp
sign_hadron=-1.0
else
stop 'Bad value for which_pion'
endif
endif
if (which_pion .ge. 10) then !Coherent pion production.
Expand Down Expand Up @@ -668,16 +698,24 @@ subroutine dbase_read(H)
else if (doing_semi) then
if (doing_semipi) then
if(doing_hydsemi) then
if(doing_hplus) then
write(6,*) ' ****-------- H(e,e''pi+)X --------****'
if(doing_pizero) then
write(6,*) ' ****-------- H(e,e''pi0)X --------****'
else
write(6,*) ' ****-------- H(e,e''pi-)X --------****'
if(doing_hplus) then
write(6,*) ' ****-------- H(e,e''pi+)X --------****'
else
write(6,*) ' ****-------- H(e,e''pi-)X --------****'
endif
endif
elseif (doing_deutsemi) then
if(doing_hplus) then
write(6,*) ' ****-------- D(e,e''pi+)X --------****'
if(doing_pizero) then
write(6,*) ' ****-------- D(e,e''pi0)X --------****'
else
write(6,*) ' ****-------- D(e,e''pi-)X --------****'
if(doing_hplus) then
write(6,*) ' ****-------- D(e,e''pi+)X --------****'
else
write(6,*) ' ****-------- D(e,e''pi-)X --------****'
endif
endif
endif

Expand Down Expand Up @@ -710,31 +748,38 @@ subroutine dbase_read(H)
stop 'I don''t have ANY idea what (e,e''p)pi we''re doing!!!'
endif
else if (doing_pion) then
if (doing_hydpi) then
if (targ%A .eq. 1) then
write(6,*) ' ****-------- H(e,e''pi) --------****'
else if (targ%A .ge. 3) then
if (doing_hydpi) then
if (targ%A .eq. 1) then
write(6,*) ' ****-------- H(e,e''pi) --------****'
else if (targ%A .ge. 3) then
write(6,*) ' ****-------- A(e,e''pi) --------****'
endif
else if (doing_deutpi) then
write(6,*) ' ****-------- D(e,e''pi) --------****'
else if (doing_hepi) then
write(6,*) ' ****-------- A(e,e''pi) --------****'
else
stop 'I don''t have ANY idea what (e,e''pi) we''re doing!!!'
endif
if (doing_pizero) then
write(6,*) ' ****------- pi0 production -------****'
else
if (which_pion.eq.0 .or. which_pion.eq.10 .or. which_pion.eq.2) then
write(6,*) ' ****------- pi+ production -------****'
else if (which_pion.eq.1 .or. which_pion.eq.11 .or. which_pion.eq.3) then
write(6,*) ' ****------- pi- production -------****'
endif
else if (doing_deutpi) then
write(6,*) ' ****-------- D(e,e''pi) --------****'
else if (doing_hepi) then
write(6,*) ' ****-------- A(e,e''pi) --------****'
else
stop 'I don''t have ANY idea what (e,e''pi) we''re doing!!!'
endif
if (which_pion.eq.0 .or. which_pion.eq.10 .or. which_pion.eq.2) then
write(6,*) ' ****------- pi+ production -------****'
else if (which_pion.eq.1 .or. which_pion.eq.11 .or. which_pion.eq.3) then
write(6,*) ' ****------- pi- production -------****'
endif
if (which_pion.eq.0 .or. which_pion.eq.1) then
endif
if (which_pion.eq.0 .or. which_pion.eq.1) then
write(6,*) ' ****---- Quasifree Production ----****'
else if (which_pion.eq.10 .or. which_pion.eq.11) then
else if (which_pion.eq.10 .or. which_pion.eq.11) then
write(6,*) ' ****---- Coherent Production ----****'
else if (which_pion.eq.2 .or. which_pion.eq.3) then
else if (which_pion.eq.2 .or. which_pion.eq.3) then
if(doing_hydpi .and. which_pion.eq.3) then
stop 'Can''t do Delta+ production from neutron for pi0'
endif
write(6,*) ' ****---- Quasifree Production - Delta final state ----****'
endif
endif
else if (doing_kaon) then
if (doing_hydkaon) then
if (targ%A .eq. 1) then
Expand Down Expand Up @@ -800,13 +845,14 @@ subroutine dbase_read(H)
else if (electron_arm.eq.4) then
write(6,*) ' HRSL is detecting electrons'
else if (electron_arm.eq.5) then
write(6,*) ' SHMS is detecting electrons (SSA TUNE)'
write(6,*) ' SHMS is detecting electrons'
else if (electron_arm.eq.6) then
write(6,*) ' SHMS is detecting electrons (LSA TUNE)'
write(6,*) ' This spectrometer option no longer available'
stop
else if (electron_arm.eq.7) then
write(6,*) ' BIGCAL is detecting electrons (HMS side of beam)'
write(6,*) ' CALORIMETER is detecting electrons (HMS side of beam)'
else if (electron_arm.eq.8) then
write(6,*) ' BIGCAL is detecting electrons (SOS side of beam)'
write(6,*) ' CALORIMETER is detecting electrons (SHMS side of beam)'
endif

if (hadron_arm.eq.1) then
Expand All @@ -818,11 +864,15 @@ subroutine dbase_read(H)
else if (hadron_arm.eq.4) then
write(6,*) ' HRSL is detecting hadrons'
else if (hadron_arm.eq.5) then
write(6,*) ' SHMS is detecting hadrons (SSA TUNE)'
write(6,*) ' SHMS is detecting hadrons'
else if (hadron_arm.eq.6) then
write(6,*) ' SHMS is detecting hadrons (LSA TUNE)'
else if (hadron_arm.eq.7 .or. hadron_arm.eq.8) then
write(6,*) ' Cannot use Bigcal for hadrons'
write(6,*) ' This spectrometer option no longer available'
stop
else if (hadron_arm.eq.7) then
write(6,*) ' CALORIMETER is detecting hadrons (HMS side of beam)'
else if (hadron_arm.eq.8) then
write(6,*) ' CALORIMETER is detecting hadrons (SHMS side of beam)'

stop
endif

Expand Down Expand Up @@ -903,6 +953,7 @@ subroutine regallvars()
ierr = regparmint('doing_delta',doing_delta_int,0)
ierr = regparmint('doing_semi', doing_semi_int,0)
ierr = regparmint('doing_hplus', doing_hplus_int,1)
ierr = regparmint('doing_pizero', doing_pizero_int,0)
ierr = regparmint('doing_rho',doing_rho_int,0)
ierr = regparmint('doing_decay',doing_decay_int,0)
ierr = regparmdouble('ctau',ctau,0.0)
Expand Down Expand Up @@ -1040,6 +1091,7 @@ subroutine convert_to_logical
if(doing_phsp_int.gt.0) doing_phsp=.true.
if(doing_semi_int.gt.0) doing_semi=.true.
if(doing_hplus_int.gt.0) doing_hplus=.true.
if(doing_pizero_int.gt.0) doing_pizero=.true.
if(doing_rho_int.gt.0) doing_rho=.true.
if(doing_decay_int.gt.0) doing_decay=.true.
if(do_fermi_int.gt.0) do_fermi=.true.
Expand Down
50 changes: 33 additions & 17 deletions physics_pion.f
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ real*8 function peepi(vertex,main)

CDG Use Peter Bosted's new fit to world, JLab 6 GeV, and preliminary 12 GeV data
ntup%sigcm1 = sig_param_2021(thetacm,phicm,main%t/1.e6,vertex%q2/1.e6,s/1.e6,main%epsilon,
> which_pion)
> which_pion,doing_pizero)
sigma_eepi = ntup%sigcm1
Expand All @@ -134,9 +134,15 @@ real*8 function peepi(vertex,main)
Q2gev = vertex%q2/1.d6 !convert to GeV**2
Wgev = main%wcm/1000.0 ! convert to GeV
cthcm = cos(thetacm)
E0 = vertex%Ein/1000.0 !convert to GeV
ipi = 3 ! pi+ by default
if (which_pion.eq.1 .or. which_pion.eq.11 .or. which_pion.eq.3) ipi=4 ! pi-
E0 = vertex%Ein/1000.0 !convert to GeV
if(doing_pizero) then
ipi=1 !pi0 from proton by default
if (which_pion.eq.1 .or. which_pion.eq. 3) ipi=2 !pi0 from neutron
else
ipi = 3 ! pi+ by default
if (which_pion.eq.1 .or. which_pion.eq.11 .or. which_pion.eq.3) ipi=4 ! pi-
endif

call sigmaid(ipi,Q2gev,Wgev,E0,cthcm,phicm,sig0)
! convert from mub / dOmega* to mub / dt / dphi*
ntup%sigcm2 = sig0 / ppicm / qstar / 2.
Expand Down Expand Up @@ -729,16 +735,18 @@ subroutine sigmaid(Ipi,q2,w,e0,costh,phi,sig0)
return
end

real*8 function sig_param_2021(thcm,phicm,t,q2,wsq,eps,which_pion)
real*8 function sig_param_2021(thcm,phicm,t,q2,wsq,eps,
> which_pion,doing_pizero)
! April 2021 fit to exclusive pi+ and pi- data from
! fpi1, fpi2, CT, pt-SIDIS, CSV-SIDIS, and KLT
! q2, t, and wsq should be in gev**2
! thcm and phicm should be in radians
! Peter Bosted, from output of ~bosted/ptc/ptb.f
implicit none
real*8 thcm,phicm,t,q2,wsq,eps
real*8 sigl,sigt,sigttv,sigltv,sigexcl3
real*8 sigl,sigt,sigttv,sigltv,sigexcl3,sigexcl3p,sigexcl3m
integer which_pion
logical doing_pizero
common/excmn/sigl,sigt,sigttv,sigltv
real*8 pp(17)/
> 1.60077,
Expand Down Expand Up @@ -777,26 +785,34 @@ real*8 function sig_param_2021(thcm,phicm,t,q2,wsq,eps,which_pion)
> -1.00355,
> 0.05055/

if (which_pion.eq.1.or.which_pion.eq.11.or.which_pion.eq.3) then
call exclfit(t,thcm,phicm,q2,
> wsq,eps,sigl,sigt,sigttv,sigltv,sigexcl3,pm)
else ! pi+
call exclfit(t,thcm,phicm,q2,
> wsq,eps,sigl,sigt,sigttv,sigltv,sigexcl3,pp)
endif
sig_param_2021 = sigexcl3
if(doing_pizero) then
call exclfit(t,thcm,phicm,q2,
> wsq,eps,sigl,sigt,sigttv,sigltv,sigexcl3p,pp,0.0)
call exclfit(t,thcm,phicm,q2,
> wsq,eps,sigl,sigt,sigttv,sigltv,sigexcl3m,pm,0.0)
sigexcl3 = (sigexcl3m + sigexcl3p)/2.0 ! first pass, average of pi+ and pi-
else
if (which_pion.eq.1.or.which_pion.eq.11.or.which_pion.eq.3) then
call exclfit(t,thcm,phicm,q2,
> wsq,eps,sigl,sigt,sigttv,sigltv,sigexcl3,pm,1.0)
else ! pi+
call exclfit(t,thcm,phicm,q2,
> wsq,eps,sigl,sigt,sigttv,sigltv,sigexcl3,pp,1.0)
endif
sig_param_2021 = sigexcl3
endif
return
end

subroutine exclfit(t,thetacm,phicm,q2_gev,
> s_gev,eps,sigl,sigt,sigtt,siglt,sig,p)
> s_gev,eps,sigl,sigt,sigtt,siglt,sig,p,fpifact)

implicit none
real*8 p(15),t,thetacm,phicm,q2_gev,s_gev,eps,sigl
real*8 sigt,sigtt,siglt,sig,mtar_gev/0.938/
real*8 fpi,q2fpi2,sig219
real*8 fpi,q2fpi2,sig219,fpifact

fpi = 1. /
fpi = fpifact /
> (1.0 + p(1)*q2_gev + p(2)*q2_gev**2)

q2fpi2 = q2_gev * fpi**2
Expand Down
7 changes: 7 additions & 0 deletions semi_physics.f
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ real*8 function peepiX(vertex,vertex0,main,survivalprob,doing_cent)
c b = pt_b_param ! now parameter in input file

Mpi_gev = Mpi/1000.0
if(doing_pizero) Mpi_gev = Mpi0/1000.0
Mp_gev = Mp/1000.0
C DJG: Setup stuff for doing "central" cross section calculation. Here, I'm
C DJG: assuming we want the cross section at some "point" in Q2 and W space.
Expand Down Expand Up @@ -476,6 +477,12 @@ real*8 function peepiX(vertex,vertex0,main,survivalprob,doing_cent)
db = u1
s1 = yu
sb = s1
if(doing_pizero) then ! just get averge of pi+ and pi-
u1 = (yf + yu) / 2.
d1 = (yf + yu) / 2.
ub = (yf + yu) / 2.
d1 = (yf + yu) / 2.
endif
elseif(doing_semika) then
IHdss=2 ! Kaons, 1=Pions
IOdss=1 ! NLO
Expand Down
Loading

0 comments on commit 79766ac

Please sign in to comment.