]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adding scripts for filtering
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 8 Oct 2009 09:44:17 +0000 (09:44 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 8 Oct 2009 09:44:17 +0000 (09:44 +0000)
All scripts assume we are working in some workspace-
Predefined directory structure

makeWorkspace.sh   - create workspace directory structure
filterCorrupted.sh - filter esd and rows  - create two files - *.Good and *.Bad
filterRecLog.sh    - finds the amount of seg. fault
                   - create a summary log for files with seg.fault
filterMissing.sh   - create a list of missing runs

TPC/scripts/filterCorrupted.sh [new file with mode: 0755]
TPC/scripts/filterMissing.sh [new file with mode: 0755]
TPC/scripts/filterRecLog.sh [new file with mode: 0755]
TPC/scripts/guiEnv.sh [new file with mode: 0755]
TPC/scripts/makeWorkspace.sh [new file with mode: 0755]

diff --git a/TPC/scripts/filterCorrupted.sh b/TPC/scripts/filterCorrupted.sh
new file mode 100755 (executable)
index 0000000..2c10522
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+# 1 argument      - qname
+
+# marian.ivanov@cern.ch
+# filter corrupted files
+# batch farm internaly used
+#
+# Assumption - the data organize in the Workspace - predefined directory structure
+#            - each directory contain the list of files 
+#            - raw.txt and esd.txt
+# Output:
+# esd.txt => esd.txt.Good and esd.txt.Bad 
+# eaw.txt -> raw.txt.Good and raw.txt.Bad
+
+qname=$1
+mydir=`pwd`
+for adir in `cat run.list`; do
+    cd $adir
+    bsub -q $qname  aliroot -b -q  $ALICE_ROOT/TPC/macros/filterRAW.C
+    cd $mydir
+    done;     
+done;
+#
+mydir=`pwd`
+for adir in `cat run.list`; do
+cd $adir
+echo bsub -q $qname  aliroot -b -q  $ALICE_ROOT/TPC/macros/filterESD.C
+bsub -q $qname  aliroot -b -q  $ALICE_ROOT/TPC/macros/filterESD.C
+cd $mydir
+done;
+
+
diff --git a/TPC/scripts/filterMissing.sh b/TPC/scripts/filterMissing.sh
new file mode 100755 (executable)
index 0000000..1f672af
--- /dev/null
@@ -0,0 +1,42 @@
+#
+# marian.ivanov@cern.ch
+#
+# Create  lists of missing runs
+# Expected the data follow given Workspace structure
+# input :  run.list  - list of runs of interest
+# output:  rawMissing.list
+#          esdMissing.list           
+#          ocdbMissing.list
+# Notice  -OCDB missing is indicated only for GRP
+#         -in next version - query from the alien     
+
+rm rawMissing.list
+rm esdMissing.list
+rm ocdbMissing.list 
+rm rawPresent.list
+rm esdPresent.list
+rm ocdPresent.list 
+
+for adir in `cat run.list`; do
+   nfiles=`cat   raw$adir.txt | grep -c .root`
+   if [ $nfiles -lt 2 ] ; then
+    #echo RAW: 0000$adir $nfiles
+    echo 0000$adir   >>rawMissing.list
+    else
+    echo 0000$adir   >>rawPresent.list
+   fi
+   nfilesReco=`cat   esd$adir.txt | grep -c .root`
+   if [ $nfilesReco -lt 2 ] ; then
+    #echo ESD: $adir $nfilesReco
+    echo $adir   >>esdMissing.list
+    else
+    echo $adir   >>esdPresent.list
+   fi
+   nfilesOCDB=`cat grp.list | grep $adir| grep -c root`
+   if [ $nfilesOCDB -lt 1 ] ; then
+    #echo OCDB: $adir $nfilesOCDB
+    echo $adir   >>ocdbMissing.list
+    else
+    echo $adir   >>ocdbPresent.list
+   fi
+done; 
diff --git a/TPC/scripts/filterRecLog.sh b/TPC/scripts/filterRecLog.sh
new file mode 100755 (executable)
index 0000000..8a58cf8
--- /dev/null
@@ -0,0 +1,30 @@
+# marian.ivanov@cern.ch
+# Filter error logs 
+# Input   - errRec.logs  - text file with the list of error logs
+# Output  - seg.log      - text file with the seg.faults runs
+#         - segout.log   - text file with the output of the seg.fault runs
+#                        - the err.log and out.log suppose to be in the same directory
+# to get the list of logs:
+# example:
+# find /lustre/alice/alien/alice/data/2009/LHC09c_TPC/00008*/esdgsi3/*/err.log  > errRec.log
+
+isOK=0
+nonOK=0
+rm seg.log
+rm segout.log
+for efile in `cat errRec.log`  ;do
+ xxx=`cat $efile| grep segmentation`
+ if [ -z "$xxx" ]
+ then
+  let isOK=isOK+1
+  else
+  let nonOK=nonOK+1
+  echo nonOK=$nonOK
+  echo "$efile" >>seg.log
+  echo $efile
+  ofile=`echo $efile| sed s_err_out_`
+  cat $ofile >> segout.log
+ fi     
+done; 
+#get the list
+echo isOK=$isOK nonOK=$nonOK
diff --git a/TPC/scripts/guiEnv.sh b/TPC/scripts/guiEnv.sh
new file mode 100755 (executable)
index 0000000..92f239e
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# setup aliroot environment
+# to be modified by users
+# 
+#
+
+#
+# set your aliroot
+#
+source /u/miranov/.balice64HEAD0108
+#
+#output directory
+#
+export GUI_OUTDIR=/lustre/alice/TPCgui
+
+#usually the next two can stay as they are. If your not happy with where the output is written
+#feel free to change them
+export GUI_OUTDIR_TIME=$GUI_OUTDIR/time
+export GUI_OUTDIR_RUNS=$GUI_OUTDIR/runs
+
+#command for batch processing
+# see also TMPLISTDIR!!!
+export BATCHCOMMAND="bsub -q alice-t3_8h"
+
+#directory for the temporary list files
+#for batch processing this dir needs to be accessable from the batch nodes!!!
+export TMPLISTDIR=$GUI_OUTDIR/guiTreeLists
+
+#path to reference tree. Consider to use one!
+#see README to understand how to create them
+export REF_DATA_FILE=$GUI_OUTDIR/ref/RefCalPads.root
+export REF_DATA_TREE=$GUI_OUTDIR/ref/RefTree.root
+
+#whether alien path is used in OCDB
+#export WITHALIEN=1
+export WITHALIEN=0
+
+#where to look for files in automatic tree creation
+#it assumes a path to an OCDB directory and uses the
+#run numbers of the file names:
+#Run([0-9]{5})_.*
+export AUTOFILES=/lustre/alice/alien/alice/data/2009/OCDB/TPC/Calib/HighVoltage
+
+#number of files per chunk in automatic tree creation
+export NFILES=25
+
diff --git a/TPC/scripts/makeWorkspace.sh b/TPC/scripts/makeWorkspace.sh
new file mode 100755 (executable)
index 0000000..ab24eb7
--- /dev/null
@@ -0,0 +1,19 @@
+#
+# marian.ivanov@cern.ch
+#
+# Make workspace structure
+# Create a list for each run 
+# and make directory structure
+# This is fast
+mydir=`pwd`
+for adir in `cat run.list`; do
+    mkdir $adir;
+    rm raw${adir}.txt
+    rm esd${adir}.txt
+    cat  $mydir/raw.list | grep $adir >raw${adir}.txt
+    cat  $mydir/esd.list | grep $adir >esd${adir}.txt
+    cp raw${adir}.txt   ${adir}/raw.txt
+    cp esd${adir}.txt   ${adir}/esd.txt
+done 
+
+