-
Notifications
You must be signed in to change notification settings - Fork 3
/
submit.sh
executable file
·429 lines (352 loc) · 11.8 KB
/
submit.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
#!/usr/bin/env bash
# Main driver to submit jobs
# Author Ryuta Kiuchi <[email protected]> and Konglingteng <[email protected]>
# Created [2018-06-16 Sat 16:00]
usage() {
printf "NAME\n\tsubmit.sh - Main driver to submit jobs\n"
printf "\nSYNOPSIS\n"
printf "\n\t%-5s\n" "./submit.sh [OPTION]"
printf "\n\start event_sel in 1.1.6 1.2.7 1.3.7\n"
printf "\nOPTIONS\n"
printf "\n\t%-9s %-40s" "1" "[Run HZZ channel]"
printf "\n\t%-9s %-40s" "2" "[Run ZH channel]"
printf "\n\t%-9s %-40s" "3" "[Run Delphes]"
printf "\n\n"
printf "\nDATE\n"
printf "\n\t%-5s\n" "Janurary 2021"
}
usage_1() {
printf "\n"
printf "\n\t%-9s %-40s" "1.1" "[HZZ SM channel]"
printf "\n\t%-9s %-40s" "1.2" "[HZZ CP odd channel]"
printf "\n\t%-9s %-40s" "1.3" "[HZZ BSM CP even channel]"
printf "\n\t%-9s %-40s" "1.4" "[BDT classification]"
}
usage_2() {
printf "\n"
printf "\n\t%-9s %-40s" "2.1" "[ZH SM channel]"
printf "\n\t%-9s %-40s" "2.2" "[ZH CP odd channel]"
printf "\n\t%-9s %-40s" "2.3" "[ZH BSM CP even channel]"
printf "\n\t%-9s %-40s" "2.4" "[BDT classification]"
}
usage_3() {
printf "\n"
printf "\n\t%-9s %-40s" "3.1" "[An example of running Delphes]"
printf "\n\t%-9s %-40s" "3.2" "[Run Data in batches using Delphes]"
}
usage_1_1() {
printf "\n"
printf "\n\t%-9s %-40s" "1.1.1" "[Please run the JHU generator and name the output as 'outfile_HZZ_SM.lhe' ]"
printf "\n\t%-9s %-40s" "1.1.2" "[Compile the root conversion script]"
printf "\n\t%-9s %-40s" "1.1.3" "[Convert lhe file into root file]"
}
usage_1_2() {
printf "\n"
printf "\n\t%-9s %-40s" "1.2.1" "[Please run the JHU generator and name the output as 'outfile_HZZ_CPodd.lhe' ]"
printf "\n\t%-9s %-40s" "1.2.2" "[Compile the root conversion script]"
printf "\n\t%-9s %-40s" "1.2.3" "[Convert lhe file into root file]"
}
usage_1_3() {
printf "\n"
printf "\n\t%-9s %-40s" "1.3.1" "[Please run the JHU generator and name the output as 'outfile_HZZ_BSM_CPeven.lhe' ]"
printf "\n\t%-9s %-40s" "1.3.2" "[Compile the root conversion script]"
printf "\n\t%-9s %-40s" "1.3.3" "[Convert lhe file into root file]"
}
usage_2_1() {
printf "\n"
printf "\n\t%-9s %-40s" "2.1.1" "[Please run the JHU generator and name the output as 'outfile_ZH_SM.lhe' ]"
printf "\n\t%-9s %-40s" "2.1.2" "[Compile the root conversion script]"
printf "\n\t%-9s %-40s" "2.1.3" "[Convert lhe file into root file]"
}
usage_2_2() {
printf "\n"
printf "\n\t%-9s %-40s" "2.2.1" "[Please run the JHU generator and name the output as 'outfile_ZH_CPodd.lhe' ]"
printf "\n\t%-9s %-40s" "2.2.2" "[Compile the root conversion script]"
printf "\n\t%-9s %-40s" "2.2.3" "[Convert lhe file into root file]"
}
usage_2_3() {
printf "\n"
printf "\n\t%-9s %-40s" "2.3.1" "[Please run the JHU generator and name the output as 'outfile_HZZ_BSM_CPeven.lhe' ]"
printf "\n\t%-9s %-40s" "2.3.2" "[Compile the root conversion script]"
printf "\n\t%-9s %-40s" "2.3.3" "[Convert lhe file into root file]"
}
usage_3_1() {
printf "\n"
printf "\n\t%-9s %-40s" "3.1.1" "[Setting up the environment of Delphes]"
printf "\n\t%-9s %-40s" "3.1.2" "[source Delphes operating environment]"
printf "\n\t%-9s %-40s" "3.1.3" "[Use Delphes to add the CEPC detector effect to the data]"
}
usage_3_2() {
printf "\n"
printf "\n\t%-9s %-40s" "3.2.1" "[Get a list of directories for data]"
printf "\n\t%-9s %-40s" "3.2.2" "[Get all data files]"
printf "\n\t%-9s %-40s" "3.2.3" "[Submit batch job]"
}
if [[ $# -eq 0 ]]; then
usage
echo "Please enter your option: "
read option
else
option=$1
fi
signal_slcio_dir_ll=/cefs/data/DstData/CEPC240/CEPC_v4/higgs/E240.Pe2e2h_zz.e0.p0.whizard195
signal_slcio_dir_nn=/cefs/data/DstData/CEPC240/CEPC_v4/higgs/E240.Pnnh_zz.e0.p0.whizard195
signal_slcio_dir_qq=/cefs/data/DstData/CEPC240/CEPC_v4/higgs/E240.Pqqh_zz.e0.p0.whizard195
signal_HZZ=outfile_HZZ_SM.root
bkg_HZZ=outfile_HZZ_BSM_CPeven.root
# --------------------------------------------------------------------------
# 1.1 HZZ SM channel
# --------------------------------------------------------------------------
sub_1_1(){
case $option in
1.1) echo "run standard model channel..."
;;
1.1.1) echo "Please prepare outfile_HZZ_SM.lhe"
;;
1.1.2) echo "Compiling root conversion script"
c++ -o lhe_conversion_HZZ `root-config --glibs --cflags` -lm lhe_conversion_HZZ.cpp
;;
1.1.3) echo "Root tree generation"
./lhe_conversion_HZZ outfile_HZZ_SM.lhe
mv trial_HZZ.root outfile_HZZ_SM.root
;;
esac
}
# --------------------------------------------------------------------------
# 1.2 HZZ CP odd channel
# --------------------------------------------------------------------------
sub_1_2(){
case $option in
1.2) echo "Run CP odd channel..."
;;
1.2.1) echo "Please prepare outfile_HZZ_CPodd.lhe"
;;
1.2.2) echo "Compiling root conversion script"
c++ -o lhe_conversion_HZZ `root-config --glibs --cflags` -lm lhe_conversion_HZZ.cpp
;;
1.2.3) echo "Root tree generation"
./lhe_conversion_HZZ outfile_HZZ_CPodd.lhe
mv trial_HZZ.root outfile_HZZ_CPodd.root
;;
esac
}
# --------------------------------------------------------------------------
# 1.3 HZZ BSM CP even channel
# --------------------------------------------------------------------------
sub_1_3(){
case $option in
1.3) echo "Run BSM CP even channel..."
;;
1.3.1) echo "Please prepare outfile_HZZ_BSM_CPeven.lhe"
;;
1.3.2) echo "Compiling root conversion script"
c++ -o lhe_conversion_HZZ `root-config --glibs --cflags` -lm lhe_conversion_HZZ.cpp
;;
1.3.3) echo "Root tree generation"
./lhe_conversion_HZZ outfile_HZZ_BSM_CPeven.lhe
mv trial_HZZ.root outfile_HZZ_BSM_CPeven.root
;;
esac
}
# --------------------------------------------------------------------------
# 1.4 BDT classification
# --------------------------------------------------------------------------
sub_1_4(){
case $option in
1.4) echo "BDT classifications for given channel"
;;
1.4.1) echo "BDT classification"
python3 train_model.py ${signal_HZZ} ${bkg_HZZ}
;;
esac
}
sub_2_1(){
case $option in
esac
}
sub_2_2(){
case $option in
esac
}
sub_2_3(){
case $option in
esac
}
sub_2_4(){
case $option in
esac
}
# --------------------------------------------------------------------------
# 3.1 An example of running Delphes
# --------------------------------------------------------------------------
sub_3_1(){
case $option in
3.1) echo "An example of running Delphes"
;;
3.1.1) echo "Setting up the environment of Delphes"
source /cvmfs/sft.cern.ch/lcg/views/LCG_99/x86_64-centos7-gcc10-opt/setup.sh
;;
3.1.2) echo "source Delphes operating environment"
source /scratchfs/bes/myliu/Delphes/DelphesEnv.sh
;;
3.1.3) echo "Use Delphes to add the CEPC detector effect to the data"
/scratchfs/bes/myliu/Delphes/DelphesSTDHEP /scratchfs/bes/myliu/Delphes/cards/delphes_card_CEPC.tcl /cefs/higgs/myliu/Higgs_CP_Data/Example/delphes_output_higgs.root /cefs/data/stdhep/CEPC240/higgs/E240.Pe1e1h_X.e0.p0.whizard195/e1e1h_X.e0.p0.00001.stdhep
;;
esac
}
sub_3_2(){
case $option in
3.2) echo "Run Data in batches using Delphes"
;;
3.2.1) echo "Get a list of directories for data"
ls /cefs/data/stdhep/CEPC240/higgs/ >jobs/txt/Dir_higgs.txt
mkdir jobs/Higgs
;;
3.2.2) echo "Get all data files"
cd /scratchfs/bes/myliu/Liumy/HiggsCP/jobs
./FileList.sh
ls /scratchfs/bes/myliu/Liumy/HiggsCP/jobs/Higgs/* >/scratchfs/bes/myliu/Liumy/HiggsCP/jobs/txt/File_higgs.txt
;;
3.2.3) echo "Submit batch job"
cd /scratchfs/bes/myliu/Liumy/HiggsCP/jobs
#./Stand_job.sh
./Sub_all.sh
;;
esac
}
sub_1(){
case $option in
# sample: 1.1 is print detail information about each step and then you can run the step you want.
# 1.1.* is directly running the step.
# --------------------------------------------------------------------------
# Data
# --------------------------------------------------------------------------
1.1) echo "run SM sample"
usage_1_1
echo "Please enter your option: "
read option
sub_1_1 option
;;
1.1.*) echo "run SM sample"
sub_1_1 option
;;
1.2) echo "run CP odd sample"
usage_1_2
echo "Please enter your option: "
read option
sub_1_2 option
;;
1.2.*) echo "run CP odd sample"
sub_1_2 option
;;
1.3) echo "run BSM CP even sample."
usage_1_3
echo "Please enter your option: "
read option
sub_1_3 option
;;
1.3.*) echo "run BSM CP even sample"
sub_1_3 option
;;
1.4) echo "BDT classification"
usage_1_4
echo "Please enter your option: "
read option
sub_1_4 option
;;
1.4.*) echo "BDT classification"
sub_1_4 option
;;
esac
}
sub_2(){
case $option in
2.1) echo "run SM sample"
usage_2_1
echo "Please enter your option: "
read option
sub_2_1 option
;;
2.1.*) echo "run SM sample"
sub_2_1 option
;;
2.2) echo "run CP odd sample"
usage_2_2
echo "Please enter your option: "
read option
sub_2_2 option
;;
2.2.*) echo "run CP odd sample"
sub_2_2 option
;;
2.3) echo "run BSM CP even sample."
usage_2_3
echo "Please enter your option: "
read option
sub_2_3 option
;;
2.3.*) echo "run BSM CP even sample"
sub_2_3 option
;;
2.4) echo "BDT classification"
usage_2_4
echo "Please enter your option: "
read option
sub_2_4 option
;;
2.4.*) echo "BDT classification"
sub_2_4 option
;;
esac
}
sub_3(){
case $option in
3.1) echo "An example of running Delphes"
usage_3_1
echo "Please enter your option: "
read option
sub_3_1 option
;;
3.1.*) echo "An example of running Delphes"
sub_3_1 option
;;
3.2) echo "Run Data in batches using Delphes"
usage_3_2
echo "Please enter your option: "
read option
sub_3_2 option
;;
3.2.*) echo "Run Data in batches using Delphes"
sub_3_2 option
;;
esac
}
case $option in
1) echo "run HZZ"
usage_1
echo "Please enter your option: "
read option
sub_1 option
;;
1.*) echo "run HZZ"
sub_1 option
;;
2) echo "run ZH"
usage_2
echo "Please enter your option: "
read option
sub_2 option
;;
2.*) echo "run ZH"
sub_2 option
;;
3) echo "Run Delphes"
usage_3
echo "Please enter your option: "
read option
sub_3 option
;;
3.*) echo "Run Delphes"
sub_3 option
;;
esac