| 70 |
by = bbb |
by = bbb |
| 71 |
if(iview.eq.12) angx = -1. * ang |
if(iview.eq.12) angx = -1. * ang |
| 72 |
if(iview.eq.12) by = -1. * bbb |
if(iview.eq.12) by = -1. * bbb |
| 73 |
tgtemp = tan(ang*acos(-1.)/180.) + pmuH_h*by*0.00001 |
cc tgtemp = tan(ang*acos(-1.)/180.) + pmuH_h*by*0.00001 !ORRORE!! |
| 74 |
|
tgtemp = tan(angx*acos(-1.)/180.) + pmuH_h*by*0.00001 |
| 75 |
|
|
| 76 |
elseif(mod(iview,2).eq.1)then |
elseif(mod(iview,2).eq.1)then |
| 77 |
c ================================================= |
c ================================================= |
| 613 |
cog2 = cog(2,ic) |
cog2 = cog(2,ic) |
| 614 |
pfaeta2=cog2 |
pfaeta2=cog2 |
| 615 |
|
|
| 616 |
|
* ---------------- |
| 617 |
* find angular bin |
* find angular bin |
| 618 |
|
* ---------------- |
| 619 |
* (in futuro possiamo pensare di interpolare anche sull'angolo) |
* (in futuro possiamo pensare di interpolare anche sull'angolo) |
| 620 |
do iang=1,nangbin |
do iang=1,nangbin |
| 621 |
if(angL(iang).lt.angle.and.angR(iang).ge.angle)then |
if(angL(iang).lt.angle.and.angR(iang).ge.angle)then |
| 629 |
if(angle.ge.angR(nangbin))iang=nangbin |
if(angle.ge.angR(nangbin))iang=nangbin |
| 630 |
98 continue !jump here if ok |
98 continue !jump here if ok |
| 631 |
|
|
| 632 |
|
* ------------- |
| 633 |
|
* within +/-0.5 |
| 634 |
|
* ------------- |
| 635 |
|
|
| 636 |
c$$$* find extremes of interpolation |
iaddmax=10 |
|
c$$$ iflag=0 |
|
|
c$$$* -------------------------------- |
|
|
c$$$ if(cog2.lt.eta2(1,iang).or.cog2.gt.eta2(netaval,iang))then |
|
|
c$$$c print*,'pfaeta2 *** warning *** argument out of range: ',cog2 |
|
|
c$$$* goto 100 |
|
|
c$$$* ---------------------------------------------- |
|
|
c$$$* non salto piu`, ma scalo di 1 o -1 |
|
|
c$$$* nel caso si tratti di un cluster |
|
|
c$$$* in cui la strip con il segnale massimo non coincide |
|
|
c$$$* con la strip con il rapposto s/n massimo!!! |
|
|
c$$$* ---------------------------------------------- |
|
|
c$$$ if(cog2.lt.eta2(1,iang))then !temp |
|
|
c$$$ cog2=cog2+1. !temp |
|
|
c$$$ iflag=1 !temp |
|
|
c$$$ else !temp |
|
|
c$$$ cog2=cog2-1. !temp |
|
|
c$$$ iflag=-1 !temp |
|
|
c$$$ endif !temp |
|
|
c$$$c print*,'shifted >>> ',cog2 |
|
|
c$$$ endif |
|
|
|
|
| 637 |
iadd=0 |
iadd=0 |
| 638 |
10 continue |
10 continue |
| 639 |
if(cog2.lt.eta2(1,iang))then |
if(cog2.lt.eta2(1,iang))then |
| 640 |
cog2 = cog2 + 1 |
cog2 = cog2 + 1 |
| 641 |
iadd = iadd + 1 |
iadd = iadd + 1 |
| 642 |
|
if(iadd>iaddmax)goto 111 |
| 643 |
goto 10 |
goto 10 |
| 644 |
endif |
endif |
| 645 |
20 continue |
20 continue |
| 646 |
if(cog2.gt.eta2(netaval,iang))then |
if(cog2.gt.eta2(netaval,iang))then |
| 647 |
cog2 = cog2 - 1 |
cog2 = cog2 - 1 |
| 648 |
iadd = iadd - 1 |
iadd = iadd - 1 |
| 649 |
|
if(iadd<-1*iaddmax)goto 111 |
| 650 |
goto 20 |
goto 20 |
| 651 |
endif |
endif |
| 652 |
|
goto 1111 |
| 653 |
|
111 continue |
| 654 |
|
if(DEBUG.eq.1)print*,'pfaeta2 *** warning *** anomalous cluster' |
| 655 |
|
if(DEBUG.eq.1)print*,'--> COG(2) = ',cog2-iadd,' (set to zero)' |
| 656 |
|
cog2=0 |
| 657 |
|
1111 continue |
| 658 |
|
|
| 659 |
* -------------------------------- |
* -------------------------------- |
| 660 |
c print*,'*****',i,view,lad,iang,'------> cog2 ',cog2 |
c print*,'*****',i,view,lad,iang,'------> cog2 ',cog2 |
| 719 |
|
|
| 720 |
iview = VIEW(ic) |
iview = VIEW(ic) |
| 721 |
lad = nld(MAXS(ic),VIEW(ic)) |
lad = nld(MAXS(ic),VIEW(ic)) |
| 722 |
cog3 = cog(3,ic) |
cog3 = cog(3,ic) |
| 723 |
|
cc = cog3 |
| 724 |
|
cog3 = cc |
| 725 |
pfaeta3=cog3 |
pfaeta3=cog3 |
| 726 |
|
|
| 727 |
|
* ---------------- |
| 728 |
* find angular bin |
* find angular bin |
| 729 |
|
* ---------------- |
| 730 |
* (in futuro possiamo pensare di interpolare anche sull'angolo) |
* (in futuro possiamo pensare di interpolare anche sull'angolo) |
| 731 |
do iang=1,nangbin |
do iang=1,nangbin |
| 732 |
c print*,'~~~~~~~~~~~~ ',iang,angL(iang),angR(iang),angle |
c print*,'~~~~~~~~~~~~ ',iang,angL(iang),angR(iang),angle |
| 741 |
if(angle.ge.angR(nangbin))iang=nangbin |
if(angle.ge.angR(nangbin))iang=nangbin |
| 742 |
98 continue !jump here if ok |
98 continue !jump here if ok |
| 743 |
|
|
| 744 |
|
* ------------- |
| 745 |
|
* within +/-0.5 |
| 746 |
|
* ------------- |
| 747 |
|
|
| 748 |
c$$$* find extremes of interpolation |
iaddmax=10 |
|
c$$$ iflag=0 |
|
|
c$$$* -------------------------------- |
|
|
c$$$ if(cog3.lt.eta3(1,iang).or.cog3.gt.eta3(netaval,iang))then |
|
|
c$$$* ---------------------------------------------- |
|
|
c$$$* non salto piu`, ma scalo di 1 o -1 |
|
|
c$$$* nel caso si tratti di un cluster |
|
|
c$$$* in cui la strip con il segnale massimo non coincide |
|
|
c$$$* con la strip con il rapposto s/n massimo!!! |
|
|
c$$$* ---------------------------------------------- |
|
|
c$$$ if(cog2.lt.eta2(1,iang))then !temp |
|
|
c$$$ cog2=cog2+1. !temp |
|
|
c$$$ iflag=1 !temp |
|
|
c$$$ else !temp |
|
|
c$$$ cog2=cog2-1. !temp |
|
|
c$$$ iflag=-1 !temp |
|
|
c$$$ endif !temp |
|
|
c$$$c print*,'shifted >>> ',cog2 |
|
|
c$$$ endif |
|
|
|
|
|
|
|
| 749 |
iadd=0 |
iadd=0 |
| 750 |
10 continue |
10 continue |
| 751 |
if(cog3.lt.eta3(1,iang))then |
if(cog3.lt.eta3(1,iang))then |
| 752 |
cog3 = cog3 + 1 |
cog3 = cog3 + 1. |
| 753 |
iadd = iadd + 1 |
iadd = iadd + 1 |
| 754 |
|
if(iadd>iaddmax) goto 111 |
| 755 |
goto 10 |
goto 10 |
| 756 |
endif |
endif |
| 757 |
20 continue |
20 continue |
| 758 |
if(cog3.gt.eta3(netaval,iang))then |
if(cog3.gt.eta3(netaval,iang))then |
| 759 |
cog3 = cog3 - 1 |
cog3 = cog3 - 1. |
| 760 |
iadd = iadd - 1 |
iadd = iadd - 1 |
| 761 |
|
if(iadd<-1*iaddmax) goto 111 |
| 762 |
goto 20 |
goto 20 |
| 763 |
endif |
endif |
| 764 |
|
goto 1111 |
| 765 |
|
111 continue |
| 766 |
|
if(DEBUG.eq.1)print*,'pfaeta3 *** warning *** anomalous cluster' |
| 767 |
|
if(DEBUG.eq.1)print*,'--> COG(3) = ',cog3-iadd,' (set to zero)' |
| 768 |
|
cog3=0 |
| 769 |
|
1111 continue |
| 770 |
|
|
| 771 |
* -------------------------------- |
* -------------------------------- |
| 772 |
c print*,'*****',i,view,lad,iang,'------> cog2 ',cog2 |
c print*,'*****',i,view,lad,iang,'------> cog2 ',cog2 |
| 792 |
pfaeta3 = AA*cog3+BB |
pfaeta3 = AA*cog3+BB |
| 793 |
pfaeta3 = pfaeta3 - iadd |
pfaeta3 = pfaeta3 - iadd |
| 794 |
|
|
|
c$$$ if(iflag.eq.1)then |
|
|
c$$$ pfaeta2=pfaeta2-1. !temp |
|
|
c$$$ cog2=cog2-1. !temp |
|
|
c$$$ endif |
|
|
c$$$ if(iflag.eq.-1)then |
|
|
c$$$ pfaeta2=pfaeta2+1. !temp |
|
|
c$$$ cog2=cog2+1. !temp |
|
|
c$$$ endif |
|
| 795 |
|
|
| 796 |
if(DEBUG.EQ.1)print*,'ETA3 (ic ',ic,' ang',angle,')' |
if(DEBUG.EQ.1)print*,'ETA3 (ic ',ic,' ang',angle,')' |
| 797 |
$ ,cog3-iadd,' -->',pfaeta3 |
$ ,cog3-iadd,' -->',pfaeta3 |
| 825 |
cog4=cog(4,ic) |
cog4=cog(4,ic) |
| 826 |
pfaeta4=cog4 |
pfaeta4=cog4 |
| 827 |
|
|
| 828 |
|
* ---------------- |
| 829 |
* find angular bin |
* find angular bin |
| 830 |
|
* ---------------- |
| 831 |
* (in futuro possiamo pensare di interpolare anche sull'angolo) |
* (in futuro possiamo pensare di interpolare anche sull'angolo) |
| 832 |
do iang=1,nangbin |
do iang=1,nangbin |
| 833 |
c print*,'~~~~~~~~~~~~ ',iang,angL(iang),angR(iang),angle |
c print*,'~~~~~~~~~~~~ ',iang,angL(iang),angR(iang),angle |
| 842 |
if(angle.ge.angR(nangbin))iang=nangbin |
if(angle.ge.angR(nangbin))iang=nangbin |
| 843 |
98 continue !jump here if ok |
98 continue !jump here if ok |
| 844 |
|
|
| 845 |
|
* ------------- |
| 846 |
|
* within +/-0.5 |
| 847 |
|
* ------------- |
| 848 |
|
|
| 849 |
c$$$* find extremes of interpolation |
iaddmax=10 |
|
c$$$ iflag=0 |
|
|
c$$$* -------------------------------- |
|
|
c$$$ if(cog3.lt.eta3(1,iang).or.cog3.gt.eta3(netaval,iang))then |
|
|
c$$$* ---------------------------------------------- |
|
|
c$$$* non salto piu`, ma scalo di 1 o -1 |
|
|
c$$$* nel caso si tratti di un cluster |
|
|
c$$$* in cui la strip con il segnale massimo non coincide |
|
|
c$$$* con la strip con il rapposto s/n massimo!!! |
|
|
c$$$* ---------------------------------------------- |
|
|
c$$$ if(cog2.lt.eta2(1,iang))then !temp |
|
|
c$$$ cog2=cog2+1. !temp |
|
|
c$$$ iflag=1 !temp |
|
|
c$$$ else !temp |
|
|
c$$$ cog2=cog2-1. !temp |
|
|
c$$$ iflag=-1 !temp |
|
|
c$$$ endif !temp |
|
|
c$$$c print*,'shifted >>> ',cog2 |
|
|
c$$$ endif |
|
|
|
|
|
|
|
| 850 |
iadd=0 |
iadd=0 |
| 851 |
10 continue |
10 continue |
| 852 |
if(cog4.lt.eta4(1,iang))then |
if(cog4.lt.eta4(1,iang))then |
| 853 |
cog4 = cog4 + 1 |
cog4 = cog4 + 1 |
| 854 |
iadd = iadd + 1 |
iadd = iadd + 1 |
| 855 |
|
if(iadd>iaddmax)goto 111 |
| 856 |
goto 10 |
goto 10 |
| 857 |
endif |
endif |
| 858 |
20 continue |
20 continue |
| 859 |
if(cog4.gt.eta4(netaval,iang))then |
if(cog4.gt.eta4(netaval,iang))then |
| 860 |
cog4 = cog4 - 1 |
cog4 = cog4 - 1 |
| 861 |
iadd = iadd - 1 |
iadd = iadd - 1 |
| 862 |
|
if(iadd<-1*iaddmax)goto 111 |
| 863 |
goto 20 |
goto 20 |
| 864 |
endif |
endif |
| 865 |
|
goto 1111 |
| 866 |
|
111 continue |
| 867 |
|
if(DEBUG.eq.1)print*,'pfaeta4 *** warning *** anomalous cluster' |
| 868 |
|
if(DEBUG.eq.1)print*,'--> COG(4) = ',cog4-iadd,' (set to zero)' |
| 869 |
|
cog4=0 |
| 870 |
|
1111 continue |
| 871 |
|
|
| 872 |
* -------------------------------- |
* -------------------------------- |
| 873 |
c print*,'*****',i,view,lad,iang,'------> cog2 ',cog2 |
c print*,'*****',i,view,lad,iang,'------> cog2 ',cog2 |
| 970 |
|
|
| 971 |
COG = 0. |
COG = 0. |
| 972 |
|
|
| 973 |
c print*,'## ',sl2,sl1,sc,sr1,sr2 |
c print *,'## ',sl2,sl1,sc,sr1,sr2 |
| 974 |
|
|
| 975 |
c ============================================================== |
c ============================================================== |
| 976 |
if(ncog.eq.1)then |
if(ncog.eq.1)then |
| 1111 |
|
|
| 1112 |
c print *,'## cog ',ncog,ic,cog,'/////////////' |
c print *,'## cog ',ncog,ic,cog,'/////////////' |
| 1113 |
|
|
| 1114 |
|
if(COG.lt.-0.75.or.COG.gt.+0.75)then |
| 1115 |
|
if(DEBUG.eq.1) |
| 1116 |
|
$ print*,'cog *** warning *** anomalous cluster ??? --> ' |
| 1117 |
|
if(DEBUG.eq.1) |
| 1118 |
|
$ print*,sl2,sl1,sc,sr1,sr2,' --> COG(',ncog,') = ',COG |
| 1119 |
|
endif |
| 1120 |
|
|
| 1121 |
|
|
| 1122 |
return |
return |
| 1123 |
end |
end |
| 1124 |
|
|