Belle II Software development
KLMMuonGenerate.py
1#!/usr/bin/env python3
2
3
10
11
17
18"""
19<header>
20 <output>muon-KLMValidation.root</output>
21 <contact>Laura.Salutari@uniroma3.it</contact>
22 <description>Create events with 1 muon track for BKLM and EKLM validation.</description>
23</header>
24"""
25
26
27import basf2
28import simulation as sim
29import reconstruction as rec
30
31basf2.set_random_seed(981543)
32basf2.set_log_level(basf2.LogLevel.ERROR)
33
34output_filename = '../muon-KLMValidation.root'
35basf2.B2INFO('The output file name is ' + output_filename)
36
37main_path = basf2.create_path()
38
39main_path.add_module('EventInfoSetter', evtNumList=2000)
40
41main_path.add_module('Progress')
42main_path.add_module('ProgressBar')
43
44main_path.add_module('ParticleGun',
45 pdgCodes=[-13, 13],
46 nTracks=1,
47 varyNTracks=0,
48 momentumGeneration='uniform',
49 momentumParams=[0.5, 5.0],
50 thetaGeneration='uniformCos',
51 thetaParams=[18., 155.],
52 phiGeneration='uniform',
53 phiParams=[0., 360.],
54 vertexGeneration='fixed',
55 xVertexParams=[0.0],
56 yVertexParams=[0.0],
57 zVertexParams=[0.0])
58
59sim.add_simulation(path=main_path)
60rec.add_reconstruction(path=main_path)
61
62main_path.add_module('RootOutput',
63 outputFileName=output_filename,
64 branchNames=['MCParticles', 'KLMMuidLikelihoods', 'KLMDigits', 'KLMHit2ds', 'EventT0'])
65
66main_path.add_module('Progress')
67basf2.process(main_path)
68print(basf2.statistics)