-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_ratio.bash
executable file
·46 lines (40 loc) · 3.36 KB
/
get_ratio.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
#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://ali-qcdb-gpn.cern.ch:8083/browse/qc/ZDC/MO/QcZDCRecTask/h_TDC_ZNA_TC_V/RunNumber=$irun?Accept=application/json" | jq -r '.objects[0] | "curl http://ali-qcdb-gpn.cern.ch:8083\(.replicas[0]) -o work/\(.path|split("/")|join("_"))_\(.RunNumber).root"' > GetPlots/do0.bash
curl -s "http://ali-qcdb-gpn.cern.ch:8083/browse/qc/ZDC/MO/QcZDCRecTask/h_TDC_ZNA_SUM_V/RunNumber=$irun?Accept=application/json" | jq -r '.objects[0] | "curl http://ali-qcdb-gpn.cern.ch:8083\(.replicas[0]) -o work/\(.path|split("/")|join("_"))_\(.RunNumber).root"' > GetPlots/do1.bash
curl -s "http://ali-qcdb-gpn.cern.ch:8083/browse/qc/ZDC/MO/QcZDCRecTask/h_TDC_ZNC_TC_V/RunNumber=$irun?Accept=application/json" | jq -r '.objects[0] | "curl http://ali-qcdb-gpn.cern.ch:8083\(.replicas[0]) -o work/\(.path|split("/")|join("_"))_\(.RunNumber).root"' > GetPlots/do2.bash
curl -s "http://ali-qcdb-gpn.cern.ch:8083/browse/qc/ZDC/MO/QcZDCRecTask/h_TDC_ZNC_SUM_V/RunNumber=$irun?Accept=application/json" | jq -r '.objects[0] | "curl http://ali-qcdb-gpn.cern.ch:8083\(.replicas[0]) -o work/\(.path|split("/")|join("_"))_\(.RunNumber).root"' > GetPlots/do3.bash
else
curl -s 'http://ali-qcdb-gpn.cern.ch:8083/browse/qc/ZDC/MO/QcZDCRecTask/h_TDC_ZNA_TC_V/?Accept=application/json' | jq -r '.objects[0] | "curl http://ali-qcdb-gpn.cern.ch:8083\(.replicas[0]) -o work/\(.path|split("/")|join("_"))_\(.RunNumber).root"' > GetPlots/do0.bash
curl -s 'http://ali-qcdb-gpn.cern.ch:8083/browse/qc/ZDC/MO/QcZDCRecTask/h_TDC_ZNA_SUM_V/?Accept=application/json' | jq -r '.objects[0] | "curl http://ali-qcdb-gpn.cern.ch:8083\(.replicas[0]) -o work/\(.path|split("/")|join("_"))_\(.RunNumber).root"' > GetPlots/do1.bash
curl -s 'http://ali-qcdb-gpn.cern.ch:8083/browse/qc/ZDC/MO/QcZDCRecTask/h_TDC_ZNC_TC_V/?Accept=application/json' | jq -r '.objects[0] | "curl http://ali-qcdb-gpn.cern.ch:8083\(.replicas[0]) -o work/\(.path|split("/")|join("_"))_\(.RunNumber).root"' > GetPlots/do2.bash
curl -s 'http://ali-qcdb-gpn.cern.ch:8083/browse/qc/ZDC/MO/QcZDCRecTask/h_TDC_ZNC_SUM_V/?Accept=application/json' | jq -r '.objects[0] | "curl http://ali-qcdb-gpn.cern.ch:8083\(.replicas[0]) -o work/\(.path|split("/")|join("_"))_\(.RunNumber).root"' > GetPlots/do3.bash
fi
bash GetPlots/do0.bash > /dev/null 2>&1
bash GetPlots/do1.bash > /dev/null 2>&1
bash GetPlots/do2.bash > /dev/null 2>&1
bash GetPlots/do3.bash > /dev/null 2>&1
if [ "$STR" == "SPECIFIC" ]; then
irun2=$(curl -s "http://ali-qcdb-gpn.cern.ch:8083/browse/qc/ZDC/MO/QcZDCRecTask/h_TDC_ZNC_SUM_V/RunNumber=$irun?Accept=application/json" | jq -r '.objects[0].RunNumber')
else
irun2=$(curl -s 'http://ali-qcdb-gpn.cern.ch:8083/browse/qc/ZDC/MO/QcZDCRecTask/h_TDC_ZNC_SUM_V/?Accept=application/json' | jq -r '.objects[0].RunNumber')
fi
rm -rf "results/$irun2/ratio"
mkdir "results/$irun2" > /dev/null 2>&1
mkdir "results/$irun2/ratio" > /dev/null 2>&1
root -q "get_ratio.C($irun2)"