Belle II Software  release-06-01-15
DBImportGainEff.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 with write access
21 # (will be created automatically, if doesn't exist)
22 b2.use_local_database("localDB/localDB.txt", "localDB", False)
23 
24 # create path
25 main = b2.create_path()
26 
27 # Event info setter - execute single event
28 eventinfosetter = b2.register_module('EventInfoSetter')
29 eventinfosetter.param('evtNumList', [1])
30 main.add_module(eventinfosetter)
31 
32 # Gearbox - access to xml files
33 gearbox = b2.register_module('Gearbox')
34 main.add_module(gearbox)
35 
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 
47 # import constants
48 dbImporter.importPmtPulseHeightFitResult("/group/belle2/users/okuto/gain_summary_bfield_newHV.root")