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