Belle II Software development
DQMVXD_Phase2.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# background (collision) files
16# bg = glob.glob('./BG/*.root')
17# on KEKCC: (choose one of the sets)
18# bg = /group/belle2/BGFile/OfficialBKG/15thCampaign/phase2/set*/*.root
19# bg = /group/belle2/BGFile/OfficialBKG/15thCampaign/phase3/set*/*.root
20bg = None
21
22# number of events to generate, can be overriden with -n
23num_events = 100
24# output filename, can be overriden with -o
25output_filename = "RootOutput_Phase2.root"
26
27# create path
28main = b2.create_path()
29
30# specify number of events to be generated
31# main.add_module('EventInfoSetter', evtNumList=num_events)
32# the experiment number for phase2 MC has to be 1002, otherwise the wrong payloads (for VXDTF2 the SectorMap) are loaded
33main.add_module("EventInfoSetter", expList=1002, runList=1, evtNumList=num_events)
34
35# in case you need to fix seed of random numbers
36# set_random_seed('some fixed value')
37# set_random_seed('d33fa68eab781f3dcb069fb23425885fcd92d3432e6433a14894e5d7bba34272')
38
39# generate BBbar events
40main.add_module('EvtGenInput')
41
42# detector and L1 trigger simulation
43add_simulation(main, bkgfiles=bg)
44
45# reconstruction
46add_reconstruction(main)
47
48# histomanager: use DqmHistoManager for in-line monitoring, or HistoManager for offline training
49# main.add_module('DqmHistoManager', Port=7777)
50main.add_module('HistoManager', histoFileName='Histos_DQMTracks_Phase2.root')
51# main.add_module('HistoManager', histoFileName='Histos_DQMTracks_BelleII.root')
52
53pxddqmExpReco = b2.register_module('PXDDQMExpressReco')
54svddqmExpReco = b2.register_module('SVDDQMExpressReco')
55vxddqmExpReco = b2.register_module('VXDDQMExpressReco')
56
57main.add_module(pxddqmExpReco)
58main.add_module(svddqmExpReco)
59main.add_module(vxddqmExpReco)
60
61# DQM of tracking
62trackDQM = main.add_module('TrackDQM')
63# In case to see more details:
64# trackDQM = main.add_module('TrackDQM', debugLevel=250)
65# trackDQM.logging.log_level = LogLevel.DEBUG
66
67# Finally add output, if you need
68# main.add_module("RootOutput", outputFileName=output_filename)
69
70# process events and print call statistics
71b2.process(main)
72print(b2.statistics)