]>
Commit | Line | Data |
---|---|---|
27eb9bff | 1 | #! /bin/bash |
2 | ||
d157f353 | 3 | # Script to merge objects coming out of the calibration train and export of the OCDB: |
4 | # Arguments: | |
5 | # 1 - directory on which to look for the files to be merged | |
6 | # 2 - pattern | |
7 | # 3 - OCDB output path | |
8 | # [4 - input default OCDB] | |
9 | # | |
10 | ||
11 | #ALIEN setting | |
12 | # $1 = directory where to perform the find | |
13 | # $2 = pattern | |
14 | # $3 = OCDB path | |
15 | ||
16 | # if fourth argument given, its the default OCDB, otherwise use the default raw:// | |
17 | defaultOCDB="raw://" | |
18 | [[ $# -eq 4 ]] && defaultOCDB=$4 | |
19 | ||
27eb9bff | 20 | # init |
21 | path=$1 | |
22 | run=$2 | |
23 | ocdb=$3 | |
d157f353 | 24 | isLocal=0 |
25 | [[ -f path ]] && isLocal=1 | |
26 | ||
27eb9bff | 27 | echo "***********************" 2>&1 | tee -a merge.log |
28 | echo mergeMakeOCDB.sh started 2>&1 | tee -a merge.log | |
29 | echo path = $path 2>&1 | tee -a merge.log | |
30 | echo run = $run 2>&1 | tee -a merge.log | |
31 | echo ocdb = $ocdb 2>&1 | tee -a merge.log | |
32 | echo "***********************" 2>&1 | tee -a merge.log | |
33 | ||
34 | # setup components | |
35 | components="TOF MeanVertex T0 TRD TPC SDD" | |
36 | ||
37 | # copy | |
d157f353 | 38 | if [ $isLocal -eq 0 ]; then |
39 | echo "***********************" 2>&1 | tee -a merge.log | |
40 | echo copying files for run $run 2>&1 | tee -a merge.log | |
41 | echo from $path 2>&1 | tee -a merge.log | |
42 | echo "***********************" 2>&1 | tee -a merge.log | |
43 | aliroot -b -q "$ALICE_ROOT/PWGPP/CalibMacros/CPass0/mergeByComponent.C(\"COPY\",0, \"$path\", \"$pattern\")" 2>&1 | tee -a merge.log | |
44 | #mv syswatch.log copy_syswatch.log | |
45 | fi; | |
27eb9bff | 46 | |
47 | # process by component | |
48 | for det in $components; do | |
49 | ||
50 | # merge | |
51 | echo "***********************" 2>&1 | tee -a merge.log | |
52 | echo merging $det data 2>&1 | tee -a merge.log | |
53 | echo "***********************" 2>&1 | tee -a merge.log | |
d157f353 | 54 | aliroot -b -q "$ALICE_ROOT/PWGPP/CalibMacros/CPass0/mergeByComponent.C(\"$det\", \"calib.list\")" 2>&1 | tee -a merge.log |
55 | mv syswatch.log merge_syswatch_$det.log | |
56 | mv CalibObjects.root CalibObjects_$det.root | |
27eb9bff | 57 | done |
58 | ||
d157f353 | 59 | |
27eb9bff | 60 | # global merge |
61 | echo "***********************" 2>&1 | tee -a merge.log | |
62 | echo merging ALL data 2>&1 | tee -a merge.log | |
63 | echo "***********************" 2>&1 | tee -a merge.log | |
d157f353 | 64 | ls CalibObjects*.root > objects.list |
65 | aliroot -b -q "$ALICE_ROOT/PWGPP/CalibMacros/CPass0/mergeByComponent.C(\"ALL\", \"objects.list\")" 2>&1 | tee -a merge.log | |
66 | #touch CalibObjects.root | |
67 | ||
68 | ||
69 | # make OCDB | |
70 | echo "***********************" 2>&1 | tee -a ocdb.log | |
71 | echo making $det OCDB 2>&1 | tee -a ocdb.log | |
72 | echo "***********************" 2>&1 | tee -a ocdb.log | |
73 | aliroot -b -q "$ALICE_ROOT/PWGPP/CalibMacros/CPass0/makeOCDB.C(\"$run\", \"$ocdb\", \"$defaultOCDB\")" 2>&1 | tee -a ocdb.log | |
74 | #mv CalibObjects.root $det\_CalibObjects.root | |
75 | ||
27eb9bff | 76 | |
77 | # summary | |
78 | echo "***********************" 2>&1 | tee -a ocdb.log | |
79 | echo SUMMARY 2>&1 | tee -a ocdb.log | |
80 | echo "***********************" 2>&1 | tee -a ocdb.log | |
81 | ls -altr *CalibObjects.root *done 2>&1 | tee -a ocdb.log |