]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGPP/CalibMacros/CPass1/mergeMakeOCDB.sh
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / PWGPP / CalibMacros / CPass1 / mergeMakeOCDB.sh
1 #!/bin/bash
2
3 # Script to merge objects coming out of the calibration train:
4 # Arguments:
5 #    1 - directory on which to look for the files to be merged 
6 #    2 - runNumber
7 #    3 - OCDB output path
8 #    [4 - default OCDB]
9
10 # example:
11 # mergeMakeOCDB.sh /alice/cern.ch/user/a/aliprod/CPass0/output/ 120691 alien://folder=/alice/cern.ch/user/a/aliprod/CPass0/output
12
13 #ALIEN setting
14 # $1 = directory where to perform the find 
15 # $2 = runNumber
16 # $3 = OCDB path
17
18 path=$1
19 runNumber=`echo "$2" | sed 's/^0*//'`
20 outputOCDB=$3
21
22 # if fourth argument given, it is the default OCDB, otherwise use the default raw://
23 defaultOCDB="raw://"
24 [[ -n $4 ]] && defaultOCDB=$4
25
26 if [ -f Run0_999999999_v3_s0.root ]; then
27     mkdir -p TPC/Calib/Correction
28     mv Run0_999999999_v3_s0.root TPC/Calib/Correction/
29 fi
30
31 echo "* Running AliRoot to merge calib objects found in $path with pattern AliESDfriends_v1.root"
32 echo aliroot -l -b -q "merge.C(\"$path\",\"AliESDfriends_v1.root\")"
33 time aliroot -l -b -q "merge.C(\"$path\",\"AliESDfriends_v1.root\")" &> merge.log
34
35 exitcode=$?
36
37 echo "*! Exit code: $exitcode"
38
39 mv syswatch.log syswatch_merge.log
40
41 echo "* Extract OCDB entries for run = $runNumber, to be stored in $outputOCDB"
42 echo aliroot -l -b -q "makeOCDB.C($runNumber,\"$outputOCDB\",\"$defaultOCDB\")"
43 time aliroot -l -b -q "makeOCDB.C($runNumber,\"$outputOCDB\",\"$defaultOCDB\")" &> ocdb.log
44
45 exitcode=$?
46
47 echo "*! Exit code: $exitcode"
48
49 mv syswatch.log syswatch_makeOCDB.log