| 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 |
* -------------------------- |
* -------------------------- |
| 634 |
angtemp = ax |
angtemp = ax |
| 635 |
bfytemp = bfy |
bfytemp = bfy |
| 636 |
if(nplx.eq.6) angtemp = -1. * ax |
* ///////////////////////////////// |
| 637 |
if(nplx.eq.6) bfytemp = -1. * bfy |
* AAAAHHHHHHHH!!!!!!!!!!!!!!!!!!!!! |
| 638 |
|
* *grvzkkjsdgjhhhgngbn###>:( |
| 639 |
|
* ///////////////////////////////// |
| 640 |
|
c if(nplx.eq.6) angtemp = -1. * ax |
| 641 |
|
c if(nplx.eq.6) bfytemp = -1. * bfy |
| 642 |
|
if(viewx.eq.12) angtemp = -1. * ax |
| 643 |
|
if(viewx.eq.12) bfytemp = -1. * bfy |
| 644 |
tgtemp = tan(angtemp*acos(-1.)/180.) + pmuH_h*bfytemp*0.00001 |
tgtemp = tan(angtemp*acos(-1.)/180.) + pmuH_h*bfytemp*0.00001 |
| 645 |
angx = 180.*atan(tgtemp)/acos(-1.) |
angx = 180.*atan(tgtemp)/acos(-1.) |
| 646 |
stripx = stripx - 0.5*pmuH_h*bfytemp*0.00001*SiDimZ/pitchX |
stripx = stripx - 0.5*pmuH_h*bfytemp*0.00001*SiDimZ/pitchX |
| 647 |
c$$$ print*,nplx,ax,bfy/10. |
c$$$ print*,nplx,ax,bfy/10. |
| 648 |
c$$$ print*,angx,0.5*pmuH_h*bfytemp*0.00001*SiDimZ/pitchX |
c$$$ print*,angx,0.5*pmuH_h*bfytemp*0.00001*SiDimZ/pitchX |
| 649 |
c$$$ print*,'========================' |
c$$$ print*,'========================' |
| 650 |
|
c$$$ if(bfy.ne.0.)print*,viewx,'-x- ' |
| 651 |
|
c$$$ $ ,bfy,-1*0.5*pmuH_h*bfytemp*0.00001*SiDimZ |
| 652 |
* -------------------------- |
* -------------------------- |
| 653 |
|
|
| 654 |
c$$$ print*,'--- x-cl ---' |
c$$$ print*,'--- x-cl ---' |
| 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) |
c if(DEBUG.and.fbad_cog(3,icx).ne.1) |
| 702 |
$ print*,'BAD icx >>> ',viewx,fbad_cog(3,icx) |
c $ print*,'BAD icx >>> ',viewx,fbad_cog(3,icx) |
| 703 |
|
|
| 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) |
c if(DEBUG.and.fbad_cog(4,icx).ne.1) |
| 710 |
$ print*,'BAD icx >>> ',viewx,fbad_cog(4,icx) |
c $ print*,'BAD icx >>> ',viewx,fbad_cog(4,icx) |
| 711 |
|
|
| 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) |
c if(DEBUG.and.fbad_cog(2,icx).ne.1) |
| 719 |
$ print*,'BAD icx >>> ',viewx,fbad_cog(2,icx) |
c $ print*,'BAD icx >>> ',viewx,fbad_cog(2,icx) |
| 720 |
|
|
| 721 |
|
elseif(PFAx.eq.'ETAL')then |
| 722 |
|
|
| 723 |
|
stripx = stripx + pfaetal(icx,angx) |
| 724 |
|
resxPAM = riseta(viewx,angx) |
| 725 |
|
resxPAM = resxPAM*fbad_eta(icx,angx) |
| 726 |
|
c if(DEBUG.and.fbad_cog(2,icx).ne.1) |
| 727 |
|
c $ print*,'BAD icx >>> ',viewx,fbad_cog(2,icx) |
| 728 |
|
|
| 729 |
elseif(PFAx.eq.'COG')then |
elseif(PFAx.eq.'COG')then |
| 730 |
|
|
| 748 |
c$$$ print*,icx,' *** ',resxPAM |
c$$$ print*,icx,' *** ',resxPAM |
| 749 |
endif |
endif |
| 750 |
|
|
| 751 |
endif |
10 endif |
| 752 |
|
|
| 753 |
|
|
| 754 |
* ----------------- |
* ----------------- |
| 755 |
* CLUSTER Y |
* CLUSTER Y |
| 756 |
* ----------------- |
* ----------------- |
| 763 |
resyPAM = RESYAV |
resyPAM = RESYAV |
| 764 |
stripy = float(MAXS(icy)) |
stripy = float(MAXS(icy)) |
| 765 |
|
|
| 766 |
|
if( |
| 767 |
|
$ viewy.lt.1.or. |
| 768 |
|
$ viewy.gt.12.or. |
| 769 |
|
$ nldy.lt.1.or. |
| 770 |
|
$ nldy.gt.3.or. |
| 771 |
|
$ stripy.lt.1.or. |
| 772 |
|
$ stripy.gt.3072.or. |
| 773 |
|
$ .false.)then |
| 774 |
|
print*,'xyz_PAM ***ERROR*** wrong input ' |
| 775 |
|
print*,'icy ',icy,'view ',viewy,'nld ',nldy,'strip ',stripy |
| 776 |
|
icy = 0 |
| 777 |
|
goto 20 |
| 778 |
|
endif |
| 779 |
|
|
| 780 |
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 |
| 781 |
if(DEBUG) then |
if(DEBUG) then |
| 782 |
print*,'xyz_PAM ***ERROR*** invalid cluster couple!!! ' |
print*,'xyz_PAM ***ERROR*** invalid cluster couple!!! ' |
| 790 |
tgtemp = tan(ay*acos(-1.)/180.)+pmuH_e*bfx*0.00001 |
tgtemp = tan(ay*acos(-1.)/180.)+pmuH_e*bfx*0.00001 |
| 791 |
angy = 180.*atan(tgtemp)/acos(-1.) |
angy = 180.*atan(tgtemp)/acos(-1.) |
| 792 |
stripy = stripy + 0.5*pmuH_e*bfx*0.00001*SiDimZ/pitchY |
stripy = stripy + 0.5*pmuH_e*bfx*0.00001*SiDimZ/pitchY |
| 793 |
|
c$$$ if(bfx.ne.0.)print*,viewy,'-y- ' |
| 794 |
|
c$$$ $ ,bfx,0.5*pmuH_e*bfx*0.00001*SiDimZ |
| 795 |
* -------------------------- |
* -------------------------- |
| 796 |
|
|
| 797 |
c$$$ print*,'--- y-cl ---' |
c$$$ print*,'--- y-cl ---' |
| 830 |
elseif(PFAy.eq.'ETA2')then |
elseif(PFAy.eq.'ETA2')then |
| 831 |
|
|
| 832 |
stripy = stripy + pfaeta2(icy,angy) |
stripy = stripy + pfaeta2(icy,angy) |
| 833 |
resyPAM = risy_eta2(abs(angy)) |
resyPAM = risyeta2(abs(angy)) |
| 834 |
resyPAM = resyPAM*fbad_cog(2,icy) |
resyPAM = resyPAM*fbad_cog(2,icy) |
| 835 |
if(DEBUG.and.fbad_cog(2,icy).ne.1) |
c if(DEBUG.and.fbad_cog(2,icy).ne.1) |
| 836 |
$ print*,'BAD icy >>> ',viewy,fbad_cog(2,icy) |
c $ print*,'BAD icy >>> ',viewy,fbad_cog(2,icy) |
| 837 |
|
|
| 838 |
elseif(PFAy.eq.'ETA3')then |
elseif(PFAy.eq.'ETA3')then |
| 839 |
|
|
| 840 |
stripy = stripy + pfaeta3(icy,angy) |
stripy = stripy + pfaeta3(icy,angy) |
| 841 |
resyPAM = resyPAM*fbad_cog(3,icy) |
resyPAM = resyPAM*fbad_cog(3,icy) |
| 842 |
if(DEBUG.and.fbad_cog(3,icy).ne.1) |
c if(DEBUG.and.fbad_cog(3,icy).ne.1) |
| 843 |
$ print*,'BAD icy >>> ',viewy,fbad_cog(3,icy) |
c $ print*,'BAD icy >>> ',viewy,fbad_cog(3,icy) |
| 844 |
|
|
| 845 |
elseif(PFAy.eq.'ETA4')then |
elseif(PFAy.eq.'ETA4')then |
| 846 |
|
|
| 847 |
stripy = stripy + pfaeta4(icy,angy) |
stripy = stripy + pfaeta4(icy,angy) |
| 848 |
resyPAM = resyPAM*fbad_cog(4,icy) |
resyPAM = resyPAM*fbad_cog(4,icy) |
| 849 |
if(DEBUG.and.fbad_cog(4,icy).ne.1) |
c if(DEBUG.and.fbad_cog(4,icy).ne.1) |
| 850 |
$ print*,'BAD icy >>> ',viewy,fbad_cog(4,icy) |
c $ print*,'BAD icy >>> ',viewy,fbad_cog(4,icy) |
| 851 |
|
|
| 852 |
elseif(PFAy.eq.'ETA')then |
elseif(PFAy.eq.'ETA')then |
| 853 |
|
|
| 854 |
stripy = stripy + pfaeta(icy,angy) |
stripy = stripy + pfaeta(icy,angy) |
| 855 |
resyPAM = ris_eta(icy,angy) |
c resyPAM = riseta(icy,angy) |
| 856 |
|
resyPAM = riseta(viewy,angy) |
| 857 |
resyPAM = resyPAM*fbad_eta(icy,angy) |
resyPAM = resyPAM*fbad_eta(icy,angy) |
| 858 |
if(DEBUG.and.fbad_cog(2,icy).ne.1) |
c if(DEBUG.and.fbad_cog(2,icy).ne.1) |
| 859 |
$ print*,'BAD icy >>> ',viewy,fbad_cog(2,icy) |
c $ print*,'BAD icy >>> ',viewy,fbad_cog(2,icy) |
| 860 |
|
|
| 861 |
|
elseif(PFAy.eq.'ETAL')then |
| 862 |
|
|
| 863 |
|
stripy = stripy + pfaetal(icy,angy) |
| 864 |
|
resyPAM = riseta(viewy,angy) |
| 865 |
|
resyPAM = resyPAM*fbad_eta(icy,angy) |
| 866 |
|
c if(DEBUG.and.fbad_cog(2,icy).ne.1) |
| 867 |
|
c $ print*,'BAD icy >>> ',viewy,fbad_cog(2,icy) |
| 868 |
|
|
| 869 |
elseif(PFAy.eq.'COG')then |
elseif(PFAy.eq.'COG')then |
| 870 |
|
|
| 889 |
endif |
endif |
| 890 |
|
|
| 891 |
|
|
| 892 |
endif |
20 endif |
| 893 |
|
|
| 894 |
c print*,'## stripx,stripy ',stripx,stripy |
c$$$ print*,'## stripx,stripy ',stripx,stripy |
| 895 |
|
|
| 896 |
c=========================================================== |
c=========================================================== |
| 897 |
C COUPLE |
C COUPLE |
| 1107 |
100 continue |
100 continue |
| 1108 |
end |
end |
| 1109 |
|
|
| 1110 |
|
************************************************************************ |
| 1111 |
|
* Call xyz_PAM subroutine with default PFA and fill the mini2 common. |
| 1112 |
|
* (done to be called from c/c++) |
| 1113 |
|
************************************************************************ |
| 1114 |
|
|
| 1115 |
|
subroutine xyzpam(ip,icx,icy,lad,sensor,ax,ay,bfx,bfy) |
| 1116 |
|
|
| 1117 |
|
include 'commontracker.f' |
| 1118 |
|
include 'level1.f' |
| 1119 |
|
include 'common_mini_2.f' |
| 1120 |
|
include 'common_xyzPAM.f' |
| 1121 |
|
include 'common_mech.f' |
| 1122 |
|
include 'calib.f' |
| 1123 |
|
|
| 1124 |
|
* flag to chose PFA |
| 1125 |
|
c$$$ character*10 PFA |
| 1126 |
|
c$$$ common/FINALPFA/PFA |
| 1127 |
|
|
| 1128 |
|
integer icx,icy !X-Y cluster ID |
| 1129 |
|
integer sensor |
| 1130 |
|
character*4 PFAx,PFAy !PFA to be used |
| 1131 |
|
real ax,ay !X-Y geometric angle |
| 1132 |
|
real bfx,bfy !X-Y b-field components |
| 1133 |
|
|
| 1134 |
|
ipx=0 |
| 1135 |
|
ipy=0 |
| 1136 |
|
|
| 1137 |
|
c$$$ PFAx = 'COG4'!PFA |
| 1138 |
|
c$$$ PFAy = 'COG4'!PFA |
| 1139 |
|
|
| 1140 |
|
if(icx.gt.nclstr1.or.icy.gt.nclstr1)then |
| 1141 |
|
print*,'xyzpam: ***WARNING*** clusters ',icx,icy |
| 1142 |
|
$ ,' does not exists (nclstr1=',nclstr1,')' |
| 1143 |
|
icx = -1*icx |
| 1144 |
|
icy = -1*icy |
| 1145 |
|
return |
| 1146 |
|
|
| 1147 |
|
endif |
| 1148 |
|
|
| 1149 |
|
call idtoc(pfaid,PFAx) |
| 1150 |
|
call idtoc(pfaid,PFAy) |
| 1151 |
|
|
| 1152 |
|
c$$$ call xyz_PAM(icx,icy,sensor,PFAx,PFAy,ax,ay,bfx,bfy) |
| 1153 |
|
|
| 1154 |
|
c$$$ print*,icx,icy,sensor,PFAx,PFAy,ax,ay,bfx,bfy |
| 1155 |
|
|
| 1156 |
|
if(icx.ne.0.and.icy.ne.0)then |
| 1157 |
|
|
| 1158 |
|
ipx=npl(VIEW(icx)) |
| 1159 |
|
ipy=npl(VIEW(icy)) |
| 1160 |
|
c$$$ if( (nplanes-ipx+1).ne.ip.or.(nplanes-ipy+1).ne.ip ) |
| 1161 |
|
c$$$ $ print*,'xyzpam: ***WARNING*** clusters ',icx,icy |
| 1162 |
|
c$$$ $ ,' does not belong to the correct plane: ',ip,ipx,ipy |
| 1163 |
|
|
| 1164 |
|
if( (nplanes-ipx+1).ne.ip )then |
| 1165 |
|
print*,'xyzpam: ***WARNING*** cluster ',icx |
| 1166 |
|
$ ,' does not belong to plane: ',ip |
| 1167 |
|
icx = -1*icx |
| 1168 |
|
return |
| 1169 |
|
endif |
| 1170 |
|
if( (nplanes-ipy+1).ne.ip )then |
| 1171 |
|
print*,'xyzpam: ***WARNING*** cluster ',icy |
| 1172 |
|
$ ,' does not belong to plane: ',ip |
| 1173 |
|
icy = -1*icy |
| 1174 |
|
return |
| 1175 |
|
endif |
| 1176 |
|
|
| 1177 |
|
call xyz_PAM(icx,icy,sensor,PFAx,PFAy,ax,ay,bfx,bfy) |
| 1178 |
|
|
| 1179 |
|
xgood(ip) = 1. |
| 1180 |
|
ygood(ip) = 1. |
| 1181 |
|
resx(ip) = resxPAM |
| 1182 |
|
resy(ip) = resyPAM |
| 1183 |
|
|
| 1184 |
|
xm(ip) = xPAM |
| 1185 |
|
ym(ip) = yPAM |
| 1186 |
|
zm(ip) = zPAM |
| 1187 |
|
xm_A(ip) = 0. |
| 1188 |
|
ym_A(ip) = 0. |
| 1189 |
|
xm_B(ip) = 0. |
| 1190 |
|
ym_B(ip) = 0. |
| 1191 |
|
|
| 1192 |
|
c zv(ip) = zPAM |
| 1193 |
|
|
| 1194 |
|
elseif(icx.eq.0.and.icy.ne.0)then |
| 1195 |
|
|
| 1196 |
|
ipy=npl(VIEW(icy)) |
| 1197 |
|
c$$$ if((nplanes-ipy+1).ne.ip) |
| 1198 |
|
c$$$ $ print*,'xyzpam: ***WARNING*** clusters ',icx,icy |
| 1199 |
|
c$$$ $ ,' does not belong to the correct plane: ',ip,ipx,ipy |
| 1200 |
|
if( (nplanes-ipy+1).ne.ip )then |
| 1201 |
|
print*,'xyzpam: ***WARNING*** cluster ',icy |
| 1202 |
|
$ ,' does not belong to plane: ',ip |
| 1203 |
|
icy = -1*icy |
| 1204 |
|
return |
| 1205 |
|
endif |
| 1206 |
|
|
| 1207 |
|
call xyz_PAM(icx,icy,sensor,PFAx,PFAy,ax,ay,bfx,bfy) |
| 1208 |
|
|
| 1209 |
|
xgood(ip) = 0. |
| 1210 |
|
ygood(ip) = 1. |
| 1211 |
|
resx(ip) = 1000. |
| 1212 |
|
resy(ip) = resyPAM |
| 1213 |
|
|
| 1214 |
|
xm(ip) = -100. |
| 1215 |
|
ym(ip) = -100. |
| 1216 |
|
zm(ip) = (zPAM_A+zPAM_B)/2. |
| 1217 |
|
xm_A(ip) = xPAM_A |
| 1218 |
|
ym_A(ip) = yPAM_A |
| 1219 |
|
xm_B(ip) = xPAM_B |
| 1220 |
|
ym_B(ip) = yPAM_B |
| 1221 |
|
|
| 1222 |
|
c zv(ip) = (zPAM_A+zPAM_B)/2. |
| 1223 |
|
|
| 1224 |
|
elseif(icx.ne.0.and.icy.eq.0)then |
| 1225 |
|
|
| 1226 |
|
ipx=npl(VIEW(icx)) |
| 1227 |
|
c$$$ if((nplanes-ipx+1).ne.ip) |
| 1228 |
|
c$$$ $ print*,'xyzpam: ***WARNING*** clusters ',icx,icy |
| 1229 |
|
c$$$ $ ,' does not belong to the correct plane: ',ip,ipx,ipy |
| 1230 |
|
|
| 1231 |
|
if( (nplanes-ipx+1).ne.ip )then |
| 1232 |
|
print*,'xyzpam: ***WARNING*** cluster ',icx |
| 1233 |
|
$ ,' does not belong to plane: ',ip |
| 1234 |
|
icx = -1*icx |
| 1235 |
|
return |
| 1236 |
|
endif |
| 1237 |
|
|
| 1238 |
|
call xyz_PAM(icx,icy,sensor,PFAx,PFAy,ax,ay,bfx,bfy) |
| 1239 |
|
|
| 1240 |
|
xgood(ip) = 1. |
| 1241 |
|
ygood(ip) = 0. |
| 1242 |
|
resx(ip) = resxPAM |
| 1243 |
|
resy(ip) = 1000. |
| 1244 |
|
|
| 1245 |
|
xm(ip) = -100. |
| 1246 |
|
ym(ip) = -100. |
| 1247 |
|
zm(ip) = (zPAM_A+zPAM_B)/2. |
| 1248 |
|
xm_A(ip) = xPAM_A |
| 1249 |
|
ym_A(ip) = yPAM_A |
| 1250 |
|
xm_B(ip) = xPAM_B |
| 1251 |
|
ym_B(ip) = yPAM_B |
| 1252 |
|
|
| 1253 |
|
c zv(ip) = (zPAM_A+zPAM_B)/2. |
| 1254 |
|
|
| 1255 |
|
else |
| 1256 |
|
|
| 1257 |
|
il = 2 |
| 1258 |
|
if(lad.ne.0)il=lad |
| 1259 |
|
is = 1 |
| 1260 |
|
if(sensor.ne.0)is=sensor |
| 1261 |
|
c print*,nplanes-ip+1,il,is |
| 1262 |
|
|
| 1263 |
|
xgood(ip) = 0. |
| 1264 |
|
ygood(ip) = 0. |
| 1265 |
|
resx(ip) = 1000. |
| 1266 |
|
resy(ip) = 1000. |
| 1267 |
|
|
| 1268 |
|
xm(ip) = -100. |
| 1269 |
|
ym(ip) = -100. |
| 1270 |
|
zm(ip) = z_mech_sensor(nplanes-ip+1,il,is)*1000./1.d4 |
| 1271 |
|
xm_A(ip) = 0. |
| 1272 |
|
ym_A(ip) = 0. |
| 1273 |
|
xm_B(ip) = 0. |
| 1274 |
|
ym_B(ip) = 0. |
| 1275 |
|
|
| 1276 |
|
c zv(ip) = z_mech_sensor(nplanes-ip+1,il,is)*1000./1.d4 |
| 1277 |
|
|
| 1278 |
|
endif |
| 1279 |
|
|
| 1280 |
|
if(DEBUG)then |
| 1281 |
|
c print*,'----------------------------- track coord' |
| 1282 |
|
22222 format(i2,' * ',3f10.4,' --- ',4f10.4,' --- ',2f4.0,2f10.5) |
| 1283 |
|
write(*,22222)ip,zm(ip),xm(ip),ym(ip) |
| 1284 |
|
$ ,xm_A(ip),ym_A(ip),xm_B(ip),ym_B(ip) |
| 1285 |
|
$ ,xgood(ip),ygood(ip),resx(ip),resy(ip) |
| 1286 |
|
c$$$ print*,'-----------------------------' |
| 1287 |
|
endif |
| 1288 |
|
end |
| 1289 |
|
|
| 1290 |
******************************************************************************** |
******************************************************************************** |
| 1291 |
******************************************************************************** |
******************************************************************************** |
| 1758 |
* mask views with too many clusters |
* mask views with too many clusters |
| 1759 |
do iv=1,nviews |
do iv=1,nviews |
| 1760 |
if( ncl_view(iv).gt. nclusterlimit)then |
if( ncl_view(iv).gt. nclusterlimit)then |
| 1761 |
mask_view(iv) = 1 |
c mask_view(iv) = 1 |
| 1762 |
|
mask_view(iv) = mask_view(iv) + 2**0 |
| 1763 |
if(DEBUG)print*,' * WARNING * cl_to_couple: n.clusters > ' |
if(DEBUG)print*,' * WARNING * cl_to_couple: n.clusters > ' |
| 1764 |
$ ,nclusterlimit,' on view ', iv,' --> masked!' |
$ ,nclusterlimit,' on view ', iv,' --> masked!' |
| 1765 |
endif |
endif |
| 1904 |
$ 'couples on plane ',nplx, |
$ 'couples on plane ',nplx, |
| 1905 |
$ 'exceeds vector dimention ' |
$ 'exceeds vector dimention ' |
| 1906 |
$ ,'( ',ncouplemax,' ) --> masked!' |
$ ,'( ',ncouplemax,' ) --> masked!' |
| 1907 |
mask_view(nviewx(nplx)) = 2 |
c mask_view(nviewx(nplx)) = 2 |
| 1908 |
mask_view(nviewy(nply)) = 2 |
c mask_view(nviewy(nply)) = 2 |
| 1909 |
|
mask_view(nviewx(nplx))= mask_view(nviewx(nplx))+ 2**1 |
| 1910 |
|
mask_view(nviewy(nply))= mask_view(nviewy(nply))+ 2**1 |
| 1911 |
goto 10 |
goto 10 |
| 1912 |
endif |
endif |
| 1913 |
|
|
| 2008 |
* -------------------------------------------- |
* -------------------------------------------- |
| 2009 |
do ip=1,nplanes |
do ip=1,nplanes |
| 2010 |
if(ncp_plane(ip).gt.ncouplelimit)then |
if(ncp_plane(ip).gt.ncouplelimit)then |
| 2011 |
mask_view(nviewx(ip)) = 8 |
c mask_view(nviewx(ip)) = 8 |
| 2012 |
mask_view(nviewy(ip)) = 8 |
c mask_view(nviewy(ip)) = 8 |
| 2013 |
|
mask_view(nviewx(ip)) = mask_view(nviewx(ip)) + 2**7 |
| 2014 |
|
mask_view(nviewy(ip)) = mask_view(nviewy(ip)) + 2**7 |
| 2015 |
endif |
endif |
| 2016 |
enddo |
enddo |
| 2017 |
|
|
| 2064 |
c good2=.false. |
c good2=.false. |
| 2065 |
c goto 880 !fill ntp and go to next event |
c goto 880 !fill ntp and go to next event |
| 2066 |
do iv=1,12 |
do iv=1,12 |
| 2067 |
mask_view(iv) = 3 |
c mask_view(iv) = 3 |
| 2068 |
|
mask_view(iv) = mask_view(iv)+ 2**2 |
| 2069 |
enddo |
enddo |
| 2070 |
iflag=1 |
iflag=1 |
| 2071 |
return |
return |
| 2144 |
c good2=.false. |
c good2=.false. |
| 2145 |
c goto 880 !fill ntp and go to next event |
c goto 880 !fill ntp and go to next event |
| 2146 |
do iv=1,nviews |
do iv=1,nviews |
| 2147 |
mask_view(iv) = 4 |
c mask_view(iv) = 4 |
| 2148 |
|
mask_view(iv)=mask_view(iv)+ 2**3 |
| 2149 |
enddo |
enddo |
| 2150 |
iflag=1 |
iflag=1 |
| 2151 |
return |
return |
| 2379 |
c good2=.false. |
c good2=.false. |
| 2380 |
c goto 880 !fill ntp and go to next event |
c goto 880 !fill ntp and go to next event |
| 2381 |
do iv=1,nviews |
do iv=1,nviews |
| 2382 |
mask_view(iv) = 5 |
c mask_view(iv) = 5 |
| 2383 |
|
mask_view(iv) = mask_view(iv) + 2**4 |
| 2384 |
enddo |
enddo |
| 2385 |
iflag=1 |
iflag=1 |
| 2386 |
return |
return |
| 2602 |
c good2=.false. |
c good2=.false. |
| 2603 |
c goto 880 !fill ntp and go to next event |
c goto 880 !fill ntp and go to next event |
| 2604 |
do iv=1,nviews |
do iv=1,nviews |
| 2605 |
mask_view(iv) = 6 |
c mask_view(iv) = 6 |
| 2606 |
|
mask_view(iv) = mask_view(iv) + 2**5 |
| 2607 |
enddo |
enddo |
| 2608 |
iflag=1 |
iflag=1 |
| 2609 |
return |
return |
| 2936 |
c good2=.false. |
c good2=.false. |
| 2937 |
c goto 880 !fill ntp and go to next event |
c goto 880 !fill ntp and go to next event |
| 2938 |
do iv=1,nviews |
do iv=1,nviews |
| 2939 |
mask_view(iv) = 7 |
c mask_view(iv) = 7 |
| 2940 |
|
mask_view(iv) = mask_view(iv) + 2**6 |
| 2941 |
enddo |
enddo |
| 2942 |
iflag=1 |
iflag=1 |
| 2943 |
return |
return |
| 3771 |
c >>> is a couple |
c >>> is a couple |
| 3772 |
cltrx(ip,ntr) = clx(nplanes-ip+1,icp_cp(id)) |
cltrx(ip,ntr) = clx(nplanes-ip+1,icp_cp(id)) |
| 3773 |
cltry(ip,ntr) = cly(nplanes-ip+1,icp_cp(id)) |
cltry(ip,ntr) = cly(nplanes-ip+1,icp_cp(id)) |
| 3774 |
|
|
| 3775 |
|
c$$$ nnnnx = npfastrips(clx(nplanes-ip+1,icp_cp(id)),PFA,angx) |
| 3776 |
|
c$$$ nnnny = npfastrips(cly(nplanes-ip+1,icp_cp(id)),PFA,angy) |
| 3777 |
|
c$$$ xbad(ip,ntr)= nbadstrips(nnnnx,clx(nplanes-ip+1,icp_cp(id))) |
| 3778 |
|
c$$$ ybad(ip,ntr)= nbadstrips(nnnny,cly(nplanes-ip+1,icp_cp(id))) |
| 3779 |
|
xbad(ip,ntr)= nbadstrips(4,clx(nplanes-ip+1,icp_cp(id))) |
| 3780 |
|
ybad(ip,ntr)= nbadstrips(4,cly(nplanes-ip+1,icp_cp(id))) |
| 3781 |
|
|
|
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))) |
|
| 3782 |
|
|
| 3783 |
if(nsatstrips(clx(nplanes-ip+1,icp_cp(id))).gt.0) |
if(nsatstrips(clx(nplanes-ip+1,icp_cp(id))).gt.0) |
| 3784 |
$ dedx_x(ip,ntr)=-dedx_x(ip,ntr) |
$ dedx_x(ip,ntr)=-dedx_x(ip,ntr) |
| 3786 |
$ dedx_y(ip,ntr)=-dedx_y(ip,ntr) |
$ dedx_y(ip,ntr)=-dedx_y(ip,ntr) |
| 3787 |
|
|
| 3788 |
elseif(icl.ne.0)then |
elseif(icl.ne.0)then |
| 3789 |
c >>> is a singlet |
|
|
c$$$ if(LADDER(icl).ne.sladder) |
|
|
c$$$ $ print*,'ERROR is ladder assignment (single)' |
|
|
c$$$ $ ,LADDER(icl),sladder |
|
| 3790 |
if(mod(VIEW(icl),2).eq.0)then |
if(mod(VIEW(icl),2).eq.0)then |
| 3791 |
cltrx(ip,ntr)=icl |
cltrx(ip,ntr)=icl |
| 3792 |
nnnnn = npfastrips(icl,PFA,angx) |
c$$$ nnnnn = npfastrips(icl,PFA,angx) |
| 3793 |
xbad(ip,ntr) = nbadstrips(nnnnn,icl) |
c$$$ xbad(ip,ntr) = nbadstrips(nnnnn,icl) |
| 3794 |
|
xbad(ip,ntr) = nbadstrips(4,icl) |
| 3795 |
|
|
| 3796 |
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) |
| 3797 |
elseif(mod(VIEW(icl),2).eq.1)then |
elseif(mod(VIEW(icl),2).eq.1)then |
| 3798 |
cltry(ip,ntr)=icl |
cltry(ip,ntr)=icl |
| 3799 |
nnnnn = npfastrips(icl,PFA,angy) |
c$$$ nnnnn = npfastrips(icl,PFA,angy) |
| 3800 |
ybad(ip,ntr) = nbadstrips(nnnnn,icl) |
c$$$ ybad(ip,ntr) = nbadstrips(nnnnn,icl) |
| 3801 |
|
ybad(ip,ntr) = nbadstrips(4,icl) |
| 3802 |
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) |
| 3803 |
endif |
endif |
| 3804 |
|
|
| 3805 |
endif |
endif |
| 3806 |
|
|
| 3807 |
enddo |
enddo |
| 3836 |
nclsy = 0 |
nclsy = 0 |
| 3837 |
|
|
| 3838 |
do iv = 1,nviews |
do iv = 1,nviews |
| 3839 |
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) |
| 3840 |
|
good2(iv) = good2(iv) + mask_view(iv)*2**8 |
| 3841 |
enddo |
enddo |
| 3842 |
|
|
| 3843 |
do icl=1,nclstr1 |
do icl=1,nclstr1 |