]>
Commit | Line | Data |
---|---|---|
a45764d9 | 1 | #!/bin/bash |
2 | ||
3 | # Script to run: | |
4 | # 1. reconstruction | |
a6168b42 | 5 | # 2. calibration |
a45764d9 | 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 | |
a6168b42 | 14 | # 4 - OCDBPath |
15 | # 5 - optional trigger mask | |
a45764d9 | 16 | # example: |
a6168b42 | 17 | # runCPass1.sh raw.root 50 104892 raw:// |
a45764d9 | 18 | |
19 | #ALIEN setting | |
20 | # $1 = raw input filename | |
25e2b4b3 | 21 | runNum=`echo $1 | cut -d "/" -f 6 | sed 's/^0*//'` |
a45764d9 | 22 | if [ $# -eq 1 ] ; then |
23 | # alien Setup | |
24 | nEvents=99999999 | |
25 | fileName="alien://"$1 | |
26 | ocdbPath="raw://" | |
5cebce24 | 27 | triggerOptions="?Trigger=kCalibBarrel" |
a45764d9 | 28 | fi; |
a6168b42 | 29 | if [ $# -ge 4 ] ; then |
a45764d9 | 30 | # local setup |
a6168b42 | 31 | fileName=$1 |
a45764d9 | 32 | nEvents=$2 |
33 | runNum=$3 | |
a45764d9 | 34 | ocdbPath=$4 |
a6168b42 | 35 | triggerOptions="?Trigger=kCalibBarrel" |
36 | fi | |
37 | if [ $# -eq 5 ] ; then | |
38 | # local setup in case we specify the trigger mask | |
39 | triggerOptions=$5 | |
5cebce24 | 40 | fi |
41 | ||
42 | CHUNKNAME="$1" | |
43 | ||
44 | if [ "${CHUNKNAME:0:1}" = "/" ]; then | |
45 | FILENAME=${CHUNKNAME##*/} | |
46 | ||
47 | if [ -f "$FILENAME" ]; then | |
48 | # locally downloaded chunk | |
49 | CHUNKNAME="`pwd`/$FILENAME" | |
50 | else | |
51 | # one chunk from alien (nodownload option to the collection) | |
52 | CHUNKNAME="alien://$CHUNKNAME" | |
53 | fi | |
54 | fi | |
a6168b42 | 55 | |
5cebce24 | 56 | if [ -f "wn.xml" ]; then |
57 | # several chunks accessed remotely | |
58 | CHUNKNAME="collection://wn.xml" | |
a45764d9 | 59 | fi |
60 | ||
61 | echo xxxxxxxxxxxxxxxxxxxxxxxxxxx | |
054d9070 | 62 | echo runCPass1.sh Input arguments |
a45764d9 | 63 | echo fileName=$fileName |
64 | echo nEvents=$nEvents | |
65 | echo runNum=$runNum | |
66 | echo ocdbPath=$ocdbPath | |
5cebce24 | 67 | echo triggerOptions=$triggerOptions |
a45764d9 | 68 | echo xxxxxxxxxxxxxxxxxxxxxxxxxxx |
5cebce24 | 69 | echo "* ************************" |
70 | echo "* runCPass1.sh $*" | |
71 | echo "* Chunk name: $CHUNKNAME" | |
72 | echo "* Run number: $runNum" | |
73 | echo "* ************************" | |
a45764d9 | 74 | |
75 | if [ -f Run0_999999999_v3_s0.root ]; then | |
5cebce24 | 76 | echo "* TPC correction file found" |
77 | ||
a45764d9 | 78 | mkdir -p TPC/Calib/Correction |
79 | mv Run0_999999999_v3_s0.root TPC/Calib/Correction/ | |
5cebce24 | 80 | |
81 | mkdir -p Barrel/TPC/Calib/Correction | |
82 | ln -s ../../../../TPC/Calib/Correction/Run0_999999999_v3_s0.root Barrel/TPC/Calib/Correction/Run0_999999999_v3_s0.root | |
83 | ||
84 | mkdir -p OuterDet/TPC/Calib/Correction | |
85 | ln -s ../../../../TPC/Calib/Correction/Run0_999999999_v3_s0.root OuterDet/TPC/Calib/Correction/Run0_999999999_v3_s0.root | |
a45764d9 | 86 | fi |
87 | ||
5cebce24 | 88 | echo "* PATH: $PATH" |
89 | echo "* LD_LIBRARY_PATH: $LD_LIBRARY_PATH" | |
90 | echo | |
a45764d9 | 91 | |
5cebce24 | 92 | if [ "$2" == "OCDB" ]; then |
93 | export OCDB_SNAPSHOT_CREATE="kTRUE" | |
94 | export OCDB_SNAPSHOT_FILENAME="OCDB.root" | |
a45764d9 | 95 | |
5cebce24 | 96 | echo "* Running AliRoot to generate the OCDB based on $CHUNKNAME" |
a45764d9 | 97 | |
5cebce24 | 98 | echo "OCDB/recCPass1.C" >&2 |
99 | time aliroot -l -b -q recCPass1.C\(\"$CHUNKNAME\"\) &> rec.log | |
100 | exitcode=$? | |
101 | echo "Exit code: $exitcode" | |
102 | ||
103 | echo "* Reconstruction ran in fake mode to create OCDB.root, exiting quickly now" | |
104 | touch OCDB.generating.job | |
a45764d9 | 105 | |
5cebce24 | 106 | if [ -f OCDB.root ]; then |
107 | echo "* OCDB.root was indeed produced" | |
108 | else | |
109 | echo "* Error: OCDB.root was NOT generated !!!" | |
110 | exit 1 | |
111 | fi | |
a45764d9 | 112 | |
5cebce24 | 113 | exit $exitcode |
114 | fi | |
115 | ||
116 | mkdir Barrel OuterDet | |
383fa54e | 117 | |
9e160db9 | 118 | [[ -f localOCDBaccessConfig.C ]] && cp localOCDBaccessConfig.C Barrel |
119 | [[ -f localOCDBaccessConfig.C ]] && cp localOCDBaccessConfig.C OuterDet | |
120 | ||
5cebce24 | 121 | cp recCPass1.C Barrel/ |
122 | cp runCalibTrain.C Barrel/ | |
123 | cp QAtrain_duo.C Barrel/ | |
124 | ||
125 | cp recCPass1_OuterDet.C OuterDet/ | |
126 | cp QAtrain_duo.C OuterDet/ | |
127 | ||
128 | if [ -f wn.xml ]; then | |
129 | cp wn.xml Barrel/ | |
130 | cp wn.xml OuterDet/ | |
131 | fi | |
132 | ||
133 | if [ -f OCDB.root ]; then | |
134 | ln -s ../OCDB.root Barrel/OCDB.root | |
135 | ln -s ../OCDB.root OuterDet/OCDB.root | |
136 | fi | |
137 | ||
138 | #################################### Barrel ####################################### | |
139 | ||
383fa54e | 140 | cd Barrel |
a45764d9 | 141 | |
5cebce24 | 142 | echo "* Running AliRoot to reconstruct barrel of $CHUNKNAME" |
d74ff87e | 143 | |
5cebce24 | 144 | echo "Barrel/recCPass1.C" >&2 |
145 | echo executing time aliroot -l -b -q "recCPass1.C(\"$CHUNKNAME\", $nEvents, \"$ocdbPath\", \"$triggerOptions\")" | |
146 | time aliroot -l -b -q "recCPass1.C(\"$CHUNKNAME\", $nEvents, \"$ocdbPath\", \"$triggerOptions\")" &> ../rec_Barrel.log | |
147 | exitcode=$? | |
148 | echo "Exit code: $exitcode" | |
383fa54e | 149 | |
5cebce24 | 150 | if [ $exitcode -ne 0 ]; then |
151 | exit $exitcode | |
152 | fi | |
383fa54e | 153 | |
5cebce24 | 154 | mv syswatch.log ../syswatch_rec_Barrel.log |
155 | ||
156 | echo "* Running AliRoot to make calibration..." | |
157 | ||
158 | echo "Barrel/recCalibTrain.C" >&2 | |
159 | echo executing time aliroot -l -b -q "runCalibTrain.C($runNum,\"AliESDs.root\",\"$ocdbPath\")" | |
160 | time aliroot -l -b -q "runCalibTrain.C($runNum,\"AliESDs.root\",\"$ocdbPath\")" &> ../calib.log | |
161 | exitcode=$? | |
162 | echo "Exit code: $exitcode" | |
163 | ||
164 | if [ $exitcode -ne 0 ]; then | |
165 | exit $exitcode | |
383fa54e | 166 | fi |
d74ff87e | 167 | |
5cebce24 | 168 | mv syswatch.log ../syswatch_calib.log |
169 | ||
170 | if [ -f QAtrain_duo.C ]; then | |
171 | echo "* Running the QA train (barrel) ..." | |
172 | ||
173 | echo "Barrel/QAtrain_duo.C" >&2 | |
174 | echo executing time aliroot -b -q "QAtrain_duo.C(\"_barrel\",$runNum,\"$ocdbPath\")" | |
175 | time aliroot -b -q "QAtrain_duo.C(\"_barrel\",$runNum,\"$ocdbPath\")" &> ../qa_barrel.log | |
176 | exitcode=$? | |
177 | echo "Exit code: $exitcode" | |
d74ff87e | 178 | |
5cebce24 | 179 | if [ $exitcode -ne 0 ]; then |
180 | exit $exitcode | |
181 | fi | |
66c736ae | 182 | |
5cebce24 | 183 | for file in *.stat; do |
184 | mv $file ../$file.qa_barrel | |
185 | done | |
186 | fi | |
187 | ||
188 | mv AliESDs.root ../AliESDs_Barrel.root | |
189 | mv AliESDfriends.root ../AliESDfriends_Barrel.root | |
190 | ||
191 | for file in AliESDfriends_v1.root QAresults_barrel.root EventStat_temp_barrel.root AODtpITS.root; do | |
192 | if [ -f "$file" ]; then | |
193 | mv "$file" ../ | |
194 | fi | |
66c736ae | 195 | done |
d74ff87e | 196 | |
5cebce24 | 197 | #################################### Outer ####################################### |
198 | ||
199 | cd ../OuterDet | |
200 | ||
201 | echo "* Running AliRoot to reconstruct outer of $CHUNKNAME" | |
202 | ||
203 | echo "OuterDet/recCPass1_OuterDet" >&2 | |
204 | echo executing aliroot -l -b -q "recCPass1_OuterDet.C(\"$CHUNKNAME\", $nEvents, \"$ocdbPath\")" | |
205 | time aliroot -l -b -q "recCPass1_OuterDet.C(\"$CHUNKNAME\", $nEvents, \"$ocdbPath\")" &> ../rec_Outer.log | |
206 | exitcode=$? | |
207 | echo "Exit code: $exitcode" | |
208 | ||
209 | if [ $exitcode -ne 0 ]; then | |
210 | exit $exitcode | |
211 | fi | |
212 | ||
213 | mv syswatch.log ../syswatch_rec_Outer.log | |
214 | ||
215 | if [ -f QAtrain_duo.C ]; then | |
216 | echo "* Running the QA train (outer) ..." | |
217 | ||
218 | echo "OuterDet/QAtrain_duo.C" >&2 | |
219 | echo executing time aliroot -b -q "QAtrain_duo.C(\"_outer\",$runNum,\"$ocdbPath\")" | |
220 | time aliroot -b -q "QAtrain_duo.C(\"_outer\",$runNum,\"$ocdbPath\")" &> ../qa_outer.log | |
221 | exitcode=$? | |
222 | echo "Exit code: $exitcode" | |
223 | ||
224 | if [ $exitcode -ne 0 ]; then | |
225 | exit $exitcode | |
226 | fi | |
227 | ||
228 | for file in *.stat ; do | |
229 | mv $file ../$file.qa_outer | |
230 | done | |
231 | fi | |
232 | ||
383fa54e | 233 | mv AliESDs.root ../AliESDs_Outer.root |
5cebce24 | 234 | mv AliESDfriends.root ../AliESDfriends_Outer.root |
9e160db9 | 235 | |
5cebce24 | 236 | for file in QAresults_outer.root EventStat_temp_outer.root; do |
237 | if [ -f "$file" ]; then | |
238 | mv "$file" ../ | |
239 | fi | |
240 | done | |
9e160db9 | 241 | |
3aabeebe | 242 | if [[ -f $ALICE_ROOT/PWGPP/CalibMacros/CPass1/makeSyswatchCPass1.C ]]; then |
243 | echo ">>>>>>> Extracting system information..." | |
244 | echo executing aliroot -b -q "$ALICE_ROOT/PWGPP/CalibMacros/CPass1/makeSyswatchCPass1.C(\"AliESDfriends_v1.root\")" | |
245 | aliroot -b -q "$ALICE_ROOT/PWGPP/CalibMacros/CPass1/makeSyswatchCPass1.C(\"AliESDfriends_v1.root\")" | |
246 | else | |
247 | echo $ALICE_ROOT/PWGPP/CalibMacros/CPass1/makeSyswatchCPass1.C not there | |
248 | fi |