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