| 578 |
|
|
| 579 |
|
|
| 580 |
parameter (ndivx=30) |
parameter (ndivx=30) |
| 581 |
|
|
| 582 |
|
|
| 583 |
|
c$$$ print*,icx,icy,sensor,PFAx,PFAy,ax,ay,bfx,bfy |
| 584 |
|
|
| 585 |
resxPAM = 0 |
resxPAM = 0 |
| 586 |
resyPAM = 0 |
resyPAM = 0 |
| 596 |
zPAM_B = 0. |
zPAM_B = 0. |
| 597 |
c print*,'## xyz_PAM: ',icx,icy,sensor,PFAx,PFAy,angx,angy |
c print*,'## xyz_PAM: ',icx,icy,sensor,PFAx,PFAy,angx,angy |
| 598 |
|
|
| 599 |
|
if(sensor.lt.1.or.sensor.gt.2)then |
| 600 |
|
print*,'xyz_PAM ***ERROR*** wrong input ' |
| 601 |
|
print*,'sensor ',sensor |
| 602 |
|
icx=0 |
| 603 |
|
icy=0 |
| 604 |
|
endif |
| 605 |
|
|
| 606 |
* ----------------- |
* ----------------- |
| 607 |
* CLUSTER X |
* CLUSTER X |
| 608 |
* ----------------- |
* ----------------- |
|
|
|
| 609 |
if(icx.ne.0)then |
if(icx.ne.0)then |
| 610 |
|
|
| 611 |
viewx = VIEW(icx) |
viewx = VIEW(icx) |
| 613 |
nplx = npl(VIEW(icx)) |
nplx = npl(VIEW(icx)) |
| 614 |
resxPAM = RESXAV |
resxPAM = RESXAV |
| 615 |
stripx = float(MAXS(icx)) |
stripx = float(MAXS(icx)) |
| 616 |
|
|
| 617 |
|
if( |
| 618 |
|
$ viewx.lt.1.or. |
| 619 |
|
$ viewx.gt.12.or. |
| 620 |
|
$ nldx.lt.1.or. |
| 621 |
|
$ nldx.gt.3.or. |
| 622 |
|
$ stripx.lt.1.or. |
| 623 |
|
$ stripx.gt.3072.or. |
| 624 |
|
$ .false.)then |
| 625 |
|
print*,'xyz_PAM ***ERROR*** wrong input ' |
| 626 |
|
print*,'icx ',icx,'view ',viewx,'nld ',nldx,'strip ',stripx |
| 627 |
|
icx = 0 |
| 628 |
|
goto 10 |
| 629 |
|
endif |
| 630 |
|
|
| 631 |
* -------------------------- |
* -------------------------- |
| 632 |
* magnetic-field corrections |
* magnetic-field corrections |
| 633 |
* -------------------------- |
* -------------------------- |
| 688 |
elseif(PFAx.eq.'ETA2')then |
elseif(PFAx.eq.'ETA2')then |
| 689 |
|
|
| 690 |
stripx = stripx + pfaeta2(icx,angx) |
stripx = stripx + pfaeta2(icx,angx) |
| 691 |
resxPAM = risx_eta2(abs(angx)) |
resxPAM = risxeta2(abs(angx)) |
| 692 |
resxPAM = resxPAM*fbad_cog(2,icx) |
resxPAM = resxPAM*fbad_cog(2,icx) |
| 693 |
if(DEBUG.and.fbad_cog(2,icx).ne.1) |
if(DEBUG.and.fbad_cog(2,icx).ne.1) |
| 694 |
$ print*,'BAD icx >>> ',viewx,fbad_cog(2,icx) |
$ print*,'BAD icx >>> ',viewx,fbad_cog(2,icx) |
| 696 |
elseif(PFAx.eq.'ETA3')then |
elseif(PFAx.eq.'ETA3')then |
| 697 |
|
|
| 698 |
stripx = stripx + pfaeta3(icx,angx) |
stripx = stripx + pfaeta3(icx,angx) |
| 699 |
resxPAM = risx_eta3(abs(angx)) |
resxPAM = risxeta3(abs(angx)) |
| 700 |
resxPAM = resxPAM*fbad_cog(3,icx) |
resxPAM = resxPAM*fbad_cog(3,icx) |
| 701 |
if(DEBUG.and.fbad_cog(3,icx).ne.1) |
if(DEBUG.and.fbad_cog(3,icx).ne.1) |
| 702 |
$ print*,'BAD icx >>> ',viewx,fbad_cog(3,icx) |
$ print*,'BAD icx >>> ',viewx,fbad_cog(3,icx) |
| 704 |
elseif(PFAx.eq.'ETA4')then |
elseif(PFAx.eq.'ETA4')then |
| 705 |
|
|
| 706 |
stripx = stripx + pfaeta4(icx,angx) |
stripx = stripx + pfaeta4(icx,angx) |
| 707 |
resxPAM = risx_eta4(abs(angx)) |
resxPAM = risxeta4(abs(angx)) |
| 708 |
resxPAM = resxPAM*fbad_cog(4,icx) |
resxPAM = resxPAM*fbad_cog(4,icx) |
| 709 |
if(DEBUG.and.fbad_cog(4,icx).ne.1) |
if(DEBUG.and.fbad_cog(4,icx).ne.1) |
| 710 |
$ print*,'BAD icx >>> ',viewx,fbad_cog(4,icx) |
$ print*,'BAD icx >>> ',viewx,fbad_cog(4,icx) |
| 712 |
elseif(PFAx.eq.'ETA')then |
elseif(PFAx.eq.'ETA')then |
| 713 |
|
|
| 714 |
stripx = stripx + pfaeta(icx,angx) |
stripx = stripx + pfaeta(icx,angx) |
| 715 |
resxPAM = ris_eta(icx,angx) |
c resxPAM = riseta(icx,angx) |
| 716 |
|
resxPAM = riseta(viewx,angx) |
| 717 |
resxPAM = resxPAM*fbad_eta(icx,angx) |
resxPAM = resxPAM*fbad_eta(icx,angx) |
| 718 |
if(DEBUG.and.fbad_cog(2,icx).ne.1) |
if(DEBUG.and.fbad_cog(2,icx).ne.1) |
| 719 |
$ print*,'BAD icx >>> ',viewx,fbad_cog(2,icx) |
$ print*,'BAD icx >>> ',viewx,fbad_cog(2,icx) |
| 740 |
c$$$ print*,icx,' *** ',resxPAM |
c$$$ print*,icx,' *** ',resxPAM |
| 741 |
endif |
endif |
| 742 |
|
|
| 743 |
endif |
10 endif |
| 744 |
|
|
| 745 |
|
|
| 746 |
* ----------------- |
* ----------------- |
| 747 |
* CLUSTER Y |
* CLUSTER Y |
| 748 |
* ----------------- |
* ----------------- |
| 755 |
resyPAM = RESYAV |
resyPAM = RESYAV |
| 756 |
stripy = float(MAXS(icy)) |
stripy = float(MAXS(icy)) |
| 757 |
|
|
| 758 |
|
if( |
| 759 |
|
$ viewy.lt.1.or. |
| 760 |
|
$ viewy.gt.12.or. |
| 761 |
|
$ nldy.lt.1.or. |
| 762 |
|
$ nldy.gt.3.or. |
| 763 |
|
$ stripy.lt.1.or. |
| 764 |
|
$ stripy.gt.3072.or. |
| 765 |
|
$ .false.)then |
| 766 |
|
print*,'xyz_PAM ***ERROR*** wrong input ' |
| 767 |
|
print*,'icy ',icy,'view ',viewy,'nld ',nldy,'strip ',stripy |
| 768 |
|
icy = 0 |
| 769 |
|
goto 20 |
| 770 |
|
endif |
| 771 |
|
|
| 772 |
if(icx.ne.0.and.(nply.ne.nplx.or.nldy.ne.nldx))then |
if(icx.ne.0.and.(nply.ne.nplx.or.nldy.ne.nldx))then |
| 773 |
if(DEBUG) then |
if(DEBUG) then |
| 774 |
print*,'xyz_PAM ***ERROR*** invalid cluster couple!!! ' |
print*,'xyz_PAM ***ERROR*** invalid cluster couple!!! ' |
| 822 |
elseif(PFAy.eq.'ETA2')then |
elseif(PFAy.eq.'ETA2')then |
| 823 |
|
|
| 824 |
stripy = stripy + pfaeta2(icy,angy) |
stripy = stripy + pfaeta2(icy,angy) |
| 825 |
resyPAM = risy_eta2(abs(angy)) |
resyPAM = risyeta2(abs(angy)) |
| 826 |
resyPAM = resyPAM*fbad_cog(2,icy) |
resyPAM = resyPAM*fbad_cog(2,icy) |
| 827 |
if(DEBUG.and.fbad_cog(2,icy).ne.1) |
if(DEBUG.and.fbad_cog(2,icy).ne.1) |
| 828 |
$ print*,'BAD icy >>> ',viewy,fbad_cog(2,icy) |
$ print*,'BAD icy >>> ',viewy,fbad_cog(2,icy) |
| 844 |
elseif(PFAy.eq.'ETA')then |
elseif(PFAy.eq.'ETA')then |
| 845 |
|
|
| 846 |
stripy = stripy + pfaeta(icy,angy) |
stripy = stripy + pfaeta(icy,angy) |
| 847 |
resyPAM = ris_eta(icy,angy) |
c resyPAM = riseta(icy,angy) |
| 848 |
|
resyPAM = riseta(viewy,angy) |
| 849 |
resyPAM = resyPAM*fbad_eta(icy,angy) |
resyPAM = resyPAM*fbad_eta(icy,angy) |
| 850 |
if(DEBUG.and.fbad_cog(2,icy).ne.1) |
if(DEBUG.and.fbad_cog(2,icy).ne.1) |
| 851 |
$ print*,'BAD icy >>> ',viewy,fbad_cog(2,icy) |
$ print*,'BAD icy >>> ',viewy,fbad_cog(2,icy) |
| 873 |
endif |
endif |
| 874 |
|
|
| 875 |
|
|
| 876 |
endif |
20 endif |
| 877 |
|
|
| 878 |
c print*,'## stripx,stripy ',stripx,stripy |
c$$$ print*,'## stripx,stripy ',stripx,stripy |
| 879 |
|
|
| 880 |
c=========================================================== |
c=========================================================== |
| 881 |
C COUPLE |
C COUPLE |
| 1091 |
100 continue |
100 continue |
| 1092 |
end |
end |
| 1093 |
|
|
| 1094 |
|
************************************************************************ |
| 1095 |
|
* Call xyz_PAM subroutine with default PFA and fill the mini2 common. |
| 1096 |
|
* (done to be called from c/c++) |
| 1097 |
|
************************************************************************ |
| 1098 |
|
|
| 1099 |
|
subroutine xyzpam(ip,icx,icy,lad,sensor,ax,ay,bfx,bfy) |
| 1100 |
|
|
| 1101 |
|
include 'commontracker.f' |
| 1102 |
|
include 'level1.f' |
| 1103 |
|
include 'common_mini_2.f' |
| 1104 |
|
include 'common_xyzPAM.f' |
| 1105 |
|
include 'common_mech.f' |
| 1106 |
|
include 'calib.f' |
| 1107 |
|
|
| 1108 |
|
* flag to chose PFA |
| 1109 |
|
c$$$ character*10 PFA |
| 1110 |
|
c$$$ common/FINALPFA/PFA |
| 1111 |
|
|
| 1112 |
|
integer icx,icy !X-Y cluster ID |
| 1113 |
|
integer sensor |
| 1114 |
|
character*4 PFAx,PFAy !PFA to be used |
| 1115 |
|
real ax,ay !X-Y geometric angle |
| 1116 |
|
real bfx,bfy !X-Y b-field components |
| 1117 |
|
|
| 1118 |
|
ipx=0 |
| 1119 |
|
ipy=0 |
| 1120 |
|
|
| 1121 |
|
c$$$ PFAx = 'COG4'!PFA |
| 1122 |
|
c$$$ PFAy = 'COG4'!PFA |
| 1123 |
|
|
| 1124 |
|
if(icx.gt.nclstr1.or.icy.gt.nclstr1)then |
| 1125 |
|
print*,'xyzpam: ***WARNING*** clusters ',icx,icy |
| 1126 |
|
$ ,' does not exists (nclstr1=',nclstr1,')' |
| 1127 |
|
icx = -1*icx |
| 1128 |
|
icy = -1*icy |
| 1129 |
|
return |
| 1130 |
|
|
| 1131 |
|
endif |
| 1132 |
|
|
| 1133 |
|
call idtoc(pfaid,PFAx) |
| 1134 |
|
call idtoc(pfaid,PFAy) |
| 1135 |
|
|
| 1136 |
|
c$$$ call xyz_PAM(icx,icy,sensor,PFAx,PFAy,ax,ay,bfx,bfy) |
| 1137 |
|
|
| 1138 |
|
c$$$ print*,icx,icy,sensor,PFAx,PFAy,ax,ay,bfx,bfy |
| 1139 |
|
|
| 1140 |
|
if(icx.ne.0.and.icy.ne.0)then |
| 1141 |
|
|
| 1142 |
|
ipx=npl(VIEW(icx)) |
| 1143 |
|
ipy=npl(VIEW(icy)) |
| 1144 |
|
c$$$ if( (nplanes-ipx+1).ne.ip.or.(nplanes-ipy+1).ne.ip ) |
| 1145 |
|
c$$$ $ print*,'xyzpam: ***WARNING*** clusters ',icx,icy |
| 1146 |
|
c$$$ $ ,' does not belong to the correct plane: ',ip,ipx,ipy |
| 1147 |
|
|
| 1148 |
|
if( (nplanes-ipx+1).ne.ip )then |
| 1149 |
|
print*,'xyzpam: ***WARNING*** cluster ',icx |
| 1150 |
|
$ ,' does not belong to plane: ',ip |
| 1151 |
|
icx = -1*icx |
| 1152 |
|
return |
| 1153 |
|
endif |
| 1154 |
|
if( (nplanes-ipy+1).ne.ip )then |
| 1155 |
|
print*,'xyzpam: ***WARNING*** cluster ',icy |
| 1156 |
|
$ ,' does not belong to plane: ',ip |
| 1157 |
|
icy = -1*icy |
| 1158 |
|
return |
| 1159 |
|
endif |
| 1160 |
|
|
| 1161 |
|
call xyz_PAM(icx,icy,sensor,PFAx,PFAy,ax,ay,bfx,bfy) |
| 1162 |
|
|
| 1163 |
|
xgood(ip) = 1. |
| 1164 |
|
ygood(ip) = 1. |
| 1165 |
|
resx(ip) = resxPAM |
| 1166 |
|
resy(ip) = resyPAM |
| 1167 |
|
|
| 1168 |
|
xm(ip) = xPAM |
| 1169 |
|
ym(ip) = yPAM |
| 1170 |
|
zm(ip) = zPAM |
| 1171 |
|
xm_A(ip) = 0. |
| 1172 |
|
ym_A(ip) = 0. |
| 1173 |
|
xm_B(ip) = 0. |
| 1174 |
|
ym_B(ip) = 0. |
| 1175 |
|
|
| 1176 |
|
c zv(ip) = zPAM |
| 1177 |
|
|
| 1178 |
|
elseif(icx.eq.0.and.icy.ne.0)then |
| 1179 |
|
|
| 1180 |
|
ipy=npl(VIEW(icy)) |
| 1181 |
|
c$$$ if((nplanes-ipy+1).ne.ip) |
| 1182 |
|
c$$$ $ print*,'xyzpam: ***WARNING*** clusters ',icx,icy |
| 1183 |
|
c$$$ $ ,' does not belong to the correct plane: ',ip,ipx,ipy |
| 1184 |
|
if( (nplanes-ipy+1).ne.ip )then |
| 1185 |
|
print*,'xyzpam: ***WARNING*** cluster ',icy |
| 1186 |
|
$ ,' does not belong to plane: ',ip |
| 1187 |
|
icy = -1*icy |
| 1188 |
|
return |
| 1189 |
|
endif |
| 1190 |
|
|
| 1191 |
|
call xyz_PAM(icx,icy,sensor,PFAx,PFAy,ax,ay,bfx,bfy) |
| 1192 |
|
|
| 1193 |
|
xgood(ip) = 0. |
| 1194 |
|
ygood(ip) = 1. |
| 1195 |
|
resx(ip) = 1000. |
| 1196 |
|
resy(ip) = resyPAM |
| 1197 |
|
|
| 1198 |
|
xm(ip) = -100. |
| 1199 |
|
ym(ip) = -100. |
| 1200 |
|
zm(ip) = (zPAM_A+zPAM_B)/2. |
| 1201 |
|
xm_A(ip) = xPAM_A |
| 1202 |
|
ym_A(ip) = yPAM_A |
| 1203 |
|
xm_B(ip) = xPAM_B |
| 1204 |
|
ym_B(ip) = yPAM_B |
| 1205 |
|
|
| 1206 |
|
c zv(ip) = (zPAM_A+zPAM_B)/2. |
| 1207 |
|
|
| 1208 |
|
elseif(icx.ne.0.and.icy.eq.0)then |
| 1209 |
|
|
| 1210 |
|
ipx=npl(VIEW(icx)) |
| 1211 |
|
c$$$ if((nplanes-ipx+1).ne.ip) |
| 1212 |
|
c$$$ $ print*,'xyzpam: ***WARNING*** clusters ',icx,icy |
| 1213 |
|
c$$$ $ ,' does not belong to the correct plane: ',ip,ipx,ipy |
| 1214 |
|
|
| 1215 |
|
if( (nplanes-ipx+1).ne.ip )then |
| 1216 |
|
print*,'xyzpam: ***WARNING*** cluster ',icx |
| 1217 |
|
$ ,' does not belong to plane: ',ip |
| 1218 |
|
icx = -1*icx |
| 1219 |
|
return |
| 1220 |
|
endif |
| 1221 |
|
|
| 1222 |
|
call xyz_PAM(icx,icy,sensor,PFAx,PFAy,ax,ay,bfx,bfy) |
| 1223 |
|
|
| 1224 |
|
xgood(ip) = 1. |
| 1225 |
|
ygood(ip) = 0. |
| 1226 |
|
resx(ip) = resxPAM |
| 1227 |
|
resy(ip) = 1000. |
| 1228 |
|
|
| 1229 |
|
xm(ip) = -100. |
| 1230 |
|
ym(ip) = -100. |
| 1231 |
|
zm(ip) = (zPAM_A+zPAM_B)/2. |
| 1232 |
|
xm_A(ip) = xPAM_A |
| 1233 |
|
ym_A(ip) = yPAM_A |
| 1234 |
|
xm_B(ip) = xPAM_B |
| 1235 |
|
ym_B(ip) = yPAM_B |
| 1236 |
|
|
| 1237 |
|
c zv(ip) = (zPAM_A+zPAM_B)/2. |
| 1238 |
|
|
| 1239 |
|
else |
| 1240 |
|
|
| 1241 |
|
il = 2 |
| 1242 |
|
if(lad.ne.0)il=lad |
| 1243 |
|
is = 1 |
| 1244 |
|
if(sensor.ne.0)is=sensor |
| 1245 |
|
c print*,nplanes-ip+1,il,is |
| 1246 |
|
|
| 1247 |
|
xgood(ip) = 0. |
| 1248 |
|
ygood(ip) = 0. |
| 1249 |
|
resx(ip) = 1000. |
| 1250 |
|
resy(ip) = 1000. |
| 1251 |
|
|
| 1252 |
|
xm(ip) = -100. |
| 1253 |
|
ym(ip) = -100. |
| 1254 |
|
zm(ip) = z_mech_sensor(nplanes-ip+1,il,is)*1000./1.d4 |
| 1255 |
|
xm_A(ip) = 0. |
| 1256 |
|
ym_A(ip) = 0. |
| 1257 |
|
xm_B(ip) = 0. |
| 1258 |
|
ym_B(ip) = 0. |
| 1259 |
|
|
| 1260 |
|
c zv(ip) = z_mech_sensor(nplanes-ip+1,il,is)*1000./1.d4 |
| 1261 |
|
|
| 1262 |
|
endif |
| 1263 |
|
|
| 1264 |
|
if(DEBUG)then |
| 1265 |
|
c print*,'----------------------------- track coord' |
| 1266 |
|
22222 format(i2,' * ',3f10.4,' --- ',4f10.4,' --- ',2f4.0,2f10.5) |
| 1267 |
|
write(*,22222)ip,zm(ip),xm(ip),ym(ip) |
| 1268 |
|
$ ,xm_A(ip),ym_A(ip),xm_B(ip),ym_B(ip) |
| 1269 |
|
$ ,xgood(ip),ygood(ip),resx(ip),resy(ip) |
| 1270 |
|
c$$$ print*,'-----------------------------' |
| 1271 |
|
endif |
| 1272 |
|
end |
| 1273 |
|
|
| 1274 |
******************************************************************************** |
******************************************************************************** |
| 1275 |
******************************************************************************** |
******************************************************************************** |
| 1742 |
* mask views with too many clusters |
* mask views with too many clusters |
| 1743 |
do iv=1,nviews |
do iv=1,nviews |
| 1744 |
if( ncl_view(iv).gt. nclusterlimit)then |
if( ncl_view(iv).gt. nclusterlimit)then |
| 1745 |
mask_view(iv) = 1 |
c mask_view(iv) = 1 |
| 1746 |
|
mask_view(iv) = mask_view(iv) + 2**0 |
| 1747 |
if(DEBUG)print*,' * WARNING * cl_to_couple: n.clusters > ' |
if(DEBUG)print*,' * WARNING * cl_to_couple: n.clusters > ' |
| 1748 |
$ ,nclusterlimit,' on view ', iv,' --> masked!' |
$ ,nclusterlimit,' on view ', iv,' --> masked!' |
| 1749 |
endif |
endif |
| 1888 |
$ 'couples on plane ',nplx, |
$ 'couples on plane ',nplx, |
| 1889 |
$ 'exceeds vector dimention ' |
$ 'exceeds vector dimention ' |
| 1890 |
$ ,'( ',ncouplemax,' ) --> masked!' |
$ ,'( ',ncouplemax,' ) --> masked!' |
| 1891 |
mask_view(nviewx(nplx)) = 2 |
c mask_view(nviewx(nplx)) = 2 |
| 1892 |
mask_view(nviewy(nply)) = 2 |
c mask_view(nviewy(nply)) = 2 |
| 1893 |
|
mask_view(nviewx(nplx))= mask_view(nviewx(nplx))+ 2**1 |
| 1894 |
|
mask_view(nviewy(nply))= mask_view(nviewy(nply))+ 2**1 |
| 1895 |
goto 10 |
goto 10 |
| 1896 |
endif |
endif |
| 1897 |
|
|
| 1992 |
* -------------------------------------------- |
* -------------------------------------------- |
| 1993 |
do ip=1,nplanes |
do ip=1,nplanes |
| 1994 |
if(ncp_plane(ip).gt.ncouplelimit)then |
if(ncp_plane(ip).gt.ncouplelimit)then |
| 1995 |
mask_view(nviewx(ip)) = 8 |
c mask_view(nviewx(ip)) = 8 |
| 1996 |
mask_view(nviewy(ip)) = 8 |
c mask_view(nviewy(ip)) = 8 |
| 1997 |
|
mask_view(nviewx(ip)) = mask_view(nviewx(ip)) + 2**7 |
| 1998 |
|
mask_view(nviewy(ip)) = mask_view(nviewy(ip)) + 2**7 |
| 1999 |
endif |
endif |
| 2000 |
enddo |
enddo |
| 2001 |
|
|
| 2048 |
c good2=.false. |
c good2=.false. |
| 2049 |
c goto 880 !fill ntp and go to next event |
c goto 880 !fill ntp and go to next event |
| 2050 |
do iv=1,12 |
do iv=1,12 |
| 2051 |
mask_view(iv) = 3 |
c mask_view(iv) = 3 |
| 2052 |
|
mask_view(iv) = mask_view(iv)+ 2**2 |
| 2053 |
enddo |
enddo |
| 2054 |
iflag=1 |
iflag=1 |
| 2055 |
return |
return |
| 2128 |
c good2=.false. |
c good2=.false. |
| 2129 |
c goto 880 !fill ntp and go to next event |
c goto 880 !fill ntp and go to next event |
| 2130 |
do iv=1,nviews |
do iv=1,nviews |
| 2131 |
mask_view(iv) = 4 |
c mask_view(iv) = 4 |
| 2132 |
|
mask_view(iv)=mask_view(iv)+ 2**3 |
| 2133 |
enddo |
enddo |
| 2134 |
iflag=1 |
iflag=1 |
| 2135 |
return |
return |
| 2363 |
c good2=.false. |
c good2=.false. |
| 2364 |
c goto 880 !fill ntp and go to next event |
c goto 880 !fill ntp and go to next event |
| 2365 |
do iv=1,nviews |
do iv=1,nviews |
| 2366 |
mask_view(iv) = 5 |
c mask_view(iv) = 5 |
| 2367 |
|
mask_view(iv) = mask_view(iv) + 2**4 |
| 2368 |
enddo |
enddo |
| 2369 |
iflag=1 |
iflag=1 |
| 2370 |
return |
return |
| 2586 |
c good2=.false. |
c good2=.false. |
| 2587 |
c goto 880 !fill ntp and go to next event |
c goto 880 !fill ntp and go to next event |
| 2588 |
do iv=1,nviews |
do iv=1,nviews |
| 2589 |
mask_view(iv) = 6 |
c mask_view(iv) = 6 |
| 2590 |
|
mask_view(iv) = mask_view(iv) + 2**5 |
| 2591 |
enddo |
enddo |
| 2592 |
iflag=1 |
iflag=1 |
| 2593 |
return |
return |
| 2920 |
c good2=.false. |
c good2=.false. |
| 2921 |
c goto 880 !fill ntp and go to next event |
c goto 880 !fill ntp and go to next event |
| 2922 |
do iv=1,nviews |
do iv=1,nviews |
| 2923 |
mask_view(iv) = 7 |
c mask_view(iv) = 7 |
| 2924 |
|
mask_view(iv) = mask_view(iv) + 2**6 |
| 2925 |
enddo |
enddo |
| 2926 |
iflag=1 |
iflag=1 |
| 2927 |
return |
return |
| 3755 |
c >>> is a couple |
c >>> is a couple |
| 3756 |
cltrx(ip,ntr) = clx(nplanes-ip+1,icp_cp(id)) |
cltrx(ip,ntr) = clx(nplanes-ip+1,icp_cp(id)) |
| 3757 |
cltry(ip,ntr) = cly(nplanes-ip+1,icp_cp(id)) |
cltry(ip,ntr) = cly(nplanes-ip+1,icp_cp(id)) |
| 3758 |
|
|
| 3759 |
|
c$$$ nnnnx = npfastrips(clx(nplanes-ip+1,icp_cp(id)),PFA,angx) |
| 3760 |
|
c$$$ nnnny = npfastrips(cly(nplanes-ip+1,icp_cp(id)),PFA,angy) |
| 3761 |
|
c$$$ xbad(ip,ntr)= nbadstrips(nnnnx,clx(nplanes-ip+1,icp_cp(id))) |
| 3762 |
|
c$$$ ybad(ip,ntr)= nbadstrips(nnnny,cly(nplanes-ip+1,icp_cp(id))) |
| 3763 |
|
xbad(ip,ntr)= nbadstrips(4,clx(nplanes-ip+1,icp_cp(id))) |
| 3764 |
|
ybad(ip,ntr)= nbadstrips(4,cly(nplanes-ip+1,icp_cp(id))) |
| 3765 |
|
|
|
c$$$ if(is_cp(id).ne.ssensor) |
|
|
c$$$ $ print*,'ERROR is sensor assignment (couple)' |
|
|
c$$$ $ ,is_cp(id),ssensor |
|
|
c$$$ if(LADDER(clx(nplanes-ip+1,icp_cp(id))).ne.sladder) |
|
|
c$$$ $ print*,'ERROR is ladder assignment (couple)' |
|
|
c$$$ $ ,LADDER(clx(nplanes-ip+1,icp_cp(id))),sladder |
|
|
|
|
|
nnnnx = npfastrips(clx(nplanes-ip+1,icp_cp(id)),PFA,angx) |
|
|
nnnny = npfastrips(cly(nplanes-ip+1,icp_cp(id)),PFA,angy) |
|
|
xbad(ip,ntr)= nbadstrips(nnnnx,clx(nplanes-ip+1,icp_cp(id))) |
|
|
ybad(ip,ntr)= nbadstrips(nnnny,cly(nplanes-ip+1,icp_cp(id))) |
|
| 3766 |
|
|
| 3767 |
if(nsatstrips(clx(nplanes-ip+1,icp_cp(id))).gt.0) |
if(nsatstrips(clx(nplanes-ip+1,icp_cp(id))).gt.0) |
| 3768 |
$ dedx_x(ip,ntr)=-dedx_x(ip,ntr) |
$ dedx_x(ip,ntr)=-dedx_x(ip,ntr) |
| 3770 |
$ dedx_y(ip,ntr)=-dedx_y(ip,ntr) |
$ dedx_y(ip,ntr)=-dedx_y(ip,ntr) |
| 3771 |
|
|
| 3772 |
elseif(icl.ne.0)then |
elseif(icl.ne.0)then |
| 3773 |
c >>> is a singlet |
|
|
c$$$ if(LADDER(icl).ne.sladder) |
|
|
c$$$ $ print*,'ERROR is ladder assignment (single)' |
|
|
c$$$ $ ,LADDER(icl),sladder |
|
| 3774 |
if(mod(VIEW(icl),2).eq.0)then |
if(mod(VIEW(icl),2).eq.0)then |
| 3775 |
cltrx(ip,ntr)=icl |
cltrx(ip,ntr)=icl |
| 3776 |
nnnnn = npfastrips(icl,PFA,angx) |
c$$$ nnnnn = npfastrips(icl,PFA,angx) |
| 3777 |
xbad(ip,ntr) = nbadstrips(nnnnn,icl) |
c$$$ xbad(ip,ntr) = nbadstrips(nnnnn,icl) |
| 3778 |
|
xbad(ip,ntr) = nbadstrips(4,icl) |
| 3779 |
|
|
| 3780 |
if(nsatstrips(icl).gt.0)dedx_x(ip,ntr)=-dedx_x(ip,ntr) |
if(nsatstrips(icl).gt.0)dedx_x(ip,ntr)=-dedx_x(ip,ntr) |
| 3781 |
elseif(mod(VIEW(icl),2).eq.1)then |
elseif(mod(VIEW(icl),2).eq.1)then |
| 3782 |
cltry(ip,ntr)=icl |
cltry(ip,ntr)=icl |
| 3783 |
nnnnn = npfastrips(icl,PFA,angy) |
c$$$ nnnnn = npfastrips(icl,PFA,angy) |
| 3784 |
ybad(ip,ntr) = nbadstrips(nnnnn,icl) |
c$$$ ybad(ip,ntr) = nbadstrips(nnnnn,icl) |
| 3785 |
|
ybad(ip,ntr) = nbadstrips(4,icl) |
| 3786 |
if(nsatstrips(icl).gt.0)dedx_y(ip,ntr)=-dedx_y(ip,ntr) |
if(nsatstrips(icl).gt.0)dedx_y(ip,ntr)=-dedx_y(ip,ntr) |
| 3787 |
endif |
endif |
| 3788 |
|
|
| 3789 |
endif |
endif |
| 3790 |
|
|
| 3791 |
enddo |
enddo |
| 3820 |
nclsy = 0 |
nclsy = 0 |
| 3821 |
|
|
| 3822 |
do iv = 1,nviews |
do iv = 1,nviews |
| 3823 |
if( mask_view(iv).ne.0 )good2(iv) = 20+mask_view(iv) |
c if( mask_view(iv).ne.0 )good2(iv) = 20+mask_view(iv) |
| 3824 |
|
good2(iv) = good2(iv) + mask_view(iv)*2**8 |
| 3825 |
enddo |
enddo |
| 3826 |
|
|
| 3827 |
do icl=1,nclstr1 |
do icl=1,nclstr1 |