]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AlirootRun_MUONtest.sh
doxy: MUON macros, refs, src links, no coll graph
[u/mrichter/AliRoot.git] / MUON / AlirootRun_MUONtest.sh
index 9aa2cc7ed63d16c47043a5671d3a3770e7b25c58..e2239c8dbb509bd4b9a68f2bd05e6f1fe24d4be9 100755 (executable)
@@ -3,12 +3,15 @@
 
 # first declare default values
 
+# path to macros
+MACROPATH=$ALICE_ROOT/MUON/macros
+
 SIMULATION=1 # will perform simulation
 RECONSTRUCTION=1 # will perform reconstruction
 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
@@ -22,17 +25,18 @@ CURDIR=`pwd`
 #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
+DUMPEVENT=5 # event to be dump on files (set to negative to skip dumps)
 
-SIMCONFIG="$ALICE_ROOT/MUON/"$MC"Config.C"
+SIMCONFIG="$MACROPATH/"$MC"Config.C"
 EMBEDWITH="" # no embedding by default
+REALISTIC=0 # ideal simulation 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:e:" option
+while getopts "SRZX:srxzn:tg:p:d:c:e:b:" option
 do
   case $option in
     R ) RECONSTRUCTION=1;;
@@ -53,6 +57,10 @@ do
     g ) SEED=$OPTARG;;
     p ) RECOPTIONS=$OPTARG;; 
     e ) EMBEDWITH=$OPTARG;;
+    b ) 
+    REALISTIC=$OPTARG
+    RAW=0
+    ;;
     *     ) echo "Unimplemented option chosen."
     EXIT=1
     ;;
@@ -84,6 +92,7 @@ if [ $# -gt 0 ] || [ "$EXIT" -eq 1 ]; then
   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)"
+  echo "       -b runnumber (int) make a realistic simulation using runnumber as anchor (default 0=ideal simulation)"
   exit 4;
 fi
 
@@ -96,6 +105,9 @@ fi
 if [ -n "$EMBEDWITH" ]; then
   echo "Will embed simulation with $EMBEDWITH"
 fi
+if [ "$REALISTIC" -gt 0 ]; then
+  echo "Will use anchor run $REALISTIC"
+fi
 if [ "$RECONSTRUCTION" -eq 1 ]; then
 echo "Reconstruction options to be used : $RECOPTIONS"
 if [ "$RAW" -eq 0 ]; then
@@ -113,13 +125,14 @@ fi
 
 # Copy *ALL* the macros we need in the output directory, not to mess
 # with our source dir in any way.
-cp $ALICE_ROOT/MUON/.rootrc \
-  $ALICE_ROOT/MUON/rootlogon.C \
-  $ALICE_ROOT/MUON/runReconstruction.C $ALICE_ROOT/MUON/runSimulation.C \
-  $ALICE_ROOT/MUON/UpdateCDBCTPConfig.C \
-  $ALICE_ROOT/MUON/MUONefficiency.C \
-  $ALICE_ROOT/MUON/MUONTriggerEfficiency.C \
-  $ALICE_ROOT/MUON/MUONCheck.C \
+cp $MACROPATH/.rootrc \
+  $MACROPATH/rootlogon.C \
+  $MACROPATH/runReconstruction.C \
+  $MACROPATH/runSimulation.C \
+  $MACROPATH/UpdateCDBCTPConfig.C \
+  $MACROPATH/MUONefficiency.C \
+  $MACROPATH/MUONTriggerEfficiency.C \
+  $MACROPATH/MUONCheck.C \
   $OUTDIR
 
 cd $OUTDIR
@@ -169,14 +182,17 @@ if [ "$SIMULATION" -eq 1 ]; then
 
   echo "Running simulation  ..."
 
-  aliroot -l -b -q runSimulation.C\($SEED,$NEVENTS,\""$SIMCONFIG"\"\,\""$EMBEDWITH"\"\) > $OUTDIR/testSim.out 2>&1
+  aliroot -l -b -q runSimulation.C\($SEED,$NEVENTS,\""$SIMCONFIG"\"\,\""$EMBEDWITH"\"\,$REALISTIC\) > $OUTDIR/testSim.out 2>&1
 
   mkdir $OUTDIR/$SIMDIR
 
   if [ "$RAW" -eq 1 ]; then
-    echo "Moving generated files to $SIMDIR"
-    mv $OUTDIR/*QA*.root $OUTDIR/*.log $OUTDIR/$SIMDIR
-    mv $OUTDIR/MUON*.root $OUTDIR/Kinematics*.root $OUTDIR/galice.root $OUTDIR/TrackRefs*.root $OUTDIR/$SIMDIR
+    if [ "$REALISTIC" -eq 0 ]; then # we can not move for realistic simulations as we need e.g. kinematics to propagate the simulated vertex to the reco.
+      echo "Moving generated files to $SIMDIR"
+      mv $OUTDIR/*QA*.root $OUTDIR/*.log $OUTDIR/$SIMDIR
+      mv $OUTDIR/MUON*.root $OUTDIR/TrackRefs*.root $OUTDIR/$SIMDIR
+      mv $OUTDIR/Kinematics*.root $OUTDIR/galice.root $OUTDIR/$SIMDIR
+    fi
   else  
     echo "Copying generated files to $SIMDIR"
     cp $OUTDIR/*QA*.root $OUTDIR/*.log $OUTDIR/$SIMDIR
@@ -185,15 +201,18 @@ if [ "$SIMULATION" -eq 1 ]; then
 
   # 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
+    rm -fr $OUTDIR/geometry
+    mkdir $OUTDIR/geometry
+    cp $OUTDIR/geometry.root $OUTDIR/geometry
   fi 
 
   # copy input geometry file in a current directory
   if [ "$MC" = "g4" ]; then
-    cp $ALICE_ROOT/MUON/geometry/geometry.root $OUTDIR
+    cp $OUTDIR/geometry/geometry.root $OUTDIR
   fi 
+  
+  cp $OUTDIR/geometry.root $OUTDIR/$SIMDIR/geometry.root
+  
 fi
 
 ###############################################################################
@@ -205,8 +224,14 @@ fi
 if [ "$RECONSTRUCTION" -eq 1 ]; then
 
   if [ "$RAW" -eq 1 ]; then
-    rm -f galice.root 
+    if [ "$REALISTIC" -eq 0 ]; then
+      rm -f galice.root
+    fi
   fi  
+
+  if [ "$REALISTIC" -ne 0 ]; then
+    rm -f geometry.root
+  fi
   
   rm -f AliESD*.root *QA*.root
   
@@ -214,19 +239,23 @@ if [ "$RECONSTRUCTION" -eq 1 ]; then
 
   cd $OUTDIR
   
-  BOOLEMBED=kFALSE
+  RAWOCDB=kFALSE
   
   if [ -n "$EMBEDWITH" ]; then
-    BOOLEMBED=kTRUE
+    RAWOCDB=kTRUE
+  fi
+  
+  if [ "$REALISTIC" -gt 0 ]; then
+    RAWOCDB=kTRUE
   fi
   
   if [ "$RAW" -eq 1 ]; then
   
-    aliroot -l -b -q runReconstruction\.C\($SEED,\""$OUTDIR/raw.root"\",\""$RECOPTIONS"\",$BOOLEMBED\) > $OUTDIR/testReco.out 2>&1
+    aliroot -l -b -q runReconstruction\.C\($SEED,\""$OUTDIR/raw.root"\",\""$RECOPTIONS"\",$RAWOCDB\) > $OUTDIR/testReco.out 2>&1
 
   else
 
-    aliroot -l -b -q runReconstruction\.C\($SEED,\"""\",\""$RECOPTIONS"\",$BOOLEMBED\) > $OUTDIR/testReco.out  2>&1
+    aliroot -l -b -q runReconstruction\.C\($SEED,\"""\",\""$RECOPTIONS"\",$RAWOCDB\) > $OUTDIR/testReco.out  2>&1
   
   fi
   
@@ -272,6 +301,8 @@ EOF
       fi
     fi
   fi
+  
+if [ "$DUMPEVENT" -ge 0 ]; then
 
   echo "Running dumps for selected event ($DUMPEVENT) ..."
 
@@ -306,6 +337,8 @@ EOF
   fi
 fi
 
+fi
+
 echo "Finished"  
 echo "... see results in $OUTDIR"