Belle II Software  release-08-01-10
B2A111-SimulateMuonPairs.py
1 #!/usr/bin/env python3
2 
3 
10 
11 
21 
22 import basf2 as b2
23 from simulation import add_simulation
24 from reconstruction import add_reconstruction
25 from beamparameters import add_beamparameters
26 from mdst import add_mdst_output
27 
28 # create path
29 main = b2.create_path()
30 
31 # Setting up number of events to generate
32 main.add_module('EventInfoSetter', evtNumList=[10])
33 
34 beamparameters = add_beamparameters(main, "Y4S")
35 beamparameters.param("smearVertex", False)
36 beamparameters.param("smearEnergy", False)
37 b2.print_params(beamparameters)
38 
39 # muon pair generator (BABAYAGA.NLO, born only)
40 main.add_module('BabayagaNLOInput',
41  FinalState='mm',
42  SearchMax=10000,
43  VacuumPolarization='hlmnt',
44  Order='born',
45  MaxAcollinearity=180.,
46  DebugEnergySpread=5.e-3,
47  ScatteringAngleRange=[15.0, 165.0],
48  VPUncertainty=True)
49 
50 # detector simulation
51 add_simulation(path=main)
52 
53 # reconstruction
54 add_reconstruction(path=main)
55 
56 # mdst output
57 add_mdst_output(
58  path=main,
59  mc=True,
60  filename='B2A111-SimulateMuonPairs.root',
61  additionalBranches=[
62  'MCInitialParticles'])
63 
64 # display a progress bar while running
65 main.add_module('ProgressBar')
66 
67 # process events and print call statistics
68 b2.process(main)
69 print(b2.statistics)