12SVD Detector Configuration Importer.
13Script to the configuration parameters, Local and Global, into a local DB
19from termcolor
import colored
20from basf2
import conditions
as b2conditions
22parser = argparse.ArgumentParser(description=
"SVD Detector Configuration 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(
'--cfgXML', metavar=
'config xml', dest=
'calib', type=str, nargs=1, help=
'GlobalRun Calibration XML file')
29if (str(sys.argv[1]) ==
"help"):
33args = parser.parse_args()
35experiment = args.exp[0]
38if args.calib
is not None:
39 calibfile = args.calib[0]
41 calibfile = args.calib
53print(
'| ---> CHECK HERE: <---')
54print(
'| experiment number = ' + str(experiment))
55print(
'|first valid run number = ' + str(run))
56print(
'| global xml = ' + str(calibfile))
57print(
'| ---> THANKS! <---')
58sys.stdout.write(RESET)
62proceed = input(
"Do you want to proceed? y/n ")
63if not str(proceed) ==
'y':
64 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 '''detector configuration importer'''
89 from ROOT
import Belle2
90 from ROOT.Belle2
import SVDDetectorConfigurationImporter
94 if args.calib
is not None:
96 configImporterToDB.importSVDGlobalConfigParametersFromXML(calibfile)
97 print(colored(
"V) Global Detector Configuration parameters: (ZS, latency, mask, APVClock units) Imported",
'green'))
99 configImporterToDB.importSVDLocalConfigParametersFromXML(calibfile)
100 print(colored(
"V) Local Detector Configuration parameters Imported",
'green'))
102 print(colored(
"X) Detector Configuration parameters are not NOT imported.",
'red'))
109print(
"IMPORT COMPLETED, check the localDB folder and then proceeed with the upload to the central DB")