]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AlirootRun_MUONtest.sh
New classes for finding multiple vertices (in case of pile-up). They will be used...
[u/mrichter/AliRoot.git] / MUON / AlirootRun_MUONtest.sh
index 4bd90a2fb122ed23266d30df80b55fbbd3f0cac5..52de790ab1646e78494a2e983f10a8e2c660811c 100755 (executable)
@@ -6,14 +6,16 @@
 SIMULATION=1 # will perform simulation
 RECONSTRUCTION=1 # will perform reconstruction
 CHECKS=1 # will perform checks
+SLASHTMP=1 #will use /tmp to put the temporary raw data 
 NEVENTS=100 # 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
 OUTDIR=""
 CURDIR=`pwd`
 
-RUN=0 # run number for OCDB access
+#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
@@ -23,7 +25,7 @@ DUMPEVENT=5 # event to be dump on files
  
 EXIT=0
 
-while getopts "SRX:srxn:p:d:c:" option
+while getopts "SRX:srxn:tg:p:d:c:" option
 do
   case $option in
     R ) RECONSTRUCTION=1;;
@@ -35,9 +37,11 @@ do
     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
@@ -54,11 +58,13 @@ shift $(($OPTIND - 1))
 
 if [ $# -gt 0 ] || [ "$EXIT" -eq 1 ]; then
   echo "ERROR : extra option not recognized"
-  echo "Usage: `basename $0` options (-SRXsrxn:p:d:c:)"
+  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)"
@@ -87,6 +93,41 @@ cp $ALICE_ROOT/MUON/.rootrc $ALICE_ROOT/MUON/rootlogon.C \
 
 cd $OUTDIR
 
+if [ "$SLASHTMP" -eq 0 ]; then
+  mkdir ./tmp
+  mkdir ./tmp/mdc1
+  mkdir ./tmp/mdc2
+  mkdir ./tmp/mdc1/tags
+
+  chmod 777 ./tmp
+  chmod 777 ./tmp/mdc1
+  chmod 777 ./tmp/mdc2
+  chmod 777 ./tmp/mdc1/tags
+
+  export ALIMDC_RAWDB1=./tmp/mdc1
+  export ALIMDC_RAWDB2=./tmp/mdc2
+  export ALIMDC_TAGDB=./tmp/mdc1/tags
+fi
+
+###############################################################################
+# 
+# Update CTP in OCDB for MUON Trigger
+#
+###############################################################################
+
+if [ ! -f $ALICE_ROOT/GRP/CTP/Config/Run0_999999999_v0_s1.root ]; then
+
+  echo "Updating GRP CTP config  ..."
+
+  aliroot -b >& $OUTDIR/updateCDBCTPConfig.out << EOF
+  .L $ALICE_ROOT/MUON/UpdateCDBCTPConfig.C+
+  UpdateCDBCTPConfig();
+  .q
+EOF
+  
+fi
+
+
 ###############################################################################
 # 
 # Performing SIMULATION
@@ -97,10 +138,11 @@ if [ "$SIMULATION" -eq 1 ]; then
 
   echo "Running simulation  ..."
 
-  aliroot -b -q runSimulation.C\($RUN,$SEED,$NEVENTS,\""$SIMCONFIG"\"\) >& $OUTDIR/testSim.out 
+  aliroot -l -b -q runSimulation.C\($SEED,$NEVENTS,\""$SIMCONFIG"\"\) >& $OUTDIR/testSim.out 
   
   echo "Moving generated files to $SIMDIR"
   mkdir $OUTDIR/$SIMDIR
+  mv $OUTDIR/*QA*.root $OUTDIR/*.log $OUTDIR/$SIMDIR
   mv $OUTDIR/MUON*.root $OUTDIR/Kinematics*.root $OUTDIR/galice.root $OUTDIR/TrackRefs*.root $OUTDIR/$SIMDIR
 
 fi
@@ -113,13 +155,13 @@ fi
 
 if [ "$RECONSTRUCTION" -eq 1 ]; then
 
-  rm -f galice.root AliESD*.root
+  rm -f galice.root AliESD*.root *QA*.root
 
   echo "Running reconstruction  ..."
 
   cd $OUTDIR
   
-  aliroot -b -q runReconstruction\.C\($RUN,$SEED,\""$OUTDIR/raw.root"\",\""$RECOPTIONS"\"\) >& $OUTDIR/testReco.out
+  aliroot -l -b -q runReconstruction\.C\($SEED,\""$OUTDIR/raw.root"\",\""$RECOPTIONS"\"\) >& $OUTDIR/testReco.out
 
 fi
 
@@ -131,7 +173,7 @@ fi
 
 if [ "$CHECKS" -eq 1 ]; then
 
-  if [ "$SIMULATION" -eq 1 ]; then
+  if [ -f "$OUTDIR/$SIMDIR/galice.root" ]; then
 
     echo "Running efficiency  ..."
 
@@ -142,7 +184,7 @@ if [ "$CHECKS" -eq 1 ]; then
     .q
 EOF
 
-    if [ "$RECONSTRUCTION" -eq 1 ]; then
+  if [ -f "$OUTDIR/galice.root" ]; then
 
       echo "Running Trigger efficiency  ..."
       aliroot -b >& $OUTDIR/testTriggerResults.out << EOF
@@ -151,20 +193,25 @@ EOF
       .q
 EOF
 
-      echo "Running check ..."
-      aliroot -b >& $OUTDIR/testCheck.out << EOF
-      gSystem->Load("libMUONevaluation");
-      .L $ALICE_ROOT/MUON/MUONCheck.C+
-      MUONCheck(0, $NEVENTS-1, "$OUTDIR/$SIMDIR/galice.root", "$OUTDIR/galice.root", "$OUTDIR/AliESDs.root"); 
-      .q
+      if [ -f "$OUTDIR/AliESDs.root" ]; then
+
+        echo "Running check ..."
+        aliroot -b >& $OUTDIR/testCheck.out << EOF
+        gSystem->Load("libMUONevaluation");
+        .L $ALICE_ROOT/MUON/MUONCheck.C+
+        MUONCheck(0, $NEVENTS-1, "$OUTDIR/$SIMDIR/galice.root", "$OUTDIR/galice.root", "$OUTDIR/AliESDs.root"); 
+        .q
 EOF
+      fi
     fi
   fi
 
   echo "Running dumps for selected event ($DUMPEVENT) ..."
 
   if [ -f "$OUTDIR/$SIMDIR/galice.root" ]; then
-    aliroot -b  << EOF
+    aliroot -l -b  << EOF
+    AliCDBManager* man = AliCDBManager::Instance();
+    man->SetDefaultStorage("local://$ALICE_ROOT");
     AliMUONMCDataInterface mcdSim("$OUTDIR/$SIMDIR/galice.root");
     mcdSim.DumpKine($DUMPEVENT);       > $OUTDIR/dump.$DUMPEVENT.kine
     mcdSim.DumpHits($DUMPEVENT);       > $OUTDIR/dump.$DUMPEVENT.hits
@@ -178,12 +225,12 @@ EOF
   fi
 
   if [ -f "$OUTDIR/galice.root" ]; then
-    aliroot -b << EOF
+    aliroot -l -b << EOF
+    AliCDBManager* man = AliCDBManager::Instance();
+    man->SetDefaultStorage("local://$ALICE_ROOT");
     AliMUONDataInterface dRec("$OUTDIR/galice.root");
     dRec.DumpDigits($DUMPEVENT,true); > $OUTDIR/dump.$DUMPEVENT.recdigits
     dRec.DumpRecPoints($DUMPEVENT);  > $OUTDIR/dump.$DUMPEVENT.recpoints
-    dRec.DumpTracks($DUMPEVENT);     > $OUTDIR/dump.$DUMPEVENT.tracks
-    dRec.DumpTriggerTracks($DUMPEVENT); > $OUTDIR/dump.$DUMPEVENT.triggertracks
     dRec.DumpTrigger($DUMPEVENT); > $OUTDIR/dump.$DUMPEVENT.trigger
     .q
 EOF