3 if __name__==
"__main__":
6 parser = argparse.ArgumentParser(prog=
'python -m PixelCalibAlgs.IBLCalibrationConfig.',
7 description=
"""Calibration tool for IBL.\n\n
8 Example: python -m PixelCalibAlgs.IBLCalibrationConfig --folder "global/path/to/folder/" --thr "threshold_file" --totLowQ "totLowCharge_file"
9 --totHisDis "totHisDisConfig_file" [--runCal --skipPlots]""")
11 parser.add_argument(
'--folder' , required=
True, help=
"Directory path to the files")
12 parser.add_argument(
'--thr' , required=
True, help=
"Threshold file, format must be \"SCAN_SXXXXXXXXX\" THRESHOLD_SCAN (0Preset_full)")
13 parser.add_argument(
'--totLowQ' , required=
True, help=
"Time over threshold lowCharge file, format must be \"SCAN_SXXXXXXXXX\" TOT_CALIB (0Preset_lowcharge) ")
14 parser.add_argument(
'--totHisDis' , required=
True, help=
"Time over threshold file, format must be \"SCAN_SXXXXXXXXX\" TOT_CALIB (0Preset_lowcharge_HisDisConfig)")
15 parser.add_argument(
'--tag' , type=str, default=
"PixelChargeCalibration-DATA-RUN2-UPD4-27", help=
"Tag in order to read the DB")
16 parser.add_argument(
'--runCal' , action=
'store_true', help=
"Runs only the IBL Calibration layer")
17 parser.add_argument(
'--skipPlots' , action=
'store_true', help=
"Skips the plotting step - Slower the running time")
19 args = parser.parse_args()
21 print(
"Running IBLCalibration layers..")
22 command =
'IBLCalibration directory_path=' + args.folder +
' THR=' + args.thr +
' TOT_HISDIS=' + args.totHisDis +
' TOT_LOWQ=' + args.totLowQ
23 print(
"Command: %s\n" % command)
25 (subprocess.Popen(command, shell=
True)).communicate()
29 print(
"Jobs finished")
32 print(
"Creating Reference file..")
34 command =
'MakeReferenceFile tagName=%s' % (args.tag)
35 print(
"Command: %s\n" % command)
36 (subprocess.Popen(command, shell=
True)).communicate()
40 print(
"Jobs finished")
43 from PixelCalibAlgs.CheckValues
import CheckThresholdsIBL
46 print(
"Validation new vs. previous calibration.")
48 from PixelCalibAlgs.EvoMonitoring
import setupRunEvo
49 setupRunEvo(
"ChargeCalib_ToTbin1_FrtEnd2_"+args.totHisDis+
".TXT", args.tag+
".log" )
53 print(
"Jobs finished")