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