12 from simulation
import add_simulation
13 from reconstruction
import add_reconstruction
28 'deuteron+': 1000010020,
29 'deuteron-': -1000010020,
35 particle = sys.argv[1]
36 pdgCode = getpdgCode(particle)
38 nEvent = int(sys.argv[2])
43 main = basf2.create_path()
46 eventInfoSetter = basf2.register_module(
'EventInfoSetter')
47 eventInfoSetter.param(
'expList', [0])
48 eventInfoSetter.param(
'runList', [0])
49 eventInfoSetter.param(
'evtNumList', [nEvent])
50 main.add_module(eventInfoSetter)
55 pGun = basf2.register_module(
'ParticleGun')
57 'pdgCodes': [pdgCode, pdgCodeNeg],
60 'momentumGeneration':
'uniform',
61 'momentumParams': [2.5, 7.0],
62 'thetaGeneration':
'uniformCos',
63 'thetaParams': [15., 150.],
64 'phiGeneration':
'uniform',
65 'phiParams': [0.0, 360.0],
66 'vertexGeneration':
'uniform',
67 'xVertexParams': [0.0, 0.0],
68 'yVertexParams': [0.0, 0.0],
69 'zVertexParams': [0.0, 0.0],
71 pGun.param(param_pGun)
78 add_reconstruction(main)
80 output = basf2.register_module(
'RootOutput')
81 outfile = f
'{particle}_{stream}.root'
82 output.param(
'outputFileName', outfile)
83 output.param(
'branchNames', [
'MCParticles',
'Muids'])
84 main.add_module(output)
89 print(basf2.statistics)