--- DarthVader/TrackerLevel2/src/F77/reductionflight.f 2006/05/19 13:15:56 1.1 +++ DarthVader/TrackerLevel2/src/F77/reductionflight.f 2006/05/30 16:30:37 1.2 @@ -10,7 +10,7 @@ * ************************************************************************* - subroutine reductionflight() + subroutine reductionflight(ierror) include 'commontracker.f' include 'level0.f' @@ -18,6 +18,8 @@ include 'common_reduction.f' include 'calib.f' + integer ierror + ierror = 0 * ------------------------------------------------------- * STRIP MASK @@ -26,17 +28,7 @@ call stripmask call init_level1 -C--------------------------------------------------- -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*,'' c-------------------------------------------------- c read the variable DATATRACKER from LEVEL0 c and fill the variable ADC (inverting view 11) @@ -44,7 +36,8 @@ call filladc(iflag) if(iflag.ne.0)then good1=0 - print*,'event ',eventn(1),' >>>>> decode ERROR' +c if(DEBUG)print*,'event ',eventn(1),' >>>>> decode ERROR' + ierror = -220 goto 200 endif @@ -56,10 +49,16 @@ do iv=1,nviews do ik=1,nva1_view cn(iv,ik)=0 !initializes cn variable - if(mask_vk(iv,ik).eq.1)call cncomp(iv,ik) + iflag=0 + if(mask_vk(iv,ik).eq.1)call cncomp(iv,ik,iflag) + if(iflag.ne.0)good1=0 enddo enddo - + if(good1.eq.0)then + ierror = 220 +c if(WARNING) +c $ print*,' WARNING - cncomp: CN computation failure ' + endif c--------------------------------------------- c loops on views, VA1 and strips, @@ -105,23 +104,18 @@ ccc print*,"cnev(",iv,",",ik,")(reduction)= ",cnev(iv,ik) enddo enddo -c$$$ nevent_good = nevent_good + 1 - C--------------------------------------------- C come here if GOOD1=0 C or the event has too many clusters C--------------------------------------------- - 200 continue -ccc print*,'nclstr1(reduction)=',nclstr1 c------------------------------------------------------------------------ -c +c c closes files and exits -c +c c------------------------------------------------------------------------ - - RETURN - END + RETURN + END ***...***...***...***...***...***...***...***...***...***...***...***...***...***...***...*** * @@ -423,7 +417,6 @@ lmax=rmax-nclstrp+1 endif endif - endif elseif(value(iseed+1).gt.value(iseed-1)) then c !??? sposto il limite del cluster a destra per includere sempre le strip @@ -477,7 +470,7 @@ nclstr1=0 totCLlength=0 flag_shower = .true. - print*,'Event ',eventn(1), + if(verbose)print*,'Event ',eventn(1), $ ': more than ',nclstrmax,' clusters' goto 2000 endif @@ -502,7 +495,7 @@ $ dedx(nclstr1)=dedx(nclstr1)+value(j) !cluster charge enddo c-------------------------------------------------------- -c +c c-------------------------------------------------------- endif !end possible seed conditio 220 continue !jumps here to skip strips left of last seed @@ -535,21 +528,6 @@ include 'level1.f' include 'calib.f' -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$$$* ---------------------- - * init mask do iv=1,nviews do ivk=1,nva1_view @@ -559,143 +537,6 @@ enddo enddo -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 return end