-
Notifications
You must be signed in to change notification settings - Fork 0
/
runSinglePEFit.sh
executable file
·112 lines (101 loc) · 3.24 KB
/
runSinglePEFit.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
#!/bin/sh
PARSED_OPTIONS=$(getopt -n "$0" -o i:lsvw --long "input:long,fromHistos,simul,view,web" -- "$@")
#Bad arguments, something has gone wrong with the getopt command.
if [ $? -ne 0 ];
then
echo "Usage: $0 -i input"
exit 1
fi
eval set -- "$PARSED_OPTIONS"
inputFile=""
long=0
simul=0
fromHistos=0
view=0
web=0
while true;
do
case "$1" in
-i|--input)
if [ -n "$2" ];
then
inputFile=$2
echo "Running fit on ${inputFile}"
fi
shift 2;;
-l|--long)
long=1
echo "LongRun analysis"
shift;;
-s|--simul)
simul=1
echo "Scan simultaneous fit analysis"
shift;;
-v|--view)
view=1
echo "View results at the end"
shift;;
-w|--web)
web=1
echo "Transfer to web server"
shift;;
--fromHistos)
fromHistos=1
echo "Running from histograms"
shift;;
--)
shift
break;;
esac
done
if [ "$inputFile" == "" ];
then
echo "Usage: $0 -i inputFile. Please check your inputs"
exit 1
fi
#source ~/H4AnalysisEnv.sh
mkdir -p SinglePEAnalysis
if [ $long -eq 1 ]; then
if [ $fromHistos -eq 0 ]; then
if [ $simul -eq 0 ]; then
root -l -b -q SinglePEAnalysis_longRun.C+\(\"/data/cmsdaq/led/ntuples/h4Reco_$inputFile.root\",1,0\)
else
root -l -b -q SinglePEAnalysis_LedScan_Simultaneous_LL.C+\(\"/data/cmsdaq/led/ntuples/\",\"$inputFile\",1\)
fi
else
if [ ! -f "/data/cmsdaq/led/histos/histos_${inputFile}.root" ]; then
python makeHisto.py --input=/data/cmsdaq/led/ntuples/h4Reco_${inputFile}.root --output=/data/cmsdaq/led/histos/histos_${inputFile}.root --inputEnvData=/data/cmsdaq/slowControl/temperatures --runType=led --longRun
fi
root -l -b -q SinglePEAnalysis_longRun.C+\(\"/data/cmsdaq/led/histos/histos_$inputFile.root\",1,1\)
fi
else
if [ $fromHistos -eq 0 ]; then
if [ $simul -eq 0 ]; then
root -l -b -q SinglePEAnalysis_longRun.C+\(\"/data/cmsdaq/led/ntuples/h4Reco_$inputFile.root\",0,0\)
else
root -l -b -q SinglePEAnalysis_LedScan_Simultaneous_LL.C+\(\"/data/cmsdaq/led/ntuples/\",\"$inputFile\",0\)
fi
else
if [ ! -f "/data/cmsdaq/led/histos/histos_${inputFile}.root" ]; then
python makeHisto.py --input=/data/cmsdaq/led/ntuples/h4Reco_${inputFile}.root --output=/data/cmsdaq/led/histos/histos_${inputFile}.root --inputEnvData=/data/cmsdaq/slowControl/temperatures --runType=led
fi
root -l -b -q SinglePEAnalysis_longRun.C+\(\"/data/cmsdaq/led/ntuples/histos_$inputFile.root\",0,1\)
fi
fi
if [ $view -eq 1 ]; then
for file in SinglePEAnalysis/*${inputFile}*.png; do
display $file > /dev/null 2>&1 &
done
fi
if [ $web -eq 1 ]; then
mkdir -p /data/cmsdaq/www/process/${inputFile}
cp -v /data/cmsdaq/www/process/index.php /data/cmsdaq/www/process/${inputFile}/index.php
for file in SinglePEAnalysis/*${inputFile}*.png; do
cp -v $file /data/cmsdaq/www/process/${inputFile}/
done
for file in SinglePEAnalysis/*${inputFile}*.pdf; do
cp -v $file /data/cmsdaq/www/process/${inputFile}/
done
. /home/cmsdaq/mattermost.ini
curl -i -X POST -H 'Content-Type: application/json' -d '{"text": "#### LED Run analysed '${inputFile}' :tada:\n Results available at http://10.0.0.44/process/'${inputFile}'\n", "username": "pmt-bench"}' ${WEB_HOOK}
fi