Belle II Software development
ParticleGunMuons.py
1#!/usr/bin/env python3
2
3
10
11# Particle gun muon events.
12
13import basf2
14from simulation import add_simulation
15from reconstruction import add_reconstruction
16
17basf2.set_log_level(basf2.LogLevel.WARNING)
18
19eventinfosetter = basf2.register_module('EventInfoSetter')
20eventinfosetter.param('evtNumList', [1000])
21eventinfosetter.param('runList', [1])
22eventinfosetter.param('expList', [0])
23
24pGun = basf2.register_module('ParticleGun')
25param_pGun = {
26 'pdgCodes': [13, -13],
27 'nTracks': 1,
28 'momentumGeneration': 'uniform',
29 'momentumParams': [1., 3.],
30 'thetaGeneration': 'uniform',
31 'thetaParams': [17., 150.],
32 'phiGeneration': 'uniform',
33 'phiParams': [0, 360],
34 'vertexGeneration': 'uniform',
35 'xVertexParams': [0.0, 0.0],
36 'yVertexParams': [0.0, 0.0],
37 'zVertexParams': [0.0, 0.0],
38}
39
40pGun.param(param_pGun)
41
42output = basf2.register_module('RootOutput')
43output.param('outputFileName', 'ParticleGunMuons.root')
44
45# Create path
46main = basf2.create_path()
47main.add_module(eventinfosetter)
48main.add_module(pGun)
49add_simulation(main)
50add_reconstruction(main)
51main.add_module(output)
52main.add_module('Progress')
53
54basf2.process(main)
55print(basf2.statistics)