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