Belle II Software  release-05-01-25
DQMVXD_Phase2Min.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
12 
13 from basf2 import *
14 from simulation import add_simulation
15 from reconstruction import add_reconstruction
16 from L1trigger import add_tsim
17 import glob
18 
19 from reconstruction import add_cosmics_reconstruction
20 from daqdqm.commondqm import add_common_dqm
21 
22 # background (collision) files
23 # bg = glob.glob('./BG/*.root')
24 # on KEKCC: (choose one of the sets)
25 # bg = /group/belle2/BGFile/OfficialBKG/15thCampaign/phase2/set*/*.root
26 # bg = /group/belle2/BGFile/OfficialBKG/15thCampaign/phase3/set*/*.root
27 bg = None
28 
29 # number of events to generate, can be overriden with -n
30 num_events = 100
31 # output filename, can be overriden with -o
32 output_filename = "RootOutput_Phase2.root"
33 
34 # create path
35 main = create_path()
36 
37 # specify number of events to be generated
38 # main.add_module('EventInfoSetter', evtNumList=num_events)
39 # the experiment number for phase2 MC has to be 1002, otherwise the wrong payloads (for VXDTF2 the SectorMap) are loaded
40 main.add_module("EventInfoSetter", expList=1002, runList=1, evtNumList=num_events)
41 
42 # in case you need to fix seed of random numbers
43 # set_random_seed('some fixed value')
44 # set_random_seed('d33fa68eab781f3dcb069fb23425885fcd92d3432e6433a14894e5d7bba34272')
45 
46 # generate BBbar events
47 main.add_module('EvtGenInput')
48 # generate cosmics events
49 # main.add_module('Cosmics')
50 
51 # detector simulation
52 add_simulation(main, bkgfiles=bg)
53 
54 # trigger simulation
55 add_tsim(main)
56 
57 # reconstruction - set pruneTracks=False to store RecoHits for TrackDQM
58 add_reconstruction(main, pruneTracks=False)
59 # reconstruction fo cosmics - set pruneTracks=False to store RecoHits for TrackDQM
60 # add_cosmics_reconstruction(main, pruneTracks=False, data_taking_period = 'phase2')
61 
62 # histomanager: use DqmHistoManager for in-line monitoring, or HistoManager for offline training
63 # main.add_module('DqmHistoManager', Port=7777)
64 main.add_module('HistoManager', histoFileName='Histos_DQMTracks_Phase2.root')
65 # main.add_module('HistoManager', histoFileName='Histos_DQMTracks_BelleII.root')
66 
67 pxddqmExpReco = register_module('PXDDQMExpressReco')
68 svddqmExpReco = register_module('SVDDQMExpressReco')
69 vxddqmExpReco = register_module('VXDDQMExpressReco')
70 main.add_module(pxddqmExpReco)
71 main.add_module(svddqmExpReco)
72 main.add_module(vxddqmExpReco)
73 # # The following should do the same as above
74 # add_common_dqm(main,['PXD', 'SVD'])
75 
76 # DQM of tracking
77 main.add_module('TrackDQM')
78 # In case to see more details:
79 # trackDQM = main.add_module('TrackDQM')
80 # trackDQM = main.add_module('TrackDQM', debugLevel=250)
81 # trackDQM.logging.log_level = LogLevel.DEBUG
82 
83 # Finally add output, if you need
84 # main.add_module("RootOutput", outputFileName=output_filename)
85 
86 # process events and print call statistics
87 process(main)
88 print(statistics)