| 29 |
C mar-08 WM: Call to "newbeta" changed, now a flag tells the function if the |
C mar-08 WM: Call to "newbeta" changed, now a flag tells the function if the |
| 30 |
C call comes from "tofl2com" or form "toftrack" |
C call comes from "tofl2com" or form "toftrack" |
| 31 |
C mar-08 WM: Bug found in dEdx if check_charge>1 |
C mar-08 WM: Bug found in dEdx if check_charge>1 |
| 32 |
|
C oct-08 WM: Calculation of zenith angle debugged, sometimes strange values |
| 33 |
|
C were possible |
| 34 |
C****************************************************************************** |
C****************************************************************************** |
| 35 |
|
|
| 36 |
INTEGER FUNCTION TOFL2COM() |
INTEGER FUNCTION TOFL2COM() |
| 50 |
INTEGER j,hitvec(6) |
INTEGER j,hitvec(6) |
| 51 |
|
|
| 52 |
REAL dx,dy,dr,ds |
REAL dx,dy,dr,ds |
| 53 |
REAL yhelp,xhelp,xhelp1,xhelp2 |
REAL yhelp,yhelp1,yhelp2,xhelp,xhelp1,xhelp2 |
| 54 |
REAL c1,c2 |
REAL c1,c2 |
| 55 |
|
|
| 56 |
C REAL sw,sxw,w_i |
C REAL sw,sxw,w_i |
| 580 |
hitvec(5)=tof31_i |
hitvec(5)=tof31_i |
| 581 |
hitvec(6)=tof32_i |
hitvec(6)=tof32_i |
| 582 |
|
|
|
c write(*,*) 'tofl2com', |
|
|
c & tof11_i,tof12_i,tof21_i,tof22_i,tof31_i,tof32_i |
|
| 583 |
|
|
| 584 |
C------------------------------------------------------------------ |
C------------------------------------------------------------------ |
| 585 |
C-- calculate track position in paddle using timing difference |
C-- calculate track position in paddle using timing difference |
| 636 |
C---------------------------------------------------------------------- |
C---------------------------------------------------------------------- |
| 637 |
C--------------------- zenith angle theta --------------------------- |
C--------------------- zenith angle theta --------------------------- |
| 638 |
C---------------------------------------------------------------------- |
C---------------------------------------------------------------------- |
| 639 |
|
C----------------------------- old ---------------------------------- |
| 640 |
|
c dx=0. |
| 641 |
|
c dy=0. |
| 642 |
|
c dr=0. |
| 643 |
|
c theta13 = 0. |
| 644 |
|
c |
| 645 |
|
c IF ((tof12_i.GT.none_find).AND.(tof32_i.GT.none_find)) |
| 646 |
|
c & dx = xtofpos(1) - xtofpos(3) |
| 647 |
|
c IF ((tof11_i.GT.none_find).AND.(tof31_i.GT.none_find)) |
| 648 |
|
c & dy = ytofpos(1) - ytofpos(3) |
| 649 |
|
c dr = sqrt(dx*dx+dy*dy) |
| 650 |
|
c theta13 = atan(dr/tofarm13) |
| 651 |
|
c |
| 652 |
|
c |
| 653 |
|
C----------------------------- new ------------------------------ |
| 654 |
|
|
| 655 |
|
xhelp1=0. |
| 656 |
|
if (tof11_i.GT.none_find) xhelp1=tof11_x(tof11_i) |
| 657 |
|
if (xtofpos(1).lt.100) xhelp1=xtofpos(1) |
| 658 |
|
|
| 659 |
dx=0. |
yhelp1=0. |
| 660 |
dy=0. |
if (tof12_i.GT.none_find) yhelp1=tof12_y(tof12_i) |
| 661 |
dr=0. |
if (ytofpos(1).lt.100) yhelp1=ytofpos(1) |
| 662 |
theta13 = 0. |
|
| 663 |
|
|
| 664 |
IF ((tof12_i.GT.none_find).AND.(tof32_i.GT.none_find)) |
yhelp2=0. |
| 665 |
& dx = xtofpos(1) - xtofpos(3) |
if (tof32_i.GT.none_find) yhelp2=tof32_y(tof32_i) |
| 666 |
IF ((tof11_i.GT.none_find).AND.(tof31_i.GT.none_find)) |
if (ytofpos(3).lt.100) yhelp2=ytofpos(3) |
| 667 |
& dy = ytofpos(1) - ytofpos(3) |
|
| 668 |
dr = sqrt(dx*dx+dy*dy) |
xhelp2=0. |
| 669 |
theta13 = atan(dr/tofarm13) |
if (tof31_i.GT.none_find) xhelp2=tof31_x(tof31_i) |
| 670 |
|
if (xtofpos(3).lt.100) xhelp2=xtofpos(3) |
| 671 |
|
|
| 672 |
|
|
| 673 |
|
dx=0. |
| 674 |
|
dy=0. |
| 675 |
|
dr=0. |
| 676 |
|
theta13 = 0. |
| 677 |
|
|
| 678 |
|
dx = xhelp1 - xhelp2 |
| 679 |
|
dy = yhelp1 - yhelp2 |
| 680 |
|
dr = sqrt(dx*dx+dy*dy) |
| 681 |
|
theta13 = atan(dr/tofarm13) |
| 682 |
|
|
| 683 |
|
|
| 684 |
C---------------------------------------------------------------------- |
C---------------------------------------------------------------------- |
| 690 |
C---------------------------------------------------------------------- |
C---------------------------------------------------------------------- |
| 691 |
|
|
| 692 |
iz = int(check_charge(theta13,hitvec)) |
iz = int(check_charge(theta13,hitvec)) |
| 693 |
C write(*,*) 'in tofl2com',iz |
c write(*,*) 'charge in tofl2com',iz |
| 694 |
|
|
| 695 |
C-------------------------------------------------------------------- |
C-------------------------------------------------------------------- |
| 696 |
C---- if TDCleft.and.TDCright and NO ADC insert artificial ADC |
C---- if TDCleft.and.TDCright and NO ADC insert artificial ADC |
| 707 |
|
|
| 708 |
C---------------------------- S1 ------------------------------------- |
C---------------------------- S1 ------------------------------------- |
| 709 |
|
|
| 710 |
yhelp=0. |
c yhelp=0. |
| 711 |
|
yhelp=100. ! WM |
| 712 |
if (tof12_i.GT.none_find) yhelp=tof12_y(tof12_i) |
if (tof12_i.GT.none_find) yhelp=tof12_y(tof12_i) |
| 713 |
if (ytofpos(1).lt.100) yhelp=ytofpos(1) |
if (ytofpos(1).lt.100) yhelp=ytofpos(1) |
| 714 |
|
|
| 728 |
endif |
endif |
| 729 |
ENDIF |
ENDIF |
| 730 |
|
|
| 731 |
xhelp=0. |
c xhelp=0. |
| 732 |
|
xhelp=100. ! WM |
| 733 |
if (tof11_i.GT.none_find) xhelp=tof11_x(tof11_i) |
if (tof11_i.GT.none_find) xhelp=tof11_x(tof11_i) |
| 734 |
if (xtofpos(1).lt.100) xhelp=xtofpos(1) |
if (xtofpos(1).lt.100) xhelp=xtofpos(1) |
| 735 |
|
|
| 751 |
|
|
| 752 |
C-----------------------------S2 -------------------------------- |
C-----------------------------S2 -------------------------------- |
| 753 |
|
|
| 754 |
xhelp=0. |
c xhelp=0. |
| 755 |
|
xhelp=100. ! WM |
| 756 |
if (tof22_i.GT.none_find) xhelp=tof22_x(tof22_i) |
if (tof22_i.GT.none_find) xhelp=tof22_x(tof22_i) |
| 757 |
if (xtofpos(2).lt.100) xhelp=xtofpos(2) |
if (xtofpos(2).lt.100) xhelp=xtofpos(2) |
| 758 |
|
|
| 773 |
ENDIF |
ENDIF |
| 774 |
|
|
| 775 |
|
|
| 776 |
yhelp=0. |
c yhelp=0. |
| 777 |
|
yhelp=100. ! WM |
| 778 |
if (tof21_i.GT.none_find) yhelp=tof21_y(tof21_i) |
if (tof21_i.GT.none_find) yhelp=tof21_y(tof21_i) |
| 779 |
if (ytofpos(2).lt.100) yhelp=ytofpos(2) |
if (ytofpos(2).lt.100) yhelp=ytofpos(2) |
| 780 |
|
|
| 796 |
|
|
| 797 |
C-----------------------------S3 -------------------------------- |
C-----------------------------S3 -------------------------------- |
| 798 |
|
|
| 799 |
yhelp=0. |
c yhelp=0. |
| 800 |
|
yhelp=100. ! WM |
| 801 |
if (tof32_i.GT.none_find) yhelp=tof32_y(tof32_i) |
if (tof32_i.GT.none_find) yhelp=tof32_y(tof32_i) |
| 802 |
if (ytofpos(3).lt.100) yhelp=ytofpos(3) |
if (ytofpos(3).lt.100) yhelp=ytofpos(3) |
| 803 |
|
|
| 817 |
endif |
endif |
| 818 |
ENDIF |
ENDIF |
| 819 |
|
|
| 820 |
xhelp=0. |
c xhelp=0. |
| 821 |
|
xhelp=100. ! WM |
| 822 |
if (tof31_i.GT.none_find) xhelp=tof31_x(tof31_i) |
if (tof31_i.GT.none_find) xhelp=tof31_x(tof31_i) |
| 823 |
if (xtofpos(3).lt.100) xhelp=xtofpos(3) |
if (xtofpos(3).lt.100) xhelp=xtofpos(3) |
| 824 |
|
|
| 959 |
ENDIF |
ENDIF |
| 960 |
ENDDO |
ENDDO |
| 961 |
|
|
| 962 |
|
|
| 963 |
C--------------------------------------------------------------- |
C--------------------------------------------------------------- |
| 964 |
C--- calculate track position in paddle using timing difference |
C--- calculate track position in paddle using timing difference |
| 965 |
C--- now using the time-walk corrected TDC values |
C--- now using the time-walk corrected TDC values |
| 975 |
IF (tof11_i.GT.none_find) THEN |
IF (tof11_i.GT.none_find) THEN |
| 976 |
ytofpos(1) = ((tof11(1,tof11_i,itdc)-tof11(2,tof11_i,itdc))/2. |
ytofpos(1) = ((tof11(1,tof11_i,itdc)-tof11(2,tof11_i,itdc))/2. |
| 977 |
+ -y_coor_lin11(tof11_i,offset))/y_coor_lin11(tof11_i,slope) |
+ -y_coor_lin11(tof11_i,offset))/y_coor_lin11(tof11_i,slope) |
| 978 |
|
i=tof11_i |
| 979 |
endif |
endif |
| 980 |
|
|
| 981 |
IF (tof12_i.GT.none_find) THEN |
IF (tof12_i.GT.none_find) THEN |
| 982 |
xtofpos(1) = ((tof12(1,tof12_i,itdc)-tof12(2,tof12_i,itdc))/2. |
xtofpos(1) = ((tof12(1,tof12_i,itdc)-tof12(2,tof12_i,itdc))/2. |
| 983 |
+ -x_coor_lin12(tof12_i,offset))/x_coor_lin12(tof12_i,slope) |
+ -x_coor_lin12(tof12_i,offset))/x_coor_lin12(tof12_i,slope) |
| 984 |
|
i=tof12_i |
| 985 |
endif |
endif |
| 986 |
|
|
| 987 |
|
|
| 990 |
IF (tof21_i.GT.none_find) THEN |
IF (tof21_i.GT.none_find) THEN |
| 991 |
xtofpos(2) = ((tof21(1,tof21_i,itdc)-tof21(2,tof21_i,itdc))/2. |
xtofpos(2) = ((tof21(1,tof21_i,itdc)-tof21(2,tof21_i,itdc))/2. |
| 992 |
+ -x_coor_lin21(tof21_i,offset))/x_coor_lin21(tof21_i,slope) |
+ -x_coor_lin21(tof21_i,offset))/x_coor_lin21(tof21_i,slope) |
| 993 |
|
i=tof21_i |
| 994 |
endif |
endif |
| 995 |
|
|
| 996 |
IF (tof22_i.GT.none_find) THEN |
IF (tof22_i.GT.none_find) THEN |
| 997 |
ytofpos(2) = ((tof22(1,tof22_i,itdc)-tof22(2,tof22_i,itdc))/2. |
ytofpos(2) = ((tof22(1,tof22_i,itdc)-tof22(2,tof22_i,itdc))/2. |
| 998 |
+ -y_coor_lin22(tof22_i,offset))/y_coor_lin22(tof22_i,slope) |
+ -y_coor_lin22(tof22_i,offset))/y_coor_lin22(tof22_i,slope) |
| 999 |
|
i=tof22_i |
| 1000 |
endif |
endif |
| 1001 |
|
|
| 1002 |
|
|
| 1005 |
IF (tof31_i.GT.none_find) THEN |
IF (tof31_i.GT.none_find) THEN |
| 1006 |
ytofpos(3) = ((tof31(1,tof31_i,itdc)-tof31(2,tof31_i,itdc))/2. |
ytofpos(3) = ((tof31(1,tof31_i,itdc)-tof31(2,tof31_i,itdc))/2. |
| 1007 |
+ -y_coor_lin31(tof31_i,offset))/y_coor_lin31(tof31_i,slope) |
+ -y_coor_lin31(tof31_i,offset))/y_coor_lin31(tof31_i,slope) |
| 1008 |
|
i=tof31_i |
| 1009 |
endif |
endif |
| 1010 |
|
|
| 1011 |
IF (tof32_i.GT.none_find) THEN |
IF (tof32_i.GT.none_find) THEN |
| 1012 |
xtofpos(3) = ((tof32(1,tof32_i,itdc)-tof32(2,tof32_i,itdc))/2. |
xtofpos(3) = ((tof32(1,tof32_i,itdc)-tof32(2,tof32_i,itdc))/2. |
| 1013 |
+ -x_coor_lin32(tof32_i,offset))/x_coor_lin32(tof32_i,slope) |
+ -x_coor_lin32(tof32_i,offset))/x_coor_lin32(tof32_i,slope) |
| 1014 |
|
i=tof32_i |
| 1015 |
endif |
endif |
| 1016 |
|
|
| 1017 |
|
|
| 1024 |
c endif |
c endif |
| 1025 |
c enddo |
c enddo |
| 1026 |
|
|
| 1027 |
|
|
| 1028 |
C-- restrict TDC measurements to physical paddle dimensions +/- 10 cm |
C-- restrict TDC measurements to physical paddle dimensions +/- 10 cm |
| 1029 |
C-- this cut is now stronger than in the old versions |
C-- this cut is now stronger than in the old versions |
| 1030 |
|
|
| 1036 |
if (abs(ytofpos(2)).gt.18.) ytofpos(2)=101. |
if (abs(ytofpos(2)).gt.18.) ytofpos(2)=101. |
| 1037 |
if (abs(ytofpos(3)).gt.18.) ytofpos(3)=101. |
if (abs(ytofpos(3)).gt.18.) ytofpos(3)=101. |
| 1038 |
|
|
|
|
|
| 1039 |
C---------------------------------------------------------------------- |
C---------------------------------------------------------------------- |
| 1040 |
C--------------------- zenith angle theta --------------------------- |
C--------------------- zenith angle theta --------------------------- |
| 1041 |
C---------------------------------------------------------------------- |
C---------------------------------------------------------------------- |
| 1042 |
|
C------------------- improved calculation --------------------------- |
| 1043 |
|
|
| 1044 |
|
xhelp1=0. |
| 1045 |
|
if (tof11_i.GT.none_find) xhelp1=tof11_x(tof11_i) |
| 1046 |
|
if (xtofpos(1).lt.100) xhelp1=xtofpos(1) |
| 1047 |
|
|
| 1048 |
|
yhelp1=0. |
| 1049 |
|
if (tof12_i.GT.none_find) yhelp1=tof12_y(tof12_i) |
| 1050 |
|
if (ytofpos(1).lt.100) yhelp1=ytofpos(1) |
| 1051 |
|
|
| 1052 |
|
yhelp2=0. |
| 1053 |
|
if (tof32_i.GT.none_find) yhelp2=tof32_y(tof32_i) |
| 1054 |
|
if (ytofpos(3).lt.100) yhelp2=ytofpos(3) |
| 1055 |
|
|
| 1056 |
|
xhelp2=0. |
| 1057 |
|
if (tof31_i.GT.none_find) xhelp2=tof31_x(tof31_i) |
| 1058 |
|
if (xtofpos(3).lt.100) xhelp2=xtofpos(3) |
| 1059 |
|
|
| 1060 |
|
|
| 1061 |
|
dx=0. |
| 1062 |
|
dy=0. |
| 1063 |
|
dr=0. |
| 1064 |
|
theta13 = 0. |
| 1065 |
|
|
| 1066 |
|
dx = xhelp1 - xhelp2 |
| 1067 |
|
dy = yhelp1 - yhelp2 |
| 1068 |
|
dr = sqrt(dx*dx+dy*dy) |
| 1069 |
|
theta13 = atan(dr/tofarm13) |
| 1070 |
|
|
|
dx=0. |
|
|
dy=0. |
|
|
dr=0. |
|
|
theta13 = 0. |
|
|
|
|
|
IF ((tof12_i.GT.none_find).AND.(tof32_i.GT.none_find)) |
|
|
& dx = xtofpos(1) - xtofpos(3) |
|
|
IF ((tof11_i.GT.none_find).AND.(tof31_i.GT.none_find)) |
|
|
& dy = ytofpos(1) - ytofpos(3) |
|
|
dr = sqrt(dx*dx+dy*dy) |
|
|
theta13 = atan(dr/tofarm13) |
|
| 1071 |
|
|
| 1072 |
C------------------------------------------------------------------ |
C------------------------------------------------------------------ |
|
c dx=0. |
|
|
c dy=0. |
|
|
c dr=0. |
|
|
c theta12 = 0. |
|
|
c |
|
|
c IF ((tof12_i.GT.none_find).AND.(tof21_i.GT.none_find)) |
|
|
c & dx = xtofpos(1) - xtofpos(2) |
|
|
c IF ((tof11_i.GT.none_find).AND.(tof22_i.GT.none_find)) |
|
|
c & dy = ytofpos(1) - ytofpos(2) |
|
|
c dr = sqrt(dx*dx+dy*dy) |
|
|
c theta12 = atan(dr/tofarm12) |
|
|
c |
|
|
c dx=0. |
|
|
c dy=0. |
|
|
c dr=0. |
|
|
c theta23 = 0. |
|
|
c |
|
|
c IF ((tof21_i.GT.none_find).AND.(tof32_i.GT.none_find)) |
|
|
c & dx = xtofpos(2) - xtofpos(3) |
|
|
c IF ((tof22_i.GT.none_find).AND.(tof31_i.GT.none_find)) |
|
|
c & dy = ytofpos(2) - ytofpos(3) |
|
|
c dr = sqrt(dx*dx+dy*dy) |
|
|
c theta23 = atan(dr/tofarm23) |
|
|
c |
|
| 1073 |
C---------------------------------------------------------------------- |
C---------------------------------------------------------------------- |
| 1074 |
C------------------angle and ADC(x) correction |
C------------------angle and ADC(x) correction |
| 1075 |
C---------------------------------------------------------------------- |
C---------------------------------------------------------------------- |
| 1083 |
c DATA tof32_y/ -5.0,0.0,5.0/ |
c DATA tof32_y/ -5.0,0.0,5.0/ |
| 1084 |
|
|
| 1085 |
yhelp=0. |
yhelp=0. |
| 1086 |
|
c yhelp=100. |
| 1087 |
if (tof12_i.GT.none_find) yhelp=tof12_y(tof12_i) |
if (tof12_i.GT.none_find) yhelp=tof12_y(tof12_i) |
| 1088 |
if (ytofpos(1).lt.100) yhelp=ytofpos(1) |
if (ytofpos(1).lt.100) yhelp=ytofpos(1) |
| 1089 |
|
|
| 1094 |
c if (adc(ch11a(i),hb11a(i)).lt.4095) then |
c if (adc(ch11a(i),hb11a(i)).lt.4095) then |
| 1095 |
tof11(left,i,iadc) = tof11(left,i,iadc)*cos(theta13) |
tof11(left,i,iadc) = tof11(left,i,iadc)*cos(theta13) |
| 1096 |
xkorr = atten(left,11,i,yhelp) |
xkorr = atten(left,11,i,yhelp) |
|
c write(40+i,*) yhelp,xkorr |
|
| 1097 |
xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
| 1098 |
adctof_c(ch11a(i),hb11a(i))=tof11(left,i,iadc)/xkorr |
adctof_c(ch11a(i),hb11a(i))=tof11(left,i,iadc)/xkorr |
| 1099 |
endif |
endif |
| 1102 |
c if (adc(ch11b(i),hb11b(i)).lt.4095) then |
c if (adc(ch11b(i),hb11b(i)).lt.4095) then |
| 1103 |
tof11(right,i,iadc) = tof11(right,i,iadc)*cos(theta13) |
tof11(right,i,iadc) = tof11(right,i,iadc)*cos(theta13) |
| 1104 |
xkorr = atten(right,11,i,yhelp) |
xkorr = atten(right,11,i,yhelp) |
|
c write(40+i,*) yhelp,xkorr |
|
| 1105 |
xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
| 1106 |
adctof_c(ch11b(i),hb11b(i))=tof11(right,i,iadc)/xkorr |
adctof_c(ch11b(i),hb11b(i))=tof11(right,i,iadc)/xkorr |
| 1107 |
endif |
endif |
| 1108 |
ENDIF |
ENDIF |
| 1109 |
|
|
| 1110 |
xhelp=0. |
xhelp=0. |
| 1111 |
|
c xhelp=100. |
| 1112 |
if (tof11_i.GT.none_find) xhelp=tof11_x(tof11_i) |
if (tof11_i.GT.none_find) xhelp=tof11_x(tof11_i) |
| 1113 |
if (xtofpos(1).lt.100) xhelp=xtofpos(1) |
if (xtofpos(1).lt.100) xhelp=xtofpos(1) |
| 1114 |
|
|
| 1119 |
c if (adc(ch12a(i),hb12a(i)).lt.4095) then |
c if (adc(ch12a(i),hb12a(i)).lt.4095) then |
| 1120 |
tof12(left,i,iadc) = tof12(left,i,iadc)*cos(theta13) |
tof12(left,i,iadc) = tof12(left,i,iadc)*cos(theta13) |
| 1121 |
xkorr = atten(left,12,i,xhelp) |
xkorr = atten(left,12,i,xhelp) |
|
c write(50+i,*) xhelp,xkorr |
|
| 1122 |
xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
| 1123 |
adctof_c(ch12a(i),hb12a(i))=tof12(left,i,iadc)/xkorr |
adctof_c(ch12a(i),hb12a(i))=tof12(left,i,iadc)/xkorr |
| 1124 |
endif |
endif |
| 1127 |
c if (adc(ch12b(i),hb12b(i)).lt.4095) then |
c if (adc(ch12b(i),hb12b(i)).lt.4095) then |
| 1128 |
tof12(right,i,iadc) = tof12(right,i,iadc)*cos(theta13) |
tof12(right,i,iadc) = tof12(right,i,iadc)*cos(theta13) |
| 1129 |
xkorr = atten(right,12,i,xhelp) |
xkorr = atten(right,12,i,xhelp) |
|
c write(50+i,*) xhelp,xkorr |
|
| 1130 |
xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
| 1131 |
adctof_c(ch12b(i),hb12b(i))=tof12(right,i,iadc)/xkorr |
adctof_c(ch12b(i),hb12b(i))=tof12(right,i,iadc)/xkorr |
| 1132 |
endif |
endif |
| 1135 |
C-----------------------------S2 -------------------------------- |
C-----------------------------S2 -------------------------------- |
| 1136 |
|
|
| 1137 |
xhelp=0. |
xhelp=0. |
| 1138 |
|
c xhelp=100. |
| 1139 |
if (tof22_i.GT.none_find) xhelp=tof22_x(tof22_i) |
if (tof22_i.GT.none_find) xhelp=tof22_x(tof22_i) |
| 1140 |
if (xtofpos(2).lt.100) xhelp=xtofpos(2) |
if (xtofpos(2).lt.100) xhelp=xtofpos(2) |
| 1141 |
|
|
| 1146 |
c if (adc(ch21a(i),hb21a(i)).lt.4095) then |
c if (adc(ch21a(i),hb21a(i)).lt.4095) then |
| 1147 |
tof21(left,i,iadc) = tof21(left,i,iadc)*cos(theta13) |
tof21(left,i,iadc) = tof21(left,i,iadc)*cos(theta13) |
| 1148 |
xkorr = atten(left,21,i,xhelp) |
xkorr = atten(left,21,i,xhelp) |
|
c write(60+i,*) xhelp,xkorr |
|
| 1149 |
xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
| 1150 |
adctof_c(ch21a(i),hb21a(i))=tof21(left,i,iadc)/xkorr |
adctof_c(ch21a(i),hb21a(i))=tof21(left,i,iadc)/xkorr |
| 1151 |
endif |
endif |
| 1155 |
tof21(right,i,iadc) = tof21(right,i,iadc)*cos(theta13) |
tof21(right,i,iadc) = tof21(right,i,iadc)*cos(theta13) |
| 1156 |
xkorr=adcx21(right,i,1)*exp(xhelp/adcx21(right,i,2)) |
xkorr=adcx21(right,i,1)*exp(xhelp/adcx21(right,i,2)) |
| 1157 |
xkorr = atten(right,21,i,xhelp) |
xkorr = atten(right,21,i,xhelp) |
|
c write(60+i,*) xhelp,xkorr |
|
| 1158 |
xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
| 1159 |
adctof_c(ch21b(i),hb21b(i))=tof21(right,i,iadc)/xkorr |
adctof_c(ch21b(i),hb21b(i))=tof21(right,i,iadc)/xkorr |
| 1160 |
endif |
endif |
| 1162 |
|
|
| 1163 |
|
|
| 1164 |
yhelp=0. |
yhelp=0. |
| 1165 |
|
c yhelp=100. |
| 1166 |
if (tof21_i.GT.none_find) yhelp=tof21_y(tof21_i) |
if (tof21_i.GT.none_find) yhelp=tof21_y(tof21_i) |
| 1167 |
if (ytofpos(2).lt.100) yhelp=ytofpos(2) |
if (ytofpos(2).lt.100) yhelp=ytofpos(2) |
| 1168 |
|
|
| 1173 |
c if (adc(ch22a(i),hb22a(i)).lt.4095) then |
c if (adc(ch22a(i),hb22a(i)).lt.4095) then |
| 1174 |
tof22(left,i,iadc) = tof22(left,i,iadc)*cos(theta13) |
tof22(left,i,iadc) = tof22(left,i,iadc)*cos(theta13) |
| 1175 |
xkorr = atten(left,22,i,yhelp) |
xkorr = atten(left,22,i,yhelp) |
|
c write(70+i,*) yhelp,xkorr |
|
| 1176 |
xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
| 1177 |
adctof_c(ch22a(i),hb22a(i))=tof22(left,i,iadc)/xkorr |
adctof_c(ch22a(i),hb22a(i))=tof22(left,i,iadc)/xkorr |
| 1178 |
endif |
endif |
| 1181 |
c if (adc(ch22b(i),hb22b(i)).lt.4095) then |
c if (adc(ch22b(i),hb22b(i)).lt.4095) then |
| 1182 |
tof22(right,i,iadc) = tof22(right,i,iadc)*cos(theta13) |
tof22(right,i,iadc) = tof22(right,i,iadc)*cos(theta13) |
| 1183 |
xkorr = atten(right,22,i,yhelp) |
xkorr = atten(right,22,i,yhelp) |
|
c write(70+i,*) yhelp,xkorr |
|
| 1184 |
xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
| 1185 |
adctof_c(ch22b(i),hb22b(i))=tof22(right,i,iadc)/xkorr |
adctof_c(ch22b(i),hb22b(i))=tof22(right,i,iadc)/xkorr |
| 1186 |
endif |
endif |
| 1189 |
C-----------------------------S3 -------------------------------- |
C-----------------------------S3 -------------------------------- |
| 1190 |
|
|
| 1191 |
yhelp=0. |
yhelp=0. |
| 1192 |
|
c yhelp=100. |
| 1193 |
if (tof32_i.GT.none_find) yhelp=tof32_y(tof32_i) |
if (tof32_i.GT.none_find) yhelp=tof32_y(tof32_i) |
| 1194 |
if (ytofpos(3).lt.100) yhelp=ytofpos(3) |
if (ytofpos(3).lt.100) yhelp=ytofpos(3) |
| 1195 |
|
|
| 1200 |
c if (adc(ch31a(i),hb31a(i)).lt.4095) then |
c if (adc(ch31a(i),hb31a(i)).lt.4095) then |
| 1201 |
tof31(left,i,iadc) = tof31(left,i,iadc)*cos(theta13) |
tof31(left,i,iadc) = tof31(left,i,iadc)*cos(theta13) |
| 1202 |
xkorr = atten(left,31,i,yhelp) |
xkorr = atten(left,31,i,yhelp) |
|
c write(80+i,*) yhelp,xkorr |
|
| 1203 |
xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
| 1204 |
adctof_c(ch31a(i),hb31a(i))=tof31(left,i,iadc)/xkorr |
adctof_c(ch31a(i),hb31a(i))=tof31(left,i,iadc)/xkorr |
| 1205 |
endif |
endif |
| 1208 |
c if (adc(ch31b(i),hb31b(i)).lt.4095) then |
c if (adc(ch31b(i),hb31b(i)).lt.4095) then |
| 1209 |
tof31(right,i,iadc) = tof31(right,i,iadc)*cos(theta13) |
tof31(right,i,iadc) = tof31(right,i,iadc)*cos(theta13) |
| 1210 |
xkorr = atten(right,31,i,yhelp) |
xkorr = atten(right,31,i,yhelp) |
|
c write(80+i,*) yhelp,xkorr |
|
| 1211 |
xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
| 1212 |
adctof_c(ch31b(i),hb31b(i))=tof31(right,i,iadc)/xkorr |
adctof_c(ch31b(i),hb31b(i))=tof31(right,i,iadc)/xkorr |
| 1213 |
endif |
endif |
| 1214 |
ENDIF |
ENDIF |
| 1215 |
|
|
| 1216 |
xhelp=0. |
xhelp=0. |
| 1217 |
|
c xhelp=100. |
| 1218 |
if (tof31_i.GT.none_find) xhelp=tof31_x(tof31_i) |
if (tof31_i.GT.none_find) xhelp=tof31_x(tof31_i) |
| 1219 |
if (xtofpos(3).lt.100) xhelp=xtofpos(3) |
if (xtofpos(3).lt.100) xhelp=xtofpos(3) |
| 1220 |
|
|
| 1225 |
c if (adc(ch32a(i),hb32a(i)).lt.4095) then |
c if (adc(ch32a(i),hb32a(i)).lt.4095) then |
| 1226 |
tof32(left,i,iadc) = tof32(left,i,iadc)*cos(theta13) |
tof32(left,i,iadc) = tof32(left,i,iadc)*cos(theta13) |
| 1227 |
xkorr = atten(left,32,i,xhelp) |
xkorr = atten(left,32,i,xhelp) |
|
c write(90+i,*) xhelp,xkorr |
|
| 1228 |
xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
| 1229 |
adctof_c(ch32a(i),hb32a(i))=tof32(left,i,iadc)/xkorr |
adctof_c(ch32a(i),hb32a(i))=tof32(left,i,iadc)/xkorr |
| 1230 |
endif |
endif |
| 1233 |
c if (adc(ch32b(i),hb32b(i)).lt.4095) then |
c if (adc(ch32b(i),hb32b(i)).lt.4095) then |
| 1234 |
tof32(right,i,iadc) = tof32(right,i,iadc)*cos(theta13) |
tof32(right,i,iadc) = tof32(right,i,iadc)*cos(theta13) |
| 1235 |
xkorr = atten(right,32,i,xhelp) |
xkorr = atten(right,32,i,xhelp) |
|
c write(90+i,*) xhelp,xkorr |
|
| 1236 |
xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
| 1237 |
adctof_c(ch32b(i),hb32b(i))=tof32(right,i,iadc)/xkorr |
adctof_c(ch32b(i),hb32b(i))=tof32(right,i,iadc)/xkorr |
| 1238 |
endif |
endif |
| 1639 |
c write(*,*) xtr_tof |
c write(*,*) xtr_tof |
| 1640 |
c write(*,*) ytr_tof |
c write(*,*) ytr_tof |
| 1641 |
|
|
| 1642 |
100 continue |
c 100 continue |
| 1643 |
|
continue |
| 1644 |
|
|
| 1645 |
C |
C |
| 1646 |
RETURN |
RETURN |
| 1784 |
REAL a1,a2 |
REAL a1,a2 |
| 1785 |
INTEGER jj |
INTEGER jj |
| 1786 |
|
|
| 1787 |
|
c get rid of warnings EMILIANO |
| 1788 |
|
i = 0 |
| 1789 |
|
slope = 0 |
| 1790 |
|
offset = 0 |
| 1791 |
|
none_find = 0 |
| 1792 |
|
none_ev = 0 |
| 1793 |
|
adc_ev = 0 |
| 1794 |
|
tdc_ev = 0 |
| 1795 |
|
iadc = 0 |
| 1796 |
|
itdc = 0 |
| 1797 |
|
right = 0 |
| 1798 |
|
left = 0 |
| 1799 |
|
tof12_y(1) = tof12_y(1) |
| 1800 |
|
tof11_x(1) = tof11_x(1) |
| 1801 |
|
tof21_y(1) = tof21_y(1) |
| 1802 |
|
tof22_x(1) = tof22_x(1) |
| 1803 |
|
tof32_y(1) = tof32_y(1) |
| 1804 |
|
tof31_x(1) = tof31_x(1) |
| 1805 |
|
c get rid of warnings |
| 1806 |
|
|
| 1807 |
C----------------------------------------------------------- |
C----------------------------------------------------------- |
| 1808 |
C--- get data |
C--- get data |
| 1809 |
C----------------------------------------------------------- |
C----------------------------------------------------------- |
| 2187 |
DATA itop /1,1,2,2,3,3,4,4,1,1,2,2/ |
DATA itop /1,1,2,2,3,3,4,4,1,1,2,2/ |
| 2188 |
DATA ibot /5,6,5,6,5,6,5,6,3,4,3,4/ |
DATA ibot /5,6,5,6,5,6,5,6,3,4,3,4/ |
| 2189 |
|
|
| 2190 |
|
|
| 2191 |
|
c get rid of warnings EMILIANO |
| 2192 |
|
slope = 0 |
| 2193 |
|
offset = 0 |
| 2194 |
|
none_find = 0 |
| 2195 |
|
none_ev = 0 |
| 2196 |
|
adc_ev = 0 |
| 2197 |
|
tdc_ev = 0 |
| 2198 |
|
iadc = 0 |
| 2199 |
|
itdc = 0 |
| 2200 |
|
right = 0 |
| 2201 |
|
left = 0 |
| 2202 |
|
tof12_y(1) = tof12_y(1) |
| 2203 |
|
tof11_x(1) = tof11_x(1) |
| 2204 |
|
tof21_y(1) = tof21_y(1) |
| 2205 |
|
tof22_x(1) = tof22_x(1) |
| 2206 |
|
tof32_y(1) = tof32_y(1) |
| 2207 |
|
tof31_x(1) = tof31_x(1) |
| 2208 |
|
c get rid of warnings |
| 2209 |
|
|
| 2210 |
C==================================================================== |
C==================================================================== |
| 2211 |
|
|
| 2212 |
tof11_i = hitvec(1) |
tof11_i = hitvec(1) |
| 2380 |
|
|
| 2381 |
C**************************************************************************** |
C**************************************************************************** |
| 2382 |
|
|
|
|
|