Belle II Software development
TrgEclDatabaseImport.py
1#!/usr/bin/env python3
2
3
10
11import basf2 as b2
12from ROOT import Belle2 # noqa: make Belle2 namespace available
13from ROOT.Belle2 import TrgEclDatabaseImporter
14from ROOT.Belle2 import FileSystem
15
16
17# register event info setter
18eventinfo = b2.register_module('EventInfoSetter')
19eventinfo.initialize()
20
21# register gearbox
22gearbox = b2.register_module('Gearbox')
23gearbox.initialize()
24
25
26FAMParameters = FileSystem.findFile('../data/FAM_Parameters.dat')
27SignalPDF = FileSystem.findFile('trg/ecl/data/SignalPDF.dat')
28NoiseMatrix = FileSystem.findFile('trg/ecl/data/NoiseMatrix.dat')
29
30TMMParameters = FileSystem.findFile('trg/ecl/data/TMM_Parameters.dat')
31ETMParameters = FileSystem.findFile('trg/ecl/data/ETM_Parameters.dat')
32BadRunList = FileSystem.findFile('trg/ecl/data/BadRunList.dat')
33
34b2.use_local_database("trg_ecl/database.txt", "trg_ecl")
35
36dbImporter = TrgEclDatabaseImporter()
37
38dbImporter.setExpNumber(0, -1)
39dbImporter.setRunNumber(0, -1)
40
41dbImporter.importFAMParameter(FAMParameters, NoiseMatrix, NoiseMatrix)
42dbImporter.importTMMParameter(TMMParameters)
43dbImporter.importETMParameter(ETMParameters)
44dbImporter.importBadRunNumber(BadRunList)