-
Notifications
You must be signed in to change notification settings - Fork 1
/
dofitEE.sh
executable file
·137 lines (100 loc) · 2.84 KB
/
dofitEE.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#!/bin/sh
date
#n fits
NTIME=$1
#job index
IDX=$2
#iz
IZ=$3
#fit method
METHOD=$4
#mode
MODE=$5
#Gaussian Resolution
GAUSRESO="1.0"
#Hit energy fraction
HITENERGYFRACTION="0.01"
#RegVersion
REGVERSION="V7Elec"
#Eta scale file
#ETASCALEFILE="etascale_V8Elec_Mode76_Method7_A_1.dat;etascale_V8Elec_Mode76_Method7_B_1.dat;etascale_V8Elec_Mode76_Method7_C_1.dat;etascale_V8Elec_Mode76_Method7_D_1.dat"
ETASCALEFILE="etascale_V8Elec_Mode76_Method7_Odd_A_1.dat;etascale_V8Elec_Mode76_Method7_Odd_B_1.dat;etascale_V8Elec_Mode76_Method7_Odd_C_1.dat;etascale_V8Elec_Mode76_Method7_Odd_D_1.dat"
#debug
DEBUG="1"
#do odd if 1 , even if 2, both if 0
DOEVENODD="1"
#initilize working area
TOP=$PWD
SOURCE=/afs/cern.ch/user/h/heli/work/private/calib/2013Nov06/FitEBEE/fitEEEtaScaleV4
DATA=/eos/cms/store/user/heli/2013Nov06/ShervinDataEE
alias eos='/afs/cern.ch/project/eos/installation/0.2.31/bin/eos.select'
ROOTFILEIN=CombRegV8ZeeData_IZ${IZ}_IX${IDX}_ABCD.root
ROOTFILEOUT=fitzee_out_IZ${IZ}_IX${IDX}_${NTIME}_ABCD.root
TABLEIN=emptyCalibTable_IZ${IZ}_IX${IDX}.dat
TABLEOUT=calibTable_out_IZ${IZ}_IX${IDX}_${NTIME}_ABCD.dat
TABLEREF=emptyCalibTable_IZ${IZ}_IX${IDX}.dat
LOGFILE=fitzee_out_IZ${IZ}_IX${IDX}_${NTIME}_ABCD.log
if [ $NTIME -ge 2 ];
then
TABLEIN="calibTable_in_IZ${IZ}_IX${IDX}_${NTIME}_ABCD.dat"
TABLEREF="calibTableRef_$((NTIME-1))_ABCD.dat"
fi
echo "setup"
cp ${SOURCE}/env_CMSSW_5_3_7_patch5.sh .
source env_CMSSW_5_3_7_patch5.sh
cd ${TOP}
date
#
echo "copy codes"
cd ${SOURCE}
cp calibRecord.h fitzee.cc functions.h variables.h voigt.h ${TOP}/
cp ${ETASCALEFILE//;/ } ${TOP}/
cd ${TOP}
date
echo "build"
g++ -o fitzee.exe fitzee.cc \
-pthread -m64 \
-I${ROOTSYS}/include \
-I./ -L${ROOTSYS}/lib \
-lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d \
-lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics \
-lMathCore -lThread -lMinuit -lMinuit2 -lpthread \
-lTreePlayer \
-Wl,-rpath,${ROOTSYS}/lib -lm -ldl
date
#echo "copy data"
#eos cp ${DATA}/${ROOTFILEIN} ./
#date
# use eos directly
ROOTFILEIN="root://eoscms/${DATA}/${ROOTFILEIN}"
date
echo "copy tables"
cp ${SOURCE}/table/${TABLEIN} ./
cp ${SOURCE}/table/${TABLEREF} ./
date
echo "run"
./fitzee.exe ${MODE} \
${ROOTFILEIN} \
${ROOTFILEOUT} \
${TABLEIN} \
${TABLEOUT} \
${TABLEREF} \
0.9999 \
${METHOD} ${GAUSRESO} \
${HITENERGYFRACTION} \
${DEBUG} \
${DOEVENODD} \
${REGVERSION} \
${ETASCALEFILE} \
&> ${LOGFILE}
date
echo "copy output"
OUTDIR="${SOURCE}/out_${NTIME}_method${METHOD}_mode${MODE}_evenodd${DOEVENODD}_reg${REGVERSION}"
if [ ! -d $OUTDIR ];
then
mkdir $OUTDIR
fi
cp ${ROOTFILEOUT} ${OUTDIR}/
cp ${TABLEOUT} ${OUTDIR}/
cp ${LOGFILE} ${OUTDIR}/
date