]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AlirootRun_MUONtest.sh
Previous commit had the bad side-effect of changing the behaviour of Raw QA to comput...
[u/mrichter/AliRoot.git] / MUON / AlirootRun_MUONtest.sh
index 52de790ab1646e78494a2e983f10a8e2c660811c..ae3a376a0db5afc9283c570145e8e9f235557e33 100755 (executable)
@@ -5,6 +5,7 @@
 
 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
@@ -25,7 +26,7 @@ DUMPEVENT=5 # event to be dump on files
  
 EXIT=0
 
-while getopts "SRX:srxn:tg:p:d:c:" option
+while getopts "SRZX:srxzn:tg:p:d:c:" option
 do
   case $option in
     R ) RECONSTRUCTION=1;;
@@ -34,10 +35,12 @@ do
     CHECKS=1
     DUMPEVENT=$OPTARG
     ;;
+    Z ) RAW=1;;
     r ) RECONSTRUCTION=0;;
     s ) SIMULATION=0;;
     x ) CHECKS=0;;
     t ) SLASHTMP=0;;
+    z ) RAW=0;;
     c ) SIMCONFIG=$OPTARG;;
     d ) OUTDIR=$OPTARG;;
     n ) NEVENTS=$OPTARG;;
@@ -62,6 +65,7 @@ if [ $# -gt 0 ] || [ "$EXIT" -eq 1 ]; then
   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 "       -Z (-z) perform reconstruction from raw data (from digits) (default is from raw data, i.e. -Z)"
   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)"
@@ -78,6 +82,9 @@ if [ "$SIMULATION" -eq 1 ]; then
 fi
 if [ "$RECONSTRUCTION" -eq 1 ]; then
 echo "Reconstruction options to be used : $RECOPTIONS"
+if [ "$RAW" -eq 0 ]; then
+echo "Will reconstruct from digits only (not from raw data)"
+fi
 fi
 echo "Output directory will be : $OUTDIR"
 
@@ -88,8 +95,16 @@ if [ "$SIMULATION" -eq 1 ]; then
 
 fi
 
-cp $ALICE_ROOT/MUON/.rootrc $ALICE_ROOT/MUON/rootlogon.C \
-  $ALICE_ROOT/MUON/runReconstruction.C $ALICE_ROOT/MUON/runSimulation.C $OUTDIR
+# 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 \
+  $OUTDIR
 
 cd $OUTDIR
 
@@ -115,12 +130,12 @@ fi
 #
 ###############################################################################
 
-if [ ! -f $ALICE_ROOT/GRP/CTP/Config/Run0_999999999_v0_s1.root ]; then
+if [ ! -f $ALICE_ROOT/OCDB/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+
+  .L UpdateCDBCTPConfig.C+
   UpdateCDBCTPConfig();
   .q
 EOF
@@ -139,12 +154,19 @@ if [ "$SIMULATION" -eq 1 ]; then
   echo "Running simulation  ..."
 
   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
 
+  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
+  else  
+    echo "Copying generated files to $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
+  
 fi
 
 ###############################################################################
@@ -155,14 +177,26 @@ fi
 
 if [ "$RECONSTRUCTION" -eq 1 ]; then
 
-  rm -f galice.root AliESD*.root *QA*.root
-
+  if [ "$RAW" -eq 1 ]; then
+    rm -f galice.root 
+  fi  
+  
+  rm -f AliESD*.root *QA*.root
+  
   echo "Running reconstruction  ..."
 
   cd $OUTDIR
   
-  aliroot -l -b -q runReconstruction\.C\($SEED,\""$OUTDIR/raw.root"\",\""$RECOPTIONS"\"\) >& $OUTDIR/testReco.out
+  if [ "$RAW" -eq 1 ]; then
+  
+    aliroot -l -b -q runReconstruction\.C\($SEED,\""$OUTDIR/raw.root"\",\""$RECOPTIONS"\"\) >& $OUTDIR/testReco.out
+
+  else
 
+    aliroot -l -b -q runReconstruction\.C\($SEED,\"""\",\""$RECOPTIONS"\"\) >& $OUTDIR/testReco.out
+  
+  fi
+  
 fi
 
 ###############################################################################
@@ -178,7 +212,7 @@ if [ "$CHECKS" -eq 1 ]; then
     echo "Running efficiency  ..."
 
     aliroot -b >& $OUTDIR/testResults.out << EOF
-    .L $ALICE_ROOT/MUON/MUONefficiency.C+
+    .L MUONefficiency.C+
     // no argument assumes Upsilon but MUONefficiency(443) works on Jpsi
     MUONefficiency("$OUTDIR/$SIMDIR/galice.root");
     .q
@@ -188,7 +222,7 @@ EOF
 
       echo "Running Trigger efficiency  ..."
       aliroot -b >& $OUTDIR/testTriggerResults.out << EOF
-      .L $ALICE_ROOT/MUON/MUONTriggerEfficiency.C+
+      .L MUONTriggerEfficiency.C+
       MUONTriggerEfficiency("$OUTDIR/$SIMDIR/galice.root", "$OUTDIR/galice.root", 1);
       .q
 EOF
@@ -198,7 +232,7 @@ EOF
         echo "Running check ..."
         aliroot -b >& $OUTDIR/testCheck.out << EOF
         gSystem->Load("libMUONevaluation");
-        .L $ALICE_ROOT/MUON/MUONCheck.C+
+        .L MUONCheck.C+
         MUONCheck(0, $NEVENTS-1, "$OUTDIR/$SIMDIR/galice.root", "$OUTDIR/galice.root", "$OUTDIR/AliESDs.root"); 
         .q
 EOF
@@ -211,7 +245,7 @@ EOF
   if [ -f "$OUTDIR/$SIMDIR/galice.root" ]; then
     aliroot -l -b  << EOF
     AliCDBManager* man = AliCDBManager::Instance();
-    man->SetDefaultStorage("local://$ALICE_ROOT");
+    man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
     AliMUONMCDataInterface mcdSim("$OUTDIR/$SIMDIR/galice.root");
     mcdSim.DumpKine($DUMPEVENT);       > $OUTDIR/dump.$DUMPEVENT.kine
     mcdSim.DumpHits($DUMPEVENT);       > $OUTDIR/dump.$DUMPEVENT.hits
@@ -227,7 +261,7 @@ EOF
   if [ -f "$OUTDIR/galice.root" ]; then
     aliroot -l -b << EOF
     AliCDBManager* man = AliCDBManager::Instance();
-    man->SetDefaultStorage("local://$ALICE_ROOT");
+    man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
     AliMUONDataInterface dRec("$OUTDIR/galice.root");
     dRec.DumpDigits($DUMPEVENT,true); > $OUTDIR/dump.$DUMPEVENT.recdigits
     dRec.DumpRecPoints($DUMPEVENT);  > $OUTDIR/dump.$DUMPEVENT.recpoints