Belle II Software  release-08-01-10
TRGValidationGen.py
1 #!/usr/bin/env python3
2 
3 
10 
11 """
12 <header>
13 <output>TRGValidationGen.root</output>
14 <contact>Yun-Tsung Lai, ytlai@post.kek.jp</contact>
15 <description>This steering file generates 1000 e+/e- mu+/mu- particle guns to validate the trg package.</description>
16 </header>
17 """
18 
19 import basf2 as b2
20 from simulation import add_simulation
21 import reconstruction as re
22 import mdst
23 
24 
25 main = b2.create_path()
26 eventinfosetter = b2.register_module('EventInfoSetter')
27 eventinfosetter.param({'evtNumList': [5000], 'runList': [1]})
28 main.add_module(eventinfosetter)
29 
30 particlegun = b2.register_module('ParticleGun')
31 particlegun.param('pdgCodes', [11, -11, 13, -13])
32 particlegun.param('nTracks', 1)
33 particlegun.param('momentumGeneration', 'uniformPt')
34 particlegun.param('momentumParams', [0.5, 3.0])
35 particlegun.param('thetaParams', [35, 127])
36 particlegun.param('phiGeneration', 'uniform')
37 particlegun.param('phiParams', [0, 360])
38 particlegun.param('vertexGeneration', 'uniform')
39 particlegun.param('xVertexParams', [0, 0])
40 particlegun.param('yVertexParams', [0, 0])
41 particlegun.param('zVertexParams', [-20.0, 20.0])
42 main.add_module(particlegun)
43 
44 
45 # trigger simulation is included in latest basf2
46 add_simulation(main)
47 
48 
49 re.add_reconstruction(main)
50 
51 # output
53  path=main,
54  mc=True,
55  filename='../TRGValidationGen.root',
56  additionalBranches=[
57  "TRGKLMHits",
58  "TRGKLMTracks",
59  "KLMTrgSummary",
60  "TRGCDC2DFinderTracks",
61  "TRGCDC3DFitterTracks",
62  "TRGCDCNeuroTracks",
63  "TRGECLClusters",
64  "TRGSummary",
65  "MCInitialParticles"])
66 
67 
68 main.add_module('Progress')
69 # main
70 b2.process(main)
71 print(b2.statistics)
72 # ===<END>
def add_mdst_output(path, mc=True, filename='mdst.root', additionalBranches=[], dataDescription=None)
Definition: mdst.py:37