-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpreprocess.sh
executable file
·51 lines (43 loc) · 1.99 KB
/
preprocess.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
#! /bin/bash
magnify_source="$(dirname $(readlink -f $BASH_SOURCE))"
# no pramater specified, or given an "-h" option
if [ "$#" -lt 1 ] || [ "$1" == "-h" ]; then
echo ""
echo "NAME"
echo " preprocess.sh - wrapper for merging magnify histograms from all APAs"
echo ""
echo "SYNOPSIS"
echo " ./preprocess.sh /path/and/input.root [/output/directory] [extension label]"
echo ""
echo "DESCRIPTION"
echo " The output directory and the extension label are optional."
echo " For example, if they were NOT specified explictly, the default"
echo " output path is data/, and extension label would be v2."
echo " To specify them, try this example:"
echo " ./preprocess.sh /data1/protodune.root /home/user/data/ v3"
echo ""
exit 0
fi
rootfile="$1"
rootfile=$(readlink -f "$rootfile") # complete the fullpath
outPath="$magnify_source/data"
ext="v2"
if [ "$#" -eq 2 ]; then
outPath=$(readlink -f "$2") # complete the fullpath
elif [ "$#" -eq 3 ]; then
outPath=$(readlink -f "$2")
ext="$3"
fi
# echo $rootfile
# echo $outPath
# echo $ext
cd $magnify_source/scripts
root -l -b -q preprocess.C+'("'"$rootfile"'", "'"$outPath"'", "orig", "orig", "'"$ext"'", false, "recreate")'
root -l -b -q preprocess.C+'("'"$rootfile"'", "'"$outPath"'", "raw", "raw", "'"$ext"'", true)'
root -l -b -q preprocess.C+'("'"$rootfile"'", "'"$outPath"'", "gauss", "decon", "'"$ext"'")'
root -l -b -q preprocess.C+'("'"$rootfile"'", "'"$outPath"'", "threshold", "threshold", "'"$ext"'")'
# root -l -b -q preprocess.C+'("'"$rootfile"'", "'"$outPath"'", "tree:T_hm", "T_bad", "'"$ext"'")'
# root -l -b -q preprocess.C+'("'"$rootfile"'", "'"$outPath"'", "wiener", "wiener", "'"$ext"'")'
# root -l -b -q preprocess.C+'("'"$rootfile"'", "'"$outPath"'", "gauss", "gauss", "'"$ext"'")'
# root -l -b -q preprocess.C+'("'"$rootfile"'", "'"$outPath"'", "troi", "troi", "'"$ext"'")'
# root -l -b -q preprocess.C+'("'"$rootfile"'", "'"$outPath"'", "lroi", "lroi", "'"$ext"'")'