Belle II Software  release-08-01-10
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 
27 import basf2
28 import simulation as sim
29 import reconstruction as rec
30 
31 basf2.set_random_seed(981543)
32 basf2.set_log_level(basf2.LogLevel.ERROR)
33 
34 output_filename = '../muon-KLMValidation.root'
35 basf2.B2INFO('The output file name is ' + output_filename)
36 
37 main_path = basf2.create_path()
38 
39 main_path.add_module('EventInfoSetter', evtNumList=2000)
40 
41 main_path.add_module('Progress')
42 main_path.add_module('ProgressBar')
43 
44 main_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 
59 sim.add_simulation(path=main_path)
60 rec.add_reconstruction(path=main_path)
61 
62 main_path.add_module('RootOutput',
63  outputFileName=output_filename,
64  branchNames=['MCParticles', 'KLMMuidLikelihoods', 'KLMDigits', 'KLMHit2ds', 'EventT0'])
65 
66 main_path.add_module('Progress')
67 basf2.process(main_path)
68 print(basf2.statistics)