Optical Photons Production Position with MGDRAW

Dear FLUKA experts,

I want to obtain initial positions of optical photons produced in a material. I am using the following algorithm in the mgdraw.f :

  ENTRY USDRAW ( ICODE, MREG, XSCO, YSCO, ZSCO )
  IF ( .NOT. LFCOPE ) THEN
     LFCOPE = .TRUE.
     OPEN ( UNIT = 88, FILE = "result", FORM = 'FORMATTED',  
 &       STATUS = "UNKNOWN")
  END IF
  CALL GEOR2N ( MREG, NAMREG, IERR )
  IF(NAMREG .EQ. "TARGET") THEN
  	 IF(JTRACK .EQ. -1) THEN
  	    WRITE(88,'(1P,8G15.7)') XSCO, YSCO, ZSCO
  	    Lpkill = .TRUE.
     END IF
  END IF
  RETURN

I can see optical photons in the target region with usrbin, but myfile is empty. Moreover, I can obtain data when I change JTRACK=3 (electron, my beam particle). What is the problem or what could it be?

Also, is there a better way to obtain the initial position rather than saving the track position and then killing the track?

Best regards,
Selman

Dear @Selman,

Please, always share your input and all your source routines to allow debugging a problem.