Belle II Software  release-08-01-10
phase2_simulate_localDB.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 
16 import sys
17 
18 import basf2 as b2
19 from generators import add_evtgen_generator
20 
21 print('***')
22 print('*** Used steering script:')
23 with open(sys.argv[0], 'r') as fin:
24  print(fin.read(), end="")
25 print('*** end of the script.')
26 print('***')
27 
28 fileOUT = sys.argv[1]
29 localdb_dir = sys.argv[2]
30 
31 dec_file = None
32 final_state = 'mixed'
33 
34 # main path
35 main = b2.create_path()
36 
37 # event info setter
38 main.add_module("EventInfoSetter", expList=1002, runList=0, evtNumList=100)
39 
40 main.add_module('Gearbox')
41 main.add_module('Geometry')
42 
43 # EvtGen
44 add_evtgen_generator(path=main, finalstate=final_state, signaldecfile=dec_file)
45 
46 # Simulation
47 main.add_module('FullSim', StoreAllSecondaries=True)
48 
49 # Digitizer
50 main.add_module('SVDDigitizer')
51 
52 main.add_module("Progress")
53 main.add_module('RootOutput', outputFileName=fileOUT)
54 
55 # generate events
56 b2.process(main)
57 
58 # show call statistics
59 print(b2.statistics)