]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGPP/CalibMacros/CPass0/mergeMakeOCDB.byComponent.sh
CPass0/AddTaskTPCCalib.C - adding higher level calibration
[u/mrichter/AliRoot.git] / PWGPP / CalibMacros / CPass0 / mergeMakeOCDB.byComponent.sh
CommitLineData
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://
17defaultOCDB="raw://"
18[[ $# -eq 4 ]] && defaultOCDB=$4
19
27eb9bff 20# init
21path=$1
22run=$2
23ocdb=$3
d157f353 24isLocal=0
25[[ -f path ]] && isLocal=1
26
27eb9bff 27echo "***********************" 2>&1 | tee -a merge.log
28echo mergeMakeOCDB.sh started 2>&1 | tee -a merge.log
29echo path = $path 2>&1 | tee -a merge.log
30echo run = $run 2>&1 | tee -a merge.log
31echo ocdb = $ocdb 2>&1 | tee -a merge.log
32echo "***********************" 2>&1 | tee -a merge.log
33
34# setup components
35components="TOF MeanVertex T0 TRD TPC SDD"
36
37# copy
d157f353 38if [ $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
45fi;
27eb9bff 46
47# process by component
48for 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 57done
58
d157f353 59
27eb9bff 60# global merge
61echo "***********************" 2>&1 | tee -a merge.log
62echo merging ALL data 2>&1 | tee -a merge.log
63echo "***********************" 2>&1 | tee -a merge.log
d157f353 64ls CalibObjects*.root > objects.list
65aliroot -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
70echo "***********************" 2>&1 | tee -a ocdb.log
71echo making $det OCDB 2>&1 | tee -a ocdb.log
72echo "***********************" 2>&1 | tee -a ocdb.log
73aliroot -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
78echo "***********************" 2>&1 | tee -a ocdb.log
79echo SUMMARY 2>&1 | tee -a ocdb.log
80echo "***********************" 2>&1 | tee -a ocdb.log
81ls -altr *CalibObjects.root *done 2>&1 | tee -a ocdb.log