12 from basf2
import set_log_level, LogLevel, register_module, create_path, process, statistics, set_random_seed, print_params
15 set_log_level(LogLevel.ERROR)
16 set_random_seed(1028307)
19 vertex1 = register_module(
'ParticleGun')
22 vertex1.param(
'nTracks', -1)
23 vertex1.param(
'pdgCodes', [-11, 11, -13, 13])
26 vertex1.param(
'momentumGeneration',
'normal')
27 vertex1.param(
'momentumParams', [1, 0.05])
29 vertex1.param(
'thetaGeneration',
'uniform')
30 vertex1.param(
'thetaParams', [17, 150])
32 vertex1.param(
'phiGeneration',
'uniform')
33 vertex1.param(
'phiParams', [0, 360])
36 vertex1.param(
'independentVertices',
False)
38 vertex1.param(
'vertexGeneration',
'fixed')
39 vertex1.param(
'xVertexParams', [0.0, 0.0])
40 vertex1.param(
'yVertexParams', [0.0, 0.0])
41 vertex1.param(
'zVertexParams', [0.0, 0.0])
44 vertex2 = register_module(
'ParticleGun')
47 vertex2.param(
'nTracks', -1)
48 vertex2.param(
'pdgCodes', [-211, 211, -211])
51 vertex2.param(
'momentumGeneration',
'normal')
52 vertex2.param(
'momentumParams', [1, 0.05])
54 vertex2.param(
'thetaGeneration',
'uniform')
55 vertex2.param(
'thetaParams', [17, 150])
57 vertex2.param(
'phiGeneration',
'uniform')
58 vertex2.param(
'phiParams', [0, 360])
61 vertex2.param(
'independentVertices',
False)
63 vertex2.param(
'vertexGeneration',
'fixed')
64 vertex2.param(
'xVertexParams', [1, 1])
65 vertex2.param(
'yVertexParams', [1, 1])
66 vertex2.param(
'zVertexParams', [1, 1])
69 vertex3 = register_module(
'ParticleGun')
72 vertex3.param(
'nTracks', -1)
73 vertex3.param(
'pdgCodes', [-11, 11])
76 vertex3.param(
'momentumGeneration',
'normal')
77 vertex3.param(
'momentumParams', [0.5, 0.01])
79 vertex3.param(
'thetaGeneration',
'uniform')
80 vertex3.param(
'thetaParams', [60, 120])
82 vertex3.param(
'phiGeneration',
'uniform')
83 vertex3.param(
'phiParams', [0, 360])
86 vertex3.param(
'independentVertices',
False)
88 vertex3.param(
'vertexGeneration',
'fixed')
89 vertex3.param(
'xVertexParams', [0, 0])
90 vertex3.param(
'yVertexParams', [0, 0])
91 vertex3.param(
'zVertexParams', [3, 3])
103 eventinfosetter = register_module(
'EventInfoSetter')
105 progress = register_module(
'Progress')
107 gearbox = register_module(
'Gearbox')
109 geometry = register_module(
'Geometry')
111 simulation = register_module(
'FullSim')
113 output = register_module(
'RootOutput')
117 eventinfosetter.param({
'evtNumList': [10],
'runList': [1]})
120 output.param(
'outputFileName',
'ParticleGunOutput.root')
124 mcparticleprinter = register_module(
'PrintMCParticles')
125 mcparticleprinter.logging.log_level = LogLevel.INFO
127 main.add_module(eventinfosetter)
128 main.add_module(progress)
129 main.add_module(gearbox)
130 main.add_module(geometry)
131 main.add_module(vertex1)
132 main.add_module(vertex2)
133 main.add_module(vertex3)
134 main.add_module(mcparticleprinter)
135 main.add_module(simulation)
136 main.add_module(output)