271 |
*------------------------------------------------------------------------------- |
*------------------------------------------------------------------------------- |
272 |
ccc ntrk=0 !counter of identified physical tracks |
ccc ntrk=0 !counter of identified physical tracks |
273 |
|
|
274 |
11111 continue !<<<<<<< come here when performing a new search |
c11111 continue !<<<<<<< come here when performing a new search |
275 |
|
continue !<<<<<<< come here when performing a new search |
276 |
|
|
277 |
if(nclouds_xz.eq.0)goto 880 !go to next event |
if(nclouds_xz.eq.0)goto 880 !go to next event |
278 |
if(nclouds_yz.eq.0)goto 880 !go to next event |
if(nclouds_yz.eq.0)goto 880 !go to next event |
303 |
* 1st) decreasing n.points |
* 1st) decreasing n.points |
304 |
* 2nd) increasing chi**2 |
* 2nd) increasing chi**2 |
305 |
* ------------------------------------------------------- |
* ------------------------------------------------------- |
306 |
rchi2best=1000000000. |
rchi2best=1000000000. |
307 |
ndofbest=0 |
ndofbest=0 |
308 |
do i=1,ntracks |
do i=1,ntracks |
309 |
ndof=0 |
ndof=0 |
528 |
|
|
529 |
|
|
530 |
* --- and store the results -------------------------------- |
* --- and store the results -------------------------------- |
|
ntrk = ntrk + 1 !counter of found tracks |
|
|
if(.not.FIMAGE |
|
|
$ .and.iimage.eq.0) image(ntrk)= 0 |
|
|
if(.not.FIMAGE |
|
|
$ .and.iimage.ne.0)image(ntrk)=ntrk+1 !this is the image of the next |
|
|
if(FIMAGE) image(ntrk)=ntrk-1 !this is the image of the previous |
|
|
call fill_level2_tracks(ntrk) !==> good2=.true. |
|
|
|
|
531 |
if(ntrk.eq.NTRKMAX)then |
if(ntrk.eq.NTRKMAX)then |
532 |
if(verbose.eq.1) |
if(verbose.eq.1) |
533 |
$ print*, |
$ print*, |
537 |
cc good2=.false. |
cc good2=.false. |
538 |
goto 880 !fill ntp and go to next event |
goto 880 !fill ntp and go to next event |
539 |
endif |
endif |
540 |
|
|
541 |
|
ntrk = ntrk + 1 !counter of found tracks |
542 |
|
if(.not.FIMAGE |
543 |
|
$ .and.iimage.eq.0) image(ntrk)= 0 |
544 |
|
if(.not.FIMAGE |
545 |
|
$ .and.iimage.ne.0)image(ntrk)=ntrk+1 !this is the image of the next |
546 |
|
if(FIMAGE) image(ntrk)=ntrk-1 !this is the image of the previous |
547 |
|
call fill_level2_tracks(ntrk) !==> good2=.true. |
548 |
|
|
549 |
|
c$$$ if(ntrk.eq.NTRKMAX)then |
550 |
|
c$$$ if(verbose.eq.1) |
551 |
|
c$$$ $ print*, |
552 |
|
c$$$ $ '** warning ** number of identified '// |
553 |
|
c$$$ $ 'tracks exceeds vector dimension ' |
554 |
|
c$$$ $ ,'( ',NTRKMAX,' )' |
555 |
|
c$$$cc good2=.false. |
556 |
|
c$$$ goto 880 !fill ntp and go to next event |
557 |
|
c$$$ endif |
558 |
if(iimage.ne.0)then |
if(iimage.ne.0)then |
559 |
FIMAGE=.true. ! |
FIMAGE=.true. ! |
560 |
goto 1212 !>>> fit image-track |
goto 1212 !>>> fit image-track |
716 |
stripx = stripx + corr |
stripx = stripx + corr |
717 |
resxPAM = res |
resxPAM = res |
718 |
|
|
719 |
10 endif |
10 continue |
720 |
|
endif |
721 |
|
|
722 |
* ----------------- |
* ----------------- |
723 |
* CLUSTER Y |
* CLUSTER Y |
763 |
stripy = stripy + corr |
stripy = stripy + corr |
764 |
resyPAM = res |
resyPAM = res |
765 |
|
|
766 |
20 endif |
20 continue |
767 |
|
endif |
768 |
|
|
769 |
|
|
770 |
c=========================================================== |
c=========================================================== |
1046 |
ipy=npl(VIEW(icy)) |
ipy=npl(VIEW(icy)) |
1047 |
|
|
1048 |
if( (nplanes-ipx+1).ne.ip )then |
if( (nplanes-ipx+1).ne.ip )then |
1049 |
print*,'xyzpam: ***WARNING*** cluster ',icx |
print*,'xyzpam: ***WARNING*** cluster icx=',icx |
1050 |
$ ,' does not belong to plane: ',ip |
$ ,' belongs to plane ',(nplanes-ipx+1) |
1051 |
|
$ ,' and not ',ip |
1052 |
icx = -1*icx |
icx = -1*icx |
1053 |
return |
return |
1054 |
endif |
endif |
1055 |
if( (nplanes-ipy+1).ne.ip )then |
if( (nplanes-ipy+1).ne.ip )then |
1056 |
print*,'xyzpam: ***WARNING*** cluster ',icy |
print*,'xyzpam: ***WARNING*** cluster icy=',icy |
1057 |
$ ,' does not belong to plane: ',ip |
$ ,' belongs to plane ',(nplanes-ipy+1) |
1058 |
icy = -1*icy |
$ ,' and not ',ip |
1059 |
|
icy = -1*icy |
1060 |
return |
return |
1061 |
endif |
endif |
1062 |
|
|
1072 |
zm(ip) = zPAM |
zm(ip) = zPAM |
1073 |
xm_A(ip) = 0.D0 |
xm_A(ip) = 0.D0 |
1074 |
ym_A(ip) = 0.D0 |
ym_A(ip) = 0.D0 |
1075 |
|
zm_A(ip) = 0.D0 |
1076 |
xm_B(ip) = 0.D0 |
xm_B(ip) = 0.D0 |
1077 |
ym_B(ip) = 0.D0 |
ym_B(ip) = 0.D0 |
1078 |
|
zm_B(ip) = 0.D0 |
1079 |
|
|
1080 |
c zv(ip) = zPAM |
c zv(ip) = zPAM |
1081 |
|
|
1083 |
|
|
1084 |
ipy=npl(VIEW(icy)) |
ipy=npl(VIEW(icy)) |
1085 |
if( (nplanes-ipy+1).ne.ip )then |
if( (nplanes-ipy+1).ne.ip )then |
1086 |
print*,'xyzpam: ***WARNING*** cluster ',icy |
print*,'xyzpam: ***WARNING*** cluster icy=',icy |
1087 |
$ ,' does not belong to plane: ',ip |
$ ,' belongs to plane ',(nplanes-ipy+1) |
1088 |
|
$ ,' and not ',ip |
1089 |
icy = -1*icy |
icy = -1*icy |
1090 |
return |
return |
1091 |
endif |
endif |
1105 |
zm(ip) = zPAM |
zm(ip) = zPAM |
1106 |
xm_A(ip) = xPAM_A |
xm_A(ip) = xPAM_A |
1107 |
ym_A(ip) = yPAM_A |
ym_A(ip) = yPAM_A |
1108 |
|
zm_A(ip) = zPAM_A |
1109 |
xm_B(ip) = xPAM_B |
xm_B(ip) = xPAM_B |
1110 |
ym_B(ip) = yPAM_B |
ym_B(ip) = yPAM_B |
1111 |
|
zm_B(ip) = zPAM_B |
1112 |
|
|
1113 |
c zv(ip) = (zPAM_A+zPAM_B)/2. |
c zv(ip) = (zPAM_A+zPAM_B)/2. |
1114 |
|
|
1117 |
ipx=npl(VIEW(icx)) |
ipx=npl(VIEW(icx)) |
1118 |
|
|
1119 |
if( (nplanes-ipx+1).ne.ip )then |
if( (nplanes-ipx+1).ne.ip )then |
1120 |
print*,'xyzpam: ***WARNING*** cluster ',icx |
print*,'xyzpam: ***WARNING*** cluster icx=',icx |
1121 |
$ ,' does not belong to plane: ',ip |
$ ,' belongs to plane ',(nplanes-ipx+1) |
1122 |
|
$ ,' and not ',ip |
1123 |
icx = -1*icx |
icx = -1*icx |
1124 |
return |
return |
1125 |
endif |
endif |
1139 |
zm(ip) = zPAM |
zm(ip) = zPAM |
1140 |
xm_A(ip) = xPAM_A |
xm_A(ip) = xPAM_A |
1141 |
ym_A(ip) = yPAM_A |
ym_A(ip) = yPAM_A |
1142 |
|
zm_A(ip) = zPAM_A |
1143 |
xm_B(ip) = xPAM_B |
xm_B(ip) = xPAM_B |
1144 |
ym_B(ip) = yPAM_B |
ym_B(ip) = yPAM_B |
1145 |
|
zm_B(ip) = zPAM_B |
1146 |
|
|
1147 |
c zv(ip) = (zPAM_A+zPAM_B)/2. |
c zv(ip) = (zPAM_A+zPAM_B)/2. |
1148 |
|
|
1163 |
zm(ip) = z_mech_sensor(nplanes-ip+1,il,is)*1000./1.d4 |
zm(ip) = z_mech_sensor(nplanes-ip+1,il,is)*1000./1.d4 |
1164 |
xm_A(ip) = 0. |
xm_A(ip) = 0. |
1165 |
ym_A(ip) = 0. |
ym_A(ip) = 0. |
1166 |
|
zm_A(ip) = 0. |
1167 |
xm_B(ip) = 0. |
xm_B(ip) = 0. |
1168 |
ym_B(ip) = 0. |
ym_B(ip) = 0. |
1169 |
|
zm_B(ip) = 0. |
1170 |
|
|
1171 |
c zv(ip) = z_mech_sensor(nplanes-ip+1,il,is)*1000./1.d4 |
c zv(ip) = z_mech_sensor(nplanes-ip+1,il,is)*1000./1.d4 |
1172 |
|
|
1391 |
iv1=iside |
iv1=iside |
1392 |
iv2=mod(iside,4)+1 |
iv2=mod(iside,4)+1 |
1393 |
* straight line passing trhough two consecutive vertexes |
* straight line passing trhough two consecutive vertexes |
1394 |
AA = (yvv(iv1)-yvv(iv2))/(xvv(iv1)-xvv(iv2)) |
AA = REAL((yvv(iv1)-yvv(iv2))/(xvv(iv1)-xvv(iv2))) !EM GCC4.7 |
1395 |
BB = yvv(iv1) - AA*xvv(iv1) |
BB = REAL(yvv(iv1) - AA*xvv(iv1)) !EM GCC4.7 |
1396 |
* point along the straight line closer to the track |
* point along the straight line closer to the track |
1397 |
xoo = (xPAM+AA*yPAM-AA*BB)/(1+AA**2) |
xoo = (xPAM+AA*yPAM-AA*BB)/(1+AA**2) |
1398 |
yoo = AA*xoo + BB |
yoo = AA*xoo + BB |
1404 |
iv1=iside |
iv1=iside |
1405 |
iv2=mod(iside,4)+1 |
iv2=mod(iside,4)+1 |
1406 |
* straight line passing trhough two consecutive vertexes |
* straight line passing trhough two consecutive vertexes |
1407 |
AA = (xvv(iv1)-xvv(iv2))/(yvv(iv1)-yvv(iv2)) |
AA = REAL((xvv(iv1)-xvv(iv2))/(yvv(iv1)-yvv(iv2))) !EM GCC4.7 |
1408 |
BB = xvv(iv1) - AA*yvv(iv1) |
BB = REAL(xvv(iv1) - AA*yvv(iv1)) !EM GCC4.7 |
1409 |
* point along the straight line closer to the track |
* point along the straight line closer to the track |
1410 |
yoo = (yPAM+AA*xPAM-AA*BB)/(1+AA**2) |
yoo = (yPAM+AA*xPAM-AA*BB)/(1+AA**2) |
1411 |
xoo = AA*yoo + BB |
xoo = AA*yoo + BB |
1606 |
integer iflag |
integer iflag |
1607 |
|
|
1608 |
integer badseed,badclx,badcly |
integer badseed,badclx,badcly |
1609 |
|
|
1610 |
|
iflag = iflag |
1611 |
if(DEBUG.EQ.1)print*,'cl_to_couples:' |
if(DEBUG.EQ.1)print*,'cl_to_couples:' |
1612 |
|
|
1613 |
cc if(RECOVER_SINGLETS.and..not.SECOND_SEARCH)goto 80 |
cc if(RECOVER_SINGLETS.and..not.SECOND_SEARCH)goto 80 |
1793 |
$ ,'( ',ncouplemax,' ) --> masked!' |
$ ,'( ',ncouplemax,' ) --> masked!' |
1794 |
c mask_view(nviewx(nplx)) = 2 |
c mask_view(nviewx(nplx)) = 2 |
1795 |
c mask_view(nviewy(nply)) = 2 |
c mask_view(nviewy(nply)) = 2 |
1796 |
mask_view(nviewx(nplx))= mask_view(nviewx(nplx))+ 2**1 |
mask_view(nviewx(nplx))= mask_view(nviewx(nplx))+ 2**1 |
1797 |
mask_view(nviewy(nply))= mask_view(nviewy(nply))+ 2**1 |
mask_view(nviewy(nply))= mask_view(nviewy(nply))+ 2**1 |
1798 |
goto 10 |
goto 10 |
1799 |
endif |
endif |
1800 |
|
|
1822 |
endif |
endif |
1823 |
enddo |
enddo |
1824 |
|
|
1825 |
80 continue |
c 80 continue |
1826 |
|
continue |
1827 |
|
|
1828 |
|
|
1829 |
if(DEBUG.EQ.1)then |
if(DEBUG.EQ.1)then |
1988 |
c call xyz_PAM(icx1,icy1,is1,'COG2','COG2',0.,0.)!(1) |
c call xyz_PAM(icx1,icy1,is1,'COG2','COG2',0.,0.)!(1) |
1989 |
c call xyz_PAM(icx1,icy1,is1,PFAdef,PFAdef,0.,0.) !(1) |
c call xyz_PAM(icx1,icy1,is1,PFAdef,PFAdef,0.,0.) !(1) |
1990 |
call xyz_PAM(icx1,icy1,is1,PFAdef,PFAdef,0.,0.,0.,0.) |
call xyz_PAM(icx1,icy1,is1,PFAdef,PFAdef,0.,0.,0.,0.) |
1991 |
xm1=xPAM |
xm1=REAL(xPAM) !EM GCC4.7 |
1992 |
ym1=yPAM |
ym1=REAL(yPAM) !EM GCC4.7 |
1993 |
zm1=zPAM |
zm1=REAL(zPAM) !EM GCC4.7 |
1994 |
|
|
1995 |
do ip2=(ip1+1),nplanes !loop on planes - COPPIA 2 |
do ip2=(ip1+1),nplanes !loop on planes - COPPIA 2 |
1996 |
c$$$ print*,'(2) ip ',ip2 |
c$$$ print*,'(2) ip ',ip2 |
2011 |
c $ (icx2,icy2,is2,PFAdef,PFAdef,0.,0.) !(1) |
c $ (icx2,icy2,is2,PFAdef,PFAdef,0.,0.) !(1) |
2012 |
call xyz_PAM |
call xyz_PAM |
2013 |
$ (icx2,icy2,is2,PFAdef,PFAdef,0.,0.,0.,0.) |
$ (icx2,icy2,is2,PFAdef,PFAdef,0.,0.,0.,0.) |
2014 |
xm2=xPAM |
xm2=REAL(xPAM) !EM GCC4.7 |
2015 |
ym2=yPAM |
ym2=REAL(yPAM) !EM GCC4.7 |
2016 |
zm2=zPAM |
zm2=REAL(zPAM) !EM GCC4.7 |
2017 |
|
|
2018 |
* --------------------------------------------------- |
* --------------------------------------------------- |
2019 |
* both couples must have a y-cluster |
* both couples must have a y-cluster |
2054 |
* tg(th_yz) |
* tg(th_yz) |
2055 |
alfayz2(ndblt)=(ym1-ym2)/(zm1-zm2) |
alfayz2(ndblt)=(ym1-ym2)/(zm1-zm2) |
2056 |
* y0 (cm) |
* y0 (cm) |
2057 |
alfayz1(ndblt)=alfayz2(ndblt)*(zini-zm1)+ym1 |
alfayz1(ndblt)=alfayz2(ndblt)*(REAL(zini)-zm1)+ym1! EM GCC4.7 zm1, ym1 and alfayz1/2 are REAL |
2058 |
|
|
2059 |
**** -----------------------------------------------**** |
**** -----------------------------------------------**** |
2060 |
**** reject non phisical couples **** |
**** reject non phisical couples **** |
2117 |
call xyz_PAM |
call xyz_PAM |
2118 |
$ (icx3,icy3,is3,PFAdef,PFAdef |
$ (icx3,icy3,is3,PFAdef,PFAdef |
2119 |
$ ,0.,0.,0.,0.) |
$ ,0.,0.,0.,0.) |
2120 |
xm3=xPAM |
xm3=REAL(xPAM) !EM GCC4.7 |
2121 |
ym3=yPAM |
ym3=REAL(yPAM) !EM GCC4.7 |
2122 |
zm3=zPAM |
zm3=REAL(zPAM) !EM GCC4.7 |
2123 |
|
|
2124 |
|
|
2125 |
* find the circle passing through the three points |
* find the circle passing through the three points |
2151 |
SZX=SZX+ZP(I)*XX |
SZX=SZX+ZP(I)*XX |
2152 |
SSX=SSX+XX |
SSX=SSX+XX |
2153 |
SZ=SZ+ZP(I) |
SZ=SZ+ZP(I) |
2154 |
S1=S1+1. |
S1=S1+1. |
2155 |
ENDDO |
ENDDO |
2156 |
DET=SZZ*S1-SZ*SZ |
DET=SZZ*S1-SZ*SZ |
2157 |
AX=(SZX*S1-SZ*SSX)/DET |
AX=(SZX*S1-SZ*SSX)/DET |
2158 |
BX=(SZZ*SSX-SZX*SZ)/DET |
BX=(SZZ*SSX-SZX*SZ)/DET |
2159 |
X0 = AX*ZINI+BX |
X0 = AX*REAL(ZINI)+BX ! EM GCC4.7 |
2160 |
|
|
2161 |
endif |
endif |
2162 |
|
|
2195 |
|
|
2196 |
if(radius.ne.0.and.xc.lt.0)then |
if(radius.ne.0.and.xc.lt.0)then |
2197 |
*************POSITIVE DEFLECTION |
*************POSITIVE DEFLECTION |
2198 |
alfaxz1(ntrpt) = xc+sqrt(radius**2-(ZINI-zc)**2) |
alfaxz1(ntrpt) = xc+sqrt(radius**2-(REAL(ZINI)-zc)**2) !EM GCC4.7 |
2199 |
alfaxz2(ntrpt) = (ZINI-zc)/sqrt(radius**2-(ZINI-zc)**2) |
alfaxz2(ntrpt) = (REAL(ZINI)-zc)/ |
2200 |
alfaxz3(ntrpt) = 1/radius |
$ sqrt(radius**2-(REAL(ZINI)-zc)**2) !EM GCC4.7 |
2201 |
|
alfaxz3(ntrpt) = 1/radius |
2202 |
else if(radius.ne.0.and.xc.ge.0)then |
else if(radius.ne.0.and.xc.ge.0)then |
2203 |
*************NEGATIVE DEFLECTION |
*************NEGATIVE DEFLECTION |
2204 |
alfaxz1(ntrpt) = xc-sqrt(radius**2-(ZINI-zc)**2) |
alfaxz1(ntrpt) = xc-sqrt(radius**2-(REAL(ZINI)-zc)**2) |
2205 |
alfaxz2(ntrpt) = -(ZINI-zc)/sqrt(radius**2-(ZINI-zc)**2) |
alfaxz2(ntrpt) = -(REAL(ZINI)-zc)/ |
2206 |
alfaxz3(ntrpt) = -1/radius |
$ sqrt(radius**2-(REAL(ZINI)-zc)**2) !EM GCC4.7 |
2207 |
|
alfaxz3(ntrpt) = -1/radius |
2208 |
else if(radius.eq.0)then |
else if(radius.eq.0)then |
2209 |
*************straight fit |
*************straight fit |
2210 |
alfaxz1(ntrpt) = X0 |
alfaxz1(ntrpt) = X0 |
2239 |
enddo !end loop on planes - COPPIA 3 |
enddo !end loop on planes - COPPIA 3 |
2240 |
|
|
2241 |
31 continue |
31 continue |
2242 |
1 enddo !end loop on COPPIA 2 |
c 1 enddo !end loop on COPPIA 2 |
2243 |
|
enddo !end loop on COPPIA 2 |
2244 |
enddo !end loop on sensors - COPPIA 2 |
enddo !end loop on sensors - COPPIA 2 |
2245 |
20 continue |
20 continue |
2246 |
enddo !end loop on planes - COPPIA 2 |
enddo !end loop on planes - COPPIA 2 |
2247 |
|
|
2248 |
11 continue |
c 11 continue |
2249 |
|
continue |
2250 |
enddo !end loop on COPPIA1 |
enddo !end loop on COPPIA1 |
2251 |
enddo !end loop on sensors - COPPIA 1 |
enddo !end loop on sensors - COPPIA 1 |
2252 |
10 continue |
10 continue |
2353 |
* doublet distance in parameter space |
* doublet distance in parameter space |
2354 |
distance= |
distance= |
2355 |
$ ((alfayz1(idbref)-alfayz1(idb2))/Dalfayz1)**2 |
$ ((alfayz1(idbref)-alfayz1(idb2))/Dalfayz1)**2 |
2356 |
$ +((alfayz2(idbref)-alfayz2(idb2))/Dalfayz2)**2 |
$ +((alfayz2(idbref)-alfayz2(idb2))/Dalfayz2)**2 |
2357 |
distance = sqrt(distance) |
distance = sqrt(distance) |
2358 |
|
|
2359 |
if(distance.lt.cutdistyz)then |
if(distance.lt.cutdistyz)then |
2378 |
1118 continue |
1118 continue |
2379 |
enddo !end loop (2) on DOUBLETS |
enddo !end loop (2) on DOUBLETS |
2380 |
|
|
2381 |
1188 continue |
c 1188 continue |
2382 |
|
continue |
2383 |
enddo !end loop on... bo? |
enddo !end loop on... bo? |
2384 |
|
|
2385 |
nptloop=npv |
nptloop=npv |
2567 |
* solo i due parametri spaziali per il momemnto |
* solo i due parametri spaziali per il momemnto |
2568 |
distance= |
distance= |
2569 |
$ ((alfaxz1(itrref)-alfaxz1(itr2))/Dalfaxz1)**2 |
$ ((alfaxz1(itrref)-alfaxz1(itr2))/Dalfaxz1)**2 |
2570 |
$ +((alfaxz2(itrref)-alfaxz2(itr2))/Dalfaxz2)**2 |
$ +((alfaxz2(itrref)-alfaxz2(itr2))/Dalfaxz2)**2 |
2571 |
distance = sqrt(distance) |
distance = sqrt(distance) |
2572 |
|
|
2573 |
|
|
2606 |
11188 continue |
11188 continue |
2607 |
enddo !end loop (2) on TRIPLETS |
enddo !end loop (2) on TRIPLETS |
2608 |
|
|
2609 |
11888 continue |
c11888 continue |
2610 |
|
continue |
2611 |
enddo !end loop on... bo? |
enddo !end loop on... bo? |
2612 |
|
|
2613 |
nptloop=npv |
nptloop=npv |
2672 |
npt_tot=npt_tot+npt |
npt_tot=npt_tot+npt |
2673 |
|
|
2674 |
if(DEBUG.EQ.1)then |
if(DEBUG.EQ.1)then |
2675 |
print*,'>>>> cloud ',nclouds_xz,' --- ',npt,' points' |
print*,'>>>> cloud ',nclouds_xz,' --- ',npt,' points' |
2676 |
print*,'- alfaxz1 ',alfaxz1_av(nclouds_xz) |
print*,'- alfaxz1 ',alfaxz1_av(nclouds_xz) |
2677 |
print*,'- alfaxz2 ',alfaxz2_av(nclouds_xz) |
print*,'- alfaxz2 ',alfaxz2_av(nclouds_xz) |
2678 |
print*,'- alfaxz3 ',alfaxz3_av(nclouds_xz) |
print*,'- alfaxz3 ',alfaxz3_av(nclouds_xz) |
2975 |
xm(nplanes-ip+1)=xPAM |
xm(nplanes-ip+1)=xPAM |
2976 |
ym(nplanes-ip+1)=yPAM |
ym(nplanes-ip+1)=yPAM |
2977 |
zm(nplanes-ip+1)=zPAM |
zm(nplanes-ip+1)=zPAM |
2978 |
resx(nplanes-ip+1)=resxPAM |
resx(nplanes-ip+1)=resxPAM |
2979 |
resy(nplanes-ip+1)=resyPAM |
resy(nplanes-ip+1)=resyPAM |
2980 |
if(DEBUG.EQ.1)print*,'(X,Y)' |
if(DEBUG.EQ.1)print*,'(X,Y)' |
2981 |
$ ,nplanes-ip+1,xPAM,yPAM |
$ ,nplanes-ip+1,xPAM,yPAM |
2986 |
ym_B(nplanes-ip+1) = yPAM_B |
ym_B(nplanes-ip+1) = yPAM_B |
2987 |
zm(nplanes-ip+1) |
zm(nplanes-ip+1) |
2988 |
$ = (zPAM_A+zPAM_B)/2. |
$ = (zPAM_A+zPAM_B)/2. |
2989 |
resx(nplanes-ip+1) = resxPAM |
resx(nplanes-ip+1) = resxPAM |
2990 |
resy(nplanes-ip+1) = resyPAM |
resy(nplanes-ip+1) = resyPAM |
2991 |
if(icx.eq.0.and.icy.gt.0)then |
if(icx.eq.0.and.icy.gt.0)then |
2992 |
xgood(nplanes-ip+1)=0. |
xgood(nplanes-ip+1)=0. |
3073 |
|
|
3074 |
XV_STORE(ip,ntracks)=sngl(xv(ip)) |
XV_STORE(ip,ntracks)=sngl(xv(ip)) |
3075 |
YV_STORE(ip,ntracks)=sngl(yv(ip)) |
YV_STORE(ip,ntracks)=sngl(yv(ip)) |
3076 |
ZV_STORE(ip,ntracks)=sngl(zv(ip)) |
ZV_STORE(ip,ntracks)=sngl(zv(ip)) |
3077 |
XM_STORE(ip,ntracks)=sngl(xm(ip)) |
XM_STORE(ip,ntracks)=sngl(xm(ip)) |
3078 |
YM_STORE(ip,ntracks)=sngl(ym(ip)) |
YM_STORE(ip,ntracks)=sngl(ym(ip)) |
3079 |
ZM_STORE(ip,ntracks)=sngl(zm(ip)) |
ZM_STORE(ip,ntracks)=sngl(zm(ip)) |
3118 |
enddo |
enddo |
3119 |
enddo |
enddo |
3120 |
|
|
3121 |
RCHI2_STORE(ntracks)=chi2 |
RCHI2_STORE(ntracks)=REAL(chi2) |
3122 |
|
|
3123 |
* -------------------------------- |
* -------------------------------- |
3124 |
* STORE candidate TRACK INFO - end |
* STORE candidate TRACK INFO - end |
3186 |
character*10 PFA |
character*10 PFA |
3187 |
common/FINALPFA/PFA |
common/FINALPFA/PFA |
3188 |
|
|
3189 |
|
double precision xmm,rxmm,xmm_A,xmm_B !EM GCC4.7 |
3190 |
|
double precision ymm,rymm,ymm_A,ymm_B !EM GCC4.7 |
3191 |
|
double precision zmm,zmm_A,zmm_B !EM GCC4.7 |
3192 |
|
double precision clincnewc !EM GCC4.7 |
3193 |
|
double precision clincnew !EM GCC4.7 |
3194 |
|
|
3195 |
real k(6) |
real k(6) |
3196 |
DATA k/1.099730,0.418900,0.220939,0.220907,0.418771,1.100674/ |
DATA k/1.099730,0.418900,0.220939,0.220907,0.418771,1.100674/ |
3197 |
|
|
3410 |
idm = id |
idm = id |
3411 |
dedxmmx = sgnl(icx)/mip(VIEW(icx),LADDER(icx)) !(1)(2) |
dedxmmx = sgnl(icx)/mip(VIEW(icx),LADDER(icx)) !(1)(2) |
3412 |
dedxmmy = sgnl(icy)/mip(VIEW(icy),LADDER(icy)) !(1)(2) |
dedxmmy = sgnl(icy)/mip(VIEW(icy),LADDER(icy)) !(1)(2) |
3413 |
clincnewc=10*sqrt(rymm**2+rxmm**2 |
clincnewc=10.*dsqrt(rymm**2+rxmm**2 |
3414 |
$ +RCHI2_STORE(ibest)*k(ip)*(cov(1,1)+cov(2,2))) |
$ +DBLE(RCHI2_STORE(ibest)*k(ip)*(cov(1,1)+cov(2,2))))! EM GCC4.7 |
3415 |
endif |
endif |
3416 |
1188 continue |
1188 continue |
3417 |
enddo !end loop on couples on plane icp |
enddo !end loop on couples on plane icp |
3579 |
if(iclm.ne.0)then |
if(iclm.ne.0)then |
3580 |
if(mod(VIEW(iclm),2).eq.0)then |
if(mod(VIEW(iclm),2).eq.0)then |
3581 |
clincnew= |
clincnew= |
3582 |
$ 20* |
$ 20.* !EM GCC4.7 |
3583 |
$ sqrt(rxmm**2+RCHI2_STORE(ibest)*k(ip)*cov(1,1)) |
$ dsqrt(rxmm**2 + |
3584 |
|
$ DBLE(RCHI2_STORE(ibest)*k(ip))*cov(1,1)) |
3585 |
else if(mod(VIEW(iclm),2).ne.0)then |
else if(mod(VIEW(iclm),2).ne.0)then |
3586 |
clincnew= |
clincnew= |
3587 |
$ 10* |
$ 10.* !EM GCC4.7 |
3588 |
$ sqrt(rymm**2+RCHI2_STORE(ibest)*k(ip)*cov(2,2)) |
$ dsqrt(rymm**2 + |
3589 |
|
$ DBLE(RCHI2_STORE(ibest)*k(ip))*cov(2,2)) |
3590 |
endif |
endif |
3591 |
|
|
3592 |
if(distmin.le.clincnew)then |
if(distmin.le.clincnew)then |
3835 |
character*10 PFA |
character*10 PFA |
3836 |
common/FINALPFA/PFA |
common/FINALPFA/PFA |
3837 |
|
|
3838 |
real sinth,phi,pig |
real sinth,phi,pig, npig ! EM GCC4.7 |
3839 |
integer ssensor,sladder |
integer ssensor,sladder |
3840 |
pig=acos(-1.) |
pig=acos(-1.) |
3841 |
|
|
3845 |
chi2_nt(ntr) = sngl(chi2) |
chi2_nt(ntr) = sngl(chi2) |
3846 |
nstep_nt(ntr) = nstep |
nstep_nt(ntr) = nstep |
3847 |
* ------------------------------------- |
* ------------------------------------- |
3848 |
phi = al(4) |
phi = REAL(al(4)) |
3849 |
sinth = al(3) |
sinth = REAL(al(3)) |
3850 |
if(sinth.lt.0)then |
if(sinth.lt.0)then |
3851 |
sinth = -sinth |
sinth = -sinth |
3852 |
phi = phi + pig |
phi = phi + pig |
3916 |
if(ip.eq.6.and.ssensor.ne.0)ssensor = 3 - ssensor !notazione paolo x align |
if(ip.eq.6.and.ssensor.ne.0)ssensor = 3 - ssensor !notazione paolo x align |
3917 |
LS(IP,ntr) = ssensor+10*sladder |
LS(IP,ntr) = ssensor+10*sladder |
3918 |
|
|
3919 |
if(id.ne.0)then |
c if(id.ne.0)then |
3920 |
|
CCCCCC(10 novembre 2009) PATCH X NUCLEI |
3921 |
|
C non ho capito perche', ma durante il ritracciamento dei nuclei |
3922 |
|
C (quando una traccia viene trovata ma non e' buona) c'e' qualche variabile |
3923 |
|
C che non viene reinizializzata correttamente e i cluster esclusi |
3924 |
|
C dal fit risultano ancora inclusi... |
3925 |
|
C |
3926 |
|
cltrx(ip,ntr) = 0 |
3927 |
|
cltry(ip,ntr) = 0 |
3928 |
|
c$$$ if( |
3929 |
|
c$$$ $ xgood_nt(ip,ntr).eq.1.and.ygood_nt(ip,ntr).eq.1 |
3930 |
|
c$$$ $ .and. |
3931 |
|
c$$$ $ id.ne.0)then |
3932 |
|
if(id.ne.0)then !patch 30/12/09 |
3933 |
|
|
3934 |
c >>> is a couple |
c >>> is a couple |
3935 |
cltrx(ip,ntr) = clx(nplanes-ip+1,icp_cp(id)) |
cltrx(ip,ntr) = clx(nplanes-ip+1,icp_cp(id)) |
3936 |
cltry(ip,ntr) = cly(nplanes-ip+1,icp_cp(id)) |
cltry(ip,ntr) = cly(nplanes-ip+1,icp_cp(id)) |
3939 |
|
|
3940 |
cl_used(cltrx(ip,ntr)) = 1 !tag used clusters |
cl_used(cltrx(ip,ntr)) = 1 !tag used clusters |
3941 |
|
|
3942 |
xbad(ip,ntr)= nbadstrips(4,clx(nplanes-ip+1,icp_cp(id))) |
xbad(ip,ntr)= nbadstrips(4,clx(nplanes-ip+1,icp_cp(id))) |
3943 |
|
|
3944 |
if(nsatstrips(clx(nplanes-ip+1,icp_cp(id))).gt.0) |
if(nsatstrips(clx(nplanes-ip+1,icp_cp(id))).gt.0) |
3945 |
$ dedx_x(ip,ntr)=-dedx_x(ip,ntr) |
$ dedx_x(ip,ntr)=-dedx_x(ip,ntr) |
3969 |
ypu(ip,ntr) = corr |
ypu(ip,ntr) = corr |
3970 |
endif |
endif |
3971 |
|
|
3972 |
elseif(icl.ne.0)then |
c$$$ elseif(icl.ne.0)then |
3973 |
|
endif !patch 30/12/09 |
3974 |
|
if(icl.ne.0)then !patch 30/12/09 |
3975 |
|
|
3976 |
cl_used(icl) = 1 !tag used clusters |
cl_used(icl) = 1 !tag used clusters |
3977 |
|
|
4069 |
do is=1,2 |
do is=1,2 |
4070 |
c call xyz_PAM(icl,0,is,'COG1',' ',0.,0.) |
c call xyz_PAM(icl,0,is,'COG1',' ',0.,0.) |
4071 |
c call xyz_PAM(icl,0,is,PFAdef,' ',0.,0.) |
c call xyz_PAM(icl,0,is,PFAdef,' ',0.,0.) |
4072 |
call xyz_PAM(icl,0,is,PFAdef,' ',0.,0.,0.,0.) |
call xyz_PAM(icl,0,is,PFAdef,' ',0.,0.,0.,0.) |
4073 |
xs(is,nclsx) = (xPAM_A+xPAM_B)/2 |
xs(is,nclsx) = REAL((xPAM_A+xPAM_B)/2.) ! EM GCC4.7 |
4074 |
enddo |
enddo |
4075 |
else !=== Y views |
else !=== Y views |
4076 |
nclsy = nclsy + 1 |
nclsy = nclsy + 1 |
4085 |
do is=1,2 |
do is=1,2 |
4086 |
c call xyz_PAM(0,icl,is,' ','COG1',0.,0.) |
c call xyz_PAM(0,icl,is,' ','COG1',0.,0.) |
4087 |
c call xyz_PAM(0,icl,is,' ',PFAdef,0.,0.) |
c call xyz_PAM(0,icl,is,' ',PFAdef,0.,0.) |
4088 |
call xyz_PAM(0,icl,is,' ',PFAdef,0.,0.,0.,0.) |
call xyz_PAM(0,icl,is,' ',PFAdef,0.,0.,0.,0.) |
4089 |
ys(is,nclsy) = (yPAM_A+yPAM_B)/2 |
ys(is,nclsy) = REAL((yPAM_A+yPAM_B)/2.) ! EM GCC4.7 |
4090 |
enddo |
enddo |
4091 |
endif |
endif |
4092 |
endif |
endif |
4162 |
alfayz2_av_nt(iyz)=alfayz2_av(iyz) |
alfayz2_av_nt(iyz)=alfayz2_av(iyz) |
4163 |
nnn=nnn+ptcloud_yz(iyz) |
nnn=nnn+ptcloud_yz(iyz) |
4164 |
enddo |
enddo |
4165 |
do ipt=1,nnn |
do ipt=1,min(ndblt_max_nt,nnn) |
4166 |
db_cloud_nt(ipt)=db_cloud(ipt) |
db_cloud_nt(ipt)=db_cloud(ipt) |
4167 |
enddo |
enddo |
4168 |
endif |
endif |
4175 |
alfaxz3_av_nt(ixz)=alfaxz3_av(ixz) |
alfaxz3_av_nt(ixz)=alfaxz3_av(ixz) |
4176 |
nnn=nnn+ptcloud_xz(ixz) |
nnn=nnn+ptcloud_xz(ixz) |
4177 |
enddo |
enddo |
4178 |
do ipt=1,nnn |
do ipt=1,min(ntrpt_max_nt,nnn) |
4179 |
tr_cloud_nt(ipt)=tr_cloud(ipt) |
tr_cloud_nt(ipt)=tr_cloud(ipt) |
4180 |
enddo |
enddo |
4181 |
endif |
endif |