#############################################################################
#
# modification history
+#
# $Log$
+# Revision 1.7 2001/05/21 17:22:52 buncic
+# Fixed problem with missing AliConfig while reading galice.root
+#
+# Revision 1.6 2001/05/16 14:57:30 alibrary
+# New files for folders and Stack
+#
+#
+# Revision 1.5 2001/02/23 17:33:40 buncic
+# Added alifs wrapper for CASTOR and alirun modified accordingly.
+#
# Revision 1.4 2001/02/08 18:55:43 buncic
# Support for writing to remote file systems (shift/castor).
#
# - Reco ................ reconstruction
#
# -d <TPC+ITS+..> | -d all | -all
-# Selects detector for which <command> will be run. If none of these options was specified, an internal loop in AliRoot over all active detectors is assumed. Otherwise, for each detector, input file(s) are re-opened in update mode, command (or macro) is executed and the file is closed. Option -all is equivalent to MUON+RICH+TOF+ITS+TPC+PHOS+PMD+CASTOR+TRD. Detectors are processed in order as they appear on the command line.
+# Selects detector for which <command> will be run. If none of these options was specified, an internal loop in AliRoot over all active detectors is assumed. Otherwise, for each detector, input file(s) are re-opened in update mode, command (or macro) is executed and the file is closed. Option -all is equivalent to MUON+HMPID+TOF+ITS+TPC+PHOS+PMD+CASTOR+TRD. Detectors are processed in order as they appear on the command line.
#
# -f <file>
# Name of the top level Root file where Root trees will be stored (branches may reside in the same file or be diverted to separate files (see -split option). By default, file is named galice.root.
# -debugger <command_name>
# Execute AliRoot under debugger other than gdb.
#
+# -debuglevel <level>
+# Set AliRoot debug flag to <level>.
+#
# -break <breakpoint>
# Execute AliRoot under gdb and set <breakpoint>.
#
#
# alirun -o /tmp/event.2 -f test.root -split -p 100 -c Hits
#
-# Use output from first step and create TOF and RICH digits. Output is in the same direcory and in file test.root
+# Use output from first step and create TOF and HMPID digits. Output is in the same direcory and in file test.root
#
-# alirun -d TOF+RICH -o /tmp/event.1 -c Digits
+# alirun -d TOF+HMPID -o /tmp/event.1 -c Digits
#
# Use output from second step and create digits for all detectors. Output is in the same direcory and branches are diverted to separate files:
#
exec $ALIRUN_SHELL -norc -noprofile $0 $*
fi
+
###########################################################################
AliRun()
###########################################################################
exit
}
+###########################################################################
+AliSetRoot()
+###########################################################################
+{
+ ALICE_ROOT=$1; export ALICE_ROOT
+ ALICE=`dirname $ALICE_ROOT`; export ALICE
+ ALICE_LEVEL=`basename $ALICE_ROOT`; export ALICE_LEVEL
+ ALICE_TARGET=`uname`; export ALICE_TARGET
+ ROOTSYS=$2; export ROOTSYS
+
+ LD_LIBRARY_PATH=$ROOTSYS/lib
+
+ if [ -f $ALICE/bin/changeRoot.sh ]
+ then
+ . $ALICE/bin/changeRoot.sh \
+ $ALICE $ALICE_LEVEL $ALICE_TARGET $ROOTSYS
+ fi
+
+ if [ ! -x $ALICE_BIN/aliroot -o ! -x $ROOTSYS/bin/root ]
+ then
+ printf "Invalid Alice library directory: %s\n" $1
+ exit 1
+ fi
+
+ LD_LIBRARY_PATH=${ROOTSYS}/lib:${ALICE_LIB}; export LD_LIBRARY_PATH
+ PATH=${ALICE_BIN}:${ROOTSYS}/bin:${PATH}; export PATH
+
+ printf "ALICE environment reset to %s\n" $ALICE_ROOT
+ which root
+ which aliroot
+}
+
###########################################################################
Mktemp()
###########################################################################
gAlice->Init(gSystem->Getenv("CONFIG"));
- gAlice->Run(1);
+ $DEBUG_LEVEL;
+
+ gAlice->RunMC($NEVENTS);
}
////////////////////////////////////////////////////////////////////////////
AliRun *gAlice = (AliRun*)file->Get("gAlice");
+ $DEBUG_LEVEL;
+
gAlice->$mode(gSystem->Getenv("CONFIG_DETECTOR"));
}
////////////////////////////////////////////////////////////////////////////
}
###########################################################################
-AliRunDigits()
+AliRunSplitCmd()
###########################################################################
{
if [ "$DETECTORS" = "" ]
then
- AliRoot Digits
+ AliRoot $1
else
for det in $DETECTORS
do
then
if [ "$LSF_FORK" = "TRUE" ]
then
- lsrun AliRoot Digits $CONFIG_DETECTOR
+ lsrun AliRoot $1 $CONFIG_DETECTOR
else
- AliRoot Digits $CONFIG_DETECTOR &
+ AliRoot $1 $CONFIG_DETECTOR &
fi
else
- AliRoot Digits $CONFIG_DETECTOR
+ AliRoot $1 $CONFIG_DETECTOR
fi
done
wait
fi
}
+###########################################################################
+AliRunDigits()
+###########################################################################
+{
+ AliRunSplitCmd Digits
+}
+
+###########################################################################
+AliRunReco()
+###########################################################################
+{
+ AliRunSplitCmd Reco
+}
+
###########################################################################
-ALL="MUON RICH TOF ITS TPC PHOS PMD CASTOR ZDC TRD";
+ALL="MUON HMPID TOF ITS TPC PHOS PMD CASTOR ZDC TRD";
DETECTORS="";
FILE="galice.root";
ALIRUN_DEBUGGER=gdb
DEBUG="FALSE"
+DEBUG_LEVEL=""
BREAK=""
VERBOSE="TRUE"
OUTPUT=.
-CMDLIST="Usage"
+CMDLIST=""
FORK="FALSE"
FORK_LSF="FALSE"
+BATCH="FALSE"
ECHO=""
+NEVENTS=1
USE_CACHE="file->UseCache()"
if [ -x /usr/local/lsf/bin/lsrun ]
shift 1
ALIRUN_DEBUGGER=$1
;;
+ -debuglevel)
+ shift 1
+ DEBUG_LEVEL="gAlice->SetDebug($1)"
+ ;;
-break)
shift 1
DEBUG="TRUE"
shift 1
set -vx
;;
+ -setroot)
+ shift 1
+ AliSetRoot $1 $2
+ shift 1
+ ;;
+ -batch)
+ shift 1
+ BATCH="TRUE"
+ ;;
-echo)
shift 1
ECHO="echo "
esac
done
+if [ "$CMDLIST" = "" ]
+then
+ AliRun
+fi
+
if [ `dirname $OUTPUT` = "." ]
then
CONFIG_OUTDIR=`pwd`/$OUTPUT
$MKDIR -p $CONFIG_OUTDIR
fi
-mkdir -p $ALIRUN_TMPDIR
-
CONFIG_FILE=$CONFIG_FILE_PREFIX$CONFIG_OUTDIR/$FILE; export CONFIG_FILE
+mkdir -p $ALIRUN_TMPDIR
+
trap Cleanup 2
(