Adding QA train into the CPass1
[u/mrichter/AliRoot.git] / PWGPP / CalibMacros / CPass1 / runCPass1.sh
CommitLineData
a45764d9 1#!/bin/bash
2
3# Script to run:
4# 1. reconstruction
5# 2. calibration and friend track filtering
6#
7# Files assumed to be in working directory:
054d9070 8# recCPass1.C - reconstruction macro
a45764d9 9# runCalibTrain.C - calibration/filtering macro
10# Arguments (run locally):
11# 1 - raw data file name
12# 2 - number of events to be processed
13# 3 - run number
14
15# example:
054d9070 16# runCPass1.sh raw.root 50 104892
a45764d9 17
18#ALIEN setting
19# $1 = raw input filename
20runNum=`echo $1 | cut -d "/" -f 6`
21if [ $# -eq 1 ] ; then
22 # alien Setup
23 nEvents=99999999
24 fileName="alien://"$1
25 ocdbPath="raw://"
26fi;
27if [ $# -eq 4 ] ; then
28 # local setup
29 nEvents=$2
30 runNum=$3
31 fileName=$1
32 ocdbPath=$4
33fi
34
35echo xxxxxxxxxxxxxxxxxxxxxxxxxxx
054d9070 36echo runCPass1.sh Input arguments
a45764d9 37echo fileName=$fileName
38echo nEvents=$nEvents
39echo runNum=$runNum
40echo ocdbPath=$ocdbPath
41echo xxxxxxxxxxxxxxxxxxxxxxxxxxx
42
43if [ -f Run0_999999999_v3_s0.root ]; then
44 mkdir -p TPC/Calib/Correction
45 mv Run0_999999999_v3_s0.root TPC/Calib/Correction/
46fi
47
48
49
50echo File to be processed $1
51echo Number of events to be processed $nEvents
52
53echo ">>>>>>>>> PATH is..."
54echo $PATH
55echo ">>>>>>>>> LD_LIBRARY_PATH is..."
56echo $LD_LIBRARY_PATH
054d9070 57echo ">>>>>>>>> recCPass1.C is..."
58#cat recCPass1.C
a45764d9 59echo
60
61echo ">>>>>>> Running AliRoot to reconstruct $1. Run number is $runNum..."
62
054d9070 63aliroot -l -b -q recCPass1.C\(\""$fileName\", $nEvents, \"$ocdbPath"\"\) 2>&1 | tee rec.log
a45764d9 64mv syswatch.log syswatch_rec.log
65
66echo ">>>>>>> Running AliRoot to make calibration..."
67aliroot -l -b -q runCalibTrain.C\(\""$runNum\",\"AliESDs.root\",\"$ocdbPath"\"\) 2>&1 | tee calib.log
68mv syswatch.log syswatch_calib.log
d74ff87e 69
70
71
72if [ -f QAtrain.C ]; then
73 echo ">>>>>>> Running the QA train..."
74 time aliroot -b -q QAtrain.C\($runstripped\) 2>&1 | tee qa.log
75
76 for file in *.stat; do
77 mv $file $file.qa
78 done
79fi