Belle II Software development
DQMVXD_Phase2Min.py
1#!/usr/bin/env python3
2
3
10
11import basf2 as b2
12from simulation import add_simulation
13from reconstruction import add_reconstruction
14
15
16# background (collision) files
17# bg = glob.glob('./BG/*.root')
18# on KEKCC: (choose one of the sets)
19# bg = /group/belle2/BGFile/OfficialBKG/15thCampaign/phase2/set*/*.root
20# bg = /group/belle2/BGFile/OfficialBKG/15thCampaign/phase3/set*/*.root
21bg = None
22
23# number of events to generate, can be overriden with -n
24num_events = 100
25# output filename, can be overriden with -o
26output_filename = "RootOutput_Phase2.root"
27
28# create path
29main = b2.create_path()
30
31# specify number of events to be generated
32# main.add_module('EventInfoSetter', evtNumList=num_events)
33# the experiment number for phase2 MC has to be 1002, otherwise the wrong payloads (for VXDTF2 the SectorMap) are loaded
34main.add_module("EventInfoSetter", expList=1002, runList=1, evtNumList=num_events)
35
36# in case you need to fix seed of random numbers
37# set_random_seed('some fixed value')
38# set_random_seed('d33fa68eab781f3dcb069fb23425885fcd92d3432e6433a14894e5d7bba34272')
39
40# generate BBbar events
41main.add_module('EvtGenInput')
42# generate cosmics events
43# main.add_module('Cosmics')
44
45# detector and L1 trigger simulation
46add_simulation(main, bkgfiles=bg)
47
48# reconstruction - set pruneTracks=False to store RecoHits for TrackDQM
49add_reconstruction(main, pruneTracks=False)
50# reconstruction fo cosmics - set pruneTracks=False to store RecoHits for TrackDQM
51# add_cosmics_reconstruction(main, pruneTracks=False, data_taking_period = 'phase2')
52
53# histomanager: use DqmHistoManager for in-line monitoring, or HistoManager for offline training
54# main.add_module('DqmHistoManager', Port=7777)
55main.add_module('HistoManager', histoFileName='Histos_DQMTracks_Phase2.root')
56# main.add_module('HistoManager', histoFileName='Histos_DQMTracks_BelleII.root')
57
58pxddqmExpReco = b2.register_module('PXDDQMExpressReco')
59svddqmExpReco = b2.register_module('SVDDQMExpressReco')
60vxddqmExpReco = b2.register_module('VXDDQMExpressReco')
61main.add_module(pxddqmExpReco)
62main.add_module(svddqmExpReco)
63main.add_module(vxddqmExpReco)
64# # The following should do the same as above
65# add_common_dqm(main,['PXD', 'SVD'])
66
67# DQM of tracking
68main.add_module('TrackDQM')
69# In case to see more details:
70# trackDQM = main.add_module('TrackDQM')
71# trackDQM = main.add_module('TrackDQM', debugLevel=250)
72# trackDQM.logging.log_level = LogLevel.DEBUG
73
74# Finally add output, if you need
75# main.add_module("RootOutput", outputFileName=output_filename)
76
77# process events and print call statistics
78b2.process(main)
79print(b2.statistics)