Belle II Software  release-08-01-10
DQMVXD_Phase2.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 import basf2 as b2
13 from simulation import add_simulation
14 from reconstruction import add_reconstruction
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
21 bg = None
22 
23 # number of events to generate, can be overriden with -n
24 num_events = 100
25 # output filename, can be overriden with -o
26 output_filename = "RootOutput_Phase2.root"
27 
28 # create path
29 main = 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
34 main.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
41 main.add_module('EvtGenInput')
42 
43 # detector and L1 trigger simulation
44 add_simulation(main, bkgfiles=bg)
45 
46 # reconstruction
47 add_reconstruction(main)
48 
49 # histomanager: use DqmHistoManager for in-line monitoring, or HistoManager for offline training
50 # main.add_module('DqmHistoManager', Port=7777)
51 main.add_module('HistoManager', histoFileName='Histos_DQMTracks_Phase2.root')
52 # main.add_module('HistoManager', histoFileName='Histos_DQMTracks_BelleII.root')
53 
54 pxddqmExpReco = b2.register_module('PXDDQMExpressReco')
55 svddqmExpReco = b2.register_module('SVDDQMExpressReco')
56 vxddqmExpReco = b2.register_module('VXDDQMExpressReco')
57 
58 main.add_module(pxddqmExpReco)
59 main.add_module(svddqmExpReco)
60 main.add_module(vxddqmExpReco)
61 
62 # DQM of tracking
63 trackDQM = main.add_module('TrackDQM')
64 # In case to see more details:
65 # trackDQM = main.add_module('TrackDQM', debugLevel=250)
66 # trackDQM.logging.log_level = LogLevel.DEBUG
67 
68 # Finally add output, if you need
69 # main.add_module("RootOutput", outputFileName=output_filename)
70 
71 # process events and print call statistics
72 b2.process(main)
73 print(b2.statistics)