Skip to content

Commit

Permalink
Merge pull request #48 from gaskelld/kaon_decay
Browse files Browse the repository at this point in the history
Kaon decay and continuous decay in SHMS
  • Loading branch information
gaskelld authored May 22, 2023
2 parents 66e822e + db004be commit 29d453a
Show file tree
Hide file tree
Showing 5 changed files with 288 additions and 176 deletions.
4 changes: 3 additions & 1 deletion constants.inc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

! ... some physical constants
real*8 Me, Me2, Mp, Mp2, Mn, Mn2, Mpi, Mpi2, Mpi0, Mpi02
real*8 Mk, Mk2, Mrho, Mrho2,Md, Md2
real*8 Mk, Mk2, Mrho, Mrho2,Md, Md2, Mmu, Mmu2
real*8 Mlambda, Msigma0, Msigma_minus
real*8 MDelta, Delta_width
real*8 amu, hbarc, pi, twopi, alpha, alpi, degrad, euler
Expand All @@ -22,6 +22,8 @@
parameter (Mn2=Mn**2)
parameter (Mpi=139.57018)
parameter (Mpi2=Mpi**2)
parameter (Mmu=105.6583755)
parameter (Mmu2=Mmu**2)
parameter (Mpi0=134.9766)
parameter (Mpi02=Mpi0**2)
parameter (Mk=493.677)
Expand Down
30 changes: 23 additions & 7 deletions shared/project.f
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ subroutine project(x_new,y_new,z_drift,decay_flag,dflag,m2,ph,pathlen)
logical dflag !has particle decayed yet?

C Local declarations.
real*8 p_spec,ph,m2
real*8 p_spec,ph,m2, m_final
real*8 z_decay,pathlen
real*8 rph,rth1,rth
real*8 beta,gamma,dlen
Expand Down Expand Up @@ -71,12 +71,28 @@ subroutine project(x_new,y_new,z_drift,decay_flag,dflag,m2,ph,pathlen)
rph = grnd()*2.*pi
rth1 = grnd()*2.-1.
rth = acos(rth1)
er = 109.787
pr = 29.783
pxr = 29.783*sin(rth)*cos(rph)
pyr = 29.783*sin(rth)*sin(rph)
pzr = 29.783*cos(rth)
m2 = 105.67 **2 !need mass-squared for multiple scattering.

pr = 0.
m_final = Mmu ! default
if(abs(sqrt(m2) - Mpi).lt.2) pr = 29.783 ! pion decay
if(abs(sqrt(m2) - Mk).lt.2) then ! kaons
if(grnd().lt.0.7) then ! decay to muon plus neutrino
pr = 235.5
else ! decay to two pions
pr = sqrt(Mk**2 / 4. - Mpi**2)
m_final = Mpi
endif
endif
if(pr.eq.0.) then
write(6,'(''error, cannot decay particle with'',
> '' mass='',f8.2)') sqrt(m2)
stop
endif
er = sqrt(m_final**2 + pr**2)
pxr = pr*sin(rth)*cos(rph)
pyr = pr*sin(rth)*sin(rph)
pzr = pr*cos(rth)
m2 = m_final**2 !need mass-squared for multiple scattering.
Mh2_final = m2 !for ntuple


Expand Down
59 changes: 46 additions & 13 deletions shared/transp.f
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ subroutine transp(spectr,class,decay_flag,dflag,m2,ph,zd,pathlen)
character*(*) file !Used in entry point below.
logical decay_flag !check for decay
logical dflag !has particle decayed yet?
real*8 m2,ph,zd !decay variables.
real*8 m2,ph,zd, m_final !decay variables.
real*8 pathlen

C Parameters.
Expand Down Expand Up @@ -146,11 +146,26 @@ subroutine transp(spectr,class,decay_flag,dflag,m2,ph,zd,pathlen)
rth1 = grnd()*2.-1.
rth = acos(rth1)
er = 109.787
pr = 29.783
pxr = 29.783*sin(rth)*cos(rph)
pyr = 29.783*sin(rth)*sin(rph)
pzr = 29.783*cos(rth)
pr = 0.
m_final = Mmu ! default
if(abs(sqrt(m2) - Mpi).lt.2) pr = 29.783 ! pion decay
if(abs(sqrt(m2) - Mk).lt.2) then ! kaons
if(grnd().lt.0.7) then ! decay to muon plus neutrino
pr = 235.5
else ! decay to two pions
pr = sqrt(Mk**2 / 4. - Mpi**2)
m_final = Mk
endif
endif
if(pr.eq.0.) then
write(6,'(''error, cannot decay particle with'',
> '' mass='',f8.2)') sqrt(m2)
stop
endif
er = sqrt(m_final**2 + pr**2)
pxr = pr*sin(rth)*cos(rph)
pyr = pr*sin(rth)*sin(rph)
pzr = pr*cos(rth)
C Boost from pion/kaon center of mass back to lab frame. Loren wants
C beta of new frame w.r.t. original frame, so beta is opposite of the
Expand All @@ -164,7 +179,7 @@ subroutine transp(spectr,class,decay_flag,dflag,m2,ph,zd,pathlen)
dydzs = pyf/pzf
dpps = 100.*(pf/p_spec-1.)
ph=pf
m2 = 105.67**2 !need mass-squared for multiple scattering.
m2 = m_final**2 !need mass-squared for multiple scattering.
Mh2_final = m2 !for ntuple
endif
Expand Down Expand Up @@ -223,11 +238,29 @@ subroutine transp(spectr,class,decay_flag,dflag,m2,ph,zd,pathlen)
rth1 = grnd()*2.-1.
rth = acos(rth1)

er = 109.787
pr = 29.783
pxr = 29.783*sin(rth)*cos(rph)
pyr = 29.783*sin(rth)*sin(rph)
pzr = 29.783*cos(rth)

pr = 0.
m_final = Mmu ! default
if(abs(sqrt(m2) - Mpi).lt.2) pr = 29.783 ! pion decay
if(abs(sqrt(m2) - Mk).lt.2) then ! kaons
if(grnd().lt.0.7) then ! decay to muon plus neutrino
pr = 235.5
else ! decay to two pions
pr = sqrt(Mk**2 / 4. - Mpi**2)
m_final = Mpi
endif
endif
if(pr.eq.0.) then
write(6,'(''error, cannot decay particle with'',
> '' mass='',f8.2)') sqrt(m2)
stop
endif
er = sqrt(m_final**2 + pr**2)
pxr = pr*sin(rth)*cos(rph)
pyr = pr*sin(rth)*sin(rph)
pzr = pr*cos(rth)


bx = -beta * dxdzs / sqrt(1. + dxdzs**2 + dydzs**2)
by = -beta * dydzs / sqrt(1. + dxdzs**2 + dydzs**2)
bz = -beta * 1. / sqrt(1. + dxdzs**2 + dydzs**2)
Expand All @@ -236,7 +269,7 @@ subroutine transp(spectr,class,decay_flag,dflag,m2,ph,zd,pathlen)
dydzs = pyf/pzf
dpps = 100.*(pf/p_spec-1.)
ph=pf
m2 = 105.67**2 !need mass-squared for multiple scattering.
m2 = m_final**2 !need mass-squared for multiple scattering.
Mh2_final = m2 !for ntuple
endif
endif
Expand Down
Loading

0 comments on commit 29d453a

Please sign in to comment.