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