Belle II Software development
genCalPulse.py
1#!/usr/bin/env python3
2
3
10
11import basf2 as b2
12
13# ----------------------------------------------------------------------------
14# Example of generating realistic calibration pulses with TOPCalPulseGenerator
15# ----------------------------------------------------------------------------
16
17# Create path
18main = b2.create_path()
19
20# Set number of events to generate
21eventinfosetter = b2.register_module('EventInfoSetter')
22eventinfosetter.param('evtNumList', [100])
23main.add_module(eventinfosetter)
24
25# Gearbox: access to database (xml files)
26gearbox = b2.register_module('Gearbox')
27main.add_module(gearbox)
28
29# Geometry
30geometry = b2.register_module('Geometry')
31geometry.param('useDB', False)
32geometry.param('components', ['TOP'])
33main.add_module(geometry)
34
35# pulse generator
36calpulse = b2.register_module('TOPCalPulseGenerator')
37calpulse.param('asicChannels', [0])
38calpulse.param('moduleIDs', [1])
39calpulse.param('amplitude', 750.0)
40main.add_module(calpulse)
41
42# digitization
43topdigi = b2.register_module('TOPDigitizer')
44topdigi.param('useSampleTimeCalibration', True)
45main.add_module(topdigi)
46
47# output
48main.add_module('RootOutput')
49
50# Show progress of processing
51progress = b2.register_module('Progress')
52main.add_module(progress)
53
54# Process events
55b2.process(main)
56
57# Print call statistics
58print(b2.statistics)