/[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.16 by pam-fi, Fri Aug 17 14:36:06 2007 UTC revision 1.19 by pam-fi, Tue Aug 21 15:21:22 2007 UTC
# Line 3  Line 3 
3        subroutine idtoc(ipfa,cpfa)        subroutine idtoc(ipfa,cpfa)
4                
5        integer ipfa        integer ipfa
6        character*4 cpfa        character*10 cpfa
7    
8        CPFA='COG4'        CPFA='COG4'
9        if(ipfa.eq.0)CPFA='ETA'        if(ipfa.eq.0)CPFA='ETA'
# Line 139  c      print*,pfastrips Line 139  c      print*,pfastrips
139                
140           if( abs(angle).ge.e2fay.and.abs(angle).le.e2tay )then           if( abs(angle).ge.e2fay.and.abs(angle).le.e2tay )then
141              pfaeta = pfaeta2(ic,angle)              pfaeta = pfaeta2(ic,angle)
142    cc            print*,pfaeta2(ic,angle)
143           elseif( abs(angle).ge.e3fay.and.abs(angle).le.e3tay )then           elseif( abs(angle).ge.e3fay.and.abs(angle).le.e3tay )then
144              pfaeta = pfaeta3(ic,angle)              pfaeta = pfaeta3(ic,angle)
145           elseif( abs(angle).ge.e4fay.and.abs(angle).le.e4tay )then           elseif( abs(angle).ge.e4fay.and.abs(angle).le.e4tay )then
# Line 178  c      print*,pfastrips Line 179  c      print*,pfastrips
179        include 'level1.f'        include 'level1.f'
180        include 'calib.f'        include 'calib.f'
181                
182        pfaeta = 0        pfaetal = 0
183    
184        if(mod(int(VIEW(ic)),2).eq.1)then !Y-view        if(mod(int(VIEW(ic)),2).eq.1)then !Y-view
185                
186           if( abs(angle).ge.e2fay.and.abs(angle).le.e2tay )then           if( abs(angle).ge.e2fay.and.abs(angle).le.e2tay )then
187              pfaeta = pfaeta2(ic,angle)+pfcorr(ic,angle)              pfaetal = pfaeta2(ic,angle)+pfacorr(ic,angle)
188    cc            print*,VIEW(ic),angle,pfaeta2(ic,angle),pfacorr(ic,angle)
189           elseif( abs(angle).ge.e3fay.and.abs(angle).le.e3tay )then           elseif( abs(angle).ge.e3fay.and.abs(angle).le.e3tay )then
190              pfaeta = pfaeta3(ic,angle)+pfcorr(ic,angle)              pfaetal = pfaeta3(ic,angle)+pfacorr(ic,angle)
191           elseif( abs(angle).ge.e4fay.and.abs(angle).le.e4tay )then           elseif( abs(angle).ge.e4fay.and.abs(angle).le.e4tay )then
192              pfaeta = pfaeta4(ic,angle)+pfcorr(ic,angle)              pfaetal = pfaeta4(ic,angle)+pfacorr(ic,angle)
193           else           else
194              pfaeta = cog(4,ic)              pfaetal = cog(4,ic)
195           endif                       endif            
196    
197        else                      !X-view        else                      !X-view
198    
199           if( abs(angle).ge.e2fax.and.abs(angle).le.e2tax )then           if( abs(angle).ge.e2fax.and.abs(angle).le.e2tax )then
200              pfaeta = pfaeta2(ic,angle)+pfcorr(ic,angle)              pfaetal = pfaeta2(ic,angle)+pfacorr(ic,angle)
201    cc            print*,VIEW(ic),angle,pfaeta2(ic,angle),pfacorr(ic,angle)
202           elseif( abs(angle).ge.e3fax.and.abs(angle).le.e3tax )then           elseif( abs(angle).ge.e3fax.and.abs(angle).le.e3tax )then
203              pfaeta = pfaeta3(ic,angle)+pfcorr(ic,angle)              pfaetal = pfaeta3(ic,angle)+pfacorr(ic,angle)
204           elseif( abs(angle).ge.e4fax.and.abs(angle).le.e4tax )then           elseif( abs(angle).ge.e4fax.and.abs(angle).le.e4tax )then
205              pfaeta = pfaeta4(ic,angle)+pfcorr(ic,angle)              pfaetal = pfaeta4(ic,angle)+pfacorr(ic,angle)
206           else           else
207              pfaeta = cog(4,ic)              pfaetal = cog(4,ic)
208           endif                       endif            
209                            
210        endif        endif
# Line 338  c      if(mod(int(VIEW(ic)),2).eq.1)then Line 341  c      if(mod(int(VIEW(ic)),2).eq.1)then
341              goto 98              goto 98
342           endif           endif
343        enddo        enddo
344        if(DEBUG)        if(DEBUG.EQ.1)
345       $     print*,'pfaeta2 *** warning *** angle out of range: ',angle       $     print*,'pfaeta2 *** warning *** angle out of range: ',angle
346        if(angle.lt.angL(1))iang=1        if(angle.lt.angL(1))iang=1
347        if(angle.gt.angR(nangbin))iang=nangbin        if(angle.gt.angR(nangbin))iang=nangbin
# Line 414  c$$$         pfaeta2=pfaeta2+1.   !temp Line 417  c$$$         pfaeta2=pfaeta2+1.   !temp
417  c$$$         cog2=cog2+1.           !temp  c$$$         cog2=cog2+1.           !temp
418  c$$$      endif  c$$$      endif
419    
420        if(DEBUG)print*,'ETA2  (ic ',ic,' ang',angle,')'        if(DEBUG.EQ.1)print*,'ETA2  (ic ',ic,' ang',angle,')'
421       $     ,cog2-iadd,' -->',pfaeta2       $     ,cog2-iadd,' -->',pfaeta2
422    
423    
# Line 456  c         print*,'~~~~~~~~~~~~ ',iang,an Line 459  c         print*,'~~~~~~~~~~~~ ',iang,an
459              goto 98              goto 98
460           endif           endif
461        enddo        enddo
462        if(DEBUG)        if(DEBUG.EQ.1)
463       $     print*,'pfaeta3 *** warning *** angle out of range: ',angle       $     print*,'pfaeta3 *** warning *** angle out of range: ',angle
464        if(angle.lt.angL(1))iang=1        if(angle.lt.angL(1))iang=1
465        if(angle.gt.angR(nangbin))iang=nangbin        if(angle.gt.angR(nangbin))iang=nangbin
# Line 531  c$$$         pfaeta2=pfaeta2+1.   !temp Line 534  c$$$         pfaeta2=pfaeta2+1.   !temp
534  c$$$         cog2=cog2+1.           !temp  c$$$         cog2=cog2+1.           !temp
535  c$$$      endif  c$$$      endif
536    
537        if(DEBUG)print*,'ETA3  (ic ',ic,' ang',angle,')'        if(DEBUG.EQ.1)print*,'ETA3  (ic ',ic,' ang',angle,')'
538       $     ,cog3-iadd,' -->',pfaeta3       $     ,cog3-iadd,' -->',pfaeta3
539    
540   100  return   100  return
# Line 572  c         print*,'~~~~~~~~~~~~ ',iang,an Line 575  c         print*,'~~~~~~~~~~~~ ',iang,an
575              goto 98              goto 98
576           endif           endif
577        enddo        enddo
578        if(DEBUG)        if(DEBUG.EQ.1)
579       $     print*,'pfaeta4 *** warning *** angle out of range: ',angle       $     print*,'pfaeta4 *** warning *** angle out of range: ',angle
580        if(angle.lt.angL(1))iang=1        if(angle.lt.angL(1))iang=1
581        if(angle.gt.angR(nangbin))iang=nangbin        if(angle.gt.angR(nangbin))iang=nangbin
# Line 647  c$$$         pfaeta2=pfaeta2+1.   !temp Line 650  c$$$         pfaeta2=pfaeta2+1.   !temp
650  c$$$         cog2=cog2+1.           !temp  c$$$         cog2=cog2+1.           !temp
651  c$$$      endif  c$$$      endif
652    
653        if(DEBUG)print*,'ETA4  (ic ',ic,' ang',angle,')'        if(DEBUG.EQ.1)print*,'ETA4  (ic ',ic,' ang',angle,')'
654       $     ,cog4-iadd,' -->',pfaeta4       $     ,cog4-iadd,' -->',pfaeta4
655    
656   100  return   100  return
# Line 1753  c         if(BAD(VIEW(ic),nvk(MAXS(ic)), Line 1756  c         if(BAD(VIEW(ic),nvk(MAXS(ic)),
1756    
1757    
1758  *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***  *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
1759        real function pfacorr(ic,angle) !(1)        real function pfacorr(ic,angle)
1760  *--------------------------------------------------------------  *--------------------------------------------------------------
1761  *     this function returns the landi correction for this cluster  *     this function returns the landi correction for this cluster
1762  *--------------------------------------------------------------  *--------------------------------------------------------------
# Line 1775  c         if(BAD(VIEW(ic),nvk(MAXS(ic)), Line 1778  c         if(BAD(VIEW(ic),nvk(MAXS(ic)),
1778              goto 98              goto 98
1779           endif           endif
1780        enddo        enddo
1781        if(DEBUG)        if(DEBUG.eq.1)
1782       $     print*,'pfacorr *** warning *** angle out of range: ',angle       $     print*,'pfacorr *** warning *** angle out of range: ',angle
1783        if(angle.lt.angL(1))iang=1        if(angle.lt.angL(1))iang=1
1784        if(angle.gt.angR(nangbin))iang=nangbin        if(angle.gt.angR(nangbin))iang=nangbin
# Line 1783  c         if(BAD(VIEW(ic),nvk(MAXS(ic)), Line 1786  c         if(BAD(VIEW(ic),nvk(MAXS(ic)),
1786    
1787        pfacorr = fcorr(iview,lad,iang)        pfacorr = fcorr(iview,lad,iang)
1788    
1789        if(DEBUG)print*,'CORR  (ic ',ic,' ang',angle,') -->',pfacorr        if(DEBUG.eq.1)print*,'CORR  (ic ',ic,' ang',angle,') -->',pfacorr
1790    
1791    
1792   100  return   100  return

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.19

  ViewVC Help
Powered by ViewVC 1.1.23