#!/bin/csh -f

setenv vers v3r5

# folders list
setenv DAT    dat
setenv EVENTS evt
setenv INFO   livetime

# execution parameters
setenv run_id     0023
setenv num_events 100000

setenv seed 12345678

setenv INFILE ${DAT}/parameters.dat
setenv OUTFILE1 ${EVENTS}/mupage${vers}.run_$run_id.evt
setenv OUTFILE2 ${INFO}/livetime${vers}.run_$run_id.info

# Set the geometry file and verification of geometry file existence
setenv DETNAME r12_c00_s01
if (-e ${ANTRS_ROOT}/DETECTOR/$DETNAME.det) then
  setenv GEOFIL "${ANTRS_ROOT}/DETECTOR/$DETNAME.det"
else
  echo "File " $DETNAME".det doesn't exist in folder "${ANTRS_ROOT}/DETECTOR
  exit
endif

./mupage${vers}.exe  -i $run_id -n $num_events -s $seed \
-o $OUTFILE1 $OUTFILE2 -p $INFILE -g $GEOFIL \
#-t #to having table format


