Belle II Software  release-08-01-10
B2A101-Y4SEventGeneration.py
1 #!/usr/bin/env python3
2 
3 
10 
11 
29 
30 import basf2 as b2
31 import generators as ge
32 import modularAnalysis as ma
33 
34 # generation of 100 events according to the specified DECAY table
35 # Y(4S) -> Btag- Bsig+
36 # Btag- -> D0 pi-; D0 -> K- pi+
37 # Bsig+ -> mu+ nu_mu
38 #
39 
40 # Defining custom path
41 my_path = b2.create_path()
42 
43 # Setting up number of events to generate
44 ma.setupEventInfo(noEvents=100, path=my_path)
45 
46 # Adding genberator
47 ge.add_evtgen_generator(path=my_path,
48  finalstate='signal',
49  signaldecfile=b2.find_file(
50  'analysis/examples/simulations/B2A101-Y4SEventGeneration.dec'))
51 
52 # dump generated events in DST format to the output ROOT file
53 my_path.add_module('RootOutput', outputFileName='B2A101-Y4SEventGeneration-evtgen.root')
54 
55 # process all modules added to the path
56 b2.process(path=my_path)
57 
58 # print out the summary
59 print(b2.statistics)