Belle II Software  release-06-01-15
DBImporter.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 # --------------------------------------------------------------------------------
13 # Example of using Database importer
14 # Note: this example is not meant to be executed, but to see how to write the code
15 # --------------------------------------------------------------------------------
16 
17 import basf2 as b2
18 from ROOT.Belle2 import TOPDatabaseImporter
19 
20 # define local database with write access
21 b2.use_local_database("localDB/localDB.txt", "localDB", False)
22 
23 # create path
24 main = b2.create_path()
25 
26 # Event info setter - execute single event
27 eventinfosetter = b2.register_module('EventInfoSetter')
28 eventinfosetter.param('evtNumList', [1])
29 main.add_module(eventinfosetter)
30 
31 # Gearbox - access to xml files
32 gearbox = b2.register_module('Gearbox')
33 main.add_module(gearbox)
34 
35 # Geometry
36 geometry = b2.register_module('Geometry')
37 geometry.param('useDB', False)
38 geometry.param('components', ['TOP'])
39 main.add_module(geometry)
40 
41 # process single event
42 b2.process(main)
43 
44 # and then run the importer
45 dbImporter = TOPDatabaseImporter()
46 dbImporter.importDummyCalTimebase(0, 0, 0, -1)