12SVD Detector Configuration Importer.
13Script to the configuration parameters, Local and Global, into a local DB
17from ROOT.Belle2
import SVDDetectorConfigurationImporter
20from termcolor
import colored
21from basf2
import conditions
as b2conditions
23parser = argparse.ArgumentParser(description=
"SVD Detector Configuration Importer")
24parser.add_argument(
'--exp', metavar=
'experiment', dest=
'exp', type=int, nargs=1, help=
'Experiment Number, = 1 for GCR')
25parser.add_argument(
'--run', metavar=
'run', dest=
'run', type=int, nargs=1, help=
'Run Number')
26parser.add_argument(
'--cfgXML', metavar=
'config xml', dest=
'calib', type=str, nargs=1, help=
'GlobalRun Calibration XML file')
30if(str(sys.argv[1]) ==
"help"):
34args = parser.parse_args()
36experiment = args.exp[0]
39if args.calib
is not None:
40 calibfile = args.calib[0]
42 calibfile = args.calib
54print(
'| ---> CHECK HERE: <---')
55print(
'| experiment number = ' + str(experiment))
56print(
'|first valid run number = ' + str(run))
57print(
'| global xml = ' + str(calibfile))
58print(
'| ---> THANKS! <---')
59sys.stdout.write(RESET)
63proceed = input(
"Do you want to proceed? y/n ")
64if not str(proceed) ==
'y':
65 print(colored(str(proceed) +
' != y, therefore we exit now',
'red'))
68b2conditions.prepend_globaltag(
"svd_basic")
70main = b2.create_path()
74eventinfosetter = b2.register_module(
'EventInfoSetter')
75eventinfosetter.param({
'evtNumList': [1],
'expList': experiment,
'runList': run})
76main.add_module(eventinfosetter)
79main.add_module(
"Gearbox")
85 '''detector configuration importer'''
92 if args.calib
is not None:
94 configImporterToDB.importSVDGlobalConfigParametersFromXML(calibfile)
95 print(colored(
"V) Global Detector Configuration parameters: (ZS, latency, mask, APVClock units) Imported",
'green'))
97 configImporterToDB.importSVDLocalConfigParametersFromXML(calibfile)
98 print(colored(
"V) Local Detector Configuration parameters Imported",
'green'))
100 print(colored(
"X) Detector Configuration parameters are not NOT imported.",
'red'))
107print(
"IMPORT COMPLETED, check the localDB folder and then proceeed with the upload to the central DB")