Belle II Software  release-05-01-25
datconsvdreconstruction.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 = None
16 
17 set_random_seed(3)
18 
19 num_events = 100
20 
21 output_filename = "datconsvdreconstruction.root"
22 
23 output_branches = ["DATCONSVDDigits", "DATCONSimpleSVDCluster", "DATCONSVDSpacePoints"]
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=0, runList=1, evtNumList=num_events)
31 
32 # in case you need to fix seed of random numbers
33 # set_random_seed('some fixed value')
34 
35 # generate BBbar events
36 main.add_module('EvtGenInput')
37 
38 # detector simulation
39 add_simulation(main, bkgfiles=bg, bkgOverlay=True)
40 
41 # trigger simulation
42 add_tsim(main)
43 
44 # reconstruction
45 add_reconstruction(main)
46 
47 main.add_module('SVDShaperDigitToDATCONSVDDigitConverter')
48 
49 main.add_module('DATCONSVDSimpleClusterizer')
50 
51 main.add_module('DATCONSVDSpacePointCreator')
52 
53 main.add_module('Progress')
54 
55 # Finally add output
56 main.add_module("RootOutput", outputFileName=output_filename, branchNames=output_branches)
57 
58 # process events and print call statistics
59 process(main)
60 print(statistics)