ATLAS Offline Software
IBLCalibrationConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 if __name__=="__main__":
4 
5  import argparse
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]""")
10 
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")
18 
19  args = parser.parse_args()
20 
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)
24  import subprocess
25  (subprocess.Popen(command, shell=True)).communicate()
26 
27  # Use --runCal = True if you plan to run just the calibration
28  if args.runCal:
29  print("Jobs finished")
30  exit(0)
31 
32  print("Creating Reference file..")
33  # Downloads the last IOV
34  command = 'MakeReferenceFile tagName=%s' % (args.tag)
35  print("Command: %s\n" % command)
36  (subprocess.Popen(command, shell=True)).communicate()
37  print("Done\n")
38 
39  if args.skipPlots:
40  print("Jobs finished")
41  exit(0)
42 
43  from PixelCalibAlgs.CheckValues import CheckThresholdsIBL
44  CheckThresholdsIBL("ChargeCalib_ToTbin1_FrtEnd2_"+args.totHisDis+".TXT")
45 
46  print("Validation new vs. previous calibration.")
47  # Plots the old vs. new charge for all FE (includes IBL)
48  from PixelCalibAlgs.EvoMonitoring import setupRunEvo
49  setupRunEvo("ChargeCalib_ToTbin1_FrtEnd2_"+args.totHisDis+".TXT", args.tag+".log" )
50  print("Done\n")
51 
52 
53  print("Jobs finished")
54  exit(0)
55 
CheckValues.CheckThresholdsIBL
def CheckThresholdsIBL(_file)
Definition: CheckValues.py:248
EvoMonitoring.setupRunEvo
def setupRunEvo(path_newCalib, path_oldCalib)
Definition: EvoMonitoring.py:231
calibdata.exit
exit
Definition: calibdata.py:236
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25