/[PAMELA software]/DarthVader/TrackerLevel2/src/F77/functionspfa.f
ViewVC logotype

Diff of /DarthVader/TrackerLevel2/src/F77/functionspfa.f

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by pam-fi, Thu Oct 26 16:22:37 2006 UTC revision 1.7 by pam-fi, Thu Jan 11 10:20:58 2007 UTC
# Line 153  c      real function pfaeta2(cog2,view,l Line 153  c      real function pfaeta2(cog2,view,l
153  c      logical DEBUG  c      logical DEBUG
154  c      common/dbg/DEBUG  c      common/dbg/DEBUG
155    
156    c      print*,'## pfaeta2 ',ic,angle
157        iview = VIEW(ic)              !(1)        iview = VIEW(ic)              !(1)
158        lad = nld(MAXS(ic),VIEW(ic)) !(1)        lad = nld(MAXS(ic),VIEW(ic)) !(1)
159        cog2 = cog(2,ic)             !(1)        cog2 = cog(2,ic)             !(1)
# Line 277  c      real function pfaeta3(cog3,view,l Line 278  c      real function pfaeta3(cog3,view,l
278  c      logical DEBUG  c      logical DEBUG
279  c      common/dbg/DEBUG  c      common/dbg/DEBUG
280    
281    c      print*,'## pfaeta3 ',ic,angle
282    
283        iview = VIEW(ic)              !(1)        iview = VIEW(ic)              !(1)
284        lad = nld(MAXS(ic),VIEW(ic)) !(1)        lad = nld(MAXS(ic),VIEW(ic)) !(1)
# Line 400  c      real function pfaeta4(cog4,view,l Line 402  c      real function pfaeta4(cog4,view,l
402  c      logical DEBUG  c      logical DEBUG
403  c      common/dbg/DEBUG  c      common/dbg/DEBUG
404    
405    c      print*,'## pfaeta4 ',ic,angle
406    
407        iview = VIEW(ic)             !(1)        iview = VIEW(ic)             !(1)
408        lad = nld(MAXS(ic),VIEW(ic)) !(1)        lad = nld(MAXS(ic),VIEW(ic)) !(1)
409        cog4=cog(4,ic)               !(1)        cog4=cog(4,ic)               !(1)
# Line 656  c      common/dbg/DEBUG Line 660  c      common/dbg/DEBUG
660                    
661           COG = 0.           COG = 0.
662                    
663    c         print*,'## ',sl2,sl1,sc,sr1,sr2
664    
665           if(ncog.eq.1)then           if(ncog.eq.1)then
666              COG = 0.              COG = 0.
667           elseif(ncog.eq.2)then           elseif(ncog.eq.2)then
668              if(sl1.gt.sr1)then              if(sl1.gt.sr1)then
669                 COG = -sl1/(sl1+sc)                         if((sl1+sc).ne.0)COG = -sl1/(sl1+sc)        
670              elseif(sl1.le.sr1)then              elseif(sl1.le.sr1)then
671                 COG = sr1/(sc+sr1)                             if((sc+sr1).ne.0)COG = sr1/(sc+sr1)            
672              endif              endif
673           elseif(ncog.eq.3)then           elseif(ncog.eq.3)then
674              COG = (sr1-sl1)/(sl1+sc+sr1)               if((sl1+sc+sr1).ne.0)COG = (sr1-sl1)/(sl1+sc+sr1)
675           elseif(ncog.eq.4)then           elseif(ncog.eq.4)then
676              if(sl2.gt.sr2)then              if(sl2.gt.sr2)then
677                 COG = (sr1-sl1-2*sl2)/(sl2+sl1+sc+sr1)                 if((sl2+sl1+sc+sr1).ne.0)
678         $              COG = (sr1-sl1-2*sl2)/(sl2+sl1+sc+sr1)
679              elseif(sl2.le.sr2)then              elseif(sl2.le.sr2)then
680                 COG = (2*sr2+sr1-sl1)/(sl2+sl1+sc+sr1)                  if((sl2+sl1+sc+sr1).ne.0)
681         $              COG = (2*sr2+sr1-sl1)/(sl2+sl1+sc+sr1)
682              endif              endif
683           else           else
684              print*,'function COG(NCOG,IC) ==> WARNING!! NCOG=',NCOG              print*,'function COG(NCOG,IC) ==> WARNING!! NCOG=',NCOG
685              print*,'                 (NCOG must be <= 4)'       $           ,' not implemented'
686              COG = 0.              COG = 0.
687           endif           endif
688    
# Line 696  ' Line 704  '
704           mu  = 0           mu  = 0
705           do i = istart,istop           do i = istart,istop
706              ipos = i-INDMAX(ic)              ipos = i-INDMAX(ic)
 cc            ivk  = nvk(MAXS(ic)+ipos)  
 cc            is   = nst(MAXS(ic)+ipos)  
 *            print*,'******************',istart,istop,ipos  
 *     $           ,MAXS(ic)+ipos,iv,ivk,is  
 cc            cut  = incut*SIGMA(iv,ivk,is)  
707              cut  = incut*CLSIGMA(i)              cut  = incut*CLSIGMA(i)
 c            if(SIGMA(iv,ivk,is).ne.CLSIGMA(i))  
 c     $           print*,'cog(0,ic) --> hai fatto qualche cazzata'  
708              if(CLSIGNAL(i).ge.cut)then              if(CLSIGNAL(i).ge.cut)then
709                 COG = COG + ipos*CLSIGNAL(i)                 COG = COG + ipos*CLSIGNAL(i)
710                 mu = mu + 1                 mu = mu + 1
 c               print*,ipos,CLSIGNAL(i),incut,cut  
711              endif              endif
712           enddo           enddo
713           if(DEDX(ic).le.0)then           if(DEDX(ic).le.0)then
# Line 718  c               print*,ipos,CLSIGNAL(i), Line 718  c               print*,ipos,CLSIGNAL(i),
718           else           else
719              COG=COG/DEDX(ic)              COG=COG/DEDX(ic)
720           endif           endif
 c         if(DEBUG)print*,'COG  (ic ',ic,' m',mu,')'  
 c     $        ,cog  
721                    
722        else        else
723                    
# Line 730  c     $        ,cog Line 728  c     $        ,cog
728    
729        endif        endif
730    
731  c      print *,ncog,ic,cog,'/////////////'  c      print *,'## cog ',ncog,ic,cog,'/////////////'
732    
733        return        return
734        end        end

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.23