]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGPP/CalibMacros/CPass1/runCPass1.sh
Improving printouts, minor changes, update according to current settings for T0 and...
[u/mrichter/AliRoot.git] / PWGPP / CalibMacros / CPass1 / runCPass1.sh
1 #!/bin/bash
2
3 # Script to run:
4 #    1. reconstruction
5 #    2. calibration 
6 #
7 # Files assumed to be in working directory:
8 # recCPass1.C          - reconstruction macro
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 #    4  - OCDBPath
15 #    5  - optional trigger mask
16 # example:
17 # runCPass1.sh raw.root  50  104892 raw://
18
19 #ALIEN setting
20 # $1 = raw input filename
21 runNum=`echo $1 | cut -d "/" -f 6 | sed 's/^0*//'`
22 if [ $# -eq 1 ] ; then
23   # alien Setup
24   nEvents=99999999
25   fileName="alien://"$1
26   ocdbPath="raw://"
27 fi;
28 if [ $# -ge 4 ] ; then
29   # local setup
30   fileName=$1
31   nEvents=$2
32   runNum=$3
33   ocdbPath=$4
34   triggerOptions="?Trigger=kCalibBarrel"
35 fi
36 if [ $# -eq 5 ] ; then
37   # local setup in case we specify the trigger mask
38   triggerOptions=$5
39
40 fi
41
42 echo xxxxxxxxxxxxxxxxxxxxxxxxxxx
43 echo runCPass1.sh Input arguments
44 echo fileName=$fileName
45 echo nEvents=$nEvents
46 echo runNum=$runNum
47 echo ocdbPath=$ocdbPath
48 echo xxxxxxxxxxxxxxxxxxxxxxxxxxx
49
50 if [ -f Run0_999999999_v3_s0.root ]; then
51     mkdir -p TPC/Calib/Correction
52     mv Run0_999999999_v3_s0.root TPC/Calib/Correction/
53 fi
54
55
56
57 echo File to be  processed $1
58 echo Number of events to be processed $nEvents
59
60 echo ">>>>>>>>> PATH is..."
61 echo $PATH
62 echo ">>>>>>>>> LD_LIBRARY_PATH is..."
63 echo $LD_LIBRARY_PATH
64 echo ">>>>>>>>> recCPass1.C is..."
65 #cat recCPass1.C
66 echo
67
68 echo ">>>>>>> Running AliRoot to reconstruct $1. Run number is $runNum..."
69
70 mkdir Barrel
71 mkdir OuterDet
72
73 [[ -f localOCDBaccessConfig.C ]] && cp localOCDBaccessConfig.C Barrel
74 [[ -f localOCDBaccessConfig.C ]] && cp localOCDBaccessConfig.C OuterDet
75
76 cd Barrel
77 time aliroot -l -b -q "../recCPass1.C(\"$fileName\", $nEvents, \"$ocdbPath\", \"$triggerOptions\")" 2>&1 | tee rec_Barrel.log
78 mv syswatch.log syswatch_rec_Barrel.log
79
80 echo ">>>>>>> Running AliRoot to make calibration..."
81 time aliroot -l -b -q "../runCalibTrain.C($runNum,\"AliESDs.root\",\"$ocdbPath\")"   2>&1 | tee calib.log
82 mv syswatch.log syswatch_calib.log
83 echo ">>>>>>> Doing ls -l"
84 ls -l
85
86 echo ">>>>>>> Running the QA train..."
87 time aliroot -b -q "../QAtrain.C($runNum,\"\",0,\"$ocdbPath\")" 2>&1 | tee qa_Barrel.log
88
89 for file in *.stat; do
90     mv $file $file.qa
91 done
92
93 echo ">>>>>>>> Moving files to upper directory"
94 mv AliESDs.root ../AliESDs_Barrel.root
95 mv rec_Barrel.log ../rec_Barrel.log
96 mv calib.log ../calib.log
97 mv AliESDfriends_v1.root ../AliESDfriends_v1.root
98 mv qa_Barrel.log ../qa_Barrel.out
99 mv QAresults.root ../QAresults_Barrel.root
100 if [ -f AODtpITS.root ] ; then
101  mv AODtpITS.root ../
102 fi
103
104 cd ../OuterDet
105 time aliroot -l -b -q ../recCPass1_OuterDet.C\(\""$fileName\", $nEvents, \"$ocdbPath"\"\) 2>&1 | tee rec_Outer.log
106 mv syswatch.log syswatch_rec_Outer.log
107
108 echo ">>>>>>> Running the QA train..."
109 time aliroot -b -q "../QAtrain.C($runNum,\"\",0,\"$ocdbPath\")" 2>&1 | tee qa_Outer.log
110
111 for file in *.stat; do
112     mv $file $file.qa
113 done
114
115 mv AliESDs.root ../AliESDs_Outer.root
116 mv rec_Outer.log ../rec_Outer.log
117 mv qa_Outer.log ../qa_Outer.out
118 mv QAresults.root ../QAresults_Outer.root
119
120
121 echo ">>>>>>> Extracting system information..."
122 aliroot -b -q $ALICE_ROOT/PWGPP/CalibMacros/CPass1/makeSyswatchCPass1.C\(\"AliESDfriends_v1.root\"\)