-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_peak1n_offline.bash
executable file
·56 lines (48 loc) · 5 KB
/
get_peak1n_offline.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#STR="LAST"
#STR="SPECIFIC"
#irun=559147
if [ -z "$1" ]; then
# No argument provided, set STR to "LAST"
STR="LAST"
else
# Argument provided, set STR to "SPECIFIC" and irun to the argument value
STR="SPECIFIC"
irun="$1"
fi
rm -rf work/ > /dev/null 2>&1
rm -rf GetPlots/ > /dev/null 2>&1
mkdir results/ > /dev/null 2>&1
mkdir work/ > /dev/null 2>&1
mkdir GetPlots/ > /dev/null 2>&1
if [ "$STR" == "SPECIFIC" ]; then
curl -s "http://ccdb-test.cern.ch:8080/browse/qc/ZDC/MO/QcZDCRecTask/h_TDC_ZNA_TC_A_H_CUT/RunNumber=$irun?Accept=application/json" | jq -r '.objects[0] | "curl http://ccdb-test.cern.ch:8080/\(.replicas[0]) -o work/\(.path|split("/")|join("_"))_\(.RunNumber).root"' > GetPlots/do0peak1n.bash
curl -s "http://ccdb-test.cern.ch:8080/browse/qc/ZDC/MO/QcZDCRecTask/h_TDC_ZNA_SUM_A_H_CUT/RunNumber=$irun?Accept=application/json" | jq -r '.objects[0] | "curl http://ccdb-test.cern.ch:8080/\(.replicas[0]) -o work/\(.path|split("/")|join("_"))_\(.RunNumber).root"' > GetPlots/do1peak1n.bash
curl -s "http://ccdb-test.cern.ch:8080/browse/qc/ZDC/MO/QcZDCRecTask/h_TDC_ZNC_TC_A_H_CUT/RunNumber=$irun?Accept=application/json" | jq -r '.objects[0] | "curl http://ccdb-test.cern.ch:8080/\(.replicas[0]) -o work/\(.path|split("/")|join("_"))_\(.RunNumber).root"' > GetPlots/do2peak1n.bash
curl -s "http://ccdb-test.cern.ch:8080/browse/qc/ZDC/MO/QcZDCRecTask/h_TDC_ZNC_SUM_A_H_CUT/RunNumber=$irun?Accept=application/json" | jq -r '.objects[0] | "curl http://ccdb-test.cern.ch:8080/\(.replicas[0]) -o work/\(.path|split("/")|join("_"))_\(.RunNumber).root"' > GetPlots/do3peak1n.bash
else
curl -s 'http://ccdb-test.cern.ch:8080/browse/qc/ZDC/MO/QcZDCRecTask/h_TDC_ZNA_TC_A_H_CUT/?Accept=application/json' | jq -r '.objects[0] | "curl http://ccdb-test.cern.ch:8080/\(.replicas[0]) -o work/\(.path|split("/")|join("_"))_\(.RunNumber).root"' > GetPlots/do0peak1n.bash
curl -s 'http://ccdb-test.cern.ch:8080/browse/qc/ZDC/MO/QcZDCRecTask/h_TDC_ZNA_SUM_A_H_CUT/?Accept=application/json' | jq -r '.objects[0] | "curl http://ccdb-test.cern.ch:8080/\(.replicas[0]) -o work/\(.path|split("/")|join("_"))_\(.RunNumber).root"' > GetPlots/do1peak1n.bash
curl -s 'http://ccdb-test.cern.ch:8080/browse/qc/ZDC/MO/QcZDCRecTask/h_TDC_ZNC_TC_A_H_CUT/?Accept=application/json' | jq -r '.objects[0] | "curl http://ccdb-test.cern.ch:8080/\(.replicas[0]) -o work/\(.path|split("/")|join("_"))_\(.RunNumber).root"' > GetPlots/do2peak1n.bash
curl -s 'http://ccdb-test.cern.ch:8080/browse/qc/ZDC/MO/QcZDCRecTask/h_TDC_ZNC_SUM_A_H_CUT/?Accept=application/json' | jq -r '.objects[0] | "curl http://ccdb-test.cern.ch:8080/\(.replicas[0]) -o work/\(.path|split("/")|join("_"))_\(.RunNumber).root"' > GetPlots/do3peak1n.bash
fi
bash GetPlots/do0peak1n.bash > /dev/null 2>&1
bash GetPlots/do1peak1n.bash > /dev/null 2>&1
bash GetPlots/do2peak1n.bash > /dev/null 2>&1
bash GetPlots/do3peak1n.bash > /dev/null 2>&1
if [ "$STR" == "SPECIFIC" ]; then
irun2=$(curl -s "http://ccdb-test.cern.ch:8080/browse/qc/ZDC/MO/QcZDCRecTask/h_TDC_ZNA_TC_A_H_CUT/RunNumber=$irun?Accept=application/json" | jq -r '.objects[0].RunNumber')
else
irun2=$(curl -s 'http://ccdb-test.cern.ch:8080/browse/qc/ZDC/MO/QcZDCRecTask/h_TDC_ZNA_TC_A_H_CUT/?Accept=application/json' | jq -r '.objects[0].RunNumber')
fi
rm -rf "results/$irun2/1n_o"
mkdir "results/$irun2" > /dev/null 2>&1
mkdir "results/$irun2/1n_o" > /dev/null 2>&1
root -q "get_peak1n_offline.C($irun2)"
root -l -q 'work/qc_ZDC_MO_QcZDCRecTask_h_TDC_ZNA_TC_A_H_CUT_'$irun2'.root' 'fitmultigamma_1n_cut.C("ccdb_object",0x1,0,27,5,4,20,0,'$irun2',"A","TC")'
root -l -q 'work/qc_ZDC_MO_QcZDCRecTask_h_TDC_ZNA_SUM_A_H_CUT_'$irun2'.root' 'fitmultigamma_1n_cut.C("ccdb_object",0x1,0,27,5,4,20,0,'$irun2',"A","SUM")'
root -l -q 'work/qc_ZDC_MO_QcZDCRecTask_h_TDC_ZNC_TC_A_H_CUT_'$irun2'.root' 'fitmultigamma_1n_cut.C("ccdb_object",0x1,0,27,5,4,20,0,'$irun2',"C","TC")'
root -l -q 'work/qc_ZDC_MO_QcZDCRecTask_h_TDC_ZNC_SUM_A_H_CUT_'$irun2'.root' 'fitmultigamma_1n_cut.C("ccdb_object",0x1,0,27,5,4,20,0,'$irun2',"C","SUM")'
o2-ccdb-upload --host ccdb-test.cern.ch:8080 --path qc/ZDC/MO/QcZDCRecTask/1nfit/h_TDC_ZNC_TC_A_H/ --meta "RunNumber=$irun2" --file /home/stefan/Work/ZDC_Backgroud_Script/results/$irun2/1n_o/h_TDC_ZNC_TC_A_fit.root --key h_TDC_ZNC_TC_A_H_CUT
o2-ccdb-upload --host ccdb-test.cern.ch:8080 --path qc/ZDC/MO/QcZDCRecTask/1nfit/h_TDC_ZNC_SUM_A_H/ --meta "RunNumber=$irun2" --file /home/stefan/Work/ZDC_Backgroud_Script/results/$irun2/1n_o/h_TDC_ZNC_SUM_A_fit.root --key h_TDC_ZNC_SUM_A_H_CUT
o2-ccdb-upload --host ccdb-test.cern.ch:8080 --path qc/ZDC/MO/QcZDCRecTask/1nfit/h_TDC_ZNA_TC_A_H/ --meta "RunNumber=$irun2" --file /home/stefan/Work/ZDC_Backgroud_Script/results/$irun2/1n_o/h_TDC_ZNA_TC_A_fit.root --key h_TDC_ZNA_TC_A_H_CUT
o2-ccdb-upload --host ccdb-test.cern.ch:8080 --path qc/ZDC/MO/QcZDCRecTask/1nfit/h_TDC_ZNA_SUM_A_H/ --meta "RunNumber=$irun2" --file /home/stefan/Work/ZDC_Backgroud_Script/results/$irun2/1n_o/h_TDC_ZNA_SUM_A_fit.root --key h_TDC_ZNA_SUM_A_H_CUT