Belle II Software development
BeamParameters.py
1#!/usr/bin/env python3
2
3
10
11import basf2
12from beamparameters import add_beamparameters
13
14# small example to show how to set BeamParameters
15
16main = basf2.create_path()
17main.add_module("EventInfoSetter", expList=0, runList=1, evtNumList=10000)
18
19# add beamparameters with named preset
20beamparameters = add_beamparameters(main, "Y4S")
21
22# override preset however you like
23beamparameters.param("covHER", [0.01, 0.01, 0.01])
24beamparameters.param("smearDirection", False)
25
26# print parameters to be used
27basf2.print_params(beamparameters)
28
29# add generator, simulation, analysis, and so forth
30main.add_module("RootOutput", outputFileName="BeamParameters.root")
31
32basf2.process(main)