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