Belle II Software  release-05-01-25
produceGunEvents.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 # ####### Imports #######
5 from basf2 import *
6 
7 import simulation
8 
9 # ######## Register modules ########
10 eventInfoSetterModule = register_module('EventInfoSetter')
11 eventInfoSetterModule.param({'evtNumList': [10], 'runList': [1],
12  'expList': [0]})
13 
14 progressModule = register_module('Progress')
15 
16 particleGunModule = register_module('ParticleGun')
17 particleGunModule.param({
18  'pdgCodes': [13, -13],
19  'nTracks': 10,
20  'varyNTracks': False,
21  'momentumGeneration': 'uniform',
22  'momentumParams': [0.6, 1.4],
23  'thetaGeneration': 'uniform',
24  'thetaParams': [17., 150.],
25 })
26 
27 rootOutputModule = register_module('RootOutput')
28 rootOutputModule.param({'outputFileName': 'mc_gun.root'})
29 
30 # ######## Create paths and add modules ########
31 main = create_path()
32 
33 main.add_module(eventInfoSetterModule)
34 main.add_module(progressModule)
35 
36 main.add_module(particleGunModule)
37 
38 components = ['MagneticFieldConstant4LimitedRCDC', 'BeamPipe', 'PXD', 'SVD',
39  'CDC']
40 
41 simulation.add_simulation(main, components=components)
42 
43 main.add_module(rootOutputModule)
44 
45 process(main)
46 
47 # Print call statistics
48 print(statistics)
simulation.add_simulation
def add_simulation(path, components=None, bkgfiles=None, bkgOverlay=True, forceSetPXDDataReduction=False, usePXDDataReduction=True, cleanupPXDDataReduction=True, generate_2nd_cdc_hits=False, simulateT0jitter=False, usePXDGatedMode=False)
Definition: simulation.py:114