*
*	READGE.KUMAC
*
*	KUMAC to open NT file from GEANT_LEMSR simulation on next free
*	LUN.
*
*	Input parameter:
*
*	[1]:	GEant Runnumber
*
*	TP,	10-feb-1999,	PSI
*
*	TP,	06-Apr-2001,	PSI: Unix, Linux and Windows version
*
*---------------------------------------------------------------------------
*
	if ([1] .eq. '?' .or. [1] .eq. ' ' .or. [1] .eq. '!') then
		mess
		mess READGE kumac to open GEANT_LEMSR NTUPLE file.
		mess
		mess Syntax:
		mess
		mess READGE runNr
		mess
		exitm
	endif
	runnr = [1]
*
*	determine operating system to build the filename;
*	only Windows or Unix/Linux
*
	os = $OS
*
	if ( [os] .eq. 'Windows') then
		file  = 'c:\users\thomas\mc\geant\data\geant_lemsr_'//[runnr]//'.nt'
		goto check_file
	endif
	if ( [os] .eq. 'UNIX') then
*	 if ( $OSTYPE .eq. 'Linux' ) then
	        file = /scratch/$USER/geant/geant_lemsr_[runnr].nt
		goto check_file
*	 else
*		file = $HOME//'/mc/geant/data/geant_lemsr_'//[runnr]//'.nt'
*		goto check_file
*	 endif
	endif
*
	mess Operating system [os] not supported
	exitm
*
check_file:

	if ( $fexist([file]) ) then 
		hi/file 0 [file] 4096
	else
		mess
		mess File [file] does not exist...
		mess
	endif
*
*

