anchor.diff:  !++  End of    S E L E C T E D   collimator
     end if
   #endif
  -
   
   end subroutine collimate_end_collimator
   
  
positive.code:       end if
  
        xndisp = xj
  
        nspxd = sqrt(abs(gammax*xdisp**2 +  two*talphax(ie)*xdisp*xpj +  tbetax(ie)*xpj**2)/c_emitx0_collgap)
        nspx  = sqrt(abs(gammax*xndisp**2 + two*talphax(ie)*xndisp*xpj + tbetax(ie)*xpj**2)/c_emitx0_collgap)
        nspy  = sqrt(abs(gammay*yj**2 +     two*talphay(ie)*yj*ypj +     tbetay(ie)*ypj**2)/c_emity0_collgap)
  
        if(part_abs_pos(j).eq.0 .and. part_abs_turn(j).eq.0) then
  
  
negative.code: 
    integer j, iSlice, nSlices
    logical onesided, linside(napx)
    real(kind=fPrec) jawLength,jawAperture,jawOffset,jawTilt(2),x_Dump,xpDump,y_Dump,ypDump,s_Dump,   &
      xmax,ymax,calc_aperture,ldrift,c_nex2,c_ney2,Nap1pos,Nap2pos,Nap1neg,Nap2neg,tiltOffsPos1,      &
      tiltOffsPos2,tiltOffsNeg1,tiltOffsNeg2,beamsize1,beamsize2,betax1,betax2,betay1,betay2,alphax1, &
      alphax2,alphay1,alphay2,minAmpl
  
  #ifdef G4COLLIMATION
    integer :: g4_lostc
  