Belle II Software development
mpl_pair_sim.py
1#!/usr/bin/env python3
2
3
10
11
16
17import basf2 as b2
18
19import pdg
20
21# monopole characteristics
22mag = 68.5
23el = 0
24mass = 1
25# number of events
26num_events = 1
27
28mypath = b2.create_path()
29
30mypath.add_module("EventInfoSetter", expList=0, runList=1, evtNumList=num_events)
31pdg.add_particle('monopole', 99666, mass, 0.0, el, 0.5)
32pdg.add_particle('anti-monopole', -99666, mass, 0.0, -el, -0.5)
33
34# generate events
35pairgen = b2.register_module('PairGen')
36pairgen.param('pdgCode', 99666)
37pairgen.param('saveBoth', True)
38mypath.add_module(pairgen)
39
40# define geometry
41GEARBOX = b2.register_module('Gearbox')
42
43GEOMETRY = b2.register_module('Geometry')
44GEOMETRY_param = {
45 'components': ['BeamPipe', 'MagneticField', 'PXD', 'SVD', 'CDC', 'ECL', 'ARICH', 'TOP', 'KLM'],
46 'geometryType': 0
47}
48GEOMETRY.param(GEOMETRY_param)
49
50# full simulation
51g4sim = b2.register_module('FullSim')
52g4sim.param('RegisterMonopoles', True)
53g4sim.param('MonopoleMagCharge', mag)
54g4sim.param('trajectoryStore', 1)
55
56# digitization
57PXDDIGI = b2.register_module('PXDDigitizer')
58PXDDIGI_param = {
59 'Digits': 'PXDDigits',
60 'PoissonSmearing': True,
61 'ElectronicEffects': True
62}
63PXDDIGI.param(PXDDIGI_param)
64
65# SVDDIGITIZER = register_module('SVDDigitizer')
66# SVDDIGITIZER_param = {
67# 'PoissonSmearing': True,
68# 'ElectronicEffects': True
69# }
70# SVDDIGITIZER.param(SVDDIGITIZER_param)
71
72# CDCDIGITIZER = register_module('CDCDigitizer')
73# CDCDIGITIZER.param("Output2ndHit", False)
74
75pxdClusterizer = b2.register_module('PXDClusterizer')
76
77# output
78output = b2.register_module('RootOutput')
79output.param('outputFileName', 'mplPair_1GeV_test.root')
80
81
82# Show progress of processing
83progress = b2.register_module('ProgressBar')
84mypath.add_module(GEARBOX)
85mypath.add_module(GEOMETRY)
86mypath.add_module(g4sim)
87mypath.add_module(PXDDIGI)
88mypath.add_module(pxdClusterizer)
89
90mypath.add_module(output)
91mypath.add_module(progress)
92
93# Process the events
94b2.process(mypath)
95
96# print out the summary
97print(b2.statistics)
def add_particle(name, pdgCode, mass, width, charge, spin, max_width=None, lifetime=0, pythiaID=0, define_anti_particle=False)
Definition: pdg.py:135