version 1.2, 2005/09/22 02:13:57
|
version 1.13, 2006/01/26 21:19:08
|
|
|
integer i,j,k,ichoice,ichoice2,iremain | integer i,j,k,ichoice,ichoice2,iremain |
real*8 rotmat,xyz(3),xyznew(3),termang | real*8 rotmat,xyz(3),xyznew(3),termang |
integer ic,ii,jj | integer ic,ii,jj |
integer*4 junk1,ikinsetting |
integer*4 junk1,ikinsetting,isectrack |
real*8 xfp,yfp,tthfp,tphfp,pfp,junk2,junk3,thfp,phfp | real*8 xfp,yfp,tthfp,tphfp,pfp,junk2,junk3,thfp,phfp |
real*8 e0(10),eang(10),hang(10),targ_thick(10) | real*8 e0(10),eang(10),hang(10),targ_thick(10) |
real*8 xtgt,ytgt,thtgt,phtgt,ptgt,dptgt | real*8 xtgt,ytgt,thtgt,phtgt,ptgt,dptgt |
|
|
c include 'option.h' | c include 'option.h' |
c | c |
common/kincom/rotmat(3,3) | common/kincom/rotmat(3,3) |
|
c |
|
nhu1=0 |
|
nhx1=0 |
|
nhv1=0 |
|
nhu2=0 |
|
nhx2=0 |
|
nhv2=0 |
|
nhu3=0 |
|
nhx3=0 |
|
nhv3=0 |
|
nhu4=0 |
|
nhx4=0 |
|
nhv4=0 |
|
c |
call grndm ( rndm , 3 ) | call grndm ( rndm , 3 ) |
c | c |
111 format(a80) | 111 format(a80) |
|
|
c write(*,*)'Getting kinematics setting ...' | c write(*,*)'Getting kinematics setting ...' |
open(unit=1,file='geant_kinematics.dat',type='UNKNOWN') | open(unit=1,file='geant_kinematics.dat',type='UNKNOWN') |
read(1,*)ikinsetting | read(1,*)ikinsetting |
|
read(1,*)isectrack |
close(unit=1) | close(unit=1) |
|
if(isectrack.eq.1) then |
|
sectrack=.true. |
|
else |
|
sectrack=.false. |
|
endif |
open(unit=1,file='hdr_gep.dat',status='old') | open(unit=1,file='hdr_gep.dat',status='old') |
do i=1,10 | do i=1,10 |
read(1,*)e0(i),eang(i),hang(i),targ_thick(i) | read(1,*)e0(i),eang(i),hang(i),targ_thick(i) |
|
|
z=0.0 | z=0.0 |
dxdz=tan(phtgt*3.14159265/180.0) | dxdz=tan(phtgt*3.14159265/180.0) |
dydz=tan(thtgt*3.14159265/180.0) | dydz=tan(thtgt*3.14159265/180.0) |
write(*,*)p_spec,th_spec,dpp |
if(nevent.le.2)write(*,*)'******** mom = ',p_spec,' ******' |
write(*,*)x,y,z |
c write(*,*)x,y,z |
write(*,*)dxdz,dydz |
c write(*,*)dxdz,dydz |
c | c |
c Call to SIMC routine | c Call to SIMC routine |
c | c |
|
decay_flag=.false. |
|
wcs_flag=.false. |
|
ms_flag=.false. |
|
m2=(938.2796**2) |
call mc_hms (p_spec, th_spec, dpp, x, y, z, dxdz, dydz, | call mc_hms (p_spec, th_spec, dpp, x, y, z, dxdz, dydz, |
> x_fp, dx_fp, y_fp, dy_fp, m2, | > x_fp, dx_fp, y_fp, dy_fp, m2, |
> ms_flag, wcs_flag, decay_flag, resmult, fry, | > ms_flag, wcs_flag, decay_flag, resmult, fry, |
> ok_spec, pathlen) | > ok_spec, pathlen) |
write(*,*)p_spec,th_spec,dpp |
c write(*,*)'Momentum = ',p_spec,' Angle = ',th_spec |
write(*,*)x,y,z |
c write(*,*)x,y,z |
write(*,*)dxdz,dydz |
c write(*,*)dxdz,dydz |
write(6,*)x_fp,dx_fp,y_fp,dy_fp |
c write(6,*)x_fp,dx_fp,y_fp,dy_fp,ok_spec |
write(*,*)m2,ms_flag,wcs_flag,decay_flag |
c write(*,*)m2,ms_flag,wcs_flag,decay_flag |
write(*,*)resmult,fry,ok_spec,pathlen |
c write(*,*)resmult,fry,ok_spec,pathlen |
| |
xfp=x_fp | xfp=x_fp |
phfp=atan(dx_fp)/3.14159265*180.0 | phfp=atan(dx_fp)/3.14159265*180.0 |
yfp=y_fp |
yfp=y_fp*100.0 |
thfp=atan(dy_fp)/3.14159265*180.0 |
thfp=atan(dy_fp)/3.14159265*180.0*100.0 |
|
c write(6,*)'x,phi,y,theta,ok_spec =' |
|
c write(6,*)xfp,phfp,yfp,thfp,ok_spec |
|
c |
|
do ii=1,20 |
|
ntuple_array(ii)=0.0 |
|
enddo |
|
ntuple_array(11)=real(xfp) |
|
ntuple_array(12)=real(yfp) |
|
ntuple_array(13)=real(thfp) |
|
ntuple_array(14)=real(phfp) |
c | c |
pcentral=ptgt | pcentral=ptgt |
pfp=dptgt | pfp=dptgt |
|
|
c what the corresponding theta and phi are for the other arm. | c what the corresponding theta and phi are for the other arm. |
| |
if (abs(eang).gt.abs(hang)) then | if (abs(eang).gt.abs(hang)) then |
phie=-.065+rndm(1)*.130 |
c phie=-.025+rndm(1)*.050 |
thetae=-.030+rndm(2)*.060 |
c thetae=-.009+rndm(2)*.018 |
|
if(pcentral.ge.5000) then |
|
c phie=-.00+rndm(1)*.00 |
|
c thetae=-.00+rndm(2)*.00 |
|
phie=-.130+rndm(1)*.260 |
|
thetae=-.065+rndm(2)*.130 |
|
else if(pcentral.ge.3000.and.pcentral.lt.5000) then |
|
phie=-.067+rndm(1)*.135 |
|
thetae=-.034+rndm(2)*.067 |
|
else |
|
phie=-.087+rndm(1)*.174 |
|
thetae=-.044+rndm(2)*.087 |
|
endif |
|
c phie=-.00+rndm(1)*.00 |
|
c thetae=-.00+rndm(2)*.00 |
escat=mp/(1.0+mp/e0-cos(fg*eang+thetae)*cos(phie)) | escat=mp/(1.0+mp/e0-cos(fg*eang+thetae)*cos(phie)) |
pscat=sqrt(e0**2+escat**2- | pscat=sqrt(e0**2+escat**2- |
$ 2.0*e0*escat*cos(fg*eang+thetae)*cos(phie)) | $ 2.0*e0*escat*cos(fg*eang+thetae)*cos(phie)) |
|
|
else | else |
c Hadron arm defining acceptance | c Hadron arm defining acceptance |
1221 call grndm ( rndm, 3) | 1221 call grndm ( rndm, 3) |
phie=-.065+rndm(1)*.130 |
phie=-.080+rndm(1)*.160 |
thetae=-.030+rndm(2)*.060 | thetae=-.030+rndm(2)*.060 |
|
c phie=-.00+rndm(1)*.00 |
|
c thetae=-.00+rndm(2)*.00 |
escat=mp/(1.0+mp/e0-cos(fg*eang+thetae)*cos(phie)) | escat=mp/(1.0+mp/e0-cos(fg*eang+thetae)*cos(phie)) |
pscat=sqrt(e0**2+escat**2- | pscat=sqrt(e0**2+escat**2- |
$ 2.0*e0*escat*cos(fg*eang+thetae)*cos(phie)) | $ 2.0*e0*escat*cos(fg*eang+thetae)*cos(phie)) |
|
|
endif | endif |
| |
ptgt=pscat | ptgt=pscat |
|
c write(*,*)escat,eang,pscat,hang |
dptgt=(pcentral-pscat)/pcentral | dptgt=(pcentral-pscat)/pcentral |
c | c |
c Following statement to fill just the high and low dp bins | c Following statement to fill just the high and low dp bins |