/[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.9 by pam-fi, Fri Apr 27 10:39:58 2007 UTC revision 1.12 by pam-fi, Wed May 23 15:31:19 2007 UTC
# Line 1  Line 1 
1    
2    
3          subroutine idtoc(ipfa,cpfa)
4          
5          integer ipfa
6          character*4 cpfa
7    
8          CPFA='COG4'
9          if(ipfa.eq.0)CPFA='ETA'
10          if(ipfa.eq.2)CPFA='ETA2'
11          if(ipfa.eq.3)CPFA='ETA3'
12          if(ipfa.eq.4)CPFA='ETA4'
13          if(ipfa.eq.10)CPFA='COG'
14          if(ipfa.eq.11)CPFA='COG1'
15          if(ipfa.eq.12)CPFA='COG2'
16          if(ipfa.eq.13)CPFA='COG3'
17          if(ipfa.eq.14)CPFA='COG4'
18          
19          end
20    
21  *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***  *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
22  *     this file contains all subroutines and functions  *     this file contains all subroutines and functions
23  *     that are needed for position finding algorithms  *     that are needed for position finding algorithms
# Line 145  c      print*,pfastrips Line 164  c      print*,pfastrips
164        end        end
165    
166  *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***  *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
167        real function ris_eta(ic,angle)  c      real function riseta(ic,angle)
168          real function riseta(iview,angle)
169  *--------------------------------------------------------------  *--------------------------------------------------------------
170  *     this function returns the average spatial resolution  *     this function returns the average spatial resolution
171  *     (in cm) for the ETA algorithm (function pfaeta(ic,angle))  *     (in cm) for the ETA algorithm (function pfaeta(ic,angle))
# Line 160  c      print*,pfastrips Line 180  c      print*,pfastrips
180        include 'level1.f'        include 'level1.f'
181        include 'calib.f'        include 'calib.f'
182    
183        ris_eta = 0        riseta = 0
184    
185        if(mod(int(VIEW(ic)),2).eq.1)then !Y-view  c      if(mod(int(VIEW(ic)),2).eq.1)then !Y-view
186          if(mod(iview,2).eq.1)then !Y-view
187                
188    
189           if( abs(angle).ge.e2fay.and.abs(angle).le.e2tay )then           if( abs(angle).ge.e2fay.and.abs(angle).le.e2tay )then
190              ris_eta = risy_eta2(angle)              riseta = risy_eta2(angle)
191           elseif( abs(angle).ge.e3fay.and.abs(angle).le.e3tay )then           elseif( abs(angle).ge.e3fay.and.abs(angle).le.e3tay )then
192              ris_eta = risy_cog(angle) !ATTENZIONE!!              riseta = risy_cog(angle) !ATTENZIONE!!
193           elseif( abs(angle).ge.e4fay.and.abs(angle).le.e4tay )then           elseif( abs(angle).ge.e4fay.and.abs(angle).le.e4tay )then
194              ris_eta = risy_cog(angle) !ATTENZIONE!!              riseta = risy_cog(angle) !ATTENZIONE!!
195           else           else
196              ris_eta = risy_cog(angle)              riseta = risy_cog(angle)
197           endif                       endif            
198    
199        else                      !X-view        else                      !X-view
200    
201           if( abs(angle).ge.e2fax.and.abs(angle).le.e2tax )then           if( abs(angle).ge.e2fax.and.abs(angle).le.e2tax )then
202              ris_eta = risx_eta2(angle)              riseta = risx_eta2(angle)
203           elseif( abs(angle).ge.e3fax.and.abs(angle).le.e3tax )then           elseif( abs(angle).ge.e3fax.and.abs(angle).le.e3tax )then
204              ris_eta = risx_eta3(angle)              riseta = risx_eta3(angle)
205           elseif( abs(angle).ge.e4fax.and.abs(angle).le.e4tax )then           elseif( abs(angle).ge.e4fax.and.abs(angle).le.e4tax )then
206              ris_eta = risx_eta4(angle)              riseta = risx_eta4(angle)
207           else           else
208              ris_eta = risx_cog(angle)              riseta = risx_cog(angle)
209           endif                       endif            
210                            
211        endif        endif
212    
213          print*,'---- ',riseta,iview,angle
214    
215   100  return   100  return
216        end        end
217    
# Line 762  c         print*,'## ',sl2,sl1,sc,sr1,sr Line 785  c         print*,'## ',sl2,sl1,sc,sr1,sr
785                 if((sl2+sl1+sc+sr1).ne.0)                 if((sl2+sl1+sc+sr1).ne.0)
786       $              COG = (sr1-sl1-2*sl2)/(sl2+sl1+sc+sr1)       $              COG = (sr1-sl1-2*sl2)/(sl2+sl1+sc+sr1)
787              elseif(sl2.le.sr2)then              elseif(sl2.le.sr2)then
788                  if((sl2+sl1+sc+sr1).ne.0)                  if((sr2+sl1+sc+sr1).ne.0)
789       $              COG = (2*sr2+sr1-sl1)/(sl2+sl1+sc+sr1)       $              COG = (2*sr2+sr1-sl1)/(sr2+sl1+sc+sr1)
790              endif              endif
791           else           else
792              print*,'function COG(NCOG,IC) ==> WARNING!! NCOG=',NCOG              print*,'function COG(NCOG,IC) ==> WARNING!! NCOG=',NCOG
# Line 795  c         print*,'-------' Line 818  c         print*,'-------'
818                 COG = COG + ipos*CLSIGNAL(i)                 COG = COG + ipos*CLSIGNAL(i)
819                 SGN = SGN + CLSIGNAL(i)                 SGN = SGN + CLSIGNAL(i)
820                 mu = mu + 1                 mu = mu + 1
821                 print*,ipos,CLSIGNAL(i)  c               print*,ipos,CLSIGNAL(i)
822              else              else
823                 goto 10                 goto 10
824              endif              endif
# Line 808  c         print*,'-------' Line 831  c         print*,'-------'
831                 COG = COG + ipos*CLSIGNAL(i)                 COG = COG + ipos*CLSIGNAL(i)
832                 SGN = SGN + CLSIGNAL(i)                 SGN = SGN + CLSIGNAL(i)
833                 mu = mu + 1                 mu = mu + 1
834                 print*,ipos,CLSIGNAL(i)  c               print*,ipos,CLSIGNAL(i)
835              else              else
836                 goto 20                 goto 20
837              endif              endif
838           enddo           enddo
839   20      continue   20      continue
840           if(SGN.le.0)then           if(SGN.le.0)then
841  c            print*,'cog(0,ic) --> ic, dedx ',ic,SGN              print*,'cog(0,ic) --> ic, dedx ',ic,SGN
842              print*,(CLSIGNAL(i)/CLSIGMA(i),i=istart,istop)              print*,(CLSIGNAL(i)/CLSIGMA(i),i=istart,istop)
843              print*,(CLSIGNAL(i),i=istart,istop)              print*,(CLSIGNAL(i),i=istart,istop)
844  c            print*,'cog(0,ic) --> NOT EVALUATED '  c            print*,'cog(0,ic) --> NOT EVALUATED '

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.23