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