Belle II Software  release-05-01-25
import_moduleT0.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 (will be created automatically, if doesn't exist)
19 use_local_database("localDB/localDB.txt", "localDB", False)
20 
21 main = create_path()
22 
23 # Event info setter - execute single event
24 eventinfosetter = register_module('EventInfoSetter')
25 eventinfosetter.param('evtNumList', [1])
26 main.add_module(eventinfosetter)
27 
28 # Gearbox - access to xml files
29 gearbox = register_module('Gearbox')
30 main.add_module(gearbox)
31 
32 geometry = register_module('Geometry')
33 geometry.param('useDB', False)
34 geometry.param('components', ['TOP'])
35 main.add_module(geometry)
36 
37 # process single event
38 process(main)
39 
40 # and then run the importer (note: input file is not there - must change the path!)
41 dbImporter = TOPDatabaseImporter()
42 
43 # import constants
44 dbImporter.importModuleT0Calibration("/group/belle2/users/senga/minuit021_390.dat")