/[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.24 by pam-fi, Sat Mar 22 08:32:50 2008 UTC revision 1.27 by pam-fi, Tue Mar 12 11:02:02 2013 UTC
# Line 231  c            res = riseta(ic,ang)       Line 231  c            res = riseta(ic,ang)      
231  *     temporary patch for saturated clusters  *     temporary patch for saturated clusters
232  *     ======================================  *     ======================================
233           if( nsatstrips(ic).gt.0 )then           if( nsatstrips(ic).gt.0 )then
234              corr  = cog(4,ic)              c            corr  = cog(4,ic)            
235                corr = digsat(ic)
236              res = pitchX*1e-4/sqrt(12.)              res = pitchX*1e-4/sqrt(12.)
237  cc            cc=cog(4,ic)  cc            cc=cog(4,ic)
238  c$$$            print*,ic,' *** ',cc  c$$$            print*,ic,' *** ',cc
# Line 313  c            res = riseta(ic,ang)   Line 314  c            res = riseta(ic,ang)  
314  *     temporary patch for saturated clusters  *     temporary patch for saturated clusters
315  *     ======================================  *     ======================================
316           if( nsatstrips(ic).gt.0 )then           if( nsatstrips(ic).gt.0 )then
317              corr    = cog(4,ic)              c            corr    = cog(4,ic)            
318                corr = digsat(ic)
319              res = pitchY*1e-4/sqrt(12.)              res = pitchY*1e-4/sqrt(12.)
320  cc            cc=cog(4,ic)  cc            cc=cog(4,ic)
321  c$$$            print*,ic,' *** ',cc  c$$$            print*,ic,' *** ',cc
# Line 460  cc            print*,pfaeta2(ic,angle) Line 462  cc            print*,pfaeta2(ic,angle)
462                            
463        endif        endif
464                
465   100  return  c 100  return
466          return
467        end        end
468    
469  *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***  *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
# Line 507  cc            print*,VIEW(ic),angle,pfae Line 510  cc            print*,VIEW(ic),angle,pfae
510                            
511        endif        endif
512                
513   100  return  c 100  return
514          return
515        end        end
516  *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***  *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
517  c      real function riseta(ic,angle)  c      real function riseta(ic,angle)
# Line 557  c      if(mod(int(VIEW(ic)),2).eq.1)then Line 561  c      if(mod(int(VIEW(ic)),2).eq.1)then
561        endif        endif
562    
563    
564   100  return  c 100  return
565          return
566        end        end
567    
568  *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***  *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
# Line 718  c$$$      endif Line 723  c$$$      endif
723       $     ,cog2-iadd,' -->',pfaeta2       $     ,cog2-iadd,' -->',pfaeta2
724    
725    
726   100  return  c 100  return
727          return
728        end        end
729    
730  *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***  *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
# Line 821  c            print*,'-----',x1,x2,y1,y2 Line 827  c            print*,'-----',x1,x2,y1,y2
827        if(DEBUG.EQ.1)print*,'ETA3  (ic ',ic,' ang',angle,')'        if(DEBUG.EQ.1)print*,'ETA3  (ic ',ic,' ang',angle,')'
828       $     ,cog3-iadd,' -->',pfaeta3       $     ,cog3-iadd,' -->',pfaeta3
829    
830   100  return  c 100  return
831          return
832        end        end
833    
834  *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***  *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
# Line 930  c$$$      endif Line 937  c$$$      endif
937        if(DEBUG.EQ.1)print*,'ETA4  (ic ',ic,' ang',angle,')'        if(DEBUG.EQ.1)print*,'ETA4  (ic ',ic,' ang',angle,')'
938       $     ,cog4-iadd,' -->',pfaeta4       $     ,cog4-iadd,' -->',pfaeta4
939    
940   100  return  c 100  return
941          return
942        end        end
943    
944    *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
945          real function digsat(ic)
946    *-------------------------------------------------
947    *
948    *          
949    *-------------------------------------------------
950          include 'commontracker.f'
951          include 'calib.f'
952          include 'level1.f'
953          
954          integer nsat
955          real pitchsat
956          
957          nsat = 0
958          pitchsat = 0.
959          iv=VIEW(ic)              
960          istart = INDSTART(IC)
961          istop  = TOTCLLENGTH
962          if(ic.lt.NCLSTR1)istop=INDSTART(IC+1)-1
963          do i = INDMAX(IC),istart,-1
964             if(  (mod(iv,2).eq.1.and.CLADC(i).lt.ADCsatx)
965         $        .or.
966         $        (mod(iv,2).eq.0.and.CLADC(i).gt.ADCsaty) )then
967                nsat = nsat + 1
968                pitchsat = pitchsat + i - INDMAX(IC)
969             else
970                goto 10
971             endif
972          enddo
973     10   continue
974          do i = INDMAX(IC)+1,istop
975             if(  (mod(iv,2).eq.1.and.CLADC(i).lt.ADCsatx)
976         $        .or.
977         $        (mod(iv,2).eq.0.and.CLADC(i).gt.ADCsaty) )then
978                nsat = nsat + 1
979                pitchsat = pitchsat + i - INDMAX(IC)
980             else
981                goto 20
982             endif
983          enddo
984     20   continue
985          
986          digsat = 0
987          if (nsat.gt.0) digsat = pitchsat / nsat
988          
989          return
990          end
991    
992    
993  *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***  *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
994        real function cog(ncog,ic)        real function cog(ncog,ic)
# Line 1000  c      print *,'## ',sl2,sl1,sc,sr1,sr2 Line 1055  c      print *,'## ',sl2,sl1,sc,sr1,sr2
1055  c     ==============================================================  c     ==============================================================
1056           if(ncog.eq.1)then           if(ncog.eq.1)then
1057              COG = 0.              COG = 0.
1058              if(sr1.gt.sc)cog=1.           if(sr1.gt.sc)cog=1.
1059              if(sl1.gt.sc.and.sl1.gt.sr1)cog=-1.           if(sl1.gt.sc.and.sl1.gt.sr1)cog=-1.
1060  c     ==============================================================  c     ==============================================================
1061           elseif(ncog.eq.2)then           elseif(ncog.eq.2)then
1062              COG = 0.              COG = 0.
1063              if(sl1.gt.sr1)then              if(sl1.gt.sr1)then
1064                 if((sl1+sc).ne.0)COG = -sl1/(sl1+sc)                         if((sl1+sc).ne.0)COG = -sl1/(sl1+sc)        
1065              elseif(sl1.lt.sr1)then              elseif(sl1.lt.sr1)then
1066                 if((sc+sr1).ne.0)COG = sr1/(sc+sr1)                                         if((sc+sr1).ne.0)COG = sr1/(sc+sr1)
1067              elseif( sl1.eq.sr1.and.sl1.ne.-9999.)then           elseif( sl1.eq.sr1.and.sl1.ne.-9999.)then
1068                 if( clsigma(indmax(ic)-1).lt.clsigma(indmax(ic)+1)                 if( clsigma(indmax(ic)-1).lt.clsigma(indmax(ic)+1)
1069       $              .and.(sl1+sc).ne.0 )cog = -sl1/(sl1+sc)       $              .and.(sl1+sc).ne.0 )cog = -sl1/(sl1+sc)
1070                 if( clsigma(indmax(ic)-1).gt.clsigma(indmax(ic)+1)                 if( clsigma(indmax(ic)-1).gt.clsigma(indmax(ic)+1)
1071       $              .and.(sc+sr1).ne.0 )cog = sr1/(sc+sr1)       $              .and.(sc+sr1).ne.0 )cog = sr1/(sc+sr1)
1072              endif           endif
1073  c            if(cog==0)print*,'Strange cluster (2) - @maxs ',MAXS(ic)  c            if(cog==0)print*,'Strange cluster (2) - @maxs ',MAXS(ic)
1074  c     $           ,' : ',sl2,sl1,sc,sr1,sr2  c     $           ,' : ',sl2,sl1,sc,sr1,sr2
1075  c     ==============================================================  c     ==============================================================
# Line 2211  ccc         SDE = 0. Line 2266  ccc         SDE = 0.
2266        if(DEBUG.eq.1)print*,'LANDI (ic ',ic,' ang',angle,') -->',pfacorr        if(DEBUG.eq.1)print*,'LANDI (ic ',ic,' ang',angle,') -->',pfacorr
2267    
2268                
2269   100  return  c 100  return
2270          return
2271        end        end

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.27

  ViewVC Help
Powered by ViewVC 1.1.23