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