Belle II Software  release-06-02-00
BelleMCGeneration.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 # Generation of Belle MC.
13 
14 import basf2
15 from generators import add_evtgen_generator
16 
17 # Use B2BII local cache
18 basf2.conditions.metadata_providers = ["/sw/belle/b2bii/database/conditions/b2bii.sqlite"]
19 basf2.conditions.payload_locations = ["/sw/belle/b2bii/database/conditions/"]
20 
21 # Use B2BII global tag.
22 basf2.conditions.prepend_globaltag('B2BII_MC')
23 
24 # Path.
25 main = basf2.create_path()
26 
27 # Generate for experiment 55, run 0 (run-independent MC).
28 main.add_module('EventInfoSetter', expList=55, runList=0, evtNumList=100)
29 
30 # Override generation flags (allow vertex smearing).
31 main.add_module('OverrideGenerationFlags')
32 
33 # Add generator.
34 add_evtgen_generator(path=main, finalstate='charged')
35 
36 # Add output.
37 main.add_module('BelleMCOutput', outputFileName='charged.dat')
38 
39 # Progress.
40 main.add_module('Progress')
41 
42 # Generate events.
43 basf2.process(main)
44 
45 # Statistics.
46 print(basf2.statistics)