/[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.15 by pam-fi, Fri Aug 17 13:28:02 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'
10        if(ipfa.eq.2)CPFA='ETA2'        if(ipfa.eq.2)CPFA='ETA2'
11        if(ipfa.eq.3)CPFA='ETA3'        if(ipfa.eq.3)CPFA='ETA3'
12        if(ipfa.eq.4)CPFA='ETA4'        if(ipfa.eq.4)CPFA='ETA4'
13          if(ipfa.eq.5)CPFA='ETAL'
14        if(ipfa.eq.10)CPFA='COG'        if(ipfa.eq.10)CPFA='COG'
15        if(ipfa.eq.11)CPFA='COG1'        if(ipfa.eq.11)CPFA='COG1'
16        if(ipfa.eq.12)CPFA='COG2'        if(ipfa.eq.12)CPFA='COG2'
# Line 138  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 164  c      print*,pfastrips Line 166  c      print*,pfastrips
166        end        end
167    
168  *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***  *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
169          real function pfaetal(ic,angle)
170    *--------------------------------------------------------------
171    *     this function returns the position (in strip units)
172    *     it calls:
173    *     - pfaeta2(ic,angle)+pfcorr(ic,angle)
174    *     - pfaeta3(ic,angle)+pfcorr(ic,angle)
175    *     - pfaeta4(ic,angle)+pfcorr(ic,angle)
176    *     according to the angle
177    *--------------------------------------------------------------
178          include 'commontracker.f'
179          include 'level1.f'
180          include 'calib.f'
181          
182          pfaetal = 0
183    
184          if(mod(int(VIEW(ic)),2).eq.1)then !Y-view
185          
186             if( abs(angle).ge.e2fay.and.abs(angle).le.e2tay )then
187                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
190                pfaetal = pfaeta3(ic,angle)+pfacorr(ic,angle)
191             elseif( abs(angle).ge.e4fay.and.abs(angle).le.e4tay )then
192                pfaetal = pfaeta4(ic,angle)+pfacorr(ic,angle)
193             else
194                pfaetal = cog(4,ic)
195             endif            
196    
197          else                      !X-view
198    
199             if( abs(angle).ge.e2fax.and.abs(angle).le.e2tax )then
200                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
203                pfaetal = pfaeta3(ic,angle)+pfacorr(ic,angle)
204             elseif( abs(angle).ge.e4fax.and.abs(angle).le.e4tax )then
205                pfaetal = pfaeta4(ic,angle)+pfacorr(ic,angle)
206             else
207                pfaetal = cog(4,ic)
208             endif            
209                
210          endif
211          
212     100  return
213          end
214    *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
215  c      real function riseta(ic,angle)  c      real function riseta(ic,angle)
216        real function riseta(iview,angle)        real function riseta(iview,angle)
217  *--------------------------------------------------------------  *--------------------------------------------------------------
# Line 293  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 369  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 411  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 486  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 527  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 602  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 1705  c         if(BAD(VIEW(ic),nvk(MAXS(ic)), Line 1753  c         if(BAD(VIEW(ic),nvk(MAXS(ic)),
1753        risx_cog = HQUADF * 1e-4        risx_cog = HQUADF * 1e-4
1754    
1755        END        END
1756    
1757    
1758    *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
1759          real function pfacorr(ic,angle)
1760    *--------------------------------------------------------------
1761    *     this function returns the landi correction for this cluster
1762    *--------------------------------------------------------------
1763          include 'commontracker.f'
1764          include 'calib.f'
1765          include 'level1.f'
1766    
1767          real angle
1768          integer iview,lad
1769    
1770          iview = VIEW(ic)            
1771          lad = nld(MAXS(ic),VIEW(ic))
1772    
1773    *     find angular bin
1774    *     (in futuro possiamo pensare di interpolare anche sull'angolo)
1775          do iang=1,nangbin
1776             if(angL(iang).lt.angle.and.angR(iang).ge.angle)then
1777                iangle=iang
1778                goto 98
1779             endif
1780          enddo
1781          if(DEBUG.eq.1)
1782         $     print*,'pfacorr *** warning *** angle out of range: ',angle
1783          if(angle.lt.angL(1))iang=1
1784          if(angle.gt.angR(nangbin))iang=nangbin
1785     98   continue                  !jump here if ok
1786    
1787          pfacorr = fcorr(iview,lad,iang)
1788    
1789          if(DEBUG.eq.1)print*,'CORR  (ic ',ic,' ang',angle,') -->',pfacorr
1790    
1791    
1792     100  return
1793          end

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

  ViewVC Help
Powered by ViewVC 1.1.23