-
Notifications
You must be signed in to change notification settings - Fork 42
/
vary.sh
executable file
·64 lines (60 loc) · 1.87 KB
/
vary.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
#! /bin/bash
# Author: Izaak Neutelings (August 2020)
# Description: Run systematic variations, e.g. TES, LTF, JTF, ...
# pico.py channel mutau_TES1p030 'ModuleMuTau tes=1.03'
# pico.py channel mutau_TES0p970 'ModuleMuTau tes=0.97'
# ./vary.sh run -T -y UL2017
# ./vary.sh submit -T -y UL2017
# ./vary.sh resubmit -T -y UL2017
# ./vary.sh status -T -y UL2017
# ./vary.sh hadd -T -y UL2017
set -e
CMD=$1 # subcommand for pico.py
ERAS="UL2017"
CHANNELS='mutau'
SAMPLES=""
OPTIONS="--das "
CLEAN=0
#TES_FIRST=0.970
#TES_LAST=1.030
#STEP_SIZE=0.002
SHIFTS="" #`seq $TES_FIRST $STEP_SIZE $TES_LAST`
OPTIND=2
while getopts ":c:JLm:n:rq:s:Tvx:y:" option; do case "${option}" in
c) CHANNELS="${OPTARG//,/ }";;
J) SHIFTS+="JTF0p900 JTF1p100 ";;
L) SHIFTS+="LTF0p970 LTF1p030 ";;
m) OPTIONS+="-m $OPTARG ";;
n) OPTIONS="-n $OPTARG";;
T) SHIFTS+="TES0p970 TES1p030 ";;
r) OPTIONS+="-r "; CLEAN=1;;
q) OPTIONS="-q $OPTARG";;
s) SAMPLES="${OPTARG//,/ }";;
v) OPTIONS+="-v ";;
x) OPTIONS+="-x ${OPTARG//,/ } ";;
y) ERAS="${OPTARG//,/ }";;
*) OPTIONS+="-$OPTARG ";;
esac done
function peval { echo ">>> $@"; eval "$@"; }
[ "$SHIFTS" = "" ] && echo "Please define systematic variation..." && exit 1
for era in $ERAS; do
[[ $era = '#'* ]] && continue
for channel in $CHANNELS; do
[[ $channel = '#'* ]] && continue
for shft in $SHIFTS; do
SAMPLES_=$SAMPLES
if [ "$SAMPLES" = "" ]; then
[[ $shft = 'TES'* ]] && SAMPLES_="DY TT"
[[ $shft = 'LTF'* ]] && SAMPLES_="DY TT"
[[ $shft = 'JTF'* ]] && SAMPLES_="DY TT W*J"
fi
OPTIONS_="-s $SAMPLES_ $OPTIONS"
CHANNEL_="${channel}_${shft}"
peval "pico.py $CMD -c $CHANNEL_ -y $era $OPTIONS_"
###elif [ $CLEAN -gt 0 ]; then
### for samplename in $SAMPLES; do
### peval "rm output/$CHANNEL_/$era/${samplename}*/"
### done
done
done
done