+#RUN=0 # run number for OCDB access
+SEED=1234567 # random number generator seed
+SIMDIR="generated" # sub-directory where to move simulated files prior to reco
+DUMPEVENT=5 # event to be dump on files
+
+# next try to see if there are options of this script that want to change the
+# defaults
+
+EXIT=0
+
+while getopts "SRX:srxn:tg:p:d:c:" option
+do
+ case $option in
+ R ) RECONSTRUCTION=1;;
+ S ) SIMULATION=1;;
+ X )
+ CHECKS=1
+ DUMPEVENT=$OPTARG
+ ;;
+ r ) RECONSTRUCTION=0;;
+ s ) SIMULATION=0;;
+ x ) CHECKS=0;;
+ t ) SLASHTMP=0;;
+ c ) SIMCONFIG=$OPTARG;;
+ d ) OUTDIR=$OPTARG;;
+ n ) NEVENTS=$OPTARG;;
+ g ) SEED=$OPTARG;;
+ p ) RECOPTIONS=$OPTARG;;
+ * ) echo "Unimplemented option chosen."
+ EXIT=1
+ ;;
+ esac
+done
+
+if [ ! -n "$OUTDIR" ]; then
+ OUTDIR="$CURDIR/test_out.$NEVENTS"
+fi
+
+# look if there are some leftover options
+shift $(($OPTIND - 1))
+
+if [ $# -gt 0 ] || [ "$EXIT" -eq 1 ]; then
+ echo "ERROR : extra option not recognized"
+ echo "Usage: `basename $0` options (-SRXsrxn:tg:p:d:c:)"
+ echo " -S (-s) perform (or not) simulation (default is do it, i.e -S)"
+ echo " -R (-r) perform (or not) reconstruction (default is do it, i.e. -R)"
+ echo " -X event (-x) perform (or not) checks and dumps (default is do it for event $DUMPEVENT, i.e. -X $DUMPEVENT)"
+ echo " -n nevents (int) number of events to simulate (default $NEVENTS)"
+ echo " -t will use OUTDIR as a tmp directory to generate raw data "
+ echo " -g seed (uint) seed to be used in simulation (default $SEED)"
+ echo " -p recoptions (quotified string) reconstruction options to use (default \"$RECOPTIONS\")"
+ echo " -d full path to output directory (default $OUTDIR)"
+ echo " -c full path to configuration file for simulation (default $SIMCONFIG)"
+ exit 4;
+fi
+
+# printout the options
+echo "sim $SIMULATION rec $RECONSTRUCTION check $CHECKS"
+if [ "$SIMULATION" -eq 1 ]; then
+ echo "$NEVENTS events will be simulated, using the config found at $SIMCONFIG"
+fi
+if [ "$RECONSTRUCTION" -eq 1 ]; then
+echo "Reconstruction options to be used : $RECOPTIONS"
+fi
+echo "Output directory will be : $OUTDIR"
+
+if [ "$SIMULATION" -eq 1 ]; then
+
+ rm -fr $OUTDIR
+ mkdir $OUTDIR
+
+fi
+
+cp $ALICE_ROOT/MUON/.rootrc $ALICE_ROOT/MUON/rootlogon.C \
+ $ALICE_ROOT/MUON/runReconstruction.C $ALICE_ROOT/MUON/runSimulation.C $OUTDIR
+