13Script to Import SVD Channel Mapping into a local DB
19from termcolor
import colored
20from basf2
import conditions
as b2conditions
22parser = argparse.ArgumentParser(description=
"SVD Local Calibrations Importer")
23parser.add_argument(
'--exp', metavar=
'experiment', dest=
'exp', type=int, nargs=1, help=
'Experiment Number, = 1 for GCR')
24parser.add_argument(
'--run', metavar=
'run', dest=
'run', type=int, nargs=1, help=
'Run Number')
25parser.add_argument(
'--mapXML', metavar=
'channel map xml', dest=
'mapp', type=str, nargs=1, help=
'Channel Mapping xml file')
29if (str(sys.argv[1]) ==
"help"):
33args = parser.parse_args()
35experiment = args.exp[0]
38if args.mapp
is not None:
39 mappingfile = args.mapp[0]
41 mappingfile = args.mapp
52print(
'| ---> CHECK HERE: <---')
53print(
'| experiment number = ' + str(experiment))
54print(
'|first valid run number = ' + str(run))
55print(
'| mapping xml = ' + str(mappingfile))
56print(
'| ---> THANKS! <---')
57sys.stdout.write(RESET)
61proceed = input(
"Do you want to proceed? y/n ")
62if not str(proceed) ==
'y':
63 print(colored(str(proceed) +
' != y, therefore we exit now',
'red'))
67b2conditions.prepend_globaltag(
"svd_basic")
69main = b2.create_path()
73eventinfosetter = b2.register_module(
'EventInfoSetter')
74eventinfosetter.param({
'evtNumList': [1],
'expList': experiment,
'runList': run})
75main.add_module(eventinfosetter)
78main.add_module(
"Gearbox")
84 '''channel mapping importer module'''
89 from ROOT
import Belle2
90 from ROOT.Belle2
import SVDLocalCalibrationsImporter
94 if args.mapp
is not None:
96 dbImporter.importSVDChannelMapping(mappingfile)
97 print(colored(
"V) Channel Mapping Imported",
'green'))
104print(
"IMPORT COMPLETED, check the localDB folder and then proceeed with the upload to the central DB")