Belle II Software development
EclDatabaseImport.py
1#!/usr/bin/env python3
2
3
10
11"""This steering file shows how to use the EclDatabaseImport
12 to import dummy data (as TH1) into a payload ROOT file.
13
14The user should provide input and output root file name as
15first and second argument, respectively. Comment in the
16importer you need at the end. Upload the local DB afterwards.
17"""
18
19import sys
20import glob
21import basf2 as b2
22import ROOT
23from ROOT.Belle2 import ECLDatabaseImporter
24
25
26if len(sys.argv) != 3:
27 print(f'Usage: basf2 {sys.argv[0]} inputFile outputFile')
28 sys.exit(1)
29
30inputFile = sys.argv[1]
31outputFile = sys.argv[2]
32
33# Register 'EventInfoSetter' module
34eventInfoSetter = b2.register_module('EventInfoSetter')
35eventInfoSetter.initialize()
36
37# Register 'Gearbox' module
38gearbox = b2.register_module('Gearbox')
39gearbox.initialize()
40
41rootFiles = ROOT.vector('string')()
42[rootFiles.push_back(name) for name in glob.glob(inputFile)]
43eclDBImporter = ECLDatabaseImporter(rootFiles, outputFile)
44
45"""Import ECL energy calibration constants to the database
46(examples/CreateEclDigitTestPayload.C)
47"""
48eclDBImporter.importDigitEnergyCalibration()
49
50"""Import ECL time calibration constants to the database
51(input file from Chris Hearty)
52"""
53# eclDBImporter.importDigitTimeCalibration()
54
55"""Import ECL shower shape corrections to second moment
56to the database (input file from Savino Longo)
57"""
58# eclDBImporter.importShowerShapesSecondMomentCorrections()
59
60"""Import ECL leakage corrections to showers
61(input file from Suman Koirala)
62"""
63# eclDBImporter.importShowerCorrectorLeakageCorrections()
64
65"""Import threshold values for track ECL cluster matching
66(input file from Frank Meier)
67"""
68# eclDBImporter.importTrackClusterMatchingThresholds()
69
70"""Import RMS parameterizations for track ECL cluster matching
71(input file from Frank Meier)
72"""
73# eclDBImporter.importTrackClusterMatchingParameterizations()