210 |
|
|
211 |
endif |
endif |
212 |
|
|
|
print*,'---- ',riseta,iview,angle |
|
213 |
|
|
214 |
100 return |
100 return |
215 |
end |
end |
611 |
|
|
612 |
|
|
613 |
*** * * * *** * * * *** * * * *** * * * *** * * * *** * * * *** |
*** * * * *** * * * *** * * * *** * * * *** * * * *** * * * *** |
614 |
real function cog0(ncog,ic) |
c$$$ real function cog0(ncog,ic) |
615 |
*------------------------------------------------- |
c$$$*------------------------------------------------- |
616 |
* this function returns |
c$$$* this function returns |
617 |
* |
c$$$* |
618 |
* - the Center-Of-Gravity of the cluster IC |
c$$$* - the Center-Of-Gravity of the cluster IC |
619 |
* evaluated using NCOG strips, |
c$$$* evaluated using NCOG strips, |
620 |
* calculated relative to MAXS(IC) |
c$$$* calculated relative to MAXS(IC) |
621 |
* |
c$$$* |
622 |
* - zero in case that not enough strips |
c$$$* - zero in case that not enough strips |
623 |
* have a positive signal |
c$$$* have a positive signal |
624 |
* |
c$$$* |
625 |
* NOTE: |
c$$$* NOTE: |
626 |
* This is the old definition, used by Straulino. |
c$$$* This is the old definition, used by Straulino. |
627 |
* The new routine, according to Landi, |
c$$$* The new routine, according to Landi, |
628 |
* is COG(NCOG,IC) |
c$$$* is COG(NCOG,IC) |
629 |
*------------------------------------------------- |
c$$$*------------------------------------------------- |
630 |
|
c$$$ |
631 |
|
c$$$ |
632 |
include 'commontracker.f' |
c$$$ include 'commontracker.f' |
633 |
include 'level1.f' |
c$$$ include 'level1.f' |
634 |
|
c$$$ |
635 |
* --> signal of the central strip |
c$$$* --> signal of the central strip |
636 |
sc = CLSIGNAL(INDMAX(ic)) !center |
c$$$ sc = CLSIGNAL(INDMAX(ic)) !center |
637 |
|
c$$$ |
638 |
* signal of adjacent strips |
c$$$* signal of adjacent strips |
639 |
* --> left |
c$$$* --> left |
640 |
sl1 = 0 !left 1 |
c$$$ sl1 = 0 !left 1 |
641 |
if( |
c$$$ if( |
642 |
$ (INDMAX(ic)-1).ge.INDSTART(ic) |
c$$$ $ (INDMAX(ic)-1).ge.INDSTART(ic) |
643 |
$ ) |
c$$$ $ ) |
644 |
$ sl1 = max(0.,CLSIGNAL(INDMAX(ic)-1)) |
c$$$ $ sl1 = max(0.,CLSIGNAL(INDMAX(ic)-1)) |
645 |
|
c$$$ |
646 |
sl2 = 0 !left 2 |
c$$$ sl2 = 0 !left 2 |
647 |
if( |
c$$$ if( |
648 |
$ (INDMAX(ic)-2).ge.INDSTART(ic) |
c$$$ $ (INDMAX(ic)-2).ge.INDSTART(ic) |
649 |
$ ) |
c$$$ $ ) |
650 |
$ sl2 = max(0.,CLSIGNAL(INDMAX(ic)-2)) |
c$$$ $ sl2 = max(0.,CLSIGNAL(INDMAX(ic)-2)) |
651 |
|
c$$$ |
652 |
* --> right |
c$$$* --> right |
653 |
sr1 = 0 !right 1 |
c$$$ sr1 = 0 !right 1 |
654 |
if( |
c$$$ if( |
655 |
$ (ic.ne.NCLSTR1.and.(INDMAX(ic)+1).lt.INDSTART(ic+1)) |
c$$$ $ (ic.ne.NCLSTR1.and.(INDMAX(ic)+1).lt.INDSTART(ic+1)) |
656 |
$ .or. |
c$$$ $ .or. |
657 |
$ (ic.eq.NCLSTR1.and.(INDMAX(ic)+1).le.TOTCLLENGTH) |
c$$$ $ (ic.eq.NCLSTR1.and.(INDMAX(ic)+1).le.TOTCLLENGTH) |
658 |
$ ) |
c$$$ $ ) |
659 |
$ sr1 = max(0.,CLSIGNAL(INDMAX(ic)+1)) |
c$$$ $ sr1 = max(0.,CLSIGNAL(INDMAX(ic)+1)) |
660 |
|
c$$$ |
661 |
sr2 = 0 !right 2 |
c$$$ sr2 = 0 !right 2 |
662 |
if( |
c$$$ if( |
663 |
$ (ic.ne.NCLSTR1.and.(INDMAX(ic)+2).lt.INDSTART(ic+1)) |
c$$$ $ (ic.ne.NCLSTR1.and.(INDMAX(ic)+2).lt.INDSTART(ic+1)) |
664 |
$ .or. |
c$$$ $ .or. |
665 |
$ (ic.eq.NCLSTR1.and.(INDMAX(ic)+2).le.TOTCLLENGTH) |
c$$$ $ (ic.eq.NCLSTR1.and.(INDMAX(ic)+2).le.TOTCLLENGTH) |
666 |
$ ) |
c$$$ $ ) |
667 |
$ sr2 = max(0.,CLSIGNAL(INDMAX(ic)+2)) |
c$$$ $ sr2 = max(0.,CLSIGNAL(INDMAX(ic)+2)) |
668 |
|
c$$$ |
669 |
************************************************************ |
c$$$************************************************************ |
670 |
* COG computation |
c$$$* COG computation |
671 |
************************************************************ |
c$$$************************************************************ |
672 |
|
c$$$ |
673 |
c print*,sl2,sl1,sc,sr1,sr2 |
c$$$c print*,sl2,sl1,sc,sr1,sr2 |
674 |
|
c$$$ |
675 |
COG = 0. |
c$$$ COG = 0. |
676 |
|
c$$$ |
677 |
if(sl1.gt.sr1.and.sl1.gt.0.)then |
c$$$ if(sl1.gt.sr1.and.sl1.gt.0.)then |
678 |
|
c$$$ |
679 |
if(ncog.eq.2.and.sl1.ne.0)then |
c$$$ if(ncog.eq.2.and.sl1.ne.0)then |
680 |
COG = -sl1/(sl1+sc) |
c$$$ COG = -sl1/(sl1+sc) |
681 |
elseif(ncog.eq.3.and.sl1.ne.0.and.sr1.ne.0)then |
c$$$ elseif(ncog.eq.3.and.sl1.ne.0.and.sr1.ne.0)then |
682 |
COG = (sr1-sl1)/(sl1+sc+sr1) |
c$$$ COG = (sr1-sl1)/(sl1+sc+sr1) |
683 |
elseif(ncog.eq.4.and.sl1.ne.0.and.sr1.ne.0.and.sl2.ne.0)then |
c$$$ elseif(ncog.eq.4.and.sl1.ne.0.and.sr1.ne.0.and.sl2.ne.0)then |
684 |
COG = (sr1-sl1-2*sl2)/(sl2+sl1+sc+sr1) |
c$$$ COG = (sr1-sl1-2*sl2)/(sl2+sl1+sc+sr1) |
685 |
else |
c$$$ else |
686 |
COG = 0. |
c$$$ COG = 0. |
687 |
endif |
c$$$ endif |
688 |
|
c$$$ |
689 |
elseif(sl1.le.sr1.and.sr1.gt.0.)then |
c$$$ elseif(sl1.le.sr1.and.sr1.gt.0.)then |
690 |
|
c$$$ |
691 |
if(ncog.eq.2.and.sr1.ne.0)then |
c$$$ if(ncog.eq.2.and.sr1.ne.0)then |
692 |
COG = sr1/(sc+sr1) |
c$$$ COG = sr1/(sc+sr1) |
693 |
elseif(ncog.eq.3.and.sr1.ne.0.and.sl1.ne.0)then |
c$$$ elseif(ncog.eq.3.and.sr1.ne.0.and.sl1.ne.0)then |
694 |
COG = (sr1-sl1)/(sl1+sc+sr1) |
c$$$ COG = (sr1-sl1)/(sl1+sc+sr1) |
695 |
elseif(ncog.eq.4.and.sr1.ne.0.and.sl1.ne.0.and.sr2.ne.0)then |
c$$$ elseif(ncog.eq.4.and.sr1.ne.0.and.sl1.ne.0.and.sr2.ne.0)then |
696 |
COG = (2*sr2+sr1-sl1)/(sl2+sl1+sc+sr1) |
c$$$ COG = (2*sr2+sr1-sl1)/(sl2+sl1+sc+sr1) |
697 |
else |
c$$$ else |
698 |
COG = 0. |
c$$$ COG = 0. |
699 |
endif |
c$$$ endif |
700 |
|
c$$$ |
701 |
endif |
c$$$ endif |
702 |
|
c$$$ |
703 |
COG0 = COG |
c$$$ COG0 = COG |
704 |
|
c$$$ |
705 |
c print *,ncog,ic,cog,'/////////////' |
c$$$c print *,ncog,ic,cog,'/////////////' |
706 |
|
c$$$ |
707 |
return |
c$$$ return |
708 |
end |
c$$$ end |
709 |
|
|
710 |
*** * * * *** * * * *** * * * *** * * * *** * * * *** * * * *** |
*** * * * *** * * * *** * * * *** * * * *** * * * *** * * * *** |
711 |
real function cog(ncog,ic) |
real function cog(ncog,ic) |
737 |
* --> signal of the central strip |
* --> signal of the central strip |
738 |
sc = CLSIGNAL(INDMAX(ic)) !center |
sc = CLSIGNAL(INDMAX(ic)) !center |
739 |
* signal of adjacent strips |
* signal of adjacent strips |
740 |
sl1 = 0 !left 1 |
sl1 = -9999. !left 1 |
741 |
if( |
if( |
742 |
$ (INDMAX(ic)-1).ge.INDSTART(ic) |
$ (INDMAX(ic)-1).ge.INDSTART(ic) |
743 |
$ ) |
$ ) |
744 |
$ sl1 = CLSIGNAL(INDMAX(ic)-1) |
$ sl1 = CLSIGNAL(INDMAX(ic)-1) |
745 |
|
|
746 |
sl2 = 0 !left 2 |
sl2 = -9999. !left 2 |
747 |
if( |
if( |
748 |
$ (INDMAX(ic)-2).ge.INDSTART(ic) |
$ (INDMAX(ic)-2).ge.INDSTART(ic) |
749 |
$ ) |
$ ) |
750 |
$ sl2 = CLSIGNAL(INDMAX(ic)-2) |
$ sl2 = CLSIGNAL(INDMAX(ic)-2) |
751 |
|
|
752 |
sr1 = 0 !right 1 |
sr1 = -9999. !right 1 |
753 |
if( |
if( |
754 |
$ (ic.ne.NCLSTR1.and.(INDMAX(ic)+1).lt.INDSTART(ic+1)) |
$ (ic.ne.NCLSTR1.and.(INDMAX(ic)+1).lt.INDSTART(ic+1)) |
755 |
$ .or. |
$ .or. |
757 |
$ ) |
$ ) |
758 |
$ sr1 = CLSIGNAL(INDMAX(ic)+1) |
$ sr1 = CLSIGNAL(INDMAX(ic)+1) |
759 |
|
|
760 |
sr2 = 0 !right 2 |
sr2 = -9999. !right 2 |
761 |
if( |
if( |
762 |
$ (ic.ne.NCLSTR1.and.(INDMAX(ic)+2).lt.INDSTART(ic+1)) |
$ (ic.ne.NCLSTR1.and.(INDMAX(ic)+2).lt.INDSTART(ic+1)) |
763 |
$ .or. |
$ .or. |
769 |
|
|
770 |
c print*,'## ',sl2,sl1,sc,sr1,sr2 |
c print*,'## ',sl2,sl1,sc,sr1,sr2 |
771 |
|
|
772 |
|
c ============================================================== |
773 |
if(ncog.eq.1)then |
if(ncog.eq.1)then |
774 |
COG = 0. |
COG = 0. |
775 |
|
if(sr1.gt.sc)cog=1. !NEW |
776 |
|
if(sl1.gt.sc.and.sl1.gt.sr1)cog=-1. !NEW |
777 |
|
c ============================================================== |
778 |
elseif(ncog.eq.2)then |
elseif(ncog.eq.2)then |
779 |
if(sl1.gt.sr1)then |
if(sl1.gt.sr1)then |
780 |
if((sl1+sc).ne.0)COG = -sl1/(sl1+sc) |
if((sl1+sc).ne.0)COG = -sl1/(sl1+sc) |
781 |
elseif(sl1.le.sr1)then |
elseif(sl1.lt.sr1)then |
782 |
if((sc+sr1).ne.0)COG = sr1/(sc+sr1) |
if((sc+sr1).ne.0)COG = sr1/(sc+sr1) |
783 |
endif |
elseif( sl1.eq.sr1.and.sl1.ne.-9999.)then !NEW |
784 |
|
if( clsigma(indmax(ic)-1).lt.clsigma(indmax(ic)+1) |
785 |
|
$ .and.(sl1+sc).ne.0 )cog = -sl1/(sl1+sc) !NEW |
786 |
|
if( clsigma(indmax(ic)-1).gt.clsigma(indmax(ic)+1) |
787 |
|
$ .and.(sc+sr1).ne.0 )cog = sr1/(sc+sr1) !NEW |
788 |
|
endif |
789 |
|
c if(cog==0)print*,'Strange cluster (2) - @maxs ',MAXS(ic) |
790 |
|
c $ ,' : ',sl2,sl1,sc,sr1,sr2 |
791 |
|
c ============================================================== |
792 |
elseif(ncog.eq.3)then |
elseif(ncog.eq.3)then |
793 |
if((sl1+sc+sr1).ne.0)COG = (sr1-sl1)/(sl1+sc+sr1) |
if( (sl1+sc+sr1).ne.0 )COG = (sr1-sl1)/(sl1+sc+sr1) |
794 |
|
c if(cog==0)print*,'Strange cluster (3) - @maxs ',MAXS(ic) |
795 |
|
c $ ,' : ',sl2,sl1,sc,sr1,sr2 |
796 |
|
c ============================================================== |
797 |
elseif(ncog.eq.4)then |
elseif(ncog.eq.4)then |
798 |
if(sl2.gt.sr2)then |
if(sl2.gt.sr2)then |
799 |
if((sl2+sl1+sc+sr1).ne.0) |
if((sl2+sl1+sc+sr1).ne.0) |
800 |
$ COG = (sr1-sl1-2*sl2)/(sl2+sl1+sc+sr1) |
$ COG = (sr1-sl1-2*sl2)/(sl2+sl1+sc+sr1) |
801 |
elseif(sl2.le.sr2)then |
elseif(sl2.lt.sr2)then |
802 |
if((sr2+sl1+sc+sr1).ne.0) |
if((sr2+sl1+sc+sr1).ne.0) |
803 |
$ COG = (2*sr2+sr1-sl1)/(sr2+sl1+sc+sr1) |
$ COG = (2*sr2+sr1-sl1)/(sr2+sl1+sc+sr1) |
804 |
|
elseif(sl2.eq.sr2.and.sl2.ne.-9999.)then !NEW |
805 |
|
if( clsigma(indmax(ic)-2).lt.clsigma(indmax(ic)+2) |
806 |
|
$ .and.(sl2+sl1+sc+sr1).ne.0 ) |
807 |
|
$ cog = (sr1-sl1-2*sl2)/(sl2+sl1+sc+sr1) !NEW |
808 |
|
if( clsigma(indmax(ic)-2).gt.clsigma(indmax(ic)+2) |
809 |
|
$ .and.(sr2+sl1+sc+sr1).ne.0 ) |
810 |
|
$ cog = (2*sr2+sr1-sl1)/(sr2+sl1+sc+sr1) !NEW |
811 |
endif |
endif |
812 |
else |
else |
813 |
print*,'function COG(NCOG,IC) ==> WARNING!! NCOG=',NCOG |
print*,'function COG(NCOG,IC) ==> WARNING!! NCOG=',NCOG |