Newer
Older
#!/bin/bash
#set -u
function print_the_help {
echo "USAGE: $0 -r <run_number> -n <num> "
echo " OPTIONS: "
echo " -r,--run Required run number"
echo " -n,--n-events Required number of events (appears in output rootfile name)"
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
101
102
103
104
105
106
#echo " -o,--online-only Log online only"
#echo " -a,--all Log all plots (online, detectors, physics)"
#echo " -n,--no-log Do not submit any log entries"
#echo " -y,--yes Automatically submit log entries (does not prompt for y/n)"
exit
}
function yes_or_no {
while true; do
read -p "$* [y/n]: " yn
case $yn in
[Yy]*) return 0 ;;
[Nn]*) echo "No entered" ; return 1 ;;
esac
done
}
run_number=
n_events=-1
container=
if [[ $# -eq 0 ]] ; then
print_the_help
exit
fi
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-h|--help)
shift # past argument
print_the_help
;;
-r|--run)
run_number="$2"
shift # past argument
shift # past value
;;
-n|--n-events)
n_events="$2"
shift # past argument
shift # past value
;;
#-c|--container)
# container=1
# #shift # past argument
# shift # past value
# ;;
#-a|--all)
# LOG_ALL_PLOTS=1
# shift # past argument
# #shift # past value
# ;;
#-o|--online-only)
# ONLINE_ONLY=1
# shift # past argument
# #shift # past value
# ;;
*) # unknown option
#POSITIONAL+=("$1") # save it in an array for later
echo "unknown option"
print_the_help
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
if [[ -z ${n_events} ]] ; then
echo " need argument -n <num> "
fi
if [[ -z ${run_number} ]] ; then
echo " need argument -r <run> "
fi
#if [[ $# -eq 0 ]] ; then
# print_the_help
# exit
#fi
source /group/c-csv/local/setup.sh
# For some reason the module files need to put in a specific order.
# This is probably because we are using the old TCL version.
module unload csv/dev
module load csv/dev
module load tmux/latest
module load python/latest
module load python/2.7.15
module load python3/latest
module load vim/latest
module load git/latest
module load ruby/2.5.3
hcana -b -q "scripts/replay_production_coin.cxx(${run_number},${n_events})"
#root -b -q "scripts/good_jpsi_counter.cxx(${run_number})"
#sleep 1
#mkdir -p monitoring/${run_number}
#http_proxy= wget http://cdaql1.jlab.org:8888/good_jpsi_counter/${run_number}/Jpsi/Invariant_Mass/fPrimitives/JpsiMassAfterTiming/root.json -O monitoring/${run_number}/Invariant_Mass_after_timing.json