Belle II Software  release-08-01-10
DQMVXD_Phase2Min.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 
17 # background (collision) files
18 # bg = glob.glob('./BG/*.root')
19 # on KEKCC: (choose one of the sets)
20 # bg = /group/belle2/BGFile/OfficialBKG/15thCampaign/phase2/set*/*.root
21 # bg = /group/belle2/BGFile/OfficialBKG/15thCampaign/phase3/set*/*.root
22 bg = None
23 
24 # number of events to generate, can be overriden with -n
25 num_events = 100
26 # output filename, can be overriden with -o
27 output_filename = "RootOutput_Phase2.root"
28 
29 # create path
30 main = b2.create_path()
31 
32 # specify number of events to be generated
33 # main.add_module('EventInfoSetter', evtNumList=num_events)
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('some fixed value')
39 # set_random_seed('d33fa68eab781f3dcb069fb23425885fcd92d3432e6433a14894e5d7bba34272')
40 
41 # generate BBbar events
42 main.add_module('EvtGenInput')
43 # generate cosmics events
44 # main.add_module('Cosmics')
45 
46 # detector and L1 trigger simulation
47 add_simulation(main, bkgfiles=bg)
48 
49 # reconstruction - set pruneTracks=False to store RecoHits for TrackDQM
50 add_reconstruction(main, pruneTracks=False)
51 # reconstruction fo cosmics - set pruneTracks=False to store RecoHits for TrackDQM
52 # add_cosmics_reconstruction(main, pruneTracks=False, data_taking_period = 'phase2')
53 
54 # histomanager: use DqmHistoManager for in-line monitoring, or HistoManager for offline training
55 # main.add_module('DqmHistoManager', Port=7777)
56 main.add_module('HistoManager', histoFileName='Histos_DQMTracks_Phase2.root')
57 # main.add_module('HistoManager', histoFileName='Histos_DQMTracks_BelleII.root')
58 
59 pxddqmExpReco = b2.register_module('PXDDQMExpressReco')
60 svddqmExpReco = b2.register_module('SVDDQMExpressReco')
61 vxddqmExpReco = b2.register_module('VXDDQMExpressReco')
62 main.add_module(pxddqmExpReco)
63 main.add_module(svddqmExpReco)
64 main.add_module(vxddqmExpReco)
65 # # The following should do the same as above
66 # add_common_dqm(main,['PXD', 'SVD'])
67 
68 # DQM of tracking
69 main.add_module('TrackDQM')
70 # In case to see more details:
71 # trackDQM = main.add_module('TrackDQM')
72 # trackDQM = main.add_module('TrackDQM', debugLevel=250)
73 # trackDQM.logging.log_level = LogLevel.DEBUG
74 
75 # Finally add output, if you need
76 # main.add_module("RootOutput", outputFileName=output_filename)
77 
78 # process events and print call statistics
79 b2.process(main)
80 print(b2.statistics)