Belle II Software  release-06-01-15
import_moduleT0.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 # --------------------------------------------------------------------------------
13 # Example of using Database importer for importing Module T0 constants to local database
14 # Name and location of local DB can also be changed
15 # --------------------------------------------------------------------------------
16 
17 import basf2 as b2
18 from ROOT.Belle2 import TOPDatabaseImporter
19 
20 # define a local database (will be created automatically, if doesn't exist)
21 b2.use_local_database("localDB/localDB.txt", "localDB", False)
22 
23 main = b2.create_path()
24 
25 # Event info setter - execute single event
26 eventinfosetter = b2.register_module('EventInfoSetter')
27 eventinfosetter.param('evtNumList', [1])
28 main.add_module(eventinfosetter)
29 
30 # Gearbox - access to xml files
31 gearbox = b2.register_module('Gearbox')
32 main.add_module(gearbox)
33 
34 geometry = b2.register_module('Geometry')
35 geometry.param('useDB', False)
36 geometry.param('components', ['TOP'])
37 main.add_module(geometry)
38 
39 # process single event
40 b2.process(main)
41 
42 # and then run the importer (note: input file is not there - must change the path!)
43 dbImporter = TOPDatabaseImporter()
44 
45 # import constants
46 dbImporter.importModuleT0Calibration("/group/belle2/users/senga/minuit021_390.dat")