--- DarthVader/TrackerLevel2/src/F77/filladc.f 2006/05/19 13:15:55 1.1 +++ DarthVader/TrackerLevel2/src/F77/filladc.f 2006/09/05 12:52:21 1.3 @@ -2,11 +2,14 @@ include 'commontracker.f' - include 'common_reduction.f' include 'level0.f' + include 'level1.f' include 'calib.f' + include 'common_reduction.f' + + external nvk external nst @@ -63,7 +66,7 @@ call compdecode(word,flag,tipo,info,errflag) if(errflag.ne.0.) then - print*,'filladc --> ERROR on compdecode' + if(debug)print*,'filladc --> ERROR on compdecode' iflag=1 return endif @@ -71,10 +74,10 @@ if(flag.eq.1) then ! flag: fine messaggio (ladder) if(info.ne.1.and.info.ne.2.and.info.ne.3) then - print*, + if(debug)print*, $ 'filladc --> wrong end-of-ladder ' $ //'in COMPRESSED mode' - print*, + if(debug)print*, $ ' info(=ladder) ',info,' type ',tipo iflag=1 return @@ -87,7 +90,9 @@ newVAL=max(0,newVAL) newVAL=min(4095,newVAL) adc(DSPn,nvk(js),nst(js))=newVAL -ccc print*,DSPn,nvk(js),nst(js),newval +c$$$ print*,DSPn,nvk(js),nst(js) +c$$$ $ ,pedestal_t(DSPn,nvk(js),nst(js)),newval +c$$$ $ ,pedestal(DSPn,nvk(js),nst(js)) enddo if(info.eq.3) goto 1000 @@ -114,7 +119,7 @@ is = iaddr prec_ind = 1 else - print*,'filladc --> address '// + if(debug)print*,'filladc --> address '// $ 'out of range - iaddr,is',iaddr,is iflag=1 return @@ -124,7 +129,7 @@ if(prec_ind.eq.0) is=is+1 if(info.ge.0.and.info.le.4095) then if(is.gt.3072)then - print*, + if(debug)print*, $ 'filladc --> strip out of range - DSPn,is' $ ,DSPn,is iflag=1 @@ -137,7 +142,8 @@ oldVAL=newVAL else - print*,'filladc --> datum out of range - info',info + if(debug) + $ print*,'filladc --> datum out of range - info',info iflag=1 return endif @@ -177,9 +183,12 @@ enddo idata = idata+1 if(datatracker(idata).ne.ior(z'1800',i+3)) then - print*,'filladc --> wrong end-of-ladder in FULL mode' - print*,' word ',datatracker(idata) - print*,' should be ',ior(z'1800',i+3) + if(debug) + $ print*,'filladc --> wrong end-of-ladder in FULL mode' + if(debug) + $ print*,' word ',datatracker(idata) + if(debug) + $ print*,' should be ',ior(z'1800',i+3) iflag=1 return endif @@ -213,7 +222,7 @@ flag=ishft(flag,-12) if(flag.ne.0.and.flag.ne.1) then - print*,'compdecode --> error on uncompression: flag=',flag +c print*,'compdecode --> error on uncompression: flag=',flag errflag=1. endif if(flag.eq.0) then ! valore ADC @@ -224,7 +233,7 @@ info=iand(word,z'03ff') tipo=iand(word,z'0c00') if(tipo.ne.0.and.tipo.ne.z'0800') then - print*,'compdecode --> error on decompression: tipo=',tipo +c print*,'compdecode --> error on decompression: tipo=',tipo errflag=1. endif if(tipo.eq.0) then ! indirizzo