Belle II Software  release-06-02-00
DQMTracking_Phase2.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 
15 
16 import basf2 as b2
17 from simulation import add_simulation
18 from reconstruction import add_reconstruction
19 
20 # background (collision) files
21 # bg = glob.glob('./BG/*.root')
22 # on KEKCC: (choose one of the sets)
23 # bg = /group/belle2/BGFile/OfficialBKG/15thCampaign/phase2/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 = b2.create_path()
33 
34 # specify number of events to be generated
35 # the experiment number for phase2 MC has to be 1002, otherwise the wrong payloads (for VXDTF2 the SectorMap) are loaded
36 main.add_module("EventInfoSetter", expList=1002, runList=1, evtNumList=num_events)
37 
38 # in case you need to fix seed of random numbers
39 # set_random_seed('d33fa68eab781f3dcb069fb23425885fcd92d3432e6433a14894e5d7bba34272')
40 
41 # generate BBbar events
42 main.add_module('EvtGenInput')
43 
44 # detector and L1 trigger simulation
45 add_simulation(main, bkgfiles=bg)
46 
47 # reconstruction
48 add_reconstruction(main)
49 
50 # histomanager: use DqmHistoManager for in-line monitoring, or HistoManager for offline training
51 # main.add_module('DqmHistoManager', Port=7777)
52 main.add_module('HistoManager', histoFileName='Histos_DQMTracks_Phase2.root')
53 
54 # DQM of tracking
55 trackDQM = main.add_module('TrackDQM', debugLevel=250)
56 # In case to see more details:
57 # trackDQM.logging.log_level = LogLevel.DEBUG
58 
59 # Finally add output, if you need
60 # main.add_module("RootOutput", outputFileName=output_filename)
61 
62 # process events and print call statistics
63 b2.process(main)
64 print(b2.statistics)