-
Notifications
You must be signed in to change notification settings - Fork 7
/
submit.sh
executable file
·1638 lines (1395 loc) · 63.3 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
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/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 Z(->ll)H(->ZZ*) channel]"
printf "\n\t%-9s %-40s" "2" "[run Z(->nn)H(->ZZ*) channel]"
printf "\n\t%-9s %-40s" "3" "[run Z(->qq)H(->ZZ*) channel]"
printf "\n\n"
printf "\nDATE\n"
printf "\n\t%-5s\n" "AUGUST 2019"
}
usage_1() {
printf "\n\t%-9s %-40s" "1.1" "[run Z(->mumu)H(->ZZ*->nnjj) sample]"
printf "\n\t%-9s %-40s" "1.2" "[run Z(->ll,qq,nn)H(->inclusive) background sample]"
printf "\n\t%-9s %-40s" "1.3" "[run background sample]"
printf "\n\t%-9s %-40s" "1.4" "[plot pictures and save results]"
}
usage_2() {
printf "\n\t%-9s %-40s" "2.1" "[run Z(->nn)H(->ZZ*->mumujj) sample]"
printf "\n\t%-9s %-40s" "2.2" "[run Z(->ll,qq,nn)H(->inclusive) background sample]"
printf "\n\t%-9s %-40s" "2.3" "[run background sample]"
printf "\n\t%-9s %-40s" "2.4" "[plot pictures and save results]"
}
usage_3() {
printf "\n\t%-9s %-40s" "3.1" "[run Z(->qq)H(->ZZ*->nnmumu) sample]"
printf "\n\t%-9s %-40s" "3.2" "[run Z(->ll,qq,nn)H(->inclusive) background sample]"
printf "\n\t%-9s %-40s" "3.3" "[run background sample]"
printf "\n\t%-9s %-40s" "3.4" "[plot pictures and save results]"
}
usage_1_1() {
printf "\n\t%-9s %-40s" "1.1" "[run signal sample]"
printf "\n\t%-9s %-40s" "1.1.1" "Split signal sample with each group 0.5G"
printf "\n\t%-9s %-40s" "1.1.2" "Generate XML input files for Marlin job"
printf "\n\t%-9s %-40s" "1.1.3" "Run with a few events"
printf "\n\t%-9s %-40s" "1.1.4" "Generate Condor job scripts for pre-selection"
printf "\n\t%-9s %-40s" "1.1.5" "Submit Condor jobs for pre-selection on signal"
printf "\n\t%-9s %-40s" "1.1.6" "Select events on signal (with a small sample)"
printf "\n\t%-9s %-40s" "1.1.7" "Generate Condor job scripts for event selection"
printf "\n\t%-9s %-40s" "1.1.8" "Submit Condor jobs for event selection on signal"
printf "\n\t%-9s %-40s" "1.1.9" "Merge event root files"
}
usage_2_1() {
printf "\n\t%-9s %-40s" "2.1" "[run signal sample]"
printf "\n\t%-9s %-40s" "2.1.1" "Split signal sample with each group 0.5G"
printf "\n\t%-9s %-40s" "2.1.2" "Generate XML input files for Marlin job"
printf "\n\t%-9s %-40s" "2.1.3" "Run with a few events"
printf "\n\t%-9s %-40s" "2.1.4" "Generate Condor job scripts for pre-selection"
printf "\n\t%-9s %-40s" "2.1.5" "Submit Condor jobs for pre-selection on signal"
printf "\n\t%-9s %-40s" "2.1.6" "Select events on signal (with a small sample)"
printf "\n\t%-9s %-40s" "2.1.7" "Generate Condor job scripts for event selection"
printf "\n\t%-9s %-40s" "2.1.8" "Submit Condor jobs for event selection on signal"
printf "\n\t%-9s %-40s" "2.1.9" "Merge event root files"
}
usage_3_1() {
printf "\n\t%-9s %-40s" "3.1" "[run signal sample]"
printf "\n\t%-9s %-40s" "3.1.1" "Split signal sample with each group 0.5G"
printf "\n\t%-9s %-40s" "3.1.2" "Generate XML input files for Marlin job"
printf "\n\t%-9s %-40s" "3.1.3" "Run with a few events"
printf "\n\t%-9s %-40s" "3.1.4" "Generate Condor job scripts for pre-selection"
printf "\n\t%-9s %-40s" "3.1.5" "Submit Condor jobs for pre-selection on signal"
printf "\n\t%-9s %-40s" "3.1.6" "Select events on signal (with a small sample)"
printf "\n\t%-9s %-40s" "3.1.7" "Generate Condor job scripts for event selection"
printf "\n\t%-9s %-40s" "3.1.8" "Submit Condor jobs for event selection on signal"
printf "\n\t%-9s %-40s" "3.1.9" "Merge event root files"
}
usage_1_2() {
printf "\n"
printf "\n\t%-9s %-40s" "1.2" "[run Z(->ff)H(->inclusive) sample]"
printf "\n\t%-9s %-40s" "1.2.1" "Split ZH sample with each group 1G"
printf "\n\t%-9s %-40s" "1.2.2" "Generate XML input files for Marlin job"
printf "\n\t%-9s %-40s" "1.2.3" "Check the number files"
printf "\n\t%-9s %-40s" "1.2.4" "Run with a few events"
printf "\n\t%-9s %-40s" "1.2.5" "Generate Condor job scripts for pre-selection"
printf "\n\t%-9s %-40s" "1.2.6" "Submit Condor jobs for pre-selection on ZH sample"
printf "\n\t%-9s %-40s" "1.2.7" "Select events on ZH sample (with a small sample)"
printf "\n\t%-9s %-40s" "1.2.8" "Generate Condor job scripts for event selection"
printf "\n\t%-9s %-40s" "1.2.9" "Submit Condor jobs for event selection on ZH sample"
printf "\n\t%-9s %-40s" "1.2.10" "Merge event root files"
}
usage_2_2() {
printf "\n"
printf "\n\t%-9s %-40s" "2.2" "[run Z(->ll,qq,nn)H(->inclusive) sample]"
printf "\n\t%-9s %-40s" "2.2.1" "Split ZH sample with each group 1G"
printf "\n\t%-9s %-40s" "2.2.2" "Generate XML input files for Marlin job"
printf "\n\t%-9s %-40s" "2.2.3" "Check the number files"
printf "\n\t%-9s %-40s" "2.2.4" "Run with a few events"
printf "\n\t%-9s %-40s" "2.2.5" "Generate Condor job scripts for pre-selection"
printf "\n\t%-9s %-40s" "2.2.6" "Submit Condor jobs for pre-selection on ZH sample"
printf "\n\t%-9s %-40s" "2.2.7" "Select events on ZH sample (with a small sample)"
printf "\n\t%-9s %-40s" "2.2.8" "Generate Condor job scripts for event selection"
printf "\n\t%-9s %-40s" "2.2.9" "Submit Condor jobs for event selection on ZH sample"
printf "\n\t%-9s %-40s" "2.2.10" "Merge event root files"
}
usage_3_2() {
printf "\n"
printf "\n\t%-9s %-40s" "3.2" "[run Z(->ll,qq,nn)H(->inclusive) sample]"
printf "\n\t%-9s %-40s" "3.2.1" "Split ZH sample with each group 1G"
printf "\n\t%-9s %-40s" "3.2.2" "Generate XML input files for Marlin job"
printf "\n\t%-9s %-40s" "3.2.3" "Check the number files"
printf "\n\t%-9s %-40s" "3.2.4" "Run with a few events"
printf "\n\t%-9s %-40s" "3.2.5" "Generate Condor job scripts for pre-selection"
printf "\n\t%-9s %-40s" "3.2.6" "Submit Condor jobs for pre-selection on ZH sample"
printf "\n\t%-9s %-40s" "3.2.7" "Select events on ZH sample (with a small sample)"
printf "\n\t%-9s %-40s" "3.2.8" "Generate Condor job scripts for event selection"
printf "\n\t%-9s %-40s" "3.2.9" "Submit Condor jobs for event selection on ZH sample"
printf "\n\t%-9s %-40s" "3.2.10" "Merge event root files"
}
usage_1_3() {
printf "\n"
printf "\n\t%-9s %-40s" "1.3" "[run background sample]"
printf "\n\t%-9s %-40s" "1.3.1" "Split background sample with each group 20G"
printf "\n\t%-9s %-40s" "1.3.2" "Generate XML input files for Marlin job"
printf "\n\t%-9s %-40s" "1.3.3" "Check the number files"
printf "\n\t%-9s %-40s" "1.3.4" "Run with a few events"
printf "\n\t%-9s %-40s" "1.3.5" "Generate Condor job scripts for pre-selection"
printf "\n\t%-9s %-40s" "1.3.6" "Submit Condor jobs for pre-selection on Bg sample"
printf "\n\t%-9s %-40s" "1.3.7" "Select events on background (with a small sample)"
printf "\n\t%-9s %-40s" "1.3.8" "Generate Condor job scripts for event selection"
printf "\n\t%-9s %-40s" "1.3.9" "Submit Condor jobs for event selection on Bg sample"
printf "\n\t%-9s %-40s" "1.3.10" "Merge event root files"
}
usage_2_3() {
printf "\n"
printf "\n\t%-9s %-40s" "2.3" "[run background sample]"
printf "\n\t%-9s %-40s" "2.3.1" "Split background sample with each group 20G"
printf "\n\t%-9s %-40s" "2.3.2" "Generate XML input files for Marlin job"
printf "\n\t%-9s %-40s" "2.3.3" "Check the number files"
printf "\n\t%-9s %-40s" "2.3.4" "Run with a few events"
printf "\n\t%-9s %-40s" "2.3.5" "Generate Condor job scripts for pre-selection"
printf "\n\t%-9s %-40s" "2.3.6" "Submit Condor jobs for pre-selection on Bg sample"
printf "\n\t%-9s %-40s" "2.3.7" "Select events on background (with a small sample)"
printf "\n\t%-9s %-40s" "2.3.8" "Generate Condor job scripts for event selection"
printf "\n\t%-9s %-40s" "2.3.9" "Submit Condor jobs for event selection on Bg sample"
printf "\n\t%-9s %-40s" "2.3.10" "Merge event root files"
}
usage_3_3() {
printf "\n"
printf "\n\t%-9s %-40s" "3.3" "[run background sample]"
printf "\n\t%-9s %-40s" "3.3.1" "Split background sample with each group 20G"
printf "\n\t%-9s %-40s" "3.3.2" "Generate XML input files for Marlin job"
printf "\n\t%-9s %-40s" "3.3.3" "Check the number files"
printf "\n\t%-9s %-40s" "3.3.4" "Run with a few events"
printf "\n\t%-9s %-40s" "3.3.5" "Generate Condor job scripts for pre-selection"
printf "\n\t%-9s %-40s" "3.3.6" "Submit Condor jobs for pre-selection on Bg sample"
printf "\n\t%-9s %-40s" "3.3.7" "Select events on background (with a small sample)"
printf "\n\t%-9s %-40s" "3.3.8" "Generate Condor job scripts for event selection"
printf "\n\t%-9s %-40s" "3.3.9" "Submit Condor jobs for event selection on Bg sample"
printf "\n\t%-9s %-40s" "3.3.10" "Merge event root files"
}
usage_1_4() {
printf "\n"
printf "\n\t%-9s %-40s" "1.4" "[plot pictures and save results]"
printf "\n\t%-9s %-40s" "1.4.1" "Plot signal-bg histograms..."
printf "\n\t%-9s %-40s" "1.4.2" "Plot information..."
printf "\n\t%-9s %-40s" "1.4.3" "Generate tables and LaTex tables..."
printf "\n\t%-9s %-40s" "1.4.4" "Save results..."
}
usage_2_4() {
printf "\n"
printf "\n\t%-9s %-40s" "2.4" "[plot pictures and save results]"
printf "\n\t%-9s %-40s" "2.4.1" "Plot signal-bg histograms..."
printf "\n\t%-9s %-40s" "2.4.2" "Plot information..."
printf "\n\t%-9s %-40s" "2.4.3" "Generate tables and LaTex tables..."
printf "\n\t%-9s %-40s" "2.4.4" "Save results..."
}
usage_3_4() {
printf "\n"
printf "\n\t%-9s %-40s" "3.4" "[plot pictures and save results]"
printf "\n\t%-9s %-40s" "3.4.1" "Plot signal-bg histograms..."
printf "\n\t%-9s %-40s" "3.4.2" "Plot information..."
printf "\n\t%-9s %-40s" "3.4.3" "Generate tables and LaTex tables..."
printf "\n\t%-9s %-40s" "3.4.4" "Save results..."
printf "\n\t%-9s %-40s" "3.4.5" "fit pdf and generate Asimov data..."
printf "\n\t%-9s %-40s" "3.4.6" "combine fitting results for five channels..."
}
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
sel_all=0
sel_signal=1
sel_bg=2
channel_opt_ll=2 #1 for hvvjj, 2 for hjjvv
channel_opt_nn=2 #1 for hmmjj, 2 for hjjmm
channel_opt_qq=2 #1 for hvvmm, 2 for hmmvv
llhzz=1
nnhzz=2
qqhzz=3
# --------------------------------------------------------------------------
# 1.1 Signal
# --------------------------------------------------------------------------
sub_1_1(){
case $option in
1.1) echo "Running on signal sample..."
;;
1.1.1) echo "Split signal sample with each group 0.5G..."
mkdir -p ./run/channel_ll_${channel_opt_ll}/llh2zz/samples
./python/get_samples.py ${signal_slcio_dir_ll} ./run/channel_ll_${channel_opt_ll}/llh2zz/samples/E240_Pllh_zz.txt 0.5G
;;
1.1.2) echo "Generate XML input files for Marlin job..."
mkdir -p ./run/channel_ll_${channel_opt_ll}/llh2zz/steers
mkdir -p ./run/channel_ll_${channel_opt_ll}/llh2zz/steers/test
mkdir -p ./run/channel_ll_${channel_opt_ll}/llh2zz/ana
./python/gen_steerfiles.py ./table/template_jobfile.xml ./run/channel_ll_${channel_opt_ll}/llh2zz/samples ./run/channel_ll_${channel_opt_ll}/llh2zz/steers ./run/channel_ll_${channel_opt_ll}/llh2zz/ana/ana_File.root ${llhzz}
;;
1.1.3) echo "Run with a few events ..."
source setup.sh
./build.sh
Marlin ./run/channel_ll_${channel_opt_ll}/llh2zz/steers/test/sample-1.xml
;;
1.1.4) echo "Generate Condor job scripts..."
mkdir -p ./run/channel_ll_${channel_opt_ll}/llh2zz/condor/script/marlin
./python/gen_condorscripts.py ${channel_opt_ll} 1 ./run/channel_ll_${channel_opt_ll}/llh2zz/steers ./run/channel_ll_${channel_opt_ll}/llh2zz/condor ${sel_signal} ${llhzz}
;;
1.1.5) echo "Submit Condor jobs for pre-selection on signal..."
if [ ${channel_opt_ll} = 1 ]; then
cd ./run/channel_ll_${channel_opt_ll}/llh2zz/condor
mkdir -p log
./condor_submit.sh
else
echo "Use the same ntuples as vvjj channel..."
rm -r ./run/channel_ll_2/llh2zz/ana
cp -r ./run/channel_ll_1/llh2zz/ana ./run/channel_ll_2/llh2zz/ana
fi
;;
1.1.6) echo "Select events on signal (with a small sample)..."
rm -rf ./run/channel_ll_${channel_opt_ll}/llh2zz/events
mkdir -p ./run/channel_ll_${channel_opt_ll}/llh2zz/events/ana
./python/sel_events.py ${channel_opt_ll} ./run/channel_ll_${channel_opt_ll}/llh2zz/ana/ana_File-1.root ./run/channel_ll_${channel_opt_ll}/llh2zz/events/ana/ana_File-1_event.root ${sel_signal} ${llhzz}
;;
1.1.7) echo "Generate Condor job scripts for event selection..."
mkdir -p ./run/channel_ll_${channel_opt_ll}/llh2zz/events/ana
rm -rf ./run/channel_ll_${channel_opt_ll}/llh2zz/condor/script/eventsel
mkdir -p ./run/channel_ll_${channel_opt_ll}/llh2zz/condor/script/eventsel
./python/gen_condorscripts.py ${channel_opt_ll} 2 ./run/channel_ll_${channel_opt_ll}/llh2zz/ana ./run/channel_ll_${channel_opt_ll}/llh2zz/condor ${sel_signal} ${llhzz}
;;
1.1.8) echo "Submit Condor jobs for event selection on signal..."
cd ./run/channel_ll_${channel_opt_ll}/llh2zz/condor
rm -rf log/events
mkdir -p log/events
./condor_submit_eventsel.sh
;;
1.1.9) echo "Merge event root files..."
rm -rf ./run/channel_ll_${channel_opt_ll}/llh2zz/hist
mkdir -p ./run/channel_ll_${channel_opt_ll}/llh2zz/hist
./python/mrg_rootfiles.py ./run/channel_ll_${channel_opt_ll}/llh2zz/events/ana ./run/channel_ll_${channel_opt_ll}/llh2zz/hist
;;
esac
}
# --------------------------------------------------------------------------
# 1.2 ZH Inclusive Sample
# --------------------------------------------------------------------------
sub_1_2(){
case $option in
1.2) echo "Running on ZH inclusive sample..."
;;
1.2.1) echo "Split background sample with each group 1G..."
mkdir -p ./run/channel_ll_${channel_opt_ll}/zh/samples
./python/get_bg_samples.py ./table/zh_sample_list.txt ./run/channel_ll_${channel_opt_ll}/zh/samples 1G
;;
1.2.2) echo "Generate XML input files for Marlin job..."
mkdir -p ./run/channel_ll_${channel_opt_ll}/zh/steers
mkdir -p ./run/channel_ll_${channel_opt_ll}/zh/ana
./python/gen_bg_steerfiles.py ./table/zh_sample_list.txt ./table/template_jobfile.xml ./run/channel_ll_${channel_opt_ll}/zh/samples ./run/channel_ll_${channel_opt_ll}/zh/steers ./run/channel_ll_${channel_opt_ll}/zh/ana
;;
1.2.3) echo "Check statistics : print the number of files..."
./python/check_stat.py ./table/zh_sample_list.txt ./run/channel_ll_${channel_opt_ll}/zh/samples
;;
1.2.4) echo "Run with a few events ..."
source setup.sh
./build.sh
cd ./run/channel_ll_${channel_opt_ll}/zh/steers/
array=("e2e2h_zz")
for dir in "${array[@]}"
do
cd ${dir}/test
Marlin sample-1.xml
cd ../../
done
;;
1.2.5) echo "Generate Condor job scripts..."
mkdir -p ./run/channel_ll_${channel_opt_ll}/zh/condor
cd ./run/channel_ll_${channel_opt_ll}/zh/ana/
for dir in *
do
mkdir -p ../condor/$dir
done
cd ../condor/
for dir in *
do
cd $dir
rm -rf log/marlin
rm -rf script/marlin
mkdir -p log/marlin
mkdir -p script/marlin
cd ../
done
cd ../../../../
./python/gen_bg_condorscripts.py ${channel_opt_ll} 1 ./run/channel_ll_${channel_opt_ll}/zh/steers ./run/channel_ll_${channel_opt_ll}/zh/condor ${sel_signal} ${llhzz}
;;
1.2.6) echo "Submit Condor jobs for pre-selection on background sample..."
echo " ---- "
if [ ${channel_opt_ll} = 1 ]; then
echo "Please enter the number of jobs for each ZH sample (default: 120)"
read njob
if [ -z $njob ]; then
njob=120
fi
cd ./run/channel_ll_${channel_opt_ll}/zh/condor
for dir in *
do
cd $dir
echo `pwd`
./condor_submit.sh $njob
cd ../
done
else
echo "Use the same ntuples as vvjj channel..."
rm -r ./run/channel_ll_2/zh/ana
cp -r ./run/channel_ll_1/zh/ana ./run/channel_ll_2/zh/ana
fi
;;
1.2.7) echo "Select events on background (with a small sample)..."
rm -rf ./run/channel_ll_${channel_opt_ll}/zh/events
mkdir -p ./run/channel_ll_${channel_opt_ll}/zh/events/ana
cd ./run/channel_ll_${channel_opt_ll}/zh/ana
for dir in *
do
mkdir -p ../events/ana/$dir
done
cd ../../../../
./python/sel_events.py ${channel_opt_ll} ./run/channel_ll_${channel_opt_ll}/zh/ana/e2e2h_gg/ana_File-1.root ./run/channel_ll_${channel_opt_ll}/zh/events/ana/e2e2h_gg/ana_File-1_event.root ${sel_bg} ${llhzz}
;;
1.2.8) echo "Generate Condor job scripts for event selection..."
mkdir -p ./run/channel_ll_${channel_opt_ll}/zh/events/ana
cd ./run/channel_ll_${channel_opt_ll}/zh/ana
for dir in *
do
mkdir -p ../events/ana/$dir
done
cd ../condor/
for dir in *
do
cd $dir
rm -rf log/events
rm -rf script/eventsel
mkdir -p log/events
mkdir -p script/eventsel
cd ../
done
cd ../../../../
./python/gen_bg_condorscripts.py ${channel_opt_ll} 2 ./run/channel_ll_${channel_opt_ll}/zh/ana ./run/channel_ll_${channel_opt_ll}/zh/condor ${sel_bg} ${llhzz}
;;
1.2.9) echo "Submit Condor jobs for evt-selection on ZH sample..."
cd ./run/channel_ll_${channel_opt_ll}/zh/condor
for dir in *
do
cd $dir
echo `pwd`
./condor_submit_eventsel.sh
cd ../
done
;;
1.2.10) echo "Merge event root files..."
rm -rf ./run/channel_ll_${channel_opt_ll}/zh/hist
mkdir -p ./run/channel_ll_${channel_opt_ll}/zh/hist
cd ./run/channel_ll_${channel_opt_ll}/zh/events/ana
for dir in *
do
mkdir -p ../../hist/$dir
cd ../../../../../
./python/mrg_rootfiles.py ./run/channel_ll_${channel_opt_ll}/zh/events/ana/$dir ./run/channel_ll_${channel_opt_ll}/zh/hist/$dir
cd ./run/channel_ll_${channel_opt_ll}/zh/events/ana
done
;;
esac
}
# --------------------------------------------------------------------------
# 1.3 Background Sample
# --------------------------------------------------------------------------
sub_1_3(){
case $option in
1.3) echo "Running on background sample..."
;;
1.3.1) echo "Split background sample with each group 20G..."
mkdir -p ./run/channel_ll_${channel_opt_ll}/bg/samples
./python/get_bg_samples.py ./table/bg_sample_list.txt ./run/channel_ll_${channel_opt_ll}/bg/samples 20G
;;
1.3.2) echo "Generate XML input files for Marlin job..."
mkdir -p ./run/channel_ll_${channel_opt_ll}/bg/steers
mkdir -p ./run/channel_ll_${channel_opt_ll}/bg/ana
./python/gen_bg_steerfiles.py ./table/bg_sample_list.txt ./table/template_jobfile.xml ./run/channel_ll_${channel_opt_ll}/bg/samples ./run/channel_ll_${channel_opt_ll}/bg/steers ./run/channel_ll_${channel_opt_ll}/bg/ana
;;
1.3.3) echo "Check statistics : print the number of files..."
./python/check_stat.py ./table/bg_sample_list.txt ./run/channel_ll_${channel_opt_ll}/bg/samples
;;
1.3.4) echo "Run with a few events ..."
source setup.sh
./build.sh
cd ./run/channel_ll_${channel_opt_ll}/bg/steers/
array=("e3e3" "qq" "sznu_sl0nu_down" "sze_sl0uu" "ww_sl0muq" "zz_sl0mu_down")
for dir in "${array[@]}"
do
cd ${dir}/test
Marlin sample-1.xml
cd ../../
done
;;
1.3.5) echo "Generate Condor job scripts..."
mkdir -p ./run/channel_ll_${channel_opt_ll}/bg/condor
cd ./run/channel_ll_${channel_opt_ll}/bg/ana/
for dir in *
do
mkdir -p ../condor/$dir
done
cd ../condor/
for dir in *
do
cd $dir
rm -rf log/marlin
rm -rf script/marlin
mkdir -p log/marlin
mkdir -p script/marlin
cd ../
done
cd ../../../../
./python/gen_bg_condorscripts.py ${channel_opt_ll} 1 ./run/channel_ll_${channel_opt_ll}/bg/steers ./run/channel_ll_${channel_opt_ll}/bg/condor ${sel_signal} ${llhzz}
;;
1.3.6) echo "Submit Condor jobs for pre-selection on background sample..."
echo " ---- "
if [ ${channel_opt_ll} = 1 ]; then
echo "Please enter the number of jobs for each backgrond (default: 120)"
read njob
if [ -z $njob ]; then
njob=120
fi
cd ./run/channel_ll_${channel_opt_ll}/bg/condor
for dir in *
do
cd $dir
echo `pwd`
./condor_submit.sh $njob
cd ../
done
else
echo "Use the same ntuples as vvjj channel..."
rm -r ./run/channel_ll_2/bg/ana
cp -r ./run/channel_ll_1/bg/ana ./run/channel_ll_2/bg/ana
fi
;;
1.3.7) echo "Select events on background (with a small sample)..."
rm -rf ./run/channel_ll_${channel_opt_ll}/bg/events
mkdir -p ./run/channel_ll_${channel_opt_ll}/bg/events/ana
cd ./run/channel_ll_${channel_opt_ll}/bg/ana
for dir in *
do
mkdir -p ../events/ana/$dir
done
cd ../../../../
./python/sel_events.py ${channel_opt_ll} ./run/channel_ll_${channel_opt_ll}/bg/ana/zz_sl0mu_up/ana_File-1.root ./run/channel_ll_${channel_opt_ll}/bg/events/ana/zz_sl0mu_up/ana_File-1_event.root ${sel_all} ${llhzz}
;;
1.3.8) echo "Generate Condor job scripts for event selection..."
mkdir -p ./run/channel_ll_${channel_opt_ll}/bg/events/ana
cd ./run/channel_ll_${channel_opt_ll}/bg/ana
for dir in *
do
mkdir -p ../events/ana/$dir
done
cd ../condor/
for dir in *
do
cd $dir
rm -rf log/events
rm -rf script/eventsel
mkdir -p log/events
mkdir -p script/eventsel
cd ../
done
cd ../../../../
./python/gen_bg_condorscripts.py ${channel_opt_ll} 2 ./run/channel_ll_${channel_opt_ll}/bg/ana ./run/channel_ll_${channel_opt_ll}/bg/condor ${sel_all} ${llhzz}
;;
1.3.9) echo "Submit Condor jobs for pre-selection on background sample..."
cd ./run/channel_ll_${channel_opt_ll}/bg/condor
for dir in *
do
cd $dir
echo `pwd`
./condor_submit_eventsel.sh
cd ../
done
;;
1.3.10) echo "Merge event root files..."
rm -rf ./run/channel_ll_${channel_opt_ll}/bg/hist
mkdir -p ./run/channel_ll_${channel_opt_ll}/bg/hist
cd ./run/channel_ll_${channel_opt_ll}/bg/events/ana
for dir in *
do
mkdir -p ../../hist/$dir
cd ../../../../../
./python/mrg_rootfiles.py ./run/channel_ll_${channel_opt_ll}/bg/events/ana/$dir ./run/channel_ll_${channel_opt_ll}/bg/hist/$dir
cd ./run/channel_ll_${channel_opt_ll}/bg/events/ana
done
;;
esac
}
# --------------------------------------------------------------------------
# 1.4 plot pictures and save results
# --------------------------------------------------------------------------
sub_1_4(){
case $option in
1.4) echo "plot pictures and save results..."
;;
1.4.1) echo "Plot signal-bg histograms..."
mkdir -p ./fig
mkdir -p ./fig/channel_ll_${channel_opt_ll}
python ./python/plt_bg.py ${channel_opt_ll} ${llhzz} ./table/bg_2f.txt ./table/bg_4f.txt ./table/zh_sample_list.txt
;;
1.4.2) echo "Plot information..." # Meantime, it will generate table for LaTeX
mkdir -p ./table/channel_ll_${channel_opt_ll}
python ./python/plt_info.py ${channel_opt_ll} ${llhzz} ./table/zh_sample_list.txt ./table/bg_2f.txt ./table/bg_4f.txt
;;
1.4.3) echo "Generate tables and LaTex tables..."
python ./python/gen_tex.py ${channel_opt_ll} ${llhzz} ./table/zh_sample_list.txt ./table/bg_2f.txt ./table/bg_4f.txt
;;
1.4.4) echo "Save results..."
rm -rf ./root/channel_ll_${channel_opt_ll}
mkdir -p ./root/channel_ll_${channel_opt_ll}/merge
python ./python/save_root.py ${channel_opt_ll} ${llhzz} ./table/bg_2f.txt ./table/bg_4f.txt ./table/zh_sample_list.txt
cd ./root/channel_ll_${channel_opt_ll}
if [ ${channel_opt_ll} = 1 ]; then
cp sig.root ./merge/mzvj_sig.root
hadd ./merge/mzvj_sig_other.root bkg_e2e2h_zz.root bkg_e3e3h_zz.root bkg_nnh_zz.root
hadd ./merge/mzvj_az.root bkg_e2e2h_az.root
hadd ./merge/mzvj_ww.root bkg_e2e2h_ww.root bkg_e3e3h_ww.root
hadd ./merge/mzvj_tt.root bkg_e2e2h_e3e3.root bkg_e3e3h_e3e3.root
hadd ./merge/mzvj_sm.root bkg_zz_sl0mu_down.root bkg_zz_sl0tau_up.root bkg_zz_l0taumu.root
cd ../..
cp -r root/channel_ll_${channel_opt_ll}/merge/. calculate/workspace/data/new_zz/mzvj/
cd calculate/workspace/data/new_zz/mzvj/
root -l -q mzvj.cxx
else
cp sig.root ./merge/mzjv_sig.root
hadd ./merge/mzjv_sig_other.root bkg_qqh_zz.root bkg_e2e2h_zz.root bkg_e3e3h_zz.root bkg_nnh_zz.root
hadd ./merge/mzjv_az.root bkg_e2e2h_aa.root bkg_e2e2h_az.root bkg_e3e3h_az.root bkg_qqh_az.root
hadd ./merge/mzjv_ww.root bkg_e2e2h_ww.root bkg_e3e3h_ww.root
hadd ./merge/mzjv_tt.root bkg_e2e2h_e3e3.root bkg_qqh_e3e3.root
hadd ./merge/mzjv_bb.root bkg_e2e2h_bb.root
hadd ./merge/mzjv_cc.root bkg_e2e2h_cc.root
hadd ./merge/mzjv_gg.root bkg_e2e2h_gg.root
hadd ./merge/mzjv_mu.root bkg_e3e3h_e2e2.root bkg_qqh_e2e2.root
hadd ./merge/mzjv_sm.root bkg_zz_sl0mu_up.root bkg_zz_sl0mu_down.root bkg_zz_sl0tau_down.root bkg_ww_sl0muq.root
cd ../..
cp -r root/channel_ll_${channel_opt_ll}/merge/. calculate/workspace/data/new_zz/mzjv/
cd calculate/workspace/data/new_zz/mzjv/
root -l -q mzjv.cxx
fi
;;
esac
}
# 0.5.3) echo "calculate BR upper limit "
# cd calculate/cepcFit/
# ./jobs/invi.sh
# ;;
# 0.5.4) echo "The result of BR upper limit"
# python python/combine.py
sub_2_1(){
case $option in
2.1) echo "Running on signal sample..."
;;
2.1.1) echo "Split signal sample with each group 0.5G..."
mkdir -p ./run/channel_nn_${channel_opt_nn}/nnh2zz/samples
./python/get_samples.py ${signal_slcio_dir_nn} ./run/channel_nn_${channel_opt_nn}/nnh2zz/samples/E240_Pnnh_zz.txt 0.5G
;;
2.1.2) echo "Generate XML input files for Marlin job..."
mkdir -p ./run/channel_nn_${channel_opt_nn}/nnh2zz/steers
mkdir -p ./run/channel_nn_${channel_opt_nn}/nnh2zz/steers/test
mkdir -p ./run/channel_nn_${channel_opt_nn}/nnh2zz/ana
./python/gen_steerfiles.py ./table/template_jobfile.xml ./run/channel_nn_${channel_opt_nn}/nnh2zz/samples ./run/channel_nn_${channel_opt_nn}/nnh2zz/steers ./run/channel_nn_${channel_opt_nn}/nnh2zz/ana/ana_File.root ${nnhzz}
;;
2.1.3) echo "Run with a few events ..."
source setup.sh
./build.sh
Marlin ./run/channel_nn_${channel_opt_nn}/nnh2zz/steers/test/sample-1.xml
;;
2.1.4) echo "Generate Condor job scripts..."
mkdir -p ./run/channel_nn_${channel_opt_nn}/nnh2zz/condor/script/marlin
./python/gen_condorscripts.py ${channel_opt_nn} 1 ./run/channel_nn_${channel_opt_nn}/nnh2zz/steers ./run/channel_nn_${channel_opt_nn}/nnh2zz/condor ${sel_signal} ${nnhzz}
;;
2.1.5) echo "Submit Condor jobs for pre-selection on signal..."
if [ ${channel_opt_nn} = 1 ]; then
cd ./run/channel_nn_${channel_opt_nn}/nnh2zz/condor
mkdir -p log
./condor_submit.sh
else
echo "Use the same ntuples as mmjj channel..."
rm -r ./run/channel_nn_2/nnh2zz/ana
cp -r ./run/channel_nn_1/nnh2zz/ana ./run/channel_nn_2/nnh2zz/ana
fi
;;
2.1.6) echo "Select events on signal (with a small sample)..."
rm -rf ./run/channel_nn_${channel_opt_nn}/nnh2zz/events
mkdir -p ./run/channel_nn_${channel_opt_nn}/nnh2zz/events/ana
./python/sel_events.py ${channel_opt_nn} ./run/channel_nn_${channel_opt_nn}/nnh2zz/ana/ana_File-1.root ./run/channel_nn_${channel_opt_nn}/nnh2zz/events/ana/ana_File-1_event.root ${sel_signal} ${nnhzz}
;;
2.1.7) echo "Generate Condor job scripts for event selection..."
mkdir -p ./run/channel_nn_${channel_opt_nn}/nnh2zz/events/ana
rm -rf ./run/channel_nn_${channel_opt_nn}/nnh2zz/condor/script/eventsel
mkdir -p ./run/channel_nn_${channel_opt_nn}/nnh2zz/condor/script/eventsel
./python/gen_condorscripts.py ${channel_opt_nn} 2 ./run/channel_nn_${channel_opt_nn}/nnh2zz/ana ./run/channel_nn_${channel_opt_nn}/nnh2zz/condor ${sel_signal} ${nnhzz}
;;
2.1.8) echo "Submit Condor jobs for event selection on signal..."
cd ./run/channel_nn_${channel_opt_nn}/nnh2zz/condor
rm -rf log/events
mkdir -p log/events
./condor_submit_eventsel.sh
;;
2.1.9) echo "Merge event root files..."
rm -rf ./run/channel_nn_${channel_opt_nn}/nnh2zz/hist
mkdir -p ./run/channel_nn_${channel_opt_nn}/nnh2zz/hist
./python/mrg_rootfiles.py ./run/channel_nn_${channel_opt_nn}/nnh2zz/events/ana ./run/channel_nn_${channel_opt_nn}/nnh2zz/hist
;;
esac
}
sub_2_2(){
case $option in
2.2) echo "Running on ZH inclusive sample..."
;;
2.2.1) echo "Split background sample with each group 1G..."
mkdir -p ./run/channel_nn_${channel_opt_nn}/zh/samples
./python/get_bg_samples.py ./table/zh_sample_list.txt ./run/channel_nn_${channel_opt_nn}/zh/samples 1G
;;
2.2.2) echo "Generate XML input files for Marlin job..."
mkdir -p ./run/channel_nn_${channel_opt_nn}/zh/steers
mkdir -p ./run/channel_nn_${channel_opt_nn}/zh/ana
./python/gen_bg_steerfiles.py ./table/zh_sample_list.txt ./table/template_jobfile.xml ./run/channel_nn_${channel_opt_nn}/zh/samples ./run/channel_nn_${channel_opt_nn}/zh/steers ./run/channel_nn_${channel_opt_nn}/zh/ana
;;
2.2.3) echo "Check statistics : print the number of files..."
./python/check_stat.py ./table/zh_sample_list.txt ./run/channel_nn_${channel_opt_nn}/zh/samples
;;
2.2.4) echo "Run with a few events ..."
source setup.sh
./build.sh
cd ./run/channel_nn_${channel_opt_nn}/zh/steers/
array=("e2e2h_zz")
for dir in "${array[@]}"
do
cd ${dir}/test
Marlin sample-1.xml
cd ../../
done
;;
2.2.5) echo "Generate Condor job scripts..."
mkdir -p ./run/channel_nn_${channel_opt_nn}/zh/condor
cd ./run/channel_nn_${channel_opt_nn}/zh/ana/
for dir in *
do
mkdir -p ../condor/$dir
done
cd ../condor/
for dir in *
do
cd $dir
rm -rf log/marlin
rm -rf script/marlin
mkdir -p log/marlin
mkdir -p script/marlin
cd ../
done
cd ../../../../
./python/gen_bg_condorscripts.py ${channel_opt_nn} 1 ./run/channel_nn_${channel_opt_nn}/zh/steers ./run/channel_nn_${channel_opt_nn}/zh/condor ${sel_signal} ${nnhzz}
;;
2.2.6) echo "Copy the same zh ntuple as mmHzz channel..."
rm -r run/channel_nn_${channel_opt_nn}/zh/ana
cp -r run/channel_ll/zh/ana run/channel_nn_${channel_opt_nn}/zh/
;;
2.2.7) echo "Select events on background (with a small sample)..."
rm -rf ./run/channel_nn_${channel_opt_nn}/zh/events
mkdir -p ./run/channel_nn_${channel_opt_nn}/zh/events/ana
cd ./run/channel_nn_${channel_opt_nn}/zh/ana
for dir in *
do
mkdir -p ../events/ana/$dir
done
cd ../../../../
./python/sel_events.py ${channel_opt_nn} ./run/channel_nn_${channel_opt_nn}/zh/ana/e2e2h_gg/ana_File-1.root ./run/channel_nn_${channel_opt_nn}/zh/events/ana/e2e2h_gg/ana_File-1_event.root ${sel_bg} ${nnhzz}
;;
2.2.8) echo "Generate Condor job scripts for event selection..."
mkdir -p ./run/channel_nn_${channel_opt_nn}/zh/events/ana
cd ./run/channel_nn_${channel_opt_nn}/zh/ana
for dir in *
do
mkdir -p ../events/ana/$dir
done
cd ../condor/
for dir in *
do
cd $dir
rm -rf log/events
rm -rf script/eventsel
mkdir -p log/events
mkdir -p script/eventsel
cd ../
done
cd ../../../../
./python/gen_bg_condorscripts.py ${channel_opt_nn} 2 ./run/channel_nn_${channel_opt_nn}/zh/ana ./run/channel_nn_${channel_opt_nn}/zh/condor ${sel_bg} ${nnhzz}
;;
2.2.9) echo "Submit Condor jobs for pre-selection on ZH sample..."
cd ./run/channel_nn_${channel_opt_nn}/zh/condor
for dir in *
do
cd $dir
echo `pwd`
./condor_submit_eventsel.sh
cd ../
done
;;
2.2.10) echo "Merge event root files..."
rm -rf ./run/channel_nn_${channel_opt_nn}/zh/hist
mkdir -p ./run/channel_nn_${channel_opt_nn}/zh/hist
cd ./run/channel_nn_${channel_opt_nn}/zh/events/ana
for dir in *
do
mkdir -p ../../hist/$dir
cd ../../../../../
./python/mrg_rootfiles.py ./run/channel_nn_${channel_opt_nn}/zh/events/ana/$dir ./run/channel_nn_${channel_opt_nn}/zh/hist/$dir
cd ./run/channel_nn_${channel_opt_nn}/zh/events/ana
done
;;
esac
}
sub_2_3(){
case $option in
2.3) echo "Running on background sample..."
;;
2.3.1) echo "Split background sample with each group 20G..."
mkdir -p ./run/channel_nn_${channel_opt_nn}/bg/samples
./python/get_bg_samples.py ./table/bg_sample_list.txt ./run/channel_nn_${channel_opt_nn}/bg/samples 20G
;;
2.3.2) echo "Generate XML input files for Marlin job..."
mkdir -p ./run/channel_nn_${channel_opt_nn}/bg/steers
mkdir -p ./run/channel_nn_${channel_opt_nn}/bg/ana
./python/gen_bg_steerfiles.py ./table/bg_sample_list.txt ./table/template_jobfile.xml ./run/channel_nn_${channel_opt_nn}/bg/samples ./run/channel_nn_${channel_opt_nn}/bg/steers ./run/channel_nn_${channel_opt_nn}/bg/ana
;;
2.3.3) echo "Check statistics : print the number of files..."
./python/check_stat.py ./table/bg_sample_list.txt ./run/channel_nn_${channel_opt_nn}/bg/samples
;;
2.3.4) echo "Run with a few events ..."
source setup.sh
./build.sh
cd ./run/channel_nn_${channel_opt_nn}/bg/steers/
array=("e3e3" "qq" "sznu_sl0nu_down" "sze_sl0uu" "ww_sl0muq" "zz_sl0mu_down")
for dir in "${array[@]}"
do
cd ${dir}/test
Marlin sample-1.xml
cd ../../
done
;;
2.3.5) echo "Generate Condor job scripts..."
mkdir -p ./run/channel_nn_${channel_opt_nn}/bg/condor
cd ./run/channel_nn_${channel_opt_nn}/bg/ana/
for dir in *
do
mkdir -p ../condor/$dir
done
cd ../condor/
for dir in *
do
cd $dir
rm -rf log/marlin
rm -rf script/marlin
mkdir -p log/marlin
mkdir -p script/marlin
cd ../
done
cd ../../../../
./python/gen_bg_condorscripts.py ${channel_opt_nn} 1 ./run/channel_nn_${channel_opt_nn}/bg/steers ./run/channel_nn_${channel_opt_nn}/bg/condor ${sel_signal} ${nnhzz}
;;
2.3.6) echo "Copy the same bg ntuple as mmHzz channel..."
rm -r run/channel_nn_${channel_opt_nn}/bg/ana
cp -r run/channel_ll/bg/ana run/channel_nn_${channel_opt_nn}/bg
;;
2.3.7) echo "Select events on background (with a small sample)..."
rm -rf ./run/channel_nn_${channel_opt_nn}/bg/events
mkdir -p ./run/channel_nn_${channel_opt_nn}/bg/events/ana
cd ./run/channel_nn_${channel_opt_nn}/bg/ana
for dir in *
do
mkdir -p ../events/ana/$dir
done
cd ../../../../
./python/sel_events.py ${channel_opt_nn} ./run/channel_nn_${channel_opt_nn}/bg/ana/zz_sl0mu_up/ana_File-1.root ./run/channel_nn_${channel_opt_nn}/bg/events/ana/zz_sl0mu_up/ana_File-1_event.root ${sel_all} ${nnhzz}
;;
2.3.8) echo "Generate Condor job scripts for event selection..."
mkdir -p ./run/channel_nn_${channel_opt_nn}/bg/events/ana
cd ./run/channel_nn_${channel_opt_nn}/bg/ana
for dir in *
do
mkdir -p ../events/ana/$dir
done
cd ../condor/
for dir in *
do
cd $dir
rm -rf log/events
rm -rf script/eventsel
mkdir -p log/events
mkdir -p script/eventsel
cd ../
done
cd ../../../../
./python/gen_bg_condorscripts.py ${channel_opt_nn} 2 ./run/channel_nn_${channel_opt_nn}/bg/ana ./run/channel_nn_${channel_opt_nn}/bg/condor ${sel_all} ${nnhzz}
;;
2.3.9) echo "Submit Condor jobs for pre-selection on background sample..."
cd ./run/channel_nn_${channel_opt_nn}/bg/condor
for dir in *
do
cd $dir
echo `pwd`
./condor_submit_eventsel.sh
cd ../
done
;;
2.3.10) echo "Merge event root files..."
rm -rf ./run/channel_nn_${channel_opt_nn}/bg/hist
mkdir -p ./run/channel_nn_${channel_opt_nn}/bg/hist
cd ./run/channel_nn_${channel_opt_nn}/bg/events/ana
for dir in *
do
mkdir -p ../../hist/$dir
cd ../../../../../
./python/mrg_rootfiles.py ./run/channel_nn_${channel_opt_nn}/bg/events/ana/$dir ./run/channel_nn_${channel_opt_nn}/bg/hist/$dir
cd ./run/channel_nn_${channel_opt_nn}/bg/events/ana
done
;;
esac
}