-
Notifications
You must be signed in to change notification settings - Fork 0
/
fittingScript.sh
113 lines (80 loc) · 2.02 KB
/
fittingScript.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
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
107
108
109
110
111
112
113
#!/bin/bash
ROOTfile=$1
echo "OK0"
echo $ROOTfile
#aliroot -b -l -q fitZNC.cpp($ROOTfile)
#before I had always used aliroot -b -l -q , but it doesn't seem to work...
aliroot -b -l <<EOF
.L fitFinal/fitZNC.cpp
fitZNC("$ROOTfile");
EOF
echo "OK1"
aliroot -b -l <<EOF
.L fitFinal/fitZNA.cpp
fitZNA("$ROOTfile");
EOF
echo "OK2"
aliroot -b -l <<EOF
.L fitFinal/fitPROPER.cpp
fitROOFit("$ROOTfile", 0);
EOF
echo "OK3"
aliroot -b -l <<EOF
.L fitFinal/fitPROPER.cpp
fitROOFit("$ROOTfile", 1);
EOF
echo "OK4"
aliroot -b -l <<EOF
.L fitFinal/fitPROPER.cpp
fitROOFit("$ROOTfile", 2);
EOF
aliroot -b -l <<EOF
.L fitFinal/fitExponentialBkg.cpp
fitROOFit("$ROOTfile", 0);
EOF
echo "OK5"
aliroot -b -l <<EOF
.L fitFinal/fitExponentialBkg.cpp
fitROOFit("$ROOTfile", 1);
EOF
echo "OK6"
aliroot -b -l <<EOF
.L fitFinal/fitExponentialBkg.cpp
fitROOFit("$ROOTfile", 2);
EOF
var1=$(aliroot -b -l <<EOF
.L fitFinal/fitSuppressedNjpsi.cpp
fitROOFit("$ROOTfile", 0);
EOF)
echo "OK5"
var2=$(aliroot -b -l <<EOF
.L fitFinal/fitSuppressedNjpsi.cpp
fitROOFit("$ROOTfile", 1);
EOF)
echo "OK6"
var3=$(aliroot -b -l <<EOF
.L fitFinal/fitSuppressedNjpsi.cpp
fitROOFit("$ROOTfile", 2);
EOF)
echo "$var1" > outputSuppressedSelFlag0.txt
echo "$var2" > outputSuppressedSelFlag1.txt
echo "$var3" > outputSuppressedSelFlag2.txt
echo "OK7"
var=$(aliroot -b -l <<EOF
.L fitFinal/readHisto.cpp
readHisto("$ROOTfile");
EOF)
echo "$var" > output.txt
echo "OK8"
echo "These are the results of: $ROOTfile" > ReadMeAnalysisResults.md
sort -n output.txt > outputSorted.txt
rm output.txt
if [ -d "pngResults/$(date +%F)" ]; then rm -rf pngResults/$(date +%F); fi
mkdir -p pngResults/$(date +%F)
mv ReadMeAnalysisResults.md pngResults/$(date +%F)
mv outputSorted.txt pngResults/$(date +%F)
mv outputSuppressedSelFlag0.txt pngResults/$(date +%F)
mv outputSuppressedSelFlag1.txt pngResults/$(date +%F)
mv outputSuppressedSelFlag2.txt pngResults/$(date +%F)
mv test*.root pngResults/$(date +%F)
mv pngResults/*.png pngResults/$(date +%F)