-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add simulation of pions in HMS/SHMS collimators
- Loading branch information
Showing
11 changed files
with
547 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
subroutine mc_hms_coll(m2,p,p_spec,decay_flag,dflag,success, | ||
- coll_flag,pathlen) | ||
CDJG Subroutine to step a particle "through" the collimator,checking for | ||
CDJG energy loss, multiple scattering. If particle doesn't make it (too | ||
CDJG much energy loss for example), returns .FALSE. | ||
! TH - collimator thickness ~6.3 cm. He uses 20 steps for some reason | ||
! TH Why not..seems ok. Note that keep going even if the particle | ||
! TH is outside entrance specs. | ||
implicit none | ||
include 'apertures_hms.inc' | ||
include 'struct_hms.inc' | ||
include '../spectrometers.inc' | ||
real*8 m2,p,p_spec | ||
logical decay_flag, dflag,success,coll_flag | ||
real*8 grnd | ||
real*8 h_entr,h_exit,v_entr,v_exit | ||
real*8 x_off,y_off,z_off | ||
parameter (h_entr = 4.575) | ||
parameter (v_entr = 11.646) | ||
parameter (h_exit = 4.759) | ||
parameter (v_exit = 12.114) | ||
parameter (x_off = 0.000) | ||
parameter (y_off = +0.028) | ||
parameter (z_off = +40.17) | ||
integer nstep | ||
parameter(nstep=20) | ||
real*8 coll_thick,coll_dens,zcoll,acoll,coll_radl,coll_radw | ||
real*8 pathlen | ||
parameter(coll_thick = 6.30) | ||
parameter(coll_dens = 17.0) | ||
parameter(zcoll = 69.45) | ||
parameter(acoll = 171.56797) | ||
parameter(coll_radl = 0.41753) | ||
real*8 step_size,h_step,v_step | ||
logical step_flag | ||
logical slit_h_flag,slit_v_flag,slit_o_flag,rantemp_flag,epart_flag | ||
real*8 epart,trans,eloss_tot,eloss,rantemp | ||
real*8 thick,thick_temp | ||
integer n | ||
eloss_tot=0. | ||
eloss=0. | ||
step_size = 6.30/nstep | ||
coll_flag = .FALSE. | ||
success = .FALSE. | ||
slit_h_flag = .FALSE. | ||
slit_v_flag = .FALSE. | ||
slit_o_flag = .FALSE. | ||
rantemp_flag = .FALSE. | ||
epart_flag = .FALSE. | ||
h_step = h_entr | ||
v_step = v_entr | ||
epart = sqrt(p**2+m2) | ||
C Now start stepping | ||
C Check aperture, if part. hits collimator, do multiple scattering,eloss | ||
C for next step and then project. | ||
do n=1,nstep | ||
step_flag = .FALSE. | ||
if (abs(ys-y_off).gt.h_step) then | ||
coll_flag = .TRUE. | ||
step_flag = .TRUE. | ||
hSTOP_slit_hor = hSTOP_slit_hor + 1 | ||
slit_h_flag = .TRUE. | ||
thick_temp = step_size | ||
endif | ||
if (abs(xs-x_off).gt.v_step) then | ||
coll_flag = .TRUE. | ||
step_flag = .TRUE. | ||
hSTOP_slit_vert = hSTOP_slit_vert + 1 | ||
slit_v_flag = .TRUE. | ||
thick_temp=step_size | ||
endif | ||
if (abs(xs-x_off).gt.(-v_step/h_step*abs(ys-y_off)+3*v_step/2)) then | ||
coll_flag = .TRUE. | ||
step_flag = .TRUE. | ||
hSTOP_slit_oct = hSTOP_slit_oct + 1 | ||
slit_o_flag = .TRUE. | ||
thick_temp = step_size | ||
endif | ||
thick = thick_temp | ||
C If we hit the collimator, check for hadronic reaction, do eloss, mult. scat. for first step | ||
if(step_flag) then | ||
c TH - un-comment the following line if want no collimator punch through! | ||
c goto 500 | ||
if(m2.gt.12000. .and. m2.lt.20000.) then !check if pion - if muon, don't check for hadronic interaction | ||
call pion_coll_absorb(p,thick,trans) | ||
rantemp = grnd() | ||
if(rantemp.gt.trans) then | ||
rantemp_flag = .TRUE. | ||
goto 500 | ||
endif | ||
endif | ||
coll_radw = thick/coll_radl | ||
! TH - some adjustment here for multiple scattering test | ||
c call musc(m2,p,coll_radw,thick,dydzs,dxdzs) | ||
call musc(m2,p,coll_radw,dydzs,dxdzs) | ||
epart = sqrt(p**2+m2) | ||
call enerloss_new(thick,coll_dens,zcoll,acoll,epart, | ||
$ sqrt(m2),1,eloss) | ||
epart = epart - eloss | ||
eloss_tot = eloss_tot + eloss | ||
if(epart.lt.sqrt(m2)) then | ||
epart_flag = .TRUE. | ||
goto 500 | ||
endif | ||
p = sqrt(epart**2-m2) | ||
dpps = 100.*(p/p_spec - 1.) | ||
endif | ||
|
||
call project(xs,ys,step_size,decay_flag,dflag,m2,p,pathlen) !drift and decay | ||
|
||
h_step = h_step + (h_exit-h_entr)/nstep | ||
v_step = v_step + (v_exit-v_entr)/nstep | ||
c write(6,*) 'step,eloss',n,eloss,step_flag,pathlen | ||
enddo | ||
|
||
success = .TRUE. | ||
|
||
500 continue | ||
c write(6,*) 'step,eloss',n,eloss_tot,success,coll_flag,step_flag,xs,ys | ||
c if (.not.success) then | ||
c write(6,*) rantemp_flag,trans,epart_flag,eloss,slit_h_flag,slit_v_flag,slit_o_flag | ||
c endif | ||
c write(6,*) 'leaving collimator...',p,success,coll_flag,step_flag | ||
c if (abs(xs).gt.0.5 .or. abs(ys).gt.0.5) write(6,*) 'xy ',xs,ys | ||
|
||
return | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
subroutine pion_coll_absorb(ppi,thick,transmission) | ||
c Subroutine to calculate probability that pion will be absorbed in the SOS | ||
c collimator - can be used for HMS assuming same geometry applies. TH - checked that. | ||
|
||
C DJG For now, I use the "reaction" cross sections. Also, only implemented for | ||
C DJG pi+ - no pi-. | ||
|
||
! TH - cross section from Dave's parameterization of the energy and A dependence up to | ||
! TH pion momenta of ~ 2 GeV, we extended that to > 2 GeV during Fpi analysis | ||
implicit none | ||
real*8 Ppi,Epi,Tpi,mpi !pion kinematics | ||
real*8 Navagadro | ||
parameter(Navagadro = 6.0221367d+23) | ||
parameter(mpi = 139.56995) | ||
real*8 mate_dens | ||
real*8 mate_t | ||
real*8 mate_A | ||
real*8 T(14),sigreac(14),qreac(14) | ||
real*8 sighi,siglo,qhi,qlo,transmission,lambdai,thick | ||
real*8 Tlo,Thi,sigA,sigAlo,sigAhi,sum | ||
integer i | ||
! TH - DG original + TH extension for > 2GeV | ||
data T /85.0,125.0,165.0,205.0,245.0,315.0,584.02,711.95,870.12, | ||
> 1227.57,1446.58,1865.29,2858.0,4159.0/ | ||
CCCCCCCCCC TOTAL CROSS SECTIONS CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC | ||
! data sigreac /170.12,189.49,178.61,158.11,116.9,85.86,55.5,55.5, | ||
! > 55.5,55.5,55.5,55.5,55.5,55.5/ | ||
! data qreac /0.59980,0.5753,0.58046,0.59842,0.65218,0.69421,.779 | ||
! > ,.779,.779,.779,.779,.779,0.779,0.779/ | ||
CCCCCCCCCCCCC REACTION CROSS SECTIONS CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC | ||
! TH - DG Original + TH extension for > 2GeV | ||
data sigreac /26.03,84.47,117.3,117.4,101.9,69.58,42.5,44.7,47.9, | ||
> 46.5,45.2,39.6,35.34,33.15/ | ||
data qreac /0.948,0.659,0.56,0.5342,0.5452,0.60796,0.699,0.689, | ||
> 0.679,0.683,0.688,0.704,0.7483,0.7705/ | ||
CCCCCCCCCCCCC ABSORPTION(?) CROSS SECTIONS CCCCCCCCCCCCCCCCCCCCCCCCCCC | ||
c data sigreac /8.81,25.57,29.57,30.245,15.63,8.302,4.98,4.98,4.98, | ||
c > 4.98,4.98,4.98/ | ||
c data qreac /0.986,0.763,0.744,0.679,0.762,0.6506,0.75,0.75, | ||
c > 0.75,0.75,0.75,0.75/ | ||
c data sigreac_minus /25.0,100.0,120.,110.0,100.0,80.0/ | ||
c data qreac_minus /0.97,0.60,0.52,0.50,0.53,0.60/ | ||
mate_dens = 17.0 !Collimator density (g/cm^3) | ||
mate_t = 6.35 !Total aluminum seen by pion(cm) | ||
mate_A = 171.57 | ||
Epi = sqrt(Ppi**2+mpi**2) | ||
Tpi = Epi - mpi | ||
sigA = 0.0 | ||
c do i = 1,14 | ||
c GH changed this to 13, there are only 14 elements, so the T(i+1) check should fail for i=14 | ||
do i = 1,13 | ||
if((Tpi.gt.T(i)).and.(Tpi.le.T(i+1))) then | ||
Thi = T(i+1) | ||
Tlo = T(i) | ||
sighi = sigreac(i+1) | ||
siglo = sigreac(i) | ||
qhi = qreac(i+1) | ||
qlo = qreac(i) | ||
sigAhi = sighi*mate_A**qhi | ||
sigAlo = siglo*mate_A**qlo | ||
sigA = (sigAlo*(Thi-Tpi) + sigAhi*(Tpi-Tlo))/(Thi-Tlo) | ||
sigA = sigA*1.d-27 !convert to cm^2 | ||
endif | ||
enddo | ||
c GH if pion kinetic energy is greater than T(14)=4159 MeV, then use T(14) parameters | ||
if (Tpi.gt.T(14)) then | ||
sigA = sigreac(14)*mate_A**qreac(14) | ||
sigA = sigA*1.d-27 | ||
c write(6,*)' coll: pion K.E. limit ',Tpi | ||
endif | ||
sum = 0.0 | ||
lambdai = mate_dens*Navagadro*sigA/mate_A | ||
sum = sum + thick*lambdai | ||
transmission = exp(-sum) | ||
end | ||
Oops, something went wrong.