-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
74 lines (63 loc) · 2.23 KB
/
run.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
#!/bin/bash
set -e
DataValidationNR_Flag=$1
DataValidationER_Flag=$2
UAr_MLP_run_Flag=$3
Python_flag=$4
DataValidationScript=$5
NR_input_file=$6
ER_input_file=$7
Kr_input_file=$8
UAr_input_file=$9
output_dir=${10}
Python_script_MLP=${11}
loadROOTscript=${12}
vetoMLP=${13}
nEventsMLP=${14}
AnalysisFlag=${15}
veto=${16}
train_flag=${17}
nEvents=${18}
MLPFlag="mlp"
echo loading ROOT
source "$loadROOTscript"
mkdir -p "$output_dir"
if [ "$DataValidationNR_Flag" = 1 ]; then
echo Starting data validation script for AmBe data
AnalysisFlag="ambe"
veto=true
nEvents=-1
root -l -b -q "$DataValidationScript(\"$NR_input_file\", \"$AnalysisFlag\", $veto, $nEvents, \"$output_dir\")"
fi
if [ "$DataValidationER_Flag" = 1 ]; then
echo Starting data validation script for AAr data
AnalysisFlag="aar"
veto=false
nEvents=400000
root -l -b -q "$DataValidationScript(\"$ER_input_file\", \"$AnalysisFlag\", $veto, $nEvents, \"$output_dir\")"
fi
if [ "$DataValidationER_Flag" = 1 ]; then
echo Starting data validation script for Kr data
AnalysisFlag="kr"
veto=false
nEvents=-1
root -l -b -q "$DataValidationScript(\"$Kr_input_file\", \"$AnalysisFlag\", $veto, $nEvents, \"$output_dir\")"
fi
if [ "$UAr_MLP_run_Flag" = 1 ]; then
echo Starting data validation script for UAr data
echo Creating txt file with S1 for UAr data
AnalysisFlag="uar"
root -l -b -q "$DataValidationScript(\"$UAr_input_file\", \"$AnalysisFlag\", $vetoMLP, $nEventsMLP, \"$output_dir\")"
fi
if [ "$Python_flag" = 1 ]; then
echo Starting python script for MLP Classification
if [ -e mlp_DS50.pkl ]; then
train_flag=0
python "$Python_script_MLP" "$output_dir"/s1_signal_NR.txt "$output_dir"/s1_signal_ER.txt "$output_dir"/s1_signal_Kr.txt "$output_dir"/s1_signal_UAR.txt "$output_dir" $train_flag
else
train_flag=1
python "$Python_script_MLP" "$output_dir"/s1_signal_NR.txt "$output_dir"/s1_signal_ER.txt "$output_dir"/s1_signal_Kr.txt "$output_dir"/s1_signal_UAR.txt "$output_dir" $train_flag
fi
fi
echo Applying mlp_DS50 results to UAr data. See MLP folder in а mlp_output.root file
root -l -b -q "$DataValidationScript(\"$UAr_input_file\", \"$MLPFlag\", $vetoMLP, $nEventsMLP, \"$output_dir\")"