Belle II Software  release-08-01-10
BelleMCGeneration.py
1 #!/usr/bin/env python3
2 
3 
10 
11 # Generation of Belle MC.
12 
13 import basf2
14 from generators import add_evtgen_generator
15 
16 # Use B2BII local cache
17 basf2.conditions.metadata_providers = ["/sw/belle/b2bii/database/conditions/b2bii.sqlite"]
18 basf2.conditions.payload_locations = ["/sw/belle/b2bii/database/conditions/"]
19 
20 # Use B2BII global tag.
21 basf2.conditions.override_globaltags()
22 basf2.conditions.prepend_globaltag('b2bii_beamParameters_with_smearing')
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 # Add generator.
31 add_evtgen_generator(path=main, finalstate='charged')
32 
33 # Add output.
34 main.add_module('BelleMCOutput', outputFileName='charged.dat')
35 
36 # Progress.
37 main.add_module('Progress')
38 
39 # Generate events.
40 basf2.process(main)
41 
42 # Statistics.
43 print(basf2.statistics)