/[PAMELA software]/DarthVader/ToFLevel2/src/tofl2com.for
ViewVC logotype

Diff of /DarthVader/ToFLevel2/src/tofl2com.for

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.13 by mocchiut, Mon Nov 23 09:50:50 2009 UTC revision 1.14 by mocchiut, Wed Feb 17 11:50:53 2010 UTC
# Line 32  C  mar-08 WM: Bug found in dEdx if check Line 32  C  mar-08 WM: Bug found in dEdx if check
32  C  oct-08 WM: Calculation of zenith angle debugged, sometimes strange values  C  oct-08 WM: Calculation of zenith angle debugged, sometimes strange values
33  C             were possible  C             were possible
34  C  nov-09 WM: the dEdx part ("adctof_c") moved to the new dEdx routine from Napoli  C  nov-09 WM: the dEdx part ("adctof_c") moved to the new dEdx routine from Napoli
35    C  feb-10 WM: k1 values now for Z=1, Z=2, Z>2, k2 values are fix
36  C******************************************************************************  C******************************************************************************
37    
38        INTEGER FUNCTION TOFL2COM()        INTEGER FUNCTION TOFL2COM()
# Line 53  C     Line 54  C    
54        REAL dx,dy,dr,ds        REAL dx,dy,dr,ds
55        REAL yhelp,yhelp1,yhelp2,xhelp,xhelp1,xhelp2        REAL yhelp,yhelp1,yhelp2,xhelp,xhelp1,xhelp2
56        REAL c1,c2        REAL c1,c2
57          REAL dist
58    
59  C      REAL sw,sxw,w_i  C      REAL sw,sxw,w_i
60  C      INTEGER icount  C      INTEGER icount
# Line 105  c     second index : 1... number of padd Line 107  c     second index : 1... number of padd
107    
108                
109        REAL theta13        REAL theta13
110  C--   DATA ZTOF/53.74,53.04,23.94,23.44,-23.49,-24.34/ !Sergio 9.05.2006  
111          DOUBLE PRECISION ZTOF(6)
112          DATA ZTOF/53.74,53.04,23.94,23.44,-23.49,-24.34/ !Sergio 9.05.2006
113    
114        REAL tofarm12        REAL tofarm12
115        PARAMETER (tofarm12 = 29.70) ! from 53.39 to 23.69        PARAMETER (tofarm12 = 29.70) ! from 53.39 to 23.69
116        REAL tofarm23                REAL tofarm23        
# Line 121  C--   DATA ZTOF/53.74,53.04,23.94,23.44, Line 126  C--   DATA ZTOF/53.74,53.04,23.94,23.44,
126        REAL atten,pc_adc,check_charge,newbeta        REAL atten,pc_adc,check_charge,newbeta
127    
128        INTEGER IZ        INTEGER IZ
       REAL k1corrA1,k1corrB1,k1corrC1  
129    
130    
131        INTEGER ifst        INTEGER ifst
# Line 157  C     ratio between helium and proton ca Line 161  C     ratio between helium and proton ca
161         itdc = 1         itdc = 1
162         iadc = 2         iadc = 2
163    
 C--- These are the corrections to the k1-value for Z>2 particles  
        k1corrA1 = 0.  
        k1corrB1 = -5.0  
        k1corrC1=  8.0  
   
   
164          ENDIF          ENDIF
165  C---------------------------------------------------------------------  C---------------------------------------------------------------------
166    
# Line 676  C--- the k1 constants in the beta calcul Line 674  C--- the k1 constants in the beta calcul
674  C----------------------------------------------------------------------  C----------------------------------------------------------------------
675    
676           iz = int(check_charge(theta13,hitvec))           iz = int(check_charge(theta13,hitvec))
677  c         write(*,*) 'charge in tofl2com',iz  C         write(*,*) 'charge in tofl2com',iz
678    
679  C--------------------------------------------------------------------  C--------------------------------------------------------------------
680  C---- if TDCleft.and.TDCright and NO ADC insert artificial ADC  C---- if TDCleft.and.TDCright and NO ADC insert artificial ADC
# Line 1074  C     since TDC resolution varies slight Line 1072  C     since TDC resolution varies slight
1072    
1073  C     S11 - S31  C     S11 - S31
1074    
1075          dist = ZTOF(1) - ZTOF(5)
1076          c2 = (2.*0.01*dist)/(3.E08*50.E-12  )
1077    
1078         IF ((tof11_i.GT.none_find).AND.(tof31_i.GT.none_find).AND.         IF ((tof11_i.GT.none_find).AND.(tof31_i.GT.none_find).AND.
1079       &    (ytofpos(1).NE.101.).AND.(ytofpos(3).NE.101.)) THEN       &    (ytofpos(1).NE.101.).AND.(ytofpos(3).NE.101.)) THEN
1080           xhelp1 = tof11(1,tof11_i,itdc)+tof11(2,tof11_i,itdc)           xhelp1 = tof11(1,tof11_i,itdc)+tof11(2,tof11_i,itdc)
1081           xhelp2 = tof31(1,tof31_i,itdc)+tof31(2,tof31_i,itdc)           xhelp2 = tof31(1,tof31_i,itdc)+tof31(2,tof31_i,itdc)
1082           ds = xhelp1-xhelp2           ds = xhelp1-xhelp2
1083           ihelp=(tof11_i-1)*3+tof31_i           ihelp=(tof11_i-1)*3+tof31_i
1084           c1 = k_S11S31(1,ihelp)           if (iz.le.1) c1 = k_S11S31(1,ihelp)
1085           if (iz.gt.2) c1 = c1 + k1corrA1           if (iz.eq.2) c1 = k_S11S31(2,ihelp)
1086           c2 = k_S11S31(2,ihelp)           if (iz.gt.2) c1 = k_S11S31(3,ihelp)
1087           betatof_a(1) = c2/(cos(theta13)*(ds-c1))           betatof_a(1) = c2/(cos(theta13)*(ds-c1))
1088    
1089  C------- ToF Mask - S11 - S31  C------- ToF Mask - S11 - S31
# Line 1103  C------- Line 1104  C-------
1104                
1105  C     S11 - S32  C     S11 - S32
1106    
1107          dist = ZTOF(1) - ZTOF(6)
1108          c2 = (2.*0.01*dist)/(3.E08*50.E-12  )
1109    
1110         IF ((tof11_i.GT.none_find).AND.(tof32_i.GT.none_find).AND.         IF ((tof11_i.GT.none_find).AND.(tof32_i.GT.none_find).AND.
1111       &    (ytofpos(1).NE.101.).AND.(xtofpos(3).NE.101.)) THEN       &    (ytofpos(1).NE.101.).AND.(xtofpos(3).NE.101.)) THEN
1112           xhelp1 = tof11(1,tof11_i,itdc)+tof11(2,tof11_i,itdc)           xhelp1 = tof11(1,tof11_i,itdc)+tof11(2,tof11_i,itdc)
1113           xhelp2 = tof32(1,tof32_i,itdc)+tof32(2,tof32_i,itdc)           xhelp2 = tof32(1,tof32_i,itdc)+tof32(2,tof32_i,itdc)
1114           ds = xhelp1-xhelp2           ds = xhelp1-xhelp2
1115           ihelp=(tof11_i-1)*3+tof32_i           ihelp=(tof11_i-1)*3+tof32_i
1116           c1 = k_S11S32(1,ihelp)           if (iz.le.1) c1 = k_S11S32(1,ihelp)
1117           if (iz.gt.2) c1 = c1 + k1corrA1           if (iz.eq.2) c1 = k_S11S32(2,ihelp)
1118           c2 = k_S11S32(2,ihelp)           if (iz.gt.2) c1 = k_S11S32(3,ihelp)
1119           betatof_a(2) = c2/(cos(theta13)*(ds-c1))           betatof_a(2) = c2/(cos(theta13)*(ds-c1))
1120    
1121  C------- ToF Mask - S11 - S32  C------- ToF Mask - S11 - S32
# Line 1132  C------- Line 1136  C-------
1136                
1137  C     S12 - S31  C     S12 - S31
1138    
1139          dist = ZTOF(2) - ZTOF(5)
1140          c2 = (2.*0.01*dist)/(3.E08*50.E-12  )
1141    
1142         IF ((tof12_i.GT.none_find).AND.(tof31_i.GT.none_find).AND.         IF ((tof12_i.GT.none_find).AND.(tof31_i.GT.none_find).AND.
1143       &    (xtofpos(1).NE.101.).AND.(ytofpos(3).NE.101.)) THEN       &    (xtofpos(1).NE.101.).AND.(ytofpos(3).NE.101.)) THEN
1144           xhelp1 = tof12(1,tof12_i,itdc)+tof12(2,tof12_i,itdc)           xhelp1 = tof12(1,tof12_i,itdc)+tof12(2,tof12_i,itdc)
1145           xhelp2 = tof31(1,tof31_i,itdc)+tof31(2,tof31_i,itdc)           xhelp2 = tof31(1,tof31_i,itdc)+tof31(2,tof31_i,itdc)
1146           ds = xhelp1-xhelp2           ds = xhelp1-xhelp2
1147           ihelp=(tof12_i-1)*3+tof31_i           ihelp=(tof12_i-1)*3+tof31_i
1148           c1 = k_S12S31(1,ihelp)           if (iz.le.1) c1 = k_S12S31(1,ihelp)
1149           if (iz.gt.2) c1 = c1 + k1corrA1           if (iz.eq.2) c1 = k_S12S31(2,ihelp)
1150           c2 = k_S12S31(2,ihelp)           if (iz.gt.2) c1 = k_S12S31(3,ihelp)
1151           betatof_a(3) = c2/(cos(theta13)*(ds-c1))           betatof_a(3) = c2/(cos(theta13)*(ds-c1))
1152    
1153  C------- ToF Mask - S12 - S31  C------- ToF Mask - S12 - S31
# Line 1161  C------- Line 1168  C-------
1168                            
1169  C     S12 - S32  C     S12 - S32
1170    
1171          dist = ZTOF(2) - ZTOF(6)
1172          c2 = (2.*0.01*dist)/(3.E08*50.E-12  )
1173    
1174         IF ((tof12_i.GT.none_find).AND.(tof32_i.GT.none_find).AND.         IF ((tof12_i.GT.none_find).AND.(tof32_i.GT.none_find).AND.
1175       &    (xtofpos(1).NE.101.).AND.(xtofpos(3).NE.101.)) THEN       &    (xtofpos(1).NE.101.).AND.(xtofpos(3).NE.101.)) THEN
1176           xhelp1 = tof12(1,tof12_i,itdc)+tof12(2,tof12_i,itdc)           xhelp1 = tof12(1,tof12_i,itdc)+tof12(2,tof12_i,itdc)
1177           xhelp2 = tof32(1,tof32_i,itdc)+tof32(2,tof32_i,itdc)           xhelp2 = tof32(1,tof32_i,itdc)+tof32(2,tof32_i,itdc)
1178           ds = xhelp1-xhelp2           ds = xhelp1-xhelp2
1179           ihelp=(tof12_i-1)*3+tof32_i           ihelp=(tof12_i-1)*3+tof32_i
1180           c1 = k_S12S32(1,ihelp)           if (iz.le.1) c1 = k_S12S32(1,ihelp)
1181           if (iz.gt.2) c1 = c1 + k1corrA1           if (iz.eq.2) c1 = k_S12S32(2,ihelp)
1182           c2 = k_S12S32(2,ihelp)           if (iz.gt.2) c1 = k_S12S32(3,ihelp)
1183           betatof_a(4) = c2/(cos(theta13)*(ds-c1))           betatof_a(4) = c2/(cos(theta13)*(ds-c1))
1184    
1185  C------- ToF Mask - S12 - S32  C------- ToF Mask - S12 - S32
# Line 1190  C------- Line 1200  C-------
1200    
1201  C     S21 - S31  C     S21 - S31
1202    
1203          dist = ZTOF(3) - ZTOF(5)
1204          c2 = (2.*0.01*dist)/(3.E08*50.E-12  )
1205    
1206         IF ((tof21_i.GT.none_find).AND.(tof31_i.GT.none_find).AND.         IF ((tof21_i.GT.none_find).AND.(tof31_i.GT.none_find).AND.
1207       &    (xtofpos(2).NE.101.).AND.(ytofpos(3).NE.101.)) THEN       &    (xtofpos(2).NE.101.).AND.(ytofpos(3).NE.101.)) THEN
1208           xhelp1 = tof21(1,tof21_i,itdc)+tof21(2,tof21_i,itdc)           xhelp1 = tof21(1,tof21_i,itdc)+tof21(2,tof21_i,itdc)
1209           xhelp2 = tof31(1,tof31_i,itdc)+tof31(2,tof31_i,itdc)           xhelp2 = tof31(1,tof31_i,itdc)+tof31(2,tof31_i,itdc)
1210           ds = xhelp1-xhelp2           ds = xhelp1-xhelp2
1211           ihelp=(tof21_i-1)*3+tof31_i           ihelp=(tof21_i-1)*3+tof31_i
1212           c1 = k_S21S31(1,ihelp)           if (iz.le.1) c1 = k_S21S31(1,ihelp)
1213           if (iz.gt.2) c1 = c1 + k1corrB1           if (iz.eq.2) c1 = k_S21S31(2,ihelp)
1214           c2 = k_S21S31(2,ihelp)           if (iz.gt.2) c1 = k_S21S31(3,ihelp)
1215           betatof_a(5) = c2/(cos(theta13)*(ds-c1))           betatof_a(5) = c2/(cos(theta13)*(ds-c1))
1216    
1217  C------- ToF Mask - S21 - S31  C------- ToF Mask - S21 - S31
# Line 1219  C------- Line 1232  C-------
1232    
1233  C     S21 - S32  C     S21 - S32
1234    
1235          dist = ZTOF(3) - ZTOF(6)
1236          c2 = (2.*0.01*dist)/(3.E08*50.E-12  )
1237    
1238    
1239         IF ((tof21_i.GT.none_find).AND.(tof32_i.GT.none_find).AND.         IF ((tof21_i.GT.none_find).AND.(tof32_i.GT.none_find).AND.
1240       &    (xtofpos(2).NE.101.).AND.(xtofpos(3).NE.101.)) THEN       &    (xtofpos(2).NE.101.).AND.(xtofpos(3).NE.101.)) THEN
1241           xhelp1 = tof21(1,tof21_i,itdc)+tof21(2,tof21_i,itdc)           xhelp1 = tof21(1,tof21_i,itdc)+tof21(2,tof21_i,itdc)
1242           xhelp2 = tof32(1,tof32_i,itdc)+tof32(2,tof32_i,itdc)           xhelp2 = tof32(1,tof32_i,itdc)+tof32(2,tof32_i,itdc)
1243           ds = xhelp1-xhelp2           ds = xhelp1-xhelp2
1244           ihelp=(tof21_i-1)*3+tof32_i           ihelp=(tof21_i-1)*3+tof32_i
1245           c1 = k_S21S32(1,ihelp)           if (iz.le.1) c1 = k_S21S32(1,ihelp)
1246           if (iz.gt.2) c1 = c1 + k1corrB1           if (iz.eq.2) c1 = k_S21S32(2,ihelp)
1247           c2 = k_S21S32(2,ihelp)           if (iz.gt.2) c1 = k_S21S32(3,ihelp)
1248           betatof_a(6) = c2/(cos(theta13)*(ds-c1))           betatof_a(6) = c2/(cos(theta13)*(ds-c1))
1249                                        
1250  C------- ToF Mask - S21 - S32  C------- ToF Mask - S21 - S32
# Line 1248  C------- Line 1265  C-------
1265    
1266  C     S22 - S31  C     S22 - S31
1267    
1268          dist = ZTOF(4) - ZTOF(5)
1269          c2 = (2.*0.01*dist)/(3.E08*50.E-12  )
1270    
1271         IF ((tof22_i.GT.none_find).AND.(tof31_i.GT.none_find).AND.         IF ((tof22_i.GT.none_find).AND.(tof31_i.GT.none_find).AND.
1272       &    (ytofpos(2).NE.101.).AND.(ytofpos(3).NE.101.)) THEN       &    (ytofpos(2).NE.101.).AND.(ytofpos(3).NE.101.)) THEN
1273           xhelp1 = tof22(1,tof22_i,itdc)+tof22(2,tof22_i,itdc)           xhelp1 = tof22(1,tof22_i,itdc)+tof22(2,tof22_i,itdc)
1274           xhelp2 = tof31(1,tof31_i,itdc)+tof31(2,tof31_i,itdc)           xhelp2 = tof31(1,tof31_i,itdc)+tof31(2,tof31_i,itdc)
1275           ds = xhelp1-xhelp2           ds = xhelp1-xhelp2
1276           ihelp=(tof22_i-1)*3+tof31_i           ihelp=(tof22_i-1)*3+tof31_i
1277           c1 = k_S22S31(1,ihelp)           if (iz.le.1) c1 = k_S22S31(1,ihelp)
1278           if (iz.gt.2) c1 = c1 + k1corrB1           if (iz.eq.2) c1 = k_S22S31(2,ihelp)
1279           c2 = k_S22S31(2,ihelp)           if (iz.gt.2) c1 = k_S22S31(3,ihelp)
1280           betatof_a(7) = c2/(cos(theta13)*(ds-c1))           betatof_a(7) = c2/(cos(theta13)*(ds-c1))
1281    
1282  C------- ToF Mask - S22 - S31  C------- ToF Mask - S22 - S31
# Line 1277  C-------           Line 1297  C-------          
1297                
1298  C     S22 - S32  C     S22 - S32
1299    
1300          dist = ZTOF(4) - ZTOF(6)
1301          c2 = (2.*0.01*dist)/(3.E08*50.E-12  )
1302    
1303         IF ((tof22_i.GT.none_find).AND.(tof32_i.GT.none_find).AND.         IF ((tof22_i.GT.none_find).AND.(tof32_i.GT.none_find).AND.
1304       &    (ytofpos(2).NE.101.).AND.(xtofpos(3).NE.101.)) THEN       &    (ytofpos(2).NE.101.).AND.(xtofpos(3).NE.101.)) THEN
1305           xhelp1 = tof22(1,tof22_i,itdc)+tof22(2,tof22_i,itdc)           xhelp1 = tof22(1,tof22_i,itdc)+tof22(2,tof22_i,itdc)
1306           xhelp2 = tof32(1,tof32_i,itdc)+tof32(2,tof32_i,itdc)           xhelp2 = tof32(1,tof32_i,itdc)+tof32(2,tof32_i,itdc)
1307           ds = xhelp1-xhelp2           ds = xhelp1-xhelp2
1308           ihelp=(tof22_i-1)*3+tof32_i           ihelp=(tof22_i-1)*3+tof32_i
1309           c1 = k_S22S32(1,ihelp)           if (iz.le.1) c1 = k_S22S32(1,ihelp)
1310           if (iz.gt.2) c1 = c1 + k1corrB1           if (iz.eq.2) c1 = k_S22S32(2,ihelp)
1311           c2 = k_S22S32(2,ihelp)           if (iz.gt.2) c1 = k_S22S32(3,ihelp)
1312           betatof_a(8) = c2/(cos(theta13)*(ds-c1))           betatof_a(8) = c2/(cos(theta13)*(ds-c1))
1313    
1314  C------- ToF Mask - S22 - S32  C------- ToF Mask - S22 - S32
# Line 1306  C-------   Line 1329  C-------  
1329    
1330  C     S11 - S21  C     S11 - S21
1331    
1332          dist = ZTOF(1) - ZTOF(3)
1333          c2 = (2.*0.01*dist)/(3.E08*50.E-12  )
1334    
1335         IF ((tof11_i.GT.none_find).AND.(tof21_i.GT.none_find).AND.         IF ((tof11_i.GT.none_find).AND.(tof21_i.GT.none_find).AND.
1336       &    (ytofpos(1).NE.101.).AND.(xtofpos(2).NE.101.)) THEN       &    (ytofpos(1).NE.101.).AND.(xtofpos(2).NE.101.)) THEN
1337           xhelp1 = tof11(1,tof11_i,itdc)+tof11(2,tof11_i,itdc)           xhelp1 = tof11(1,tof11_i,itdc)+tof11(2,tof11_i,itdc)
1338           xhelp2 = tof21(1,tof21_i,itdc)+tof21(2,tof21_i,itdc)           xhelp2 = tof21(1,tof21_i,itdc)+tof21(2,tof21_i,itdc)
1339           ds = xhelp1-xhelp2           ds = xhelp1-xhelp2
1340           ihelp=(tof11_i-1)*2+tof21_i           ihelp=(tof11_i-1)*2+tof21_i
1341           c1 = k_S11S21(1,ihelp)           if (iz.le.1) c1 = k_S11S21(1,ihelp)
1342           if (iz.gt.2) c1 = c1 + k1corrC1           if (iz.eq.2) c1 = k_S11S21(2,ihelp)
1343           c2 = k_S11S21(2,ihelp)           if (iz.gt.2) c1 = k_S11S21(3,ihelp)
1344           betatof_a(9) = c2/(cos(theta13)*(ds-c1))           betatof_a(9) = c2/(cos(theta13)*(ds-c1))
1345    
1346  C------- ToF Mask - S11 - S21  C------- ToF Mask - S11 - S21
# Line 1335  C-------   Line 1361  C-------  
1361                
1362  C     S11 - S22  C     S11 - S22
1363    
1364          dist = ZTOF(1) - ZTOF(4)
1365          c2 = (2.*0.01*dist)/(3.E08*50.E-12  )
1366    
1367         IF ((tof11_i.GT.none_find).AND.(tof22_i.GT.none_find).AND.         IF ((tof11_i.GT.none_find).AND.(tof22_i.GT.none_find).AND.
1368       &    (ytofpos(1).NE.101.).AND.(ytofpos(2).NE.101.)) THEN       &    (ytofpos(1).NE.101.).AND.(ytofpos(2).NE.101.)) THEN
1369           xhelp1 = tof11(1,tof11_i,itdc)+tof11(2,tof11_i,itdc)           xhelp1 = tof11(1,tof11_i,itdc)+tof11(2,tof11_i,itdc)
1370           xhelp2 = tof22(1,tof22_i,itdc)+tof22(2,tof22_i,itdc)           xhelp2 = tof22(1,tof22_i,itdc)+tof22(2,tof22_i,itdc)
1371           ds = xhelp1-xhelp2           ds = xhelp1-xhelp2
1372           ihelp=(tof11_i-1)*2+tof22_i           ihelp=(tof11_i-1)*2+tof22_i
1373           c1 = k_S11S22(1,ihelp)           if (iz.le.1) c1 = k_S11S22(1,ihelp)
1374           if (iz.gt.2) c1 = c1 + k1corrC1           if (iz.eq.2) c1 = k_S11S22(2,ihelp)
1375           c2 = k_S11S22(2,ihelp)           if (iz.gt.2) c1 = k_S11S22(3,ihelp)
1376           betatof_a(10) = c2/(cos(theta13)*(ds-c1))           betatof_a(10) = c2/(cos(theta13)*(ds-c1))
1377    
1378  C------- ToF Mask - S11 - S22  C------- ToF Mask - S11 - S22
# Line 1364  C-------   Line 1393  C-------  
1393    
1394  C     S12 - S21  C     S12 - S21
1395    
1396          dist = ZTOF(2) - ZTOF(3)
1397          c2 = (2.*0.01*dist)/(3.E08*50.E-12  )
1398    
1399         IF ((tof12_i.GT.none_find).AND.(tof21_i.GT.none_find).AND.         IF ((tof12_i.GT.none_find).AND.(tof21_i.GT.none_find).AND.
1400       &    (xtofpos(1).NE.101.).AND.(xtofpos(2).NE.101.)) THEN       &    (xtofpos(1).NE.101.).AND.(xtofpos(2).NE.101.)) THEN
1401           xhelp1 = tof12(1,tof12_i,itdc)+tof12(2,tof12_i,itdc)           xhelp1 = tof12(1,tof12_i,itdc)+tof12(2,tof12_i,itdc)
1402           xhelp2 = tof21(1,tof21_i,itdc)+tof21(2,tof21_i,itdc)           xhelp2 = tof21(1,tof21_i,itdc)+tof21(2,tof21_i,itdc)
1403           ds = xhelp1-xhelp2           ds = xhelp1-xhelp2
1404           ihelp=(tof12_i-1)*2+tof21_i           ihelp=(tof12_i-1)*2+tof21_i
1405           c1 = k_S12S21(1,ihelp)           if (iz.le.1) c1 = k_S12S21(1,ihelp)
1406           if (iz.gt.2) c1 = c1 + k1corrC1           if (iz.eq.2) c1 = k_S12S21(2,ihelp)
1407           c2 = k_S12S21(2,ihelp)           if (iz.gt.2) c1 = k_S12S21(3,ihelp)
1408           betatof_a(11) = c2/(cos(theta13)*(ds-c1))           betatof_a(11) = c2/(cos(theta13)*(ds-c1))
1409    
1410  C------- ToF Mask - S12 - S21  C------- ToF Mask - S12 - S21
# Line 1393  C-------   Line 1425  C-------  
1425    
1426  C     S12 - S22  C     S12 - S22
1427    
1428          dist = ZTOF(2) - ZTOF(4)
1429          c2 = (2.*0.01*dist)/(3.E08*50.E-12  )
1430    
1431         IF ((tof12_i.GT.none_find).AND.(tof22_i.GT.none_find).AND.         IF ((tof12_i.GT.none_find).AND.(tof22_i.GT.none_find).AND.
1432       &    (xtofpos(1).NE.101.).AND.(ytofpos(2).NE.101.)) THEN       &    (xtofpos(1).NE.101.).AND.(ytofpos(2).NE.101.)) THEN
1433           xhelp1 = tof12(1,tof12_i,itdc)+tof12(2,tof12_i,itdc)           xhelp1 = tof12(1,tof12_i,itdc)+tof12(2,tof12_i,itdc)
1434           xhelp2 = tof22(1,tof22_i,itdc)+tof22(2,tof22_i,itdc)           xhelp2 = tof22(1,tof22_i,itdc)+tof22(2,tof22_i,itdc)
1435           ds = xhelp1-xhelp2           ds = xhelp1-xhelp2
1436           ihelp=(tof12_i-1)*2+tof22_i           ihelp=(tof12_i-1)*2+tof22_i
1437           c1 = k_S12S22(1,ihelp)           if (iz.le.1) c1 = k_S12S22(1,ihelp)
1438           if (iz.gt.2) c1 = c1 + k1corrC1           if (iz.eq.2) c1 = k_S12S22(2,ihelp)
1439           c2 = k_S12S22(2,ihelp)           if (iz.gt.2) c1 = k_S12S22(3,ihelp)
1440           betatof_a(12) = c2/(cos(theta13)*(ds-c1))           betatof_a(12) = c2/(cos(theta13)*(ds-c1))
1441    
1442  C------- ToF Mask - S12 - S22  C------- ToF Mask - S12 - S22
# Line 1853  C----  calculate  beta mean, only downwa Line 1888  C----  calculate  beta mean, only downwa
1888    
1889          if (sw.gt.0) beta_mean_tof=sxw/sw;          if (sw.gt.0) beta_mean_tof=sxw/sw;
1890    
1891  c        write(*,*) 'beta_mean_tof ',beta_mean_tof  C        write(*,*) 'beta_mean_tof ',beta_mean_tof
1892    
1893          beta_help = beta_mean_tof  !  pow(beta_mean_tof,1.0) gave best results          beta_help = beta_mean_tof  !  pow(beta_mean_tof,1.0) gave best results
1894    
# Line 1982  C  no beta found? Sum up geometric means Line 2017  C  no beta found? Sum up geometric means
2017    
2018                                    endif  ! beta_mean_tof.eq.100.                                    endif  ! beta_mean_tof.eq.100.
2019    
2020  c        write(*,*) 'in function charge: ',charge  C        write(*,*) 'in function charge: ',beta_mean_tof,charge
2021    
2022          check_charge = charge          check_charge = charge
2023    
2024    

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.23