Belle II Software
prerelease-10-00-00a
overlayUtils.py
1
#!/usr/bin/env python3
2
3
10
11
21
22
import
sys
23
import
basf2
as
b2
24
import
svd.overlay_utils
as
svdou
25
import
simulation
as
simu
26
import
glob
27
28
tag =
"unused"
29
if
len(sys.argv) == 2:
30
tag = sys.argv[1]
31
32
'''
33
# PREPARE YOUR INPUT FILES - ERROR printed at the end does not
34
# affect output files
35
# function provides output rootfile with SVDShaperDigits only
36
37
# random TRG
38
# 1. link the input raw data in /gpfs/fs02/belle2/group/detector/SVD/overlayFiles/randomTRG/
39
# and select:
40
# location="/gpfs/fs02/belle2/group/detector/SVD/overlayFiles/randomTRG/*.root"
41
# and outputFileTag = ZS3
42
# 2. then select:
43
# location="/gpfs/fs02/belle2/group/detector/SVD/overlayFiles/randomTRG/*_ZS3.root"
44
# and outputFileTag = overlay
45
# and outputFileTag = overlayZS with same location
46
47
filelist=glob.glob(location)
48
# print(filelist)
49
for inputfile in filelist:
50
main = b2.create_path()
51
# svdou.prepare_svd_overlay(main, [inputfile],"ZS3")
52
svdou.prepare_svd_overlay(main, [inputfile],"overlay")
53
# svdou.prepare_svd_overlay(main, [inputfile],"overlayZS5")
54
'''
55
56
# EXAMPLE OF OVERLAY
57
main = b2.create_path()
58
59
b2.set_random_seed(1)
60
61
# set the exp/run event information
62
eventinfosetter = b2.register_module(
'EventInfoSetter'
)
63
eventinfosetter.param(
'expList'
, [0])
64
eventinfosetter.param(
'runList'
, [1])
65
eventinfosetter.param(
'evtNumList'
, [10])
66
main.add_module(eventinfosetter)
67
68
# register HistoModules for DQM plots
69
main.add_module(
"HistoManager"
, histoFileName=
"SVDDQMOutput_"
+str(tag)+
".root"
)
70
71
# generate signal
72
main.add_module(
'EvtGenInput'
)
73
74
# add default simulation
75
bkgDir =
'/group/belle2/BGFile/OfficialBKG/early_phase3/prerelease-04-00-00a/overlay/phase31/BGx1/set0/*.root'
76
bg = glob.glob(bkgDir)
77
if
len(bg) == 0:
78
b2.B2ERROR(
'No files found in '
, bkgDir)
79
sys.exit()
80
simu.add_simulation(main, bkgfiles=bg, usePXDDataReduction=
False
, forceSetPXDDataReduction=
True
)
81
82
if
str(tag) ==
"xTalk"
or
str(tag) ==
"cosmics"
or
str(tag) ==
"randomTrigger"
or
str(tag) ==
"randomTriggerZS5"
:
83
svdou.overlay_svd_data(main, str(tag))
84
85
86
# add offline ZS for DQM
87
main.add_module(
88
'SVDZeroSuppressionEmulator'
,
89
SNthreshold=5,
90
ShaperDigits=
'SVDShaperDigits'
,
91
ShaperDigitsIN=
'SVDShaperDigitsZS5'
,
92
FADCmode=
True
)
93
main.add_module(
'SVDDQMExpressReco'
, offlineZSShaperDigits=
'SVDShaperDigitsZS5'
)
94
95
main.add_module(
'Progress'
)
96
97
b2.print_path(main)
98
99
b2.process(main)
100
101
print(b2.statistics)
svd.overlay_utils
Definition
overlay_utils.py:1
svd
examples
overlayUtils.py
Generated on Wed Jul 2 2025 03:32:24 for Belle II Software by
1.13.2