14from ROOT
import Belle2
15from ROOT.Belle2
import ARICHDatabaseImporter
16from optparse
import OptionParser
18parser = OptionParser()
19parser.add_option(
'-t',
'--tag', dest=
'tag', default=
'',
20 help=
'database tag from which to import/export data')
21parser.add_option(
'-e',
'--exp', dest=
'experiment',
22 default=-1, help=
'experiment')
23parser.add_option(
'-r',
'--run', dest=
'run',
24 default=-1, help=
'run')
25parser.add_option(
'-o',
'--object', dest=
'object',
26 default=
"", help=
'object to be printed')
29(options, args) = parser.parse_args()
31if options.object ==
'':
32 print(
"use option -o to specify the object to be printed (ARICHReconstructionPar, etc)")
35if options.tag ==
'local':
36 b2.conditions.testing_payloads = [
"localdb/database.txt"]
37elif options.tag ==
'':
38 print(
"Using default tag")
40 b2.conditions.override_globaltags([options.tag])
44eventinfo = b2.register_module(
'EventInfoSetter')
46main = b2.create_path()
48main.add_module(eventinfo)
51paramloader = b2.register_module(
'Gearbox')
52paramloader.initialize()
57dbImporter = ARICHDatabaseImporter()
58exp = int(options.experiment)
60if exp > 0
and run > 0:
61 dbImporter.setExperimentAndRun(exp, run)
63if options.object ==
'ARICHModulesInfo':
64 dbImporter.printModulesInfo()
65elif options.object ==
'ARICHSimulationPar':
66 dbImporter.printSimulationPar()
67elif options.object ==
'ARICHChannelMask':
68 dbImporter.printChannelMask()
69elif options.object ==
'ARICHChannelMapping':
70 dbImporter.printChannelMapping()
71elif options.object ==
'ARICHMergerMapping':
72 dbImporter.printMergerMapping()
73elif options.object ==
'ARICHCopperMapping':
74 dbImporter.printCopperMapping()
75elif options.object ==
'ARICHReconstructionPar':
76 dbImporter.printReconstructionPar()
77elif options.object ==
'ARICHGlobalAlignment':
78 dbImporter.printGlobalAlignment()
79elif options.object ==
'ARICHMirrorAlignment':
80 dbImporter.printMirrorAlignment()
81elif options.object ==
'ARICHAeroTilesAlignment':
82 dbImporter.printAeroTilesAlignment()
83elif options.object ==
'ARICHGeometryConfig':
85 dbImporter.printGeometryConfig()
86elif options.object ==
'moduleNumbering':
88 dbImporter.dumpModuleNumbering()
89elif options.object ==
'QEMap':
91 dbImporter.dumpQEMap()
92elif options.object ==
'MergerMap':
95 dbImporter.dumpMergerMapping()
96elif options.object ==
'FEMappings':
98 dbImporter.printFEMappings()
100 print(
'Non-valid arich DB object!')