]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
another update, + TOF script, still expecting the TOF
authormkrzewic <mikolaj.krzewicki@cern.ch>
Fri, 21 Feb 2014 16:31:43 +0000 (17:31 +0100)
committermkrzewic <mikolaj.krzewicki@cern.ch>
Fri, 21 Feb 2014 16:33:43 +0000 (17:33 +0100)
macros to change

PWGPP/QA/detectorQAscripts/EXAMPLE.sh
PWGPP/QA/detectorQAscripts/TOF.sh [new file with mode: 0755]
PWGPP/QA/scripts/runQA.example.config
PWGPP/QA/scripts/runQA.sh

index 1bed99e1dc3789fde2308bf513362c4747b8a199..2e3ec4fafb9324ff903f1241edc7729d54e3ac31 100755 (executable)
@@ -5,7 +5,7 @@
 #  $dataType     e.g. data or sim
 #  $year         e.g. 2011
 #  $period       e.g. LHC13g
-#  $runNumer     e.g. 169123
+#  $runNumber     e.g. 169123
 #  $pass         e.g. cpass1,pass1,passMC
 
 runLevelQA()
@@ -27,5 +27,7 @@ periodLevelQA()
   #the running dir contains all the run sub directories
   #named like 000123123 with the outputs of runLevelQA
 
+  
+
   #aliroot...
 }
diff --git a/PWGPP/QA/detectorQAscripts/TOF.sh b/PWGPP/QA/detectorQAscripts/TOF.sh
new file mode 100755 (executable)
index 0000000..e9e127b
--- /dev/null
@@ -0,0 +1,24 @@
+#available variables:
+#  $dataType     e.g. data or sim
+#  $year         e.g. 2011
+#  $period       e.g. LHC13g
+#  $runNumber     e.g. 169123
+#  $pass         e.g. cpass1,pass1,passMC
+
+runLevelQA()
+{
+  qaFile=$1
+
+  #cp $ALICE_ROOT/TOF/macrosQA/MakeTrendingTOFQA.C .
+  #aliroot -b -q -l "MakeTrendingTOFQA.C(\"$qaFile\",${runNumber})" 
+}
+
+periodLevelQA()
+{
+  trendingFile=$1
+
+  #cp $ALICE_ROOT/TOF/macrosQA/DrawTrending.C .
+  #rm trending.root
+  #ls 000*/trending.root > trending.list
+  #aliroot -b -q -l "DrawTrending.C(\"trending.list\")"
+}
index 156d5f33cec811c74dcdeb96f58dee83f157f069..008279202d73998cbc65a9a29c053ed9bae3baeb 100755 (executable)
@@ -2,11 +2,11 @@
 inputList=qaFile.list
 
 #working directory
-workingDirectory="/home/mkrzewic/cern/qaPlots/"
+workingDirectory="${PWD}"
 
 #where to place the final qa plots
 #outputDirectory="/afs/cern.ch/work/a/aliqa%det/www/"
-outputDirectory="/home/mkrzewic/cern/qaPlots/output/%det"
+outputDirectory="${PWD}/output/aliceqa%det"
 
 #filter out detector option
 
@@ -16,3 +16,5 @@ logDirectory=${workingDirectory}/logs
 #set aliroot
 alirootEnv="/home/mkrzewic/alisoft/balice_master.sh"
 
+#OCDB storage
+ocdbStorage="raw://"
index 7b2adfe4c1e4d72c65272f3d841d750cfab94bae..9779f8463fd0a261ddf926c3de0d5e280bf72fb6 100755 (executable)
@@ -6,12 +6,18 @@ main()
     echo "  - optionalStuff overrides config file, e.g.:"
     echo "       $0 configFile inputList=somefile.list outputDirectory='${PWD}'/output"
     exit 1
-  [[ ! -f $1 ]] && echo "argument not a file" && exit 1
+  fi
+  [[ ! -f $1 ]] && echo "argument not a file" && exit 1  
+
  
   configFile=${1}
   shift 1
 
-  
+  [[ -z $ALICE_ROOT ]] && source $alirootEnv
+  [[ -z $ALICE_ROOT ]] && echo "ALICE_ROOT not defined" && exit 1
+
+  ocdbregex='raw://'
+  [[ ${ocdbStorage} =~ ${ocdbregex} ]] && alien-token-init
 
   updateQA ${configFile} $@
 }
@@ -25,12 +31,16 @@ updateQA()
   shift 1
   parseConfig $configFile $@
 
+  dateString=$(date +%Y-%m-%d-%H-%M)
+  echo "Start time QA process: $dateString"
+
   #logging
   mkdir -p $logDirectory
   [[ ! -d $logDirectory ]] && echo "no log dir $logDirectory" && exit 1
-  logFile="$logDirectory/${0##*/}.$dateString.log"
+  logFile="$logDirectory/${0##*/}.${dateString}.log"
   touch ${logFile}
   [[ ! -f ${logFile} ]] && echo "cannot write logfile $logfile" && exit 1
+  echo "logFile = $logFile"
   exec &>${logFile}
 
   #check lock
@@ -49,12 +59,6 @@ updateQA()
   fi
   cd ${workingDirectory}
 
-  [[ -z $ALICE_ROOT ]] && source $alirootEnv
-  [[ -z $ALICE_ROOT ]] && echo "ALICE_ROOT not defined" && exit 1
-
-  dateString=$(date +%Y-%m-%d-%H-%M)
-  echo "Start time QA process: $dateString"
-
   ################################################################
   #ze detector loop
   for detectorScript in $ALICE_ROOT/PWGPP/QA/detectorQAscripts/*; do
@@ -71,9 +75,9 @@ updateQA()
     cd ${tmpRunDir}
 
     tmpPrefix=${tmpRunDir}/${outputDir}
-    echo outputDir=$outputDir
-    echo tmpPrefix=$tmpPrefix
-    echo detector=$detector
+    echo "running QA for ${detector}"
+    echo "  outputDir=$outputDir"
+    echo "  tmpPrefix=$tmpPrefix"
     
     unset -f runLevelQA
     unset -f periodLevelQA
@@ -86,14 +90,14 @@ updateQA()
       guessRunData ${qaFile}
 
       runDir=${tmpPrefix}/${dataType}/${year}/${period}/${pass}/000${runNumber}
-      echo runDir=$runDir
       mkdir -p ${runDir}
       cd ${runDir}
 
       #handle the case of a zip archive
       [[ "$qaFile" =~ .*.zip$ ]] && qaFile="${qaFile}#QAresults.root"
       
-      runLevelQA ${qaFile}
+      echo running ${detector} runLevelQA for run ${runNumber} from ${qaFile}
+      runLevelQA ${qaFile} &> runLevelQA.log
 
       cd ${tmpRunDir}
     
@@ -102,37 +106,49 @@ updateQA()
     #################################################################
     #cache which productions were (re)done
     arrOfTouchedProductions=( $(/bin/ls -d ${tmpPrefix}/*/*/*/*) )
-    echo arrOfTouchedProductions=${arrOfTouchedProductions[@]}
-    
+    echo "list of processed productions:"
+    echo "    ${arrOfTouchedProductions[@]}"
+    echo
     #################################################################
     #(re)do the merging/trending in the final destination
     for tmpProductionDir in ${arrOfTouchedProductions[@]}; do
     
-      echo productionDir=${outputDir}/${tmpProductionDir#${tmpPrefix}}
       productionDir=${outputDir}/${tmpProductionDir#${tmpPrefix}}
       
       echo mkdir -p ${productionDir}
       mkdir -p ${productionDir}
       if [[ ! -d ${productionDir} ]]; then 
-        echo "cannot make productionDir $productionDir" && return 1
+        echo "cannot make productionDir $productionDir" && continue
       fi
       
-      echo mv -f ${tmpProductionDir}/* ${productionDir}
-      mv -f ${tmpProductionDir}/* ${productionDir}
+      #move to final destination
+      for dir in ${tmpProductionDir}/*; do
+        oldRunDir=${outputDir}/${dir#${tmpPrefix}}
+        if [[ -d ${oldRunDir} ]]; then
+          echo "removing old run: rm -rf ${oldRunDir}"
+          rm -rf ${oldRunDir}
+        fi
+        echo "moving output to final destination"
+        echo mv -f ${dir} ${productionDir}
+        mv -f ${dir} ${productionDir}
+      done
     
       guessRunData "${productionDir}/dummyName"
 
       cd ${productionDir}
 
+      rm -f trending.root
       hadd trending.root 000*/trending.root
 
-      periodLevelQA trending.root
+      echo running ${detector} periodLevelQA for production ${period}/${pass}
+      periodLevelQA trending.root &> periodLevelQA.log
       
       cd ${tmpRunDir}
     
     done
 
     cd ${workingDirectory}
+    echo cleaning up: rm -rf ${tmpRunDir}
     rm -rf ${tmpRunDir}
   done