Skip to content
Snippets Groups Projects
Commit 1f8b5288 authored by Sergi Rodriguez Bosca's avatar Sergi Rodriguez Bosca Committed by Adam Edward Barton
Browse files

Adding python module file in order to call the Pixel Calibration

Adding python module file in order to call the Pixel Calibration
parent 0a8e6ec5
No related branches found
No related tags found
1 merge request!68446Adding python module file in order to call the Pixel Calibration
#
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
#
if __name__=="__main__":
import argparse
parser = argparse.ArgumentParser(prog='python -m PixelCalibAlgs.PixelCalibrationConfig.',
description="""Calibration tool for pixel.\n\n
Example: python -m PixelCalibAlgs.PixelCalibrationConfig --folder "global/path/to/folder/" --thr "threshold_file" --thr_intime "intime_file"
--tot "tot_file --layers [Blayer, L1, L2, disk] [--saveInfo]""")
parser.add_argument('--folder' , required=True, help="Directory path to the files")
parser.add_argument('--thr' , required=True, help="Threshold file, format must be \"SCAN_SXXXXXXXXX\" ")
parser.add_argument('--thr_intime', required=True, help="Threshold intime file, format must be \"SCAN_SXXXXXXXXX\" ")
parser.add_argument('--tot' , required=True, help="Time over threshold file, format must be \"SCAN_SXXXXXXXXX\" ")
parser.add_argument('--layers' , required=True, nargs='+', choices={"Blayer","L1","L2","disk"}, help="What layers we should run to update the calibration.")
parser.add_argument('--saveInfo' , type=bool, default=False, help="Creates a root file with the fitting plots - Slower running time")
args = parser.parse_args()
import subprocess
proc = []
for layer in args.layers :
command = 'PixelCalibration directory_path=' + args.folder + ' THR=' + args.thr + ' THRintime=' + args.thr_intime + ' TOT=' + args.tot + ' ' + layer + ' > log_' + layer
print("%s\n" % command)
proc.append(subprocess.Popen(command, shell=True))
for l in range(len(args.layers)) :
proc[l].communicate()
# Work in progress...
# After all the processes are finished, we need to download the last IOV, modify the calibrated modules and upload
# do we know if we need xchecks? if so the they can be implented here as well before the upload
print("running Code")
exit(0)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment