Belle II Software
development
DBImporter.py
1
#!/usr/bin/env python
2
3
10
11
# --------------------------------------------------------------------------------
12
# Example of using Database importer
13
# Note: this example is not meant to be executed, but to see how to write the code
14
# --------------------------------------------------------------------------------
15
16
import
basf2
as
b2
17
from
ROOT
import
Belle2
# noqa: make Belle2 namespace available
18
from
ROOT.Belle2
import
TOPDatabaseImporter
19
20
# define local database with write access
21
b2.conditions.expert_settings(save_payloads=
"localDB/localDB.txt"
)
22
23
24
class
PayloadImporter
(b2.Module):
25
''' Payload importer using TOPDatabaseImporter '''
26
27
def
initialize
(self):
28
''' Import dummy payloads '''
29
30
dbImporter = TOPDatabaseImporter()
31
dbImporter.importDummyCalTimebase(0, 0, 0, -1)
32
dbImporter.importDummyCalChannelT0(0, 0, 0, -1)
33
dbImporter.importDummyCalModuleT0(0, 0, 0, -1)
34
35
36
# create path
37
main = b2.create_path()
38
39
# Event info setter - execute single event
40
main.add_module(
'EventInfoSetter'
)
41
42
# Gearbox
43
main.add_module(
'Gearbox'
)
44
45
# Geometry parameters
46
main.add_module(
'TOPGeometryParInitializer'
, useDB=
False
)
47
48
# Importer
49
main.add_module(
PayloadImporter
())
50
51
# process single event
52
b2.process(main)
DBImporter.PayloadImporter
Definition
DBImporter.py:24
DBImporter.PayloadImporter.initialize
initialize(self)
Definition
DBImporter.py:27
top
examples
DBImporter.py
Generated on Mon Sep 1 2025 02:57:19 for Belle II Software by
1.13.2