RAW=1 # will reconstruct from raw data
CHECKS=1 # will perform checks
SLASHTMP=1 #will use /tmp to put the temporary raw data
-NEVENTS=100 # will simulate 100 events
+NEVENTS=50 # will simulate 100 events
#RECOPTIONS="SAVEDIGITS NOFASTDECODERS" # reconstruction options with non-high performance decoders
RECOPTIONS="SAVEDIGITS" # default reconstruction options
-SIMCONFIG="$ALICE_ROOT/MUON/Config.C" # default simulation configuration file
+MC="" # G3 Simulation with old Config.C
+#MC="g3" # G3 Simulation (with new config macros)
+#MC="g4" # G4 Simulation (with new config macros)
+
OUTDIR=""
CURDIR=`pwd`
SIMDIR="generated" # sub-directory where to move simulated files prior to reco
DUMPEVENT=5 # event to be dump on files
+SIMCONFIG="$ALICE_ROOT/MUON/"$MC"Config.C"
+EMBEDWITH="" # no embedding by default
+
# next try to see if there are options of this script that want to change the
# defaults
EXIT=0
-while getopts "SRZX:srxzn:tg:p:d:c:" option
+while getopts "SRZX:srxzn:tg:p:d:c:e:" option
do
case $option in
R ) RECONSTRUCTION=1;;
n ) NEVENTS=$OPTARG;;
g ) SEED=$OPTARG;;
p ) RECOPTIONS=$OPTARG;;
+ e ) EMBEDWITH=$OPTARG;;
* ) echo "Unimplemented option chosen."
EXIT=1
;;
done
if [ ! -n "$OUTDIR" ]; then
- OUTDIR="$CURDIR/test_out.$NEVENTS"
+ if [ "$MC" = "" ]; then
+ OUTDIR=$CURDIR"/test_out."$NEVENTS
+ else
+ OUTDIR=$CURDIR"/"$MC"_test_out."$NEVENTS
+ fi
fi
# look if there are some leftover options
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)"
+ echo " -e full path to a galice.root file relating to SDigits to be merged (embedding)"
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 [ -n "$EMBEDWITH" ]; then
+ echo "Will embed simulation with $EMBEDWITH"
+fi
if [ "$RECONSTRUCTION" -eq 1 ]; then
echo "Reconstruction options to be used : $RECOPTIONS"
if [ "$RAW" -eq 0 ]; then
echo "Updating GRP CTP config ..."
- aliroot -b >& $OUTDIR/updateCDBCTPConfig.out << EOF
- .L UpdateCDBCTPConfig.C+
+ aliroot -b > $OUTDIR/updateCDBCTPConfig.out 2>&1 << EOF
+ .L UpdateCDBCTPConfig.C++g
UpdateCDBCTPConfig();
.q
EOF
echo "Running simulation ..."
- aliroot -l -b -q runSimulation.C\($SEED,$NEVENTS,\""$SIMCONFIG"\"\) >& $OUTDIR/testSim.out
+ aliroot -l -b -q runSimulation.C\($SEED,$NEVENTS,\""$SIMCONFIG"\"\,\""$EMBEDWITH"\"\) > $OUTDIR/testSim.out 2>&1
mkdir $OUTDIR/$SIMDIR
cp $OUTDIR/*QA*.root $OUTDIR/*.log $OUTDIR/$SIMDIR
cp $OUTDIR/MUON*.root $OUTDIR/Kinematics*.root $OUTDIR/galice.root $OUTDIR/TrackRefs*.root $OUTDIR/$SIMDIR
fi
-
+
+ # save geometry file in a separate directory
+ if [ "$MC" = "g3" ]; then
+ rm -fr $ALICE_ROOT/MUON/geometry
+ mkdir $ALICE_ROOT/MUON/geometry
+ cp $OUTDIR/geometry.root $ALICE_ROOT/MUON/geometry
+ fi
+
+ # copy input geometry file in a current directory
+ if [ "$MC" = "g4" ]; then
+ cp $ALICE_ROOT/MUON/geometry/geometry.root $OUTDIR
+ fi
fi
###############################################################################
cd $OUTDIR
+ BOOLEMBED=kFALSE
+
+ if [ -n "$EMBEDWITH" ]; then
+ BOOLEMBED=kTRUE
+ fi
+
if [ "$RAW" -eq 1 ]; then
- aliroot -l -b -q runReconstruction\.C\($SEED,\""$OUTDIR/raw.root"\",\""$RECOPTIONS"\"\) >& $OUTDIR/testReco.out
+ aliroot -l -b -q runReconstruction\.C\($SEED,\""$OUTDIR/raw.root"\",\""$RECOPTIONS"\",$BOOLEMBED\) > $OUTDIR/testReco.out 2>&1
else
- aliroot -l -b -q runReconstruction\.C\($SEED,\"""\",\""$RECOPTIONS"\"\) >& $OUTDIR/testReco.out
+ aliroot -l -b -q runReconstruction\.C\($SEED,\"""\",\""$RECOPTIONS"\",$BOOLEMBED\) > $OUTDIR/testReco.out 2>&1
fi
echo "Running efficiency ..."
- aliroot -b >& $OUTDIR/testResults.out << EOF
- .L MUONefficiency.C+
+ aliroot -b > $OUTDIR/testResults.out 2>&1 << EOF
+ .L MUONefficiency.C++g
// no argument assumes Upsilon but MUONefficiency(443) works on Jpsi
MUONefficiency("$OUTDIR/$SIMDIR/galice.root");
.q
if [ -f "$OUTDIR/galice.root" ]; then
echo "Running Trigger efficiency ..."
- aliroot -b >& $OUTDIR/testTriggerResults.out << EOF
- .L MUONTriggerEfficiency.C+
+ aliroot -b > $OUTDIR/testTriggerResults.out 2>&1 << EOF
+ .L MUONTriggerEfficiency.C++g
MUONTriggerEfficiency("$OUTDIR/$SIMDIR/galice.root", "$OUTDIR/galice.root", 1);
.q
EOF
if [ -f "$OUTDIR/AliESDs.root" ]; then
echo "Running check ..."
- aliroot -b >& $OUTDIR/testCheck.out << EOF
+ aliroot -b > $OUTDIR/testCheck.out 2>&1 << EOF
gSystem->Load("libMUONevaluation");
- .L MUONCheck.C+
+ .L MUONCheck.C++g
MUONCheck(0, $NEVENTS-1, "$OUTDIR/$SIMDIR/galice.root", "$OUTDIR/galice.root", "$OUTDIR/AliESDs.root");
.q
EOF
if [ -f "$OUTDIR/$SIMDIR/galice.root" ]; then
aliroot -l -b << EOF
- AliCDBManager* man = AliCDBManager::Instance();
+ AliCDBManager* man = AliCDBManager::Instance();
man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
AliMUONMCDataInterface mcdSim("$OUTDIR/$SIMDIR/galice.root");
mcdSim.DumpKine($DUMPEVENT); > $OUTDIR/dump.$DUMPEVENT.kine