]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- add the possibility to process highPt trees as QA input for expert tracking QA
authormkrzewic <mikolaj.krzewicki@cern.ch>
Wed, 5 Mar 2014 10:39:42 +0000 (11:39 +0100)
committermkrzewic <mikolaj.krzewicki@cern.ch>
Wed, 5 Mar 2014 10:42:00 +0000 (11:42 +0100)
- add in TRK.sh script the logic to produce expert QA
- additional condition for log validation: "Interpreter error recovered"

PWGPP/QA/detectorQAscripts/EXAMPLE.sh
PWGPP/QA/detectorQAscripts/TRK.sh
PWGPP/QA/scripts/runQA.sh

index d3a048128a04f772c7e405e573473db7b88ad747..a3bdcf662c46ab2f30d8bbc4a40c8675720335d3 100755 (executable)
@@ -31,3 +31,11 @@ periodLevelQA()
 
   #aliroot...
 }
+
+#########################################################
+#########EXPERTS ONLY####################################
+runLevelHighPtTreeQA()
+{
+  #input is the high pt tree (if available)
+  highPtTree=$1
+}
index c8e370de03526e3058a03d72dcd1b9dcbd17ffd8..b10aa3f4b06b78a64397426fdb4c62cea97d38f0 100755 (executable)
@@ -5,14 +5,49 @@
 #  $runNumer     e.g. 169123
 #  $pass         e.g. cpass1,pass1,passMC
 
-runLevelQA()
+runLevelHighPtTreeQA()
 {
-  qaFile=$1
+  highPtTreeFile=${1}
+    
+  #makePlots needs to compile it locally for now
+  cp $ALICE_ROOT/PWGPP/QA/Tracking/ExpertQA/AliHighPtTreeAnalysis.h .
+  cp $ALICE_ROOT/PWGPP/QA/Tracking/ExpertQA/AliHighPtTreeAnalysis.cxx .
 
+  aliroot -l -b -q "$ALICE_ROOT/PWGPP/QA/Tracking/ExpertQA/makePlots.C(\"$highPtTreeFile\")"
 }
 
 periodLevelQA()
 {
   trendingFile=$1
 
+  if ls */genericHistos_Bneg.root&>/dev/null; then
+    hadd mergedGenericHistos_Bneg.root */genericHistos_Bneg.root
+    mkdir outputBneg
+    oldDir=${PWD}
+    cd outputBneg
+    mv ${oldDir}/mergedGenericHistos_Bneg.root .
+
+    #makePlots needs to compile it locally for now
+    cp $ALICE_ROOT/PWGPP/QA/Tracking/ExpertQA/AliHighPtTreeAnalysis.h .
+    cp $ALICE_ROOT/PWGPP/QA/Tracking/ExpertQA/AliHighPtTreeAnalysis.cxx .
+
+    aliroot -l -b -q "$ALICE_ROOT/PWGPP/QA/Tracking/ExpertQA/makePeriodPlots.C(\"mergedGenericHistos_Bneg.root\",\"${period}/${pass}\")"
+    cd ${oldDir}
+  fi
+  if ls */genericHistos_Bpos.root&>/dev/null; then
+    hadd mergedGenericHistos_Bpos.root */genericHistos_Bpos.root
+    mkdir outputBpos
+    oldDir=${PWD}
+    cd outputBpos
+
+    #makePlots needs to compile it locally for now
+    cp $ALICE_ROOT/PWGPP/QA/Tracking/ExpertQA/AliHighPtTreeAnalysis.h .
+    cp $ALICE_ROOT/PWGPP/QA/Tracking/ExpertQA/AliHighPtTreeAnalysis.cxx .
+
+    mv ${oldDir}/mergedGenericHistos_Bpos.root .
+    aliroot -l -b -q "$ALICE_ROOT/PWGPP/QA/Tracking/ExpertQA/makePeriodPlots.C(\"mergedGenericHistos_Bpos.root\",\"${period}/${pass}\")"
+    cd ${oldDir}
+  fi
+
+  aliroot -l -b -q "$ALICE_ROOT/PWGPP/QA/Tracking/ExpertQA/makeTrendingPlots.C(\"${trendingFile}\")"
 }
index 8a026ac1fa9bf9cfb36dd705406507b17c3f9ceb..e3324f5d1b548ec370000447633a02153e657bc3 100755 (executable)
@@ -103,6 +103,8 @@ updateQA()
     
     unset -f runLevelQA
     unset -f periodLevelQA
+    unset -f runLevelHighPtTreeQA
+    unset -f periodLevelHighPtTreeQA
     source ${detectorScript}
 
     #################################################################
@@ -118,23 +120,60 @@ updateQA()
       fi
 
       tmpProductionDir=${tmpPrefix}/${dataType}/${year}/${period}/${pass}
-      arrOfTouchedProductions[${tmpProductionDir}]=1
       tmpRunDir=${tmpProductionDir}/000${runNumber}
       mkdir -p ${tmpRunDir}
       cd ${tmpRunDir}
 
-      #handle the case of a zip archive
-      [[ "$qaFile" =~ .*.zip$ ]] && qaFile="${qaFile}#QAresults.root"
-      [[ "$qaFile" =~ .*.zip$ ]] && highPtTree="${qaFile}#FilterEvents_Trees.root"
-      
-      echo running ${detector} runLevelQA for run ${runNumber} from ${qaFile}
-      runLevelQA ${qaFile} &> runLevelQA.log
+      #by default we expect to have everything in the same archive
+      highPtTree=${qaFile}
+
+      #maybe the input is not an archive, but a file
+      [[ "${qaFile}" =~ "QAresults.root" ]] && highPtTree=""
+      [[ "${qaFile}" =~ "FilterEvents_Trees.root" ]] && qaFile=""
 
-      #perform some default actions:
-      #if trending.root not created, create a default one
-      if [[ ! -f trending.root ]]; then
-        aliroot -b -q -l "$ALICE_ROOT/PWGPP/macros/simpleTrending.C(\"${qaFile}\",${runNumber},\"${detector}\",\"trending.root\",\"trending\",\"recreate\")" &>> runLevelQA.log
+      #it is possible we get the highPt trees from somewhere else
+      #search the list of high pt trees for the proper run number
+      if [[ -n ${inputListHighPtTrees} ]]; then
+        echo "loading the highPtTree from external file ${inputListHighPtTrees}"
+        highPtTree=$(egrep -m1 ${runNumber} ${inputListHighPtTrees})
+      fi
+      
+      echo qaFile=$qaFile
+      echo highPtTree=$highPtTree
+
+      #what if we have a zip archive?
+      if [[ "$qaFile" =~ .*.zip$ ]]; then
+        if unzip -l ${qaFile} | egrep "QAresults.root" &>/dev/null; then
+          qaFile="${qaFile}#QAresults.root"
+        else
+          qaFile=""
+        fi
+      fi
+      if [[ "$highPtTree" =~ .*.zip$ ]]; then
+        if unzip -l ${highPtTree} | egrep "FilterEvents_Trees.root" &>/dev/null; then
+          highPtTree="${highPtTree}#FilterEvents_Trees.root"
+        else
+          highPtTree=""
+        fi
       fi
+     
+      if [[ -n ${qaFile} && $(type -t runLevelQA) =~ "function" ]]; then
+        echo running ${detector} runLevelQA for run ${runNumber} from ${qaFile}
+        runLevelQA "${qaFile}" &> runLevelQA.log
+        #perform some default actions:
+        #if trending.root not created, create a default one
+        if [[ ! -f trending.root ]]; then
+          aliroot -b -q -l "$ALICE_ROOT/PWGPP/macros/simpleTrending.C(\"${qaFile}\",${runNumber},\"${detector}\",\"trending.root\",\"trending\",\"recreate\")" &>> runLevelQA.log
+        fi
+        arrOfTouchedProductions[${tmpProductionDir}]=1
+      fi
+      #expert QA based on high pt trees
+      if [[ -n ${highPtTree} && $(type -t runLevelHighPtTreeQA) =~ "function" ]]; then
+        echo running ${detector} runLevelHighPtTreeQA for run ${runNumber} from ${highPtTree}
+        runLevelHighPtTreeQA "${highPtTree}" &> runLevelHighPtTreeQA.log
+        arrOfTouchedProductions[${tmpProductionDir}]=1
+      fi
+
       cd ${tmpDetectorRunDir}
     
     done < ${inputList}
@@ -178,15 +217,21 @@ updateQA()
         mv -f ${dir} ${productionDir}
       done
     
-      echo running ${detector} periodLevelQA for production ${period}/${pass}
       rm -f trending.root
       
       #merge trending files if any
       if /bin/ls 000*/trending.root &>/dev/null; then
         hadd trending.root 000*/trending.root &> periodLevelQA.log
+      fi
+      
+      if [[ -f "trending.root" && $(type -t periodLevelQA) =~ "function" ]]; then
+        echo running ${detector} periodLevelQA for production ${period}/${pass}
         periodLevelQA trending.root &>> periodLevelQA.log
+      else 
+        echo "WARNING: not running ${detector} periodLevelQA for production ${period}/${pass}, no trending.root"
       fi
 
+
       if ! validate ${PWD}; then continue; fi
 
       cd ${tmpDetectorRunDir}
@@ -289,6 +334,7 @@ validateLog()
             'core dumped'
             '\.C.*error:.*\.h: No such file'
             'segmentation'
+            'Interpreter error recovered'
   )
 
   warningConditions=(