-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathrun_analysis.sh
executable file
·70 lines (57 loc) · 2.43 KB
/
run_analysis.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
#!/bin/bash
set -e
# Parse arguments
ERA=$1 # options: 2016, 2017
IFS=',' read -r -a CHANNELS <<< $2
CHANNELSARG=$2
TAG="default"
source utils/bashFunctionCollection.sh
# Error handling to ensure that script is executed from top-level directory of
# this repository
for DIRECTORY in shapes datacards combine plotting utils
do
if [ ! -d "$DIRECTORY" ]; then
echo "[FATAL] Directory $DIRECTORY not found, you are not in the top-level directory of the analysis repository?"
exit 1
fi
done
ensureoutdirs
# Clean-up workspace
#./utils/clean.sh
# Create shapes of systematics
#./shapes/produce_shapes.sh $ERA $CHANNELSARG $TAG
# Apply blinding strategy
#./shapes/apply_blinding.sh $ERA
# Convert shapes to synced format
for CHANNEL in ${CHANNELS[@]}; do
logandrun ./shapes/convert_to_synced_shapes.sh $ERA $CHANNEL $TAG &
done
wait
# Write datacard
STXS_SIGNALS="stxs_stage0" # options: stxs_stage0, stxs_stage1p1
CATEGORIES="stxs_stage1p1" # options: stxs_stage0, stxs_stage1p1
JETFAKES=1 # options: 0, 1
EMBEDDING=1 # options: 0, 1
DATACARDDIR=output/datacards/${ERA}-${TAG}-smhtt-ML/${STXS_SIGNALS}
[ -d $DATACARDDIR ] || mkdir -p $DATACARDDIR
logandrun ./datacards/produce_datacard.sh ${ERA} $STXS_SIGNALS $CATEGORIES $JETFAKES $EMBEDDING ${TAG} ${CHANNELSARG}
# Combine datacards
# The following line combines datacards of different eras.
# The era name "combined" is used for the resulting datacards and can be fitted using this
# as ERA variable in the following.
#./datacards/combine_datacards.sh 2016 2017
# Build workspace
STXS_FIT="inclusive" # options: stxs_stage0, stxs_stage1p1, inclusive
logandrun ./datacards/produce_workspace.sh $ERA $STXS_FIT $TAG | tee ${ERA}_produce_workspace_${STXS_FIT}.log
# Run statistical inference
#./combine/significance.sh $ERA | tee ${ERA}_significance.log
logandrun ./combine/signal_strength.sh $ERA $STXS_FIT $DATACARDDIR/cmb/125 cmb ${TAG}
logandrun ./combine/signal_strength.sh $ERA $STXS_FIT $DATACARDDIR/cmb/125 cmb ${TAG} "robustHesse"
./combine/diff_nuisances.sh $ERA
#./combine/nuisance_impacts.sh $ERA
# Make prefit and postfit shapes
logandrun ./combine/prefit_postfit_shapes.sh ${ERA} ${STXS_FIT} ${DATACARDDIR}/cmb/125 ${TAG}
EMBEDDING=1
JETFAKES=1
logandrun ./plotting/plot_shapes.sh $ERA $TAG ${CHANNELSARG} $STXS_SIGNALS $STXS_FIT $CATEGORIES $JETFAKES $EMBEDDING
#./plotting/plot_signals.sh $ERA $STXS_SIGNALS $CATEGORIES $CHANNELS