Belle II Software  light-2212-foldex
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.override_globaltags()
23 basf2.conditions.prepend_globaltag('b2bii_beamParameters_with_smearing')
24 
25 # Path.
26 main = basf2.create_path()
27 
28 # Generate for experiment 55, run 0 (run-independent MC).
29 main.add_module('EventInfoSetter', expList=55, runList=0, evtNumList=100)
30 
31 # Add generator.
32 add_evtgen_generator(path=main, finalstate='charged')
33 
34 # Add output.
35 main.add_module('BelleMCOutput', outputFileName='charged.dat')
36 
37 # Progress.
38 main.add_module('Progress')
39 
40 # Generate events.
41 basf2.process(main)
42 
43 # Statistics.
44 print(basf2.statistics)