# Sequence of steps to test Pass0 and PassX reconstruction/calibration which run on GRID
# by default
#
# Semi automatic test performed on the batch farm
# Important features:
# 1. Parsing of the log files
# 2. Parsing stack traces
# author: marian.ivanov@cern.ch
--- /dev/null
+Scripts to test reconstruction/calibration chain
+marian.ivanov@cern.ch
+
+$ALICE_ROOT/TPC/scripts/calibPassX
+Content:
+README.PassX
+runTrainPassX.sh
+runPassXJob.sh
+runPassX.sh
+recPass0GSI.C
+
+
+
+runTrainPassX.sh - test of the PassX reconstruction/calibration chain
+ - filtering of the log files
+ - merging of results
+ - It is pseudo code
+
+submitPass0.sh - submit reconstruction/calibration job
+
+runPassXJob.sh - wrapper around the script $ALICE_ROOT/TPC/scripts/runPassX.sh
+ to be run
+ - intermediate results on the local machine
+
+runPassX.sh - copy from $ALICE_ROOT/ANALYSIS/macros/runPassX.sh
+ - Modification needed:
+ Provide the run number and number of events as argument
+
+recPass0GSI.C - reconstruction script
--- /dev/null
+//\r
+// rec.C to be used for pass0\r
+// \r
+\r
+void rec(const char *filename="raw.root",Int_t nevents=-1)\r
+{\r
+ // Load some system libs for Grid and monitoring\r
+ // Set the CDB storage location\r
+ AliCDBManager * man = AliCDBManager::Instance();\r
+ //man->SetDefaultStorage("raw://");\r
+ man->SetDefaultStorage("local:///lustre/alice/alien/alice/data/2010/OCDB/");\r
+ // Reconstruction settings\r
+ AliReconstruction rec;\r
+\r
+ // Set protection against too many events in a chunk (should not happen)\r
+ if (nevents>0) rec.SetEventRange(0,nevents);\r
+\r
+ // Switch off HLT until the problem with schema evolution resolved\r
+ //rec.SetRunReconstruction("ALL-HLT");\r
+ //\r
+ // QA options\r
+ //\r
+ AliQAManager *qam = AliQAManager::QAManager(AliQAv1::kRECMODE) ;\r
+ rec.SetRunQA(":");\r
+ rec.SetRunGlobalQA(kFALSE);\r
+\r
+ // AliReconstruction settings\r
+ rec.SetWriteESDfriend(kTRUE);\r
+ rec.SetWriteAlignmentData();\r
+ rec.SetInput(filename);\r
+ rec.SetUseTrackingErrorsForAlignment("ITS");\r
+ rec.SetRunReconstruction("ITS TPC TRD TOF");\r
+ rec.SetFillESD("ITS TPC TRD TOF");\r
+\r
+ // switch off cleanESD\r
+ rec.SetCleanESD(kFALSE);\r
+\r
+ AliLog::Flush();\r
+ rec.Run();\r
+\r
+}\r
+\r
+\r
--- /dev/null
+#!/bin/bash
+
+# Script to run:
+# 1. reconstruction
+# 2. calibration and friend track filtering
+# 3. tag creation
+#
+# Files assumed to be in working directory:
+# rec.C - reconstruction macro
+# runCalibTrain.C - calibration/filtering macro
+# Arguments:
+# 1 - raw data file name
+# 2 - number of events to be processed
+# 3 - run number
+
+# example:
+# runPassX.sh raw.root 50 104892
+
+#ALIEN setting
+#entries=1000
+# $1 = raw input filename
+#runnum=`echo $1 | cut -d "/" -f 6`
+
+#Local setting : setting variables
+
+entries=$2
+runnum=$3
+source $HOME/alienSetup.sh
+
+echo File to be processed $1
+echo Number of events to be processed $entries
+echo Run mumber $runnum
+
+echo ALICE_ROOT = $ALICE_ROOT
+echo AliROOT = $AliROOT
+cp $ALICE_ROOT/.rootrc ~/.rootrc
+cp $ALICE_ROOT/.rootrc $HOME
+#cat $HOME/.rootrc
+export GRID_TOKEN=OK
+
+echo ">>>>>>>>> PATH is..."
+echo $PATH
+echo ">>>>>>>>> LD_LIBRARY_PATH is..."
+echo $LD_LIBRARY_PATH
+echo ">>>>>>>>> rec.C is..."
+cat rec.C
+echo
+
+
+echo
+echo ">>>>>>> Running AliRoot to reconstruct $1. Run number is $runnum..."
+echo
+if [ -e AliESDs.root ]; then
+ echo AliESDs.root exist
+ ls -al AliESD*
+else
+ echo aliroot -l -b -q rec.C\(\"$1\",$2\) 2>&1 | tee rec.log
+ aliroot -l -b -q rec.C\(\"$1\",$2\) 2>&1 | tee rec.log
+ echo aliroot -l -b -q tag.C\(\) 2>&1 | tee tag.log
+ aliroot -l -b -q tag.C\(\) 2>&1 | tee tag.log
+fi
+
+echo
+echo ">>>>>>> Running AliRoot to make calibration..."
+echo
+echo aliroot -l -b -q runCalibTrain.C\($runnum\) 2>&1 | tee calib.log
+aliroot -l -b -q runCalibTrain.C\($runnum\) 2>&1 | tee calib.log
+
+echo
+echo ">>>>>>> Running AliRoot to generate Tags..."
+echo
+echo aliroot -l -b -q tag.C\(\) 2>&1 | tee tag.log
+#aliroot -l -b -q tag.C\(\) 2>&1 | tee tag.log
--- /dev/null
+#
+# run PassX recosntruction/calibration jobs
+#
+# Needed in order to run the jobs locally
+#
+# 1 - raw data file name
+# 2 - number of events to be processed
+# 3 - run number
+
+
+echo Input file $1
+echo Run number $3
+echo Events to reconstruct/calibrate $2
+
+outdir=`pwd`
+tmpdir=/tmp/$USER/`echo $outdir | sed s_/_x_g`
+mkdir $tmpdir
+#
+cp $outdir/*.C $tmpdir/
+cp $outdir/*.sh $tmpdir/
+cp $outdir/AliESDs.root $tmpdir/
+cp $outdir/AliESDfriends.root $tmpdir/
+
+cd $tmpdir
+#
+#
+#
+echo tmpdir = `pwd`
+echo outdir = $outdir
+ls
+
+echo runPassX.sh $1 $2 $3
+runPassX.sh $1 $2 $3
+
+ls -alrt
+cp -r $tmpdir/* $outdir/
+rm -rf $tmpdir
+
+
--- /dev/null
+#
+# Sequence of steps to test Pass0 and PassX reconstruction/calibration which run on GRID
+# by default
+#
+# Semi automatic test performed on the batch farm
+# Important features:
+# 1. Parsing of the log files
+# 2. Parsing stack traces
+
+# author: marian.ivanov@cern.ch
+
+
+#
+# 0. copy a template setup
+# To be modified if necessary
+# "standard scripts
+cp $ALICE_ROOT/ANALYSIS/macros/runCalibTrain.C .
+# scipts to run on batch farm
+cp $ALICE_ROOT/TPC/scripts/calibPassX/recPass0GSI.C rec.C
+cp $ALICE_ROOT/TPC/scripts/calibPassX/runPassX.sh .
+cp $ALICE_ROOT/TPC/scripts/calibPassX/submitPass0.sh .
+cp $ALICE_ROOT/TPC/scripts/calibPassX/runPassXJob.sh .
+
+cp ../lists/run.list .
+cp ../lists/raw.list .
+
+#
+# 1. Make workspace - directory structure with run and raw lists
+#
+$ALICE_ROOT/TPC/scripts/makeWorkspace.sh run.list
+#
+# 1.a clean the workspace all
+#
+find `pwd` | grep AliESD | xargs rm
+find `pwd` | grep out | xargs rm
+find `pwd` | grep log | xargs rm
+#
+# 1.b clean workscpace - rm root files if not tags found
+#
+find `pwd` | grep AliESDs.root > esd.txt
+for efile in `cat esd.txt`; do
+ dname=`dirname $efile`
+ status=`ls $dname/*tag.root`;
+ echo CHECK $efile $status
+ if [ -z $status ]; then
+ echo NON OK rm -r $dname/*.root
+ rm -r $dname/*.root
+ else
+ echo IS OK $status
+ fi;
+done
+
+#
+# 2. Run reconstruction/calibration
+#
+bgroup=/recPass0/`pwd | xargs basename`
+bgadd $bgroup
+nEvents=500000
+submitPass0.sh run.list "alice-t3_8h -g $bgroup" $nEvents | tee submit.log
+
+
+#
+# 3. Run merging - run level
+#
+for arun in `cat run.list`; do
+ cd $arun
+ find `pwd`/ | grep AliESDfriends_v1.root > calib.list
+ echo bsub -q alice-t3_8h -o outMerge.log aliroot -b -q $ALICE_ROOT/ANALYSIS/macros/mergeCalibObjects.C
+ bsub -q alice-t3_8h -o outMerge.log aliroot -b -q $ALICE_ROOT/ANALYSIS/macros/mergeCalibObjects.C
+ cd ../
+done;
+
+#
+# 4. Merge all
+#
+ls `pwd`/*/CalibObjects.root > calib.list
+aliroot -b -q $ALICE_ROOT/ANALYSIS/macros/mergeCalibObjects.C
+
+#
+# 5. filter reconstruction logs, make statistic of problems
+#
+mkdirhier logs/reco
+cd logs/reco
+find `pwd`/../../ | grep rec.log > errRec.log
+$ALICE_ROOT/TPC/scripts/filterRecLog.sh
+cd ../..
+
+#
+# 6. filter calibration logs, make statistic of problems
+#
+mkdirhier logs/calib
+cd logs/calib
+find `pwd`/../../ | grep calib.log > errRec.log
+$ALICE_ROOT/TPC/scripts/filterRecLog.sh
+cd ../..
+
+
+#
+# 7. filter debug streamer
+#
+mkdir debug
+cd debug
+find `pwd`/../*/ | grep V6 | grep .root > debugall.txt
+cat debugall.txt | grep calibTimeDebug > timeitstpc.txt
+
+
+
+
--- /dev/null
+#
+# parameters:
+# 1 - basedir
+# Example:
+# source /usr/local/grid/AliRoot/HEAD0108/TPC/scripts/tpcPass0Env.sh `pwd`
+export balice=/u/miranov/.balice
+export aliensetup=$HOME/alienSetup.sh
+export PASS0_DIR=/usr/local/grid/AliRoot/HEAD0108
+source $balice
+#source $aliensetup >aliensetup.log
+#
+# Test setup
+#
+export workdir=$1
+if [ ! -n length ]; then
+ echo \############################
+ echo Directory was not specified. Exiting
+ echo \############################
+ return;
+fi;
+if [ ! -r $workdir/lists/esd.list ] ; then
+ echo \############################
+ echo File esd list does not exist. Exiting
+ echo \############################
+ return;
+fi;
+if [ ! -r $workdir/lists/run.list ] ; then
+ echo \############################
+ echo File run list does not exist. Exiting
+ echo \############################
+ return;
+fi;
+
+#
+# Make directories
+#
+cd $workdir
+chgrp -R alice $workdir
+chmod -R g+rwx $workdir
+chmod -R o+rx $workdir
+mkdirhier $workdir/calibNoDrift
+mkdirhier $workdir/calibNoRefit
+mkdirhier $workdir/calibQA
+#
+#modify ConfigOCDB.C
+#
+# copy predefined Config files
+#
+cp $PASS0_DIR/TPC/macros/CalibrateTPC.C calibNoDrift/CalibrateTPC.C
+cat $PASS0_DIR/TPC/macros/CalibrateTPC.C | grep -v AddCalibCalib\(task\) > calibNoRefit/CalibrateTPC.C
+cp $PASS0_DIR/TPC/macros/CalibrateTPC.C calibQA/CalibrateTPC.C
+cp $PASS0_DIR/TPC/macros/ConfigOCDBNoDrift.C calibNoDrift/ConfigOCDB.C
+cp $PASS0_DIR/TPC/macros/ConfigOCDBNoRefit.C calibNoRefit/ConfigOCDB.C
+cp $PASS0_DIR/TPC/macros/ConfigOCDBQA.C calibQA/ConfigOCDB.C
+cp lists/*.list calibNoDrift/
+cp lists/*.list calibNoRefit/
+cp lists/*.list calibQA/
+ln -sf $balice calibNoDrift/balice.sh
+ln -sf $balice calibNoRefit/balice.sh
+ln -sf $balice calibQA/balice.sh
+ln -sf $aliensetup calibNoDrift/alienSetup.sh
+ln -sf $aliensetup calibNoRefit/alienSetup.sh
+ln -sf $aliensetup calibQA/alienSetup.sh
+# make workspaces
+#
+cd $workdir/calibNoDrift
+$PASS0_DIR/TPC/scripts/makeWorkspace.sh run.list
+$PASS0_DIR/TPC/scripts/submitCalib.sh run.list alice-t3 20
+cd $workdir/calibNoRefit
+$PASS0_DIR/TPC/scripts/makeWorkspace.sh run.list
+$PASS0_DIR/TPC/scripts/submitCalib.sh run.list alice-t3 20
+cd $workdir/calibQA
+$PASS0_DIR/TPC/scripts/makeWorkspace.sh run.list
+$PASS0_DIR/TPC/scripts/submitCalib.sh run.list alice-t3 20
+cd $workdir/
+#
+#
+#