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