Belle II Software  release-08-01-10
EvtGenUpsilon1S.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 import basf2
13 from beamparameters import add_beamparameters
14 
15 # suppress messages and warnings during processing:
16 basf2.set_log_level(basf2.LogLevel.INFO)
17 
18 # main path
19 main = basf2.create_path()
20 
21 # event info setter
22 main.add_module("EventInfoSetter", expList=0, runList=1, evtNumList=100)
23 
24 # beam parameters
25 beamparameters = add_beamparameters(main, "Y1S")
26 # beamparameters.param("generateCMS", True)
27 # beamparameters.param("smearVertex", False)
28 # beamparameters.param("smearEnergy", False)
29 # print_params(beamparameters)
30 
31 # EvtGen
32 evtgen = basf2.register_module('EvtGenInput')
33 # parent particle name from evt.pdl: Upsilon = Y(1S)
34 evtgen.param('ParentParticle', "Upsilon")
35 evtgen.set_log_level(basf2.LogLevel.INFO)
36 
37 # run
38 main.add_module("Progress")
39 main.add_module("Gearbox")
40 main.add_module(evtgen)
41 main.add_module("RootOutput", outputFileName="evtgen_upsilon1s.root")
42 main.add_module("PrintMCParticles", logLevel=basf2.LogLevel.DEBUG, onlyPrimaries=False)
43 
44 # generate events
45 basf2.process(main)
46 
47 # show call statistics
48 print(basf2.statistics)