Belle II Software  release-08-01-10
DQMTracking_Phase2.py
1 #!/usr/bin/env python3
2 
3 
10 
11 
14 
15 import basf2 as b2
16 from simulation import add_simulation
17 from reconstruction import add_reconstruction
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 = None
24 
25 # number of events to generate, can be overriden with -n
26 num_events = 100
27 # output filename, can be overriden with -o
28 output_filename = "RootOutput_Phase2.root"
29 
30 # create path
31 main = b2.create_path()
32 
33 # specify number of events to be generated
34 # the experiment number for phase2 MC has to be 1002, otherwise the wrong payloads (for VXDTF2 the SectorMap) are loaded
35 main.add_module("EventInfoSetter", expList=1002, runList=1, evtNumList=num_events)
36 
37 # in case you need to fix seed of random numbers
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 
53 # DQM of tracking
54 trackDQM = main.add_module('TrackDQM', debugLevel=250)
55 # In case to see more details:
56 # trackDQM.logging.log_level = LogLevel.DEBUG
57 
58 # Finally add output, if you need
59 # main.add_module("RootOutput", outputFileName=output_filename)
60 
61 # process events and print call statistics
62 b2.process(main)
63 print(b2.statistics)