/[PAMELA software]/DarthVader/ToFLevel2/src/toftrk.for
ViewVC logotype

Diff of /DarthVader/ToFLevel2/src/toftrk.for

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

revision 1.18 by pamelats, Thu Nov 27 13:49:13 2008 UTC revision 1.19 by mocchiut, Mon Nov 23 09:50:51 2009 UTC
# Line 52  C             length  from DOTRACK2 and Line 52  C             length  from DOTRACK2 and
52  C  oct-08 WM: New method to create artificial ADC values. Do NOT take the position  C  oct-08 WM: New method to create artificial ADC values. Do NOT take the position
53  C             from the tracking, but the position from timing. This method gives a  C             from the tracking, but the position from timing. This method gives a
54  C             better time resolution  C             better time resolution
55    C  nov-09 WM: the dEdx part ("adc_c") moved to the new dEdx routine from Napoli
56    C
57  C****************************************************************************  C****************************************************************************
58        IMPLICIT NONE        IMPLICIT NONE
59  C  C
# Line 1204  c      enddo Line 1206  c      enddo
1206    
1207    
1208    
1209  C---------------------------------------------------------------------  C--------------------------------------------------------------------
1210  C--------------------Corrections on ADC-data -------------------------  C-------------------Corrections on ADC-data -------------------------
1211  C-----------------angle and ADC(x) correction -----------------------  C-----------------angle and ADC(x) correction -----------------------
1212    C----------------   moved to the new dEdx routine -------------------
1213    
1214  C-----------------------------S1 -------------------------------------  C--------------------------------------------------------------------
   
       yhelp=yout(1)  
   
       phi   = atan(tan(THYOUT(1))/tan(THXOUT(1)))  
       theta = atan(tan(THXOUT(1))/cos(phi))  
   
       IF (tof11_i.GT.none_find.AND.yhelp.lt.100) THEN  
   
          i = tof11_i  
   
          if (tof11(left,i,iadc).lt.3786) then  
             tof11(left,i,iadc) = tof11(left,i,iadc)*cos(theta)  
             xkorr = atten(left,11,i,yhelp)  
             xkorr=xkorr/hepratio  
             adc_c(ch11a(i),hb11a(i))=tof11(left,i,iadc)/xkorr  
          endif  
   
   
          if (tof11(right,i,iadc).lt.3786) then  
             tof11(right,i,iadc) = tof11(right,i,iadc)*cos(theta)  
             xkorr = atten(right,11,i,yhelp)  
             xkorr=xkorr/hepratio  
             adc_c(ch11b(i),hb11b(i))=tof11(right,i,iadc)/xkorr  
          endif  
       ENDIF  
   
   
       xhelp=xout(2)  
       phi   = atan(tan(THYOUT(2))/tan(THXOUT(2)))  
       theta = atan(tan(THXOUT(2))/cos(phi))  
   
       IF (tof12_i.GT.none_find.AND.xhelp.lt.100) THEN  
          i = tof12_i  
          if (tof12(left,i,iadc).lt.3786) then  
             tof12(left,i,iadc) = tof12(left,i,iadc)*cos(theta)  
             xkorr = atten(left,12,i,xhelp)  
             xkorr=xkorr/hepratio  
             adc_c(ch12a(i),hb12a(i))=tof12(left,i,iadc)/xkorr  
          endif  
   
          if (tof12(right,i,iadc).lt.3786) then  
             tof12(right,i,iadc) = tof12(right,i,iadc)*cos(theta)  
             xkorr = atten(right,12,i,xhelp)  
             xkorr=xkorr/hepratio  
             adc_c(ch12b(i),hb12b(i))=tof12(right,i,iadc)/xkorr  
          endif  
       ENDIF  
   
 C-----------------------------S2 --------------------------------  
   
       xhelp=xout(3)  
       phi   = atan(tan(THYOUT(3))/tan(THXOUT(3)))  
       theta = atan(tan(THXOUT(3))/cos(phi))  
   
       IF (tof21_i.GT.none_find.AND.xhelp.lt.100) THEN  
          i = tof21_i  
          if (tof21(left,i,iadc).lt.3786) then  
             tof21(left,i,iadc) = tof21(left,i,iadc)*cos(theta)  
             xkorr = atten(left,21,i,xhelp)  
             xkorr=xkorr/hepratio  
             adc_c(ch21a(i),hb21a(i))=tof21(left,i,iadc)/xkorr  
          endif  
   
          if (tof21(right,i,iadc).lt.3786) then  
             tof21(right,i,iadc) = tof21(right,i,iadc)*cos(theta)  
             xkorr = atten(right,21,i,xhelp)  
             xkorr=xkorr/hepratio  
             adc_c(ch21b(i),hb21b(i))=tof21(right,i,iadc)/xkorr  
          endif  
       ENDIF  
   
       yhelp=yout(4)  
       phi   = atan(tan(THYOUT(4))/tan(THXOUT(4)))  
       theta = atan(tan(THXOUT(4))/cos(phi))  
   
       IF (tof22_i.GT.none_find.AND.yhelp.lt.100) THEN  
          i = tof22_i  
          if (tof22(left,i,iadc).lt.3786) then  
             tof22(left,i,iadc) = tof22(left,i,iadc)*cos(theta)  
             xkorr = atten(left,22,i,yhelp)  
             xkorr=xkorr/hepratio  
             adc_c(ch22a(i),hb22a(i))=tof22(left,i,iadc)/xkorr  
          endif  
   
          if (tof22(right,i,iadc).lt.3786) then  
             tof22(right,i,iadc) = tof22(right,i,iadc)*cos(theta)  
             xkorr = atten(right,22,i,yhelp)  
             xkorr=xkorr/hepratio  
             adc_c(ch22b(i),hb22b(i))=tof22(right,i,iadc)/xkorr  
          endif  
       ENDIF  
   
 C-----------------------------S3 --------------------------------  
   
       yhelp=yout(5)  
       phi   = atan(tan(THYOUT(5))/tan(THXOUT(5)))  
       theta = atan(tan(THXOUT(5))/cos(phi))  
   
       IF (tof31_i.GT.none_find.AND.yhelp.lt.100) THEN  
   
          i = tof31_i  
          if (tof31(left,i,iadc).lt.3786) then  
             tof31(left,i,iadc) = tof31(left,i,iadc)*cos(theta)  
             xkorr = atten(left,31,i,yhelp)  
             xkorr=xkorr/hepratio  
             adc_c(ch31a(i),hb31a(i))=tof31(left,i,iadc)/xkorr  
          endif  
   
          if (tof31(right,i,iadc).lt.3786) then  
             tof31(right,i,iadc) = tof31(right,i,iadc)*cos(theta)  
             xkorr = atten(right,31,i,yhelp)  
             xkorr=xkorr/hepratio  
             adc_c(ch31b(i),hb31b(i))=tof31(right,i,iadc)/xkorr  
          endif  
       ENDIF  
   
       xhelp=xout(6)  
       phi   = atan(tan(THYOUT(6))/tan(THXOUT(6)))  
       theta = atan(tan(THXOUT(6))/cos(phi))  
   
       IF (tof32_i.GT.none_find.AND.xhelp.lt.100) THEN  
          i = tof32_i  
          if (tof32(left,i,iadc).lt.3786) then  
             tof32(left,i,iadc) = tof32(left,i,iadc)*cos(theta)  
             xkorr = atten(left,32,i,xhelp)  
             xkorr=xkorr/hepratio  
             adc_c(ch32a(i),hb32a(i))=tof32(left,i,iadc)/xkorr  
          endif  
   
          if (tof32(right,i,iadc).lt.3786) then  
             tof32(right,i,iadc) = tof32(right,i,iadc)*cos(theta)  
             xkorr = atten(right,32,i,xhelp)  
             xkorr=xkorr/hepratio  
             adc_c(ch32b(i),hb32b(i))=tof32(right,i,iadc)/xkorr  
          endif  
       ENDIF  
   
   
 C-----------------------------------------------------------------------  
1215  C----------------------calculate Beta  ------------------------------  C----------------------calculate Beta  ------------------------------
1216  C-----------------------------------------------------------------------  C--------------------------------------------------------------------
1217  C-------------------difference of sums  ---------------------------  C---------------------difference of sums  ---------------------------
1218  C  C
1219  C     DS = (t1+t2) - t3+t4)  C     DS = (t1+t2) - t3+t4)
1220  C     DS = c1 + c2/beta*cos(theta)  C     DS = c1 + c2/beta*cos(theta)

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

  ViewVC Help
Powered by ViewVC 1.1.23