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