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