--- DarthVader/ToFLevel2/src/tofl2com.for 2006/06/17 12:14:56 1.1.1.1 +++ DarthVader/ToFLevel2/src/tofl2com.for 2006/08/10 06:32:04 1.3 @@ -92,6 +92,13 @@ enddo + do i=1,12 + do j=1,4 + tofmask(j,i) = 0 + enddo + enddo + + c the calibration files are read in the main program from xxx_tofcalib.rz @@ -611,14 +618,14 @@ i = tof11_i xdummy=tof11(left,i,iadc) tof11(left,i,iadc) = tof11(left,i,iadc)*cos(theta13) - if (tof11(left,i,iadc).lt.1000) then + if (tof11(left,i,iadc).lt.4095) then xkorr=adcx11(left,i,1)*exp(-yhelp/adcx11(left,i,2)) xkorr0=adcx11(left,i,1) adctof_c(ch11a(i),hb11a(i))=tof11(left,i,iadc)/xkorr endif tof11(right,i,iadc) = tof11(right,i,iadc)*cos(theta13) - if (tof11(right,i,iadc).lt.1000) then + if (tof11(right,i,iadc).lt.4095) then xkorr=adcx11(right,i,1)*exp(yhelp/adcx11(right,i,2)) xkorr0=adcx11(right,i,1) adctof_c(ch11b(i),hb11b(i))=tof11(right,i,iadc)/xkorr @@ -633,14 +640,14 @@ i = tof12_i tof12(left,i,iadc) = tof12(left,i,iadc)*cos(theta13) - if (tof12(left,i,iadc).lt.1000) then + if (tof12(left,i,iadc).lt.4095) then xkorr=adcx12(left,i,1)*exp(-xhelp/adcx12(left,i,2)) xkorr0=adcx12(left,i,1) adctof_c(ch12a(i),hb12a(i))=tof12(left,i,iadc)/xkorr endif tof12(right,i,iadc) = tof12(right,i,iadc)*cos(theta13) - if (tof12(right,i,iadc).lt.1000) then + if (tof12(right,i,iadc).lt.4095) then xkorr=adcx12(right,i,1)*exp(xhelp/adcx12(right,i,2)) xkorr0=adcx12(right,i,1) adctof_c(ch12b(i),hb12b(i))=tof12(right,i,iadc)/xkorr @@ -657,14 +664,14 @@ i = tof21_i tof21(left,i,iadc) = tof21(left,i,iadc)*cos(theta13) - if (tof21(left,i,iadc).lt.1000) then + if (tof21(left,i,iadc).lt.4095) then xkorr=adcx21(left,i,1)*exp(-xhelp/adcx21(left,i,2)) xkorr0=adcx21(left,i,1) adctof_c(ch21a(i),hb21a(i))=tof21(left,i,iadc)/xkorr endif tof21(right,i,iadc) = tof21(right,i,iadc)*cos(theta13) - if (tof21(right,i,iadc).lt.1000) then + if (tof21(right,i,iadc).lt.4095) then xkorr=adcx21(right,i,1)*exp(xhelp/adcx21(right,i,2)) xkorr0=adcx21(right,i,1) adctof_c(ch21b(i),hb21b(i))=tof21(right,i,iadc)/xkorr @@ -680,14 +687,14 @@ i = tof22_i tof22(left,i,iadc) = tof22(left,i,iadc)*cos(theta13) - if (tof22(left,i,iadc).lt.1000) then + if (tof22(left,i,iadc).lt.4095) then xkorr=adcx22(left,i,1)*exp(-yhelp/adcx22(left,i,2)) xkorr0=adcx22(left,i,1) adctof_c(ch22a(i),hb22a(i))=tof22(left,i,iadc)/xkorr endif tof22(right,i,iadc) = tof22(right,i,iadc)*cos(theta13) - if (tof22(right,i,iadc).lt.1000) then + if (tof22(right,i,iadc).lt.4095) then xkorr=adcx22(right,i,1)*exp(yhelp/adcx22(right,i,2)) xkorr0=adcx22(right,i,1) adctof_c(ch22b(i),hb22b(i))=tof22(right,i,iadc)/xkorr @@ -704,14 +711,14 @@ i = tof31_i tof31(left,i,iadc) = tof31(left,i,iadc)*cos(theta13) - if (tof31(left,i,iadc).lt.1000) then + if (tof31(left,i,iadc).lt.4095) then xkorr=adcx31(left,i,1)*exp(-yhelp/adcx31(left,i,2)) xkorr0=adcx31(left,i,1) adctof_c(ch31a(i),hb31a(i))=tof31(left,i,iadc)/xkorr endif tof31(right,i,iadc) = tof31(right,i,iadc)*cos(theta13) - if (tof31(right,i,iadc).lt.1000) then + if (tof31(right,i,iadc).lt.4095) then xkorr=adcx31(right,i,1)*exp(yhelp/adcx31(right,i,2)) xkorr0=adcx31(right,i,1) adctof_c(ch31b(i),hb31b(i))=tof31(right,i,iadc)/xkorr @@ -726,14 +733,14 @@ i = tof32_i tof32(left,i,iadc) = tof32(left,i,iadc)*cos(theta13) - if (tof32(left,i,iadc).lt.1000) then + if (tof32(left,i,iadc).lt.4095) then xkorr=adcx32(left,i,1)*exp(-xhelp/adcx32(left,i,2)) xkorr0=adcx32(left,i,1) adctof_c(ch32a(i),hb32a(i))=tof32(left,i,iadc)/xkorr endif tof32(right,i,iadc) = tof32(right,i,iadc)*cos(theta13) - if (tof32(right,i,iadc).lt.1000) then + if (tof32(right,i,iadc).lt.4095) then xkorr=adcx32(right,i,1)*exp(xhelp/adcx32(right,i,2)) xkorr0=adcx32(right,i,1) adctof_c(ch32b(i),hb32b(i))=tof32(right,i,iadc)/xkorr @@ -760,6 +767,21 @@ c1 = k_S11S31(1,ihelp) c2 = k_S11S31(2,ihelp) betatof_a(1) = c2/(cos(theta13)*(ds-c1)) + +C------- ToF Mask - S11 - S31 + + tofmask(ch11a(tof11_i),hb11a(tof11_i)) = + $ tofmask(ch11a(tof11_i),hb11a(tof11_i)) + 1 + tofmask(ch11b(tof11_i),hb11b(tof11_i)) = + $ tofmask(ch11b(tof11_i),hb11b(tof11_i)) + 1 + + tofmask(ch31a(tof31_i),hb31a(tof31_i)) = + $ tofmask(ch31a(tof31_i),hb31a(tof31_i)) + 1 + tofmask(ch31b(tof31_i),hb31b(tof31_i)) = + $ tofmask(ch31b(tof31_i),hb31b(tof31_i)) + 1 + +C------- + ENDIF C S11 - S32 @@ -771,8 +793,23 @@ c1 = k_S11S32(1,ihelp) c2 = k_S11S32(2,ihelp) betatof_a(2) = c2/(cos(theta13)*(ds-c1)) - ENDIF +C------- ToF Mask - S11 - S32 + + tofmask(ch11a(tof11_i),hb11a(tof11_i)) = + $ tofmask(ch11a(tof11_i),hb11a(tof11_i)) + 1 + tofmask(ch11b(tof11_i),hb11b(tof11_i)) = + $ tofmask(ch11b(tof11_i),hb11b(tof11_i)) + 1 + + tofmask(ch32a(tof32_i),hb32a(tof32_i)) = + $ tofmask(ch32a(tof32_i),hb32a(tof32_i)) + 1 + tofmask(ch32b(tof32_i),hb32b(tof32_i)) = + $ tofmask(ch32b(tof32_i),hb32b(tof32_i)) + 1 + +C------- + + ENDIF + C S12 - S31 IF (tof12_i.GT.none_find.AND.tof31_i.GT.none_find) THEN xhelp1 = tof12(1,tof12_i,itdc)+tof12(2,tof12_i,itdc) @@ -782,8 +819,23 @@ c1 = k_S12S31(1,ihelp) c2 = k_S12S31(2,ihelp) betatof_a(3) = c2/(cos(theta13)*(ds-c1)) - ENDIF +C------- ToF Mask - S12 - S31 + + tofmask(ch12a(tof12_i),hb12a(tof12_i)) = + $ tofmask(ch12a(tof12_i),hb12a(tof12_i)) + 1 + tofmask(ch12b(tof12_i),hb12b(tof12_i)) = + $ tofmask(ch12b(tof12_i),hb12b(tof12_i)) + 1 + + tofmask(ch31a(tof31_i),hb31a(tof31_i)) = + $ tofmask(ch31a(tof31_i),hb31a(tof31_i)) + 1 + tofmask(ch31b(tof31_i),hb31b(tof31_i)) = + $ tofmask(ch31b(tof31_i),hb31b(tof31_i)) + 1 + +C------- + + ENDIF + C S12 - S32 IF (tof12_i.GT.none_find.AND.tof32_i.GT.none_find) THEN xhelp1 = tof12(1,tof12_i,itdc)+tof12(2,tof12_i,itdc) @@ -793,6 +845,21 @@ c1 = k_S12S32(1,ihelp) c2 = k_S12S32(2,ihelp) betatof_a(4) = c2/(cos(theta13)*(ds-c1)) + +C------- ToF Mask - S12 - S32 + + tofmask(ch12a(tof12_i),hb12a(tof12_i)) = + $ tofmask(ch12a(tof12_i),hb12a(tof12_i)) + 1 + tofmask(ch12b(tof12_i),hb12b(tof12_i)) = + $ tofmask(ch12b(tof12_i),hb12b(tof12_i)) + 1 + + tofmask(ch32a(tof32_i),hb32a(tof32_i)) = + $ tofmask(ch32a(tof32_i),hb32a(tof32_i)) + 1 + tofmask(ch32b(tof32_i),hb32b(tof32_i)) = + $ tofmask(ch32b(tof32_i),hb32b(tof32_i)) + 1 + +C------- + ENDIF C S21 - S31 @@ -804,6 +871,21 @@ c1 = k_S21S31(1,ihelp) c2 = k_S21S31(2,ihelp) betatof_a(5) = c2/(cos(theta23)*(ds-c1)) + +C------- ToF Mask - S21 - S31 + + tofmask(ch21a(tof21_i),hb21a(tof21_i)) = + $ tofmask(ch21a(tof21_i),hb21a(tof21_i)) + 1 + tofmask(ch21b(tof21_i),hb21b(tof21_i)) = + $ tofmask(ch21b(tof21_i),hb21b(tof21_i)) + 1 + + tofmask(ch31a(tof31_i),hb31a(tof31_i)) = + $ tofmask(ch31a(tof31_i),hb31a(tof31_i)) + 1 + tofmask(ch31b(tof31_i),hb31b(tof31_i)) = + $ tofmask(ch31b(tof31_i),hb31b(tof31_i)) + 1 + +C------- + ENDIF C S21 - S32 @@ -815,6 +897,21 @@ c1 = k_S21S32(1,ihelp) c2 = k_S21S32(2,ihelp) betatof_a(6) = c2/(cos(theta23)*(ds-c1)) + +C------- ToF Mask - S21 - S32 + + tofmask(ch21a(tof21_i),hb21a(tof21_i)) = + $ tofmask(ch21a(tof21_i),hb21a(tof21_i)) + 1 + tofmask(ch21b(tof21_i),hb21b(tof21_i)) = + $ tofmask(ch21b(tof21_i),hb21b(tof21_i)) + 1 + + tofmask(ch32a(tof32_i),hb32a(tof32_i)) = + $ tofmask(ch32a(tof32_i),hb32a(tof32_i)) + 1 + tofmask(ch32b(tof32_i),hb32b(tof32_i)) = + $ tofmask(ch32b(tof32_i),hb32b(tof32_i)) + 1 + +C------- + ENDIF C S22 - S31 @@ -826,6 +923,21 @@ c1 = k_S22S31(1,ihelp) c2 = k_S22S31(2,ihelp) betatof_a(7) = c2/(cos(theta13)*(ds-c1)) + +C------- ToF Mask - S22 - S31 + + tofmask(ch22a(tof22_i),hb22a(tof22_i)) = + $ tofmask(ch22a(tof22_i),hb22a(tof22_i)) + 1 + tofmask(ch22b(tof22_i),hb22b(tof22_i)) = + $ tofmask(ch22b(tof22_i),hb22b(tof22_i)) + 1 + + tofmask(ch31a(tof31_i),hb31a(tof31_i)) = + $ tofmask(ch31a(tof31_i),hb31a(tof31_i)) + 1 + tofmask(ch31b(tof31_i),hb31b(tof31_i)) = + $ tofmask(ch31b(tof31_i),hb31b(tof31_i)) + 1 + +C------- + ENDIF C S22 - S32 @@ -837,6 +949,21 @@ c1 = k_S22S32(1,ihelp) c2 = k_S22S32(2,ihelp) betatof_a(8) = c2/(cos(theta13)*(ds-c1)) + +C------- ToF Mask - S22 - S32 + + tofmask(ch22a(tof22_i),hb22a(tof22_i)) = + $ tofmask(ch22a(tof22_i),hb22a(tof22_i)) + 1 + tofmask(ch22b(tof22_i),hb22b(tof22_i)) = + $ tofmask(ch22b(tof22_i),hb22b(tof22_i)) + 1 + + tofmask(ch32a(tof32_i),hb32a(tof32_i)) = + $ tofmask(ch32a(tof32_i),hb32a(tof32_i)) + 1 + tofmask(ch32b(tof32_i),hb32b(tof32_i)) = + $ tofmask(ch32b(tof32_i),hb32b(tof32_i)) + 1 + +C------- + ENDIF C S11 - S21 @@ -848,6 +975,21 @@ c1 = k_S11S21(1,ihelp) c2 = k_S11S21(2,ihelp) betatof_a(9) = c2/(cos(theta13)*(ds-c1)) + +C------- ToF Mask - S11 - S21 + + tofmask(ch11a(tof11_i),hb11a(tof11_i)) = + $ tofmask(ch11a(tof11_i),hb11a(tof11_i)) + 1 + tofmask(ch11b(tof11_i),hb11b(tof11_i)) = + $ tofmask(ch11b(tof11_i),hb11b(tof11_i)) + 1 + + tofmask(ch21a(tof21_i),hb21a(tof21_i)) = + $ tofmask(ch21a(tof21_i),hb21a(tof21_i)) + 1 + tofmask(ch21b(tof21_i),hb21b(tof21_i)) = + $ tofmask(ch21b(tof21_i),hb21b(tof21_i)) + 1 + +C------- + ENDIF C S11 - S22 @@ -859,6 +1001,21 @@ c1 = k_S11S22(1,ihelp) c2 = k_S11S22(2,ihelp) betatof_a(10) = c2/(cos(theta13)*(ds-c1)) + +C------- ToF Mask - S11 - S22 + + tofmask(ch11a(tof11_i),hb11a(tof11_i)) = + $ tofmask(ch11a(tof11_i),hb11a(tof11_i)) + 1 + tofmask(ch11b(tof11_i),hb11b(tof11_i)) = + $ tofmask(ch11b(tof11_i),hb11b(tof11_i)) + 1 + + tofmask(ch22a(tof22_i),hb22a(tof22_i)) = + $ tofmask(ch22a(tof22_i),hb22a(tof22_i)) + 1 + tofmask(ch22b(tof22_i),hb22b(tof22_i)) = + $ tofmask(ch22b(tof22_i),hb22b(tof22_i)) + 1 + +C------- + ENDIF C S12 - S21 @@ -870,6 +1027,21 @@ c1 = k_S12S21(1,ihelp) c2 = k_S12S21(2,ihelp) betatof_a(11) = c2/(cos(theta13)*(ds-c1)) + +C------- ToF Mask - S12 - S21 + + tofmask(ch12a(tof12_i),hb12a(tof12_i)) = + $ tofmask(ch12a(tof12_i),hb12a(tof12_i)) + 1 + tofmask(ch12b(tof12_i),hb12b(tof12_i)) = + $ tofmask(ch12b(tof12_i),hb12b(tof12_i)) + 1 + + tofmask(ch21a(tof21_i),hb21a(tof21_i)) = + $ tofmask(ch21a(tof21_i),hb21a(tof21_i)) + 1 + tofmask(ch21b(tof21_i),hb21b(tof21_i)) = + $ tofmask(ch21b(tof21_i),hb21b(tof21_i)) + 1 + +C------- + ENDIF C S12 - S22 @@ -881,9 +1053,24 @@ c1 = k_S12S22(1,ihelp) c2 = k_S12S22(2,ihelp) betatof_a(12) = c2/(cos(theta13)*(ds-c1)) + +C------- ToF Mask - S12 - S22 + + tofmask(ch12a(tof12_i),hb12a(tof12_i)) = + $ tofmask(ch12a(tof12_i),hb12a(tof12_i)) + 1 + tofmask(ch12b(tof12_i),hb12b(tof12_i)) = + $ tofmask(ch12b(tof12_i),hb12b(tof12_i)) + 1 + + tofmask(ch22a(tof22_i),hb22a(tof22_i)) = + $ tofmask(ch22a(tof22_i),hb22a(tof22_i)) + 1 + tofmask(ch22b(tof22_i),hb22b(tof22_i)) = + $ tofmask(ch22b(tof22_i),hb22b(tof22_i)) + 1 + +C------- + ENDIF - -C------- + +C--------------------------------------------------------- icount=0 sw=0. @@ -903,7 +1090,6 @@ if (icount.gt.0) beta_mean=sxw/sw betatof_a(13) = beta_mean -c write(*,*) '------------- end tofl2com ----------' 100 continue