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

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

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

revision 1.1 by mocchiut, Fri May 19 13:15:56 2006 UTC revision 1.4 by pam-fi, Fri Aug 4 08:18:06 2006 UTC
# Line 10  Line 10 
10  *    *  
11  *************************************************************************  *************************************************************************
12    
13        subroutine reductionflight()        subroutine reductionflight(ierror)
14    
15        include 'commontracker.f'        include 'commontracker.f'
16        include 'level0.f'        include 'level0.f'
# Line 18  Line 18 
18        include 'common_reduction.f'        include 'common_reduction.f'
19        include 'calib.f'        include 'calib.f'
20                
21          integer ierror
22          ierror = 0
23    
24  *     -------------------------------------------------------  *     -------------------------------------------------------
25  *     STRIP MASK  *     STRIP MASK
26  *     -------------------------------------------------------  *     -------------------------------------------------------
27    
28        call stripmask  c      call stripmask   !called later, after CN computation
29        call init_level1        call init_level1
30    
31  C---------------------------------------------------        good1 = good0
 C     variables in blocks GENERAL and CPU are anyway filled  
 C     in order to mantain sincronization among  
 C     events at different levels  
 C---------------------------------------------------  
       good1=good0  
 c$$$      do iv=1,12  
 c$$$        crc1(iv)=crc(iv)  
 c$$$      enddo  
 ccc      print*,'totdatalength(reduction)=',TOTDATAlength  
 ccc      print*,''  
32  c--------------------------------------------------  c--------------------------------------------------
33  c     read the variable DATATRACKER from LEVEL0  c     read the variable DATATRACKER from LEVEL0
34  c     and fill the variable ADC (inverting view 11)  c     and fill the variable ADC (inverting view 11)
# Line 44  c--------------------------------------- Line 36  c---------------------------------------
36        call filladc(iflag)        call filladc(iflag)
37        if(iflag.ne.0)then        if(iflag.ne.0)then
38          good1=0          good1=0
39          print*,'event ',eventn(1),' >>>>>  decode ERROR'  c       if(DEBUG)print*,'event ',eventn(1),' >>>>>  decode ERROR'
40                ierror = 220
41          goto 200          goto 200
42        endif        endif
43    
# Line 55  c     tagged with the flag CLSTR) Line 48  c     tagged with the flag CLSTR)
48  c--------------------------------------------------  c--------------------------------------------------
49        do iv=1,nviews        do iv=1,nviews
50          do ik=1,nva1_view          do ik=1,nva1_view
51            cn(iv,ik)=0           !initializes cn variable            cn(iv,ik)=0          
52            if(mask_vk(iv,ik).eq.1)call cncomp(iv,ik)            mask_vk_ev(iv,ik)=1
53              iflag=0
54              if(mask_vk(iv,ik).eq.1)call cncomp(iv,ik,iflag)
55    c          if(iflag.ne.0)good1=0
56              if(iflag.ne.0)then
57                 mask_vk_ev(iv,ik)=0
58                 ierror = 220
59              endif
60          enddo          enddo
61        enddo        enddo
62    c      if(good1.eq.0)then
63    c         ierror = 220
64    c      endif
65    
66          call stripmask !compute mask(i,j,k)
67  c---------------------------------------------  c---------------------------------------------
68  c     loops on views, VA1 and strips,  c     loops on views, VA1 and strips,
69  c     and computes strips signals using  c     and computes strips signals using
# Line 91  C===  > X view Line 94  C===  > X view
94              clinclcut(is)=incutx*sigma(iv,nvk(is),nst(is))              clinclcut(is)=incutx*sigma(iv,nvk(is),nst(is))
95       $           *mask(iv,nvk(is),nst(is))       $           *mask(iv,nvk(is),nst(is))
96            endif            endif
97    c$$$          print*,iv,is,' --- ',adc(iv,nvk(is),nst(is)),cn(iv,nvk(is))
98    c$$$     $         ,pedestal(iv,nvk(is),nst(is)),value(is)
99    c$$$     $         ,sigma(iv,nvk(is),nst(is))
100    c          if(value(is).gt.clseedcut(is))
101    c     $         print*,iv,is,' --- (ADC_PED_CN) ',value(is),clseedcut(is)
102          enddo                   !end loop on strips (1)          enddo                   !end loop on strips (1)
103          call search_cluster(iv)          call search_cluster(iv)
104          if(flag_shower.eqv..true.)then          if(flag_shower.eqv..true.)then
# Line 102  C===  > X view Line 110  C===  > X view
110        do iv=1,nviews        do iv=1,nviews
111          do ik=1,nva1_view          do ik=1,nva1_view
112            cnev(iv,ik)=cn(iv,ik) !assigns computed CN to ntuple variables            cnev(iv,ik)=cn(iv,ik) !assigns computed CN to ntuple variables
113              cnevflag(iv,ik)=cnflag(iv,ik) !assigns computed CN to ntuple variables
114  ccc          print*,"cnev(",iv,",",ik,")(reduction)= ",cnev(iv,ik)  ccc          print*,"cnev(",iv,",",ik,")(reduction)= ",cnev(iv,ik)
115          enddo          enddo
116        enddo        enddo
 c$$$      nevent_good = nevent_good + 1  
         
117  C---------------------------------------------  C---------------------------------------------
118  C     come here if GOOD1=0  C     come here if GOOD1=0
119  C     or the event has too many clusters  C     or the event has too many clusters
120  C---------------------------------------------  C---------------------------------------------
   
121   200  continue   200  continue
 ccc      print*,'nclstr1(reduction)=',nclstr1  
122  c------------------------------------------------------------------------  c------------------------------------------------------------------------
123  c      c
124  c     closes files and exits  c     closes files and exits
125  c      c
126  c------------------------------------------------------------------------  c------------------------------------------------------------------------
127                      RETURN
128        RETURN                          END
       END                        
129    
130  ***...***...***...***...***...***...***...***...***...***...***...***...***...***...***...***  ***...***...***...***...***...***...***...***...***...***...***...***...***...***...***...***
131  *  *
# Line 423  c--------------------------------------- Line 427  c---------------------------------------
427                             lmax=rmax-nclstrp+1                             lmax=rmax-nclstrp+1
428                          endif                          endif
429                       endif                       endif
                       
430                    endif                    endif
431                 elseif(value(iseed+1).gt.value(iseed-1)) then                 elseif(value(iseed+1).gt.value(iseed-1)) then
432  c     !??? sposto il limite del cluster a destra per includere sempre le strip  c     !??? sposto il limite del cluster a destra per includere sempre le strip
# Line 468  c     goto 250 !inutile!??? Line 471  c     goto 250 !inutile!???
471   250           continue   250           continue
472    
473  c--------------------------------------------------------  c--------------------------------------------------------
474  c     fills ntuple variables  c     fills cluster variables
475  c--------------------------------------------------------  c--------------------------------------------------------
476                 nclstr1=nclstr1+1 !cluster number                 nclstr1=nclstr1+1 !cluster number
477  ccc               print*,nclstr1,multtemp  ccc               print*,nclstr1,multtemp
478                 if(nclstr1.gt.nclstrmax) then !too many clusters for the event:                 if(nclstr1.gt.nclstrmax) then !too many clusters for the event:
479                      if(verbose)print*,'Event ',eventn(1),
480         $                 ': more than ',nclstrmax,' clusters'
481                    good1=0       ! event                    good1=0       ! event
482                    nclstr1=0                    nclstr1=0
483                    totCLlength=0                    totCLlength=0
484                    flag_shower = .true.                    flag_shower = .true.
                   print*,'Event ',eventn(1),  
      $                 ': more than ',nclstrmax,' clusters'  
485                    goto 2000                    goto 2000
486                 endif                 endif
487                 view(nclstr1)=iv !vista del cluster                 view(nclstr1)=iv !vista del cluster
# Line 502  c                  if(value(j).gt.0) Line 505  c                  if(value(j).gt.0)
505       $                 dedx(nclstr1)=dedx(nclstr1)+value(j) !cluster charge       $                 dedx(nclstr1)=dedx(nclstr1)+value(j) !cluster charge
506                 enddo                 enddo
507  c--------------------------------------------------------  c--------------------------------------------------------
508  c      c
509  c--------------------------------------------------------  c--------------------------------------------------------
510              endif               !end possible seed conditio              endif               !end possible seed conditio
511   220        continue            !jumps here to skip strips left of last seed   220        continue            !jumps here to skip strips left of last seed
# Line 532  c--------------------------------------- Line 535  c---------------------------------------
535  *     mask_vk(nviews,nva1_view)          !VA1 mask  *     mask_vk(nviews,nva1_view)          !VA1 mask
536  *  *
537        include 'commontracker.f'        include 'commontracker.f'
538        include 'level1.f'  c      include 'level1.f'
539          include 'common_reduction.f'
540        include 'calib.f'        include 'calib.f'
541    
 c$$$      character*20 data_file  
 c$$$  
 c$$$      character*3 aid  
 c$$$      character*6 adate  
 c$$$      integer id  
 c$$$      integer date  
 c$$$  
 c$$$*     ----------------------  
 c$$$*     retrieve date and id  
 c$$$      aid=data_file(8:10)  
 c$$$      adate=data_file(2:6)  
 c$$$      READ (aid, '(I3)'), id  
 c$$$      READ (adate, '(I6)'), date  
 c$$$*     ----------------------  
     
542  *     init mask  *     init mask
543        do iv=1,nviews        do iv=1,nviews
544           do ivk=1,nva1_view           do ivk=1,nva1_view
545              do is=1,nstrips_va1              do is=1,nstrips_va1
546                 mask(iv,ivk,is) = mask_vk(iv,ivk)  c               mask(iv,ivk,is) = mask_vk(iv,ivk)
547                   mask(iv,ivk,is) = mask_vk(iv,ivk) * mask_vk_ev(iv,ivk)              
548              enddo              enddo
549           enddo           enddo
550        enddo        enddo
551    
 c$$$*     ---------------------  
 c$$$*     VIEW 2 - VK 23-24  
 c$$$*     couple of vk damaged during integration  
 c$$$      if(date.ge.50208)then  
 c$$$cc         print*,'MASK: view 2 - vk 23/24'  
 c$$$         mask_vk(2,23)=0  
 c$$$         mask_vk(2,24)=0  
 c$$$         do is=1,nstrips_va1  
 c$$$            mask(2,23,is)=0  
 c$$$            mask(2,24,is)=0  
 c$$$         enddo  
 c$$$      endif  
 c$$$  
 c$$$*     ---------------------  
 c$$$*     VIEW 7 - VK 11-12  
 c$$$      if(date.ge.50209)then  
 c$$$        if(.not.(date.eq.50209.and.id.le.6)) then  
 c$$$cc          print*,'MASK: view 7 - vk 11/12'  
 c$$$          mask_vk(7,11)=0  
 c$$$          mask_vk(7,12)=0  
 c$$$          do is=1,nstrips_va1  
 c$$$            mask(7,11,is)=0  
 c$$$            mask(7,12,is)=0  
 c$$$          enddo  
 c$$$        endif  
 c$$$      endif  
 c$$$  
 c$$$*     ---------------------  
 c$$$*     VIEW 7 - VK 21-22  
 c$$$      if(date.ge.50316)then  
 c$$$cc         print*,'MASK: view 7 - vk 21/22'  
 c$$$         mask_vk(7,21)=0  
 c$$$         mask_vk(7,22)=0  
 c$$$         do is=1,nstrips_va1  
 c$$$            mask(7,21,is)=0  
 c$$$            mask(7,22,is)=0  
 c$$$         enddo  
 c$$$      endif  
 c$$$  
 c$$$*     ---------------------  
 c$$$*     VIEW 12 - VK 1-2-3-4  
 c$$$      if((date.eq.50317).and.(id.le.3))then  
 c$$$cc        print*,'MASK: view 12 - vk 1/2/3/4'  
 c$$$        mask_vk(12,1)=0  
 c$$$        mask_vk(12,2)=0  
 c$$$        mask_vk(12,3)=0  
 c$$$        mask_vk(12,4)=0  
 c$$$        do is=1,nstrips_va1  
 c$$$          mask(12,1,is)=0  
 c$$$          mask(12,2,is)=0  
 c$$$          mask(12,3,is)=0  
 c$$$          mask(12,4,is)=0  
 c$$$        enddo  
 c$$$      endif  
 c$$$  
 c$$$*     ---------------------  
 c$$$*     VIEW 7 - VK 5-6  
 c$$$      if(date.ge.50320)then  
 c$$$        if(.not.(date.eq.50320.and.id.le.3)) then  
 c$$$cc          print*,'MASK: view 7 - vk 5/6'  
 c$$$          mask_vk(7,5)=0  
 c$$$          mask_vk(7,6)=0  
 c$$$          do is=1,nstrips_va1  
 c$$$            mask(7,5,is)=0  
 c$$$            mask(7,6,is)=0  
 c$$$          enddo  
 c$$$        endif  
 c$$$      endif  
 c$$$  
 c$$$*     ---------------------  
 c$$$*     VIEW 7 - VK 13-14  
 c$$$      if(date.ge.50320)then  
 c$$$        if(.not.(date.eq.50320.and.id.le.5)) then  
 c$$$cc          print*,'MASK: view 7 - vk 13/14'  
 c$$$          mask_vk(7,13)=0  
 c$$$          mask_vk(7,14)=0  
 c$$$          do is=1,nstrips_va1  
 c$$$            mask(7,13,is)=0  
 c$$$            mask(7,14,is)=0  
 c$$$          enddo  
 c$$$        endif  
 c$$$      endif  
 c$$$  
 c$$$***   SAMARA  
 c$$$***   SAMARA  
 c$$$***   SAMARA  
 c$$$*     it needs further checks...  
 c$$$  
 c$$$*     ---------------------  
 c$$$*     VIEW 7 - VK 9-10  
 c$$$*     VIEW 12 - VK 1-2-3-4  
 c$$$      if((date.eq.50516).and.(id.le.8))then  
 c$$$cc        print*,'MASK: view 7 - vk 9/10'  
 c$$$cc        print*,'MASK: view 12 - vk 1/2/3/4'  
 c$$$        mask_vk(7,9)=0  
 c$$$        mask_vk(7,10)=0  
 c$$$        mask_vk(12,1)=0  
 c$$$        mask_vk(12,2)=0  
 c$$$        mask_vk(12,3)=0  
 c$$$        mask_vk(12,4)=0  
 c$$$        do is=1,nstrips_va1  
 c$$$          mask(7,9,is)=0  
 c$$$          mask(7,10,is)=0  
 c$$$          mask(12,1,is)=0  
 c$$$          mask(12,2,is)=0  
 c$$$          mask(12,3,is)=0  
 c$$$          mask(12,4,is)=0  
 c$$$        enddo  
 c$$$      endif  
 c$$$  
 c$$$*     ---------------------  
 c$$$*     VIEW 7 - VK 9-10  
 c$$$      if(date.ge.50516)then  
 c$$$        if(.not.(date.eq.50516.and.id.le.8)) then  
 c$$$cc          print*,'MASK: view 7 - vk 9/10'  
 c$$$          mask_vk(7,9)=0  
 c$$$          mask_vk(7,10)=0  
 c$$$          do is=1,nstrips_va1  
 c$$$            mask(7,9,is)=0  
 c$$$            mask(7,10,is)=0  
 c$$$          enddo  
 c$$$        endif  
 c$$$      endif  
 c$$$  
 c$$$*     ---------------------  
 c$$$*     VIEW 12 - VK 7-8  
 c$$$      if(date.ge.50523)then  
 c$$$        if(.not.(date.eq.50523.and.id.le.3)) then  
 c$$$cc          print*,'MASK: view 12 - vk 7/8'  
 c$$$          mask_vk(12,7)=0  
 c$$$          mask_vk(12,8)=0  
 c$$$          do is=1,nstrips_va1  
 c$$$            mask(12,7,is)=0  
 c$$$            mask(12,8,is)=0  
 c$$$          enddo  
 c$$$        endif  
 c$$$      endif  
552    
553        return        return
554        end        end

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.23