-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunHcalConditionValidation.sh
executable file
·102 lines (75 loc) · 2.23 KB
/
runHcalConditionValidation.sh
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/bin/bash
export DEFAULT_LINE_LENGTH=35
export jobs_in_parallel=10
export MAX_LEN=0
export BASE_PATH="$(dirname $(pwd))"
export OUTDIR="$BASE_PATH/$outdir/$NewLUTtag"
export GIT_COMMIT=$(git rev-parse HEAD)
export SCRATCH_DIR="$BASE_PATH/scratch"
if [[ $local_out == "true" ]]; then
export LOG_DIR=$BASE_PATH/logs
else
export LOG_DIR=$CI_UPLOAD_DIR
fi
if [[ $local_out == "true" ]]; then
export LOG_DIR=$BASE_PATH/logs
else
export LOG_DIR=$CI_UPLOAD_DIR
fi
function make_line(){
local length=${1:-$DEFAULT_LINE_LENGTH}
head -c $length < /dev/zero | tr '\0' '='
echo ""
}
export -f make_line
export variables=("HOAsciiInput" "release_L1" "NewLUTtag" "NewGT"
"dataset" "year" "nEvts" "lumi_start" "tier2" "OldRun"
"lumi_end" "version_L1" "OldLUTtag" "week" "run" "max_file_num"
"OldGT" "NewRun" "release_LUT" "outdir" "geometry" "arch_L1" "arch_LUT"
"jobs_in_parallel" "calo_params" "zdc_lut_topic" "transferdir"
"release_HLT" "arch_HLT" "hlt_max_events" "hlt_dataset" "hlt_paths"
)
function print_vars() {
for var in ${variables[@]}; do
: $(( MAX_LEN = (MAX_LEN > ${#var})? MAX_LEN : ${#var} ))
done
make_line
for variable in ${variables[@]}; do
printf "%-${MAX_LEN}s = %s\n" "$variable" "\"${!variable}\""
done
make_line
}
function main(){
rm -r $LOG_DIR
rm -r $SCRATCH_DIR
echo "Creating directories"
mkdir -p $SCRATCH_DIR
mkdir -p $LOG_DIR
mkdir -p $OUTDIR
make_line
echo "Running from BASE_PATH ${BASE_PATH}"
echo "Scratch directory is ${SCRATCH_DIR}"
echo "Git status is"
git status
make_line
print_vars
bash scripts/setup_python.sh
# Generate the Lookup Tables based on the conditions, both new and old
bash scripts/lutgen.sh
# Generate trigger objects for the new LUT tag
bash scripts/l1tag.sh
# Compute the L1 rates
bash scripts/l1rate.sh
# Make Plots
bash scripts/makeplots.sh
# Start HLT Validation
#bash scripts/hlt.sh
# Make Prsentations
bash scripts/make_presentations.sh
# Transfer output to eos
bash scripts/finalize_transfer.sh
make_line
echo "Validation completed"
make_line
}
main