Skip to content

Commit

Permalink
Add flag for number of photons to detect, correct photon kinematic tr…
Browse files Browse the repository at this point in the history
…ansformation
  • Loading branch information
gaskelld committed Aug 29, 2024
1 parent bbb5700 commit b2902a2
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 11 deletions.
25 changes: 24 additions & 1 deletion dbase.f
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ subroutine dbase_read(H)
! 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
! which_pion= 3: gamma* n -> pi0 Delta0
! set "pizero_ngamma" to 1 or 2 whether you want to detect a minimum of 1 or 2 photons
! 4. doing_phsp:Generate acceptance with radiation and cross section disabled,
Expand Down Expand Up @@ -700,6 +701,13 @@ subroutine dbase_read(H)
if(doing_hydsemi) then
if(doing_pizero) then
write(6,*) ' ****-------- H(e,e''pi0)X --------****'
if(pizero_ngamma.eq.1) then
write(6,*) 'Requiring only one photon from decaying pi0'
elseif(pizero_ngamma.eq.2) then
write(6,*) 'Requiring both photons from decaying pi0'
else
stop 'pizero_ngamma not set correctly(must be 1 or 2), stopping'
endif
else
if(doing_hplus) then
write(6,*) ' ****-------- H(e,e''pi+)X --------****'
Expand All @@ -710,6 +718,13 @@ subroutine dbase_read(H)
elseif (doing_deutsemi) then
if(doing_pizero) then
write(6,*) ' ****-------- D(e,e''pi0)X --------****'
if(pizero_ngamma.eq.1) then
write(6,*) 'Requiring only one photon from decaying pi0'
elseif(pizero_ngamma.eq.2) then
write(6,*) 'Requiring both photons from decaying pi0'
else
stop 'pizero_ngamma not set correctly(must be 1 or 2), stopping'
endif
else
if(doing_hplus) then
write(6,*) ' ****-------- D(e,e''pi+)X --------****'
Expand Down Expand Up @@ -763,6 +778,13 @@ subroutine dbase_read(H)
endif
if (doing_pizero) then
write(6,*) ' ****------- pi0 production -------****'
if(pizero_ngamma.eq.1) then
write(6,*) 'Requiring only one photon from decaying pi0'
elseif(pizero_ngamma.eq.2) then
write(6,*) 'Requiring both photons from decaying pi0'
else
stop 'pizero_ngamma not set correctly(must be 1 or 2), stopping'
endif
else
if (which_pion.eq.0 .or. which_pion.eq.10 .or. which_pion.eq.2) then
write(6,*) ' ****------- pi+ production -------****'
Expand Down Expand Up @@ -956,6 +978,7 @@ subroutine regallvars()
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('pizero_ngamma', pizero_ngamma,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
1 change: 1 addition & 0 deletions infiles/nps_delta_pi0_test.inp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ begin parm experiment
doing_semi = 0
doing_hplus = 0
doing_pizero = 1
pizero_ngamma=2 ; 1=require at least 1 photon, 2=require both photons
end parm experiment

begin parm kinematics_main
Expand Down
1 change: 1 addition & 0 deletions infiles/nps_excl_pi0_ld2_neutron_test.inp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ begin parm experiment
doing_semi = 0
doing_hplus = 0
doing_pizero = 1
pizero_ngamma=2 ; 1=require at least 1 photon, 2=require both photons
end parm experiment

begin parm kinematics_main
Expand Down
1 change: 1 addition & 0 deletions infiles/nps_excl_pi0_ld2_proton_test.inp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ begin parm experiment
doing_semi = 0
doing_hplus = 0
doing_pizero = 1
pizero_ngamma=2 ; 1=require at least 1 photon, 2=require both photons
end parm experiment

begin parm kinematics_main
Expand Down
1 change: 1 addition & 0 deletions infiles/nps_excl_pi0_test.inp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ begin parm experiment
doing_semi = 0
doing_hplus = 0
doing_pizero = 1
pizero_ngamma=2 ; 1=require at least 1 photon, 2=require both photons
end parm experiment

begin parm kinematics_main
Expand Down
1 change: 1 addition & 0 deletions infiles/nps_sidis_pi0_test.inp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ begin parm experiment
doing_semi = 1
doing_hplus = 0
doing_pizero = 1
pizero_ngamma=2 ; 1=require at least 1 photon, 2=require both photons
end parm experiment

begin parm kinematics_main
Expand Down
22 changes: 14 additions & 8 deletions simc.f
Original file line number Diff line number Diff line change
Expand Up @@ -870,12 +870,12 @@ subroutine report(iun,timestring1,timestring2,central,contrib,
> 'doing_kaon', doing_kaon, 'doing_pion', doing_pion
write(iun,'(5x,3(2x,a19,''='',l2))') 'doing_semi', doing_semi,
> 'doing_rho', doing_rho, 'doing_hplus', doing_hplus
write(iun,'(5x,2(2x,a19,''='',l2))') 'doing_semipi',doing_semipi,
> 'doing_semika', doing_semika
write(iun,'(5x,3(2x,a19,''='',l2))') 'doing_semipi',doing_semipi,
> 'doing_semika', doing_semika, 'doing_pizero',doing_pizero
write(iun,'(5x,2(2x,a19,''='',l2))') 'doing_delta',doing_delta,
> 'doing_phsp', doing_phsp
write(iun,'(5x,2(2x,a19,''='',i2))') 'which_pion', which_pion,
> 'which_kaon', which_kaon
write(iun,'(5x,3(2x,a19,''='',i2))') 'which_pion', which_pion,
> 'which_kaon', which_kaon, 'pizero_ngamma',pizero_ngamma
write(iun,'(5x,3(2x,a19,''='',l2))') 'doing_hyd_elast', doing_hyd_elast,
> 'doing_deuterium', doing_deuterium, 'doing_heavy', doing_heavy
write(iun,'(5x,3(2x,a19,''='',l2))') 'doing_hydpi', doing_hydpi,
Expand Down Expand Up @@ -1475,7 +1475,7 @@ subroutine montecarlo(orig,main,recon,success)
ok_gamma1=.false.
ok_gamma2=.false.
c rotate from lab w/z along beam to frame w/z point to calorimeter
c rotate from lab w/z along beam to frame w/z pointing to center of calorimeter
if (hadron_arm.eq.8) then
exrot1=ntup%gamma1(2)
Expand All @@ -1488,11 +1488,11 @@ subroutine montecarlo(orig,main,recon,success)
else
exrot1=ntup%gamma1(2)
eyrot1=ntup%gamma1(3)*cos(spec%p%theta)+ntup%gamma1(4)*sin(spec%p%theta)
ezrot1=ntup%gamma1(3)*sin(spec%p%theta)+ntup%gamma1(4)*cos(spec%p%theta)
ezrot1=-ntup%gamma1(3)*sin(spec%p%theta)+ntup%gamma1(4)*cos(spec%p%theta)
exrot2=ntup%gamma2(2)
eyrot2=ntup%gamma2(3)*cos(spec%p%theta)+ntup%gamma2(4)*sin(spec%p%theta)
ezrot2=ntup%gamma2(3)*sin(spec%p%theta)+ntup%gamma2(4)*cos(spec%p%theta)
ezrot2=-ntup%gamma2(3)*sin(spec%p%theta)+ntup%gamma2(4)*cos(spec%p%theta)
endif
c first photon
Expand Down Expand Up @@ -1531,7 +1531,13 @@ subroutine montecarlo(orig,main,recon,success)
c needs to initialize here since not initialized in mc_calo (like in other single arm MC's)
ok_P_arm=.false.
if(ok_gamma1 .and. ok_gamma2) ok_P_arm=.true. !require both photons
if(pizero_ngamma.eq.2) then
if(ok_gamma1 .and. ok_gamma2) ok_P_arm=.true. !require both photons
elseif(pizero_ngamma.eq.1) then
if(ok_gamma1 .or. ok_gamma2) ok_P_arm=.true. !require only one photon
else
stop 'pizero_ngamma not set correctly (should be 1 or 2), stopping'
endif
else ! if not doing pizero, just need to call once
call mc_calo(spec%p%p, spec%p%theta, delta_p_arm, x_p_arm,
> y_p_arm, z_p_arm, dx_p_arm, dy_p_arm, xfp, dxfp, yfp, dyfp,
Expand Down
3 changes: 2 additions & 1 deletion simulate.inc
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
logical doing_eep, doing_pion, doing_delta, doing_kaon, doing_rho
logical doing_semi, doing_semipi, doing_semika, doing_hplus
logical doing_pizero
integer*4 pizero_ngamma
integer*4 which_kaon, which_pion
logical using_cit_generation, using_Coulomb, using_Eloss
logical correct_Eloss, correct_raster,do_fermi
Expand Down Expand Up @@ -99,7 +100,7 @@ c variables that need to be translated from integer to logical
> extra_dbase_file,tgt_field_file,using_E_arm_montecarlo,using_P_arm_montecarlo,
> doing_phsp, using_rad, hard_cuts, doing_hyd_elast, doing_deuterium, doing_heavy,
> doing_eep, doing_pion, doing_delta, doing_kaon, doing_rho, doing_semi,
> doing_semipi, doing_semika, doing_hplus, doing_pizero,which_kaon,
> doing_semipi, doing_semika, doing_hplus, doing_pizero,pizero_ngamma,which_kaon,
> which_pion, using_cit_generation, using_Coulomb, using_Eloss,
> correct_Eloss, correct_raster, do_fermi,using_tgt_field,
> electron_arm, hadron_arm, use_first_cer, using_HMScoll, using_SHMScoll,
Expand Down
2 changes: 1 addition & 1 deletion util/ntuple/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ MYOS := $(subst -,,$(shell uname))
CERNLIBS = -Wl,-static -lgeant$(GEANTVER) -lpawlib -lgraflib -lgrafX11 -lpacklib -lkernlib -lmathlib -Wl,-dy

#
CERN_ROOT=/cvmfs/oasis.opensciencegrid.org/jlab/scicomp/sw/el9/cernlib/2023
#CERN_ROOT=/cvmfs/oasis.opensciencegrid.org/jlab/scicomp/sw/el9/cernlib/2023
#For use with gfortran compiler
# -fno-automatic - all program storage treated as static
ifeq ($(MYOS),Linux)
Expand Down

0 comments on commit b2902a2

Please sign in to comment.