Belle II Software development
opticalGun.py
1#!/usr/bin/env python3
2
3
10
11# ---------------------------------------------------------------
12# Example of usage of the OpticalGun module.
13# It simulates two sources at the left and right side of prism,
14# outside quartz, pointed towards the PMTs
15# ---------------------------------------------------------------
16
17import basf2 as b2
18
19# Create path
20main = b2.create_path()
21
22
23# Set number of events to generate
24main.add_module('EventInfoSetter',
25 expList=[1003], # 0 for nominal phase 3, 1002 for phase II, 1003 for early phase III
26 evtNumList=[10])
27
28# Gearbox
29main.add_module('Gearbox')
30
31# Geometry
32main.add_module('Geometry')
33
34# Optical sources
35main.add_module('OpticalGun',
36 maxAlpha=45.0,
37 na=0.5,
38 startTime=0,
39 pulseWidth=10.0e-3, # laser time Jitter, in ns
40 numPhotons=10,
41 diameter=10.0e-3, # source diameter in cm
42 slotID=5, # if nonzero, local (slot) referenc frame is used, otherwise Belle II
43 x=-22.6,
44 y=0.0,
45 z=-129.9,
46 phi=0.0,
47 theta=180.0,
48 psi=0.0,
49 angularDistribution='Gaussian')
50main.add_module('OpticalGun',
51 maxAlpha=45.0,
52 na=0.5,
53 startTime=0,
54 pulseWidth=10.0e-3,
55 numPhotons=10,
56 diameter=10.0e-3,
57 slotID=5,
58 x=22.6,
59 y=0.0,
60 z=-129.9,
61 phi=0.0,
62 theta=180.0,
63 psi=0.0,
64 angularDistribution='Gaussian')
65
66# Simulation
67main.add_module('FullSim')
68
69# TOP digitization
70main.add_module('TOPDigitizer')
71
72# Output
73main.add_module('RootOutput',
74 outputFileName='opticalGun.root')
75
76# Show progress of processing
77main.add_module('Progress')
78
79# Process events
80b2.process(main)
81
82# Print call statistics
83print(b2.statistics)