(file) Return to guout.f CVS log (file) (dir) Up to [HallC] / sane_geant_mc / SRC

Diff for /sane_geant_mc/SRC/guout.f between version 1.2 and 1.3

version 1.2, 2010/05/06 14:16:41 version 1.3, 2011/07/01 14:52:45
Line 52 
Line 52 
       real*8 Cspead       real*8 Cspead
       parameter (Cspead = 29.9792458)       parameter (Cspead = 29.9792458)
       parameter (Z_coor=335)       parameter (Z_coor=335)
   
         real q2,xb,wsq,nu
 C C
 C Fill the total energy of the event in the histogram C Fill the total energy of the event in the histogram
 C C
Line 164 
Line 166 
  
  
             COORX2 = sane_n100xye(VectorN,0)             COORX2 = sane_n100xye(VectorN,0)
   
             COORY2 = sane_n100xye(VectorN,1)             COORY2 = sane_n100xye(VectorN,1)
             COORE  = sane_n100xye(VectorN,2)             COORE  = sane_n100xye(VectorN,2)
             X_coor= XX(3,3)+COORX2             X_coor= XX(3,3)+COORX2
Line 191 
Line 194 
             cwn_z_ur(iclust)=Z_coor             cwn_z_ur(iclust)=Z_coor
             call digi_cer(iclust)             call digi_cer(iclust)
  
 c     write(*,*) X_coor_r,  c      if(X_coor_r.gt.253.5.and.Y_coor_r.gt.12)then
 c     ,          Y_coor_r,  c       write(*,*) X_coor_r
 c     ,          Z_coor_r,  c     ,           ,Y_coor_r
 c     ,          E_coor*1000  c     ,           ,Z_coor_r
   c     ,           ,E_coor*1000
   c      endif
   CCC Smear to get resolution similar to data HB NK 08/11/10
   CCCC 12% shift seems to get it closest from pi0 mass peak.
               E_coor = E_coor +(rand()-0.5)*2*0.12*E_coor
   c            E_coor = E_coor +(rand()-0.5)*2*0.09*E_coor
   
             call CORRECT_ANGLES(             call CORRECT_ANGLES(
      ,           X_coor_r,      ,           X_coor_r,
      ,           Y_coor_r,      ,           Y_coor_r,
      ,           Z_coor_r,      ,           Z_coor_r,
      ,           E_coor*1000,      ,           E_coor*1000,
      ,           THETA_C ,      ,           THETA_C ,
      ,           PHI_C,cer_h(iclust))       ,           PHI_C,cer_h(iclust),srx,sry)
  
             cwn_E_r(iclust)=E_coor             cwn_E_r(iclust)=E_coor
             cwn_th_r(iclust)=THETA_C             cwn_th_r(iclust)=THETA_C
Line 209 
Line 219 
             cwn_x_r(iclust)=X_coor_r             cwn_x_r(iclust)=X_coor_r
             cwn_y_r(iclust)=Y_coor_r             cwn_y_r(iclust)=Y_coor_r
             cwn_z_r(iclust)=Z_coor_r             cwn_z_r(iclust)=Z_coor_r
   
             call NANcheckF(THETA_C,8)             call NANcheckF(THETA_C,8)
             call NANcheckF(PHI_C,9)             call NANcheckF(PHI_C,9)
  
               nu = E_beam/1000.d0 - E_coor
               q2 = 2.d0*E_beam/1000.d0*E_coor*(1-cos(THETA_C/180.d0*3.14159d0))
               xb = q2/2.d0/0.938d0/nu
               wsq = 0.938d0**2 + 2.d0*0.938d0*nu - q2
   
               cwn_Q2_r(iclust)=q2
               cwn_xb_r(iclust)=xb
               cwn_W_r(iclust)=sqrt(wsq)
   
   
   c      if(X_coor_r.gt.253.5)then
   C      if(X_coor_r.gt.253.5.and.PHI_C.gt.10)then
   c      if(X_coor_r.gt.253.5.and.THETA_C.gt.40)then
   c       write(*,*) X_coor_r
   c     ,           ,Y_coor_r
   c     ,           ,THETA_C
   c     ,           ,PHI_C
   c      endif
   
  
             call UNCORRECT_ANGLES(             call UNCORRECT_ANGLES(
      ,           X_coor_r,      ,           X_coor_r,
Line 272 
Line 302 
          if(nclust.gt.0)then          if(nclust.gt.0)then
 c            write(*,*)nclust c            write(*,*)nclust
 c            write(*,*) '# cerenkov photons:',photCer,photGood c            write(*,*) '# cerenkov photons:',photCer,photGood
               write(56,*)zz_t,nn_t,0.938**2+
        ,           2*0.938*(E_beam-E_coor)-
        ,           2*E_beam*E_coor*(1-cos(THETA_C/180.*3.141)),
        ,           xsn,E_coor,THETA_C,-EE,th*180/3.14159
             call hfnt(nt_geant)             call hfnt(nt_geant)
          endif          endif
          call clear_cer()          call clear_cer()
Line 408 
Line 442 
 c$$$      include 'sane_neuraly.f' c$$$      include 'sane_neuraly.f'
       include 'sane_n100xye.f'       include 'sane_n100xye.f'
 cccccccccccccccccccccccccccccccccccccccccccccccccccc cccccccccccccccccccccccccccccccccccccccccccccccccccc
       Subroutine CORRECT_ANGLES(x,y,z,ee,th,phi,cer_stat)        Subroutine CORRECT_ANGLES(x,y,z,ee,th,phi,cer_stat,srx,sry)
       IMPLICIT NONE       IMPLICIT NONE
 c c
 c     X = X(Bigcal)-X(raster) c     X = X(Bigcal)-X(raster)
Line 426 
Line 460 
       real th,phi,thr,phr,ee       real th,phi,thr,phr,ee
       real dist,SANE_BETA_OMEGA       real dist,SANE_BETA_OMEGA
       real*8 P_th(10),P_phi(10)       real*8 P_th(10),P_phi(10)
         real srx,sry
  
       integer cer_stat       integer cer_stat
       data P_th /       data P_th /
Line 453 
Line 488 
 c      print*,SANE_BETA_OMEGA c      print*,SANE_BETA_OMEGA
       if(cer_stat.gt.0)then       if(cer_stat.gt.0)then
  
   c      write(*,*)field_type
   c            write(*,*)SANE_BETA_OMEGA
          if(field_type.gt.0)then          if(field_type.gt.0)then
             if(SANE_BETA_OMEGA.lt.50)then  c            write(*,*)SANE_BETA_OMEGA
               if(SANE_BETA_OMEGA.gt.-50)then
                call POLYNOM_CORRECTION(SANE_TRANSFORM_MATRIX_THETA_40,                call POLYNOM_CORRECTION(SANE_TRANSFORM_MATRIX_THETA_40,
      ,              SANE_TRANSFORM_MATRIX_PHI_40,thr,      ,              SANE_TRANSFORM_MATRIX_PHI_40,thr,
      ,              phr,ee,th,phi,      ,              phr,ee,th,phi,
      ,              SANE_BETA_OMEGA)       ,              srx,sry)
             elseif (SANE_BETA_OMEGA.gt.130)then              elseif (SANE_BETA_OMEGA.lt.-130)then
                call POLYNOM_CORRECTION(SANE_TRANSFORM_MATRIX_THETA_140,                call POLYNOM_CORRECTION(SANE_TRANSFORM_MATRIX_THETA_140,
      ,              SANE_TRANSFORM_MATRIX_PHI_140,thr,      ,              SANE_TRANSFORM_MATRIX_PHI_140,thr,
      ,              phr,ee,th,phi,      ,              phr,ee,th,phi,
      ,              SANE_BETA_OMEGA)       ,              srx,sry)
             else             else
                WRITE(*,*)'WARNING : YOU DON T'                WRITE(*,*)'WARNING : YOU DON T'
                WRITE(*,*)'HAVE SANE_TRANSFORM_MATRIX CONSTANTS'                WRITE(*,*)'HAVE SANE_TRANSFORM_MATRIX CONSTANTS'
  
             endif             endif
   c            write(*,*)phi,phr*180/3.141
  
          else          else
             phi=phr*180/3.14159             phi=phr*180/3.14159
Line 501 
Line 540 
       end       end
 ccccccccccccccccccccccccccccccccccccccccccccccccccccc ccccccccccccccccccccccccccccccccccccccccccccccccccccc
       Subroutine POLYNOM_CORRECTION(P_th,P_phi,thr,phr,eMev,th,phi,       Subroutine POLYNOM_CORRECTION(P_th,P_phi,thr,phr,eMev,th,phi,
      ,                              omega_beta)       ,                              srx,sry)
       IMPLICIT NONE       IMPLICIT NONE
  
 c c
Line 515 
Line 554 
 c      include 'pmc.inc' c      include 'pmc.inc'
       real th,phi,thr,phr,eMev,ee       real th,phi,thr,phr,eMev,ee
       real omega_beta       real omega_beta
       real P_th(14),P_phi(38),cosom,sinom        real P_th(15),P_phi(15),cosom,sinom,srx,sry
       ee=eMeV/1000.       ee=eMeV/1000.
       cosom = cos(omega_beta*3.1415926/180.d0)  c      cosom = cos(omega_beta*3.1415926/180.d0)
       sinom = sin(omega_beta*3.1415926/180.d0)  c      sinom = sin(omega_beta*3.1415926/180.d0)
 c      write(*,*)ee c      write(*,*)ee
  
          th  = thr*180/3.1415926+          th  = thr*180/3.1415926+
      ,      ((P_th(1)+P_th(2)*phr+P_th(3)*thr+P_th(4)*phr**2       ,           (p_th(1)+p_th(2)*thr+p_th(3)*phr+p_th(4)*thr**2+
      ,      +P_th(5)*thr**2)/ee)*       ,           p_th(5)*phr**2+p_th(6)*thr*phr)*
      ,        (P_th(6)*cosom+P_th(7)*sinom)+       ,           (p_th(7)+p_th(8)/EE+p_th(9)/EE**2)*
      ,      ((P_th(8)+P_th(9)*thr+P_th(10)*phr+       ,           (p_th(10)+p_th(11)*srx+p_th(12)*srx**2)*
      ,        P_th(11)*phr**2+P_th(12)*thr**2)/ee**2)*       ,           (p_th(13)+p_th(14)*sry+p_th(15)*sry**2)
      ,       (P_th(13)*cosom+P_th(14)*sinom)  
  
  
  
          phi = phr*180/3.1415926  
      ,        +(P_phi(1)*cosom+P_phi(2)*phr*cosom+P_phi(3)*phr**2*cosom+  
      ,        P_phi(4)*phr**3*cosom+P_phi(5)*thr*cosom+  
      ,        P_phi(6)*thr**2*cosom+  
      ,        P_phi(7)*thr**3*cosom+P_phi(8)*phr*thr*cosom+  
      ,        P_phi(9)*phr**2*thr*cosom+  
      ,        P_phi(10)*phr*thr**2*cosom)+  
      ,        ( P_phi(11)*cosom+P_phi(12)*phr*cosom+  
      ,        P_phi(13)*phr**2*cosom+  
      ,        P_phi(14)*thr*cosom+P_phi(15)*thr**2*cosom+  
      ,        P_phi(16)*phr*thr*cosom)/ee  
      ,        +(P_phi(17)*sinom+P_phi(18)*phr*sinom+  
      ,        P_phi(19)*phr**2*sinom+  
      ,        P_phi(20)*phr**3*sinom+P_phi(21)*thr*sinom+  
      ,        P_phi(22)*thr**2*sinom+  
      ,        P_phi(23)*thr**3*sinom+P_phi(24)*phr*thr*sinom+  
      ,        P_phi(25)*phr**2*thr*sinom+  
      ,        P_phi(26)*phr*thr**2*sinom)+  
      ,        ( P_phi(27)*sinom+P_phi(28)*phr*sinom+  
      ,        P_phi(29)*phr**2*sinom+  
      ,        P_phi(30)*thr*sinom+P_phi(31)*thr**2*sinom+  
      ,        P_phi(32)*phr*thr*sinom)/ee+  
      ,         P_phi(33)*sinom**2+P_phi(34)*sinom**3+P_phi(35)*sinom**4  
      ,        +P_phi(36)*sinom**5+P_phi(37)*sinom**6+P_phi(38)*sinom**7  
 c         write(*,*)phi,phr*180/3.14159  
  
 c      write(*,*)'corrected',th,phi           phi = phr*180/3.1415926+
        ,           (p_phi(1)+p_phi(2)*thr+p_phi(3)*phr+p_phi(4)*thr**2+
        ,           p_phi(5)*phr**2+p_phi(6)*thr*phr)*
        ,           (p_phi(7)+p_phi(8)/EE+p_phi(9)/EE**2)*
        ,           (p_phi(10)+p_phi(11)*srx+p_phi(12)*srx**2)*
        ,           (p_phi(13)+p_phi(14)*sry+p_phi(15)*sry**2)
               end               end
  
  


Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

Analyzer/Replay: Mark Jones, Documents: Stephen Wood
Powered by
ViewCVS 0.9.2-cvsgraph-1.4.0