calibration_set

CalibrationSet class to handle Ph2ACF config files and result files.

Classes

CalibrationSet([hw_config, directory, name])

Ph2ACF calibration config and result file context manager.

CalibrationSet

class module_testing.dataflow.calibration_set.CalibrationSet(hw_config='CMSIT.xml', directory=None, name=None)

Bases: object

Ph2ACF calibration config and result file context manager.

Handles config loading, reading, saving, and management, and moves result files to more sensible directories and naming conventions after completion of calibration.

__init__(hw_config='CMSIT.xml', directory=None, name=None)
Parameters:
  • hw_config – name of hardware config file (i.e. CMSIT.xml file).

  • directory – directory to move results to. Defaults to name if not provided.

  • name – name of calibration set.

CHIPMONITOR_DIR = 'MonitorResults'

Name of results directory used by Ph2ACF CMSITminiDAQ.

LOG_DIR = 'logs'
RESULTS_DIR = 'Results'
RUNNUMBER_FILE = 'RunNumber.txt'

Name of run number txt file used by Ph2ACF CMSITminiDAQ.

property config
Returns:

DetectorConfig object for current hardware config file.

property directory
Returns:

directory (read-only).

fake_RunNumber()

Generates and increments a fake RunNumber.txt file. This was introduced to accomodate uploading IV and SLDO data to Panthera. The ‘test name’ must be unique, which is accomplished by Ph2 ACF scans by reading the RunNumber.txt file and creating a test name from the two digit number + test name (e.g. “00_PixelAlive”)

felis_add_result(context, file_path, test_name, test_type)
felis_add_result_basic(context, felis_files, module_name, test_name, test_type)
felis_add_result_sequence(context, file_path, scan_name, test_type, test_name)
property hw_config
Returns:

name of hardware config (CMSIT.xml) file (read-only).

property last_run
Returns:

run number of last run, as read from RUNNUMBER_FILE.

queue_IV_ROOT_file(folder, name, x_data, y_data, titles, rpath)
queue_SLDO_ROOT_file(folder, name, x_data, y_data, module_name, hybrid, chip_ids)
queue_felis_add_result(context, file_path, test_name, test_type)

Files (data, plots) are created on calibration_set __exit__, therefore anything that needs to be uploaded to Panthera using Felis must also be performed after they are created. This function simply queues Felis uploads.

queue_felis_add_result_basic(context, felis_files, module_name, test_name, test_type)
queue_felis_add_result_sequence(context, file_path, scan_name, test_type, test_name)

This was created to support calibration sequences like ‘assembly_test’ etc. assembly_test (for example) allows calibrations to create the files that will be uploaded with felis, but will not upload to Panthera until all calibrations have run to avoid waiting for user input after every calibration. A separate function makes this a little bit easier as it can just upload all files already stored in Felis_Results.

queue_monitoring_result(monitor)

Queue a monitoring result to be saved in the result directory once the monitor completes.

Parameters:

monitor – a monitors.monitor.Monitor-compliant monitor object.

queue_plot(folder, name, x_data, y_data, axes, labels, errors=[], fig_types=['pdf'])

Queue the creation of a plot.

Parameters:
  • folder – In which folder the plot belongs

  • name – Name of the plot file

  • x_data – list of values to be put into the x-axis [x0,x1,x2…]

  • y_data – list or matrix of data points at the respective points [y0,y1,y2…] or [[y0_0,y0_1,y0_2…][y1_0,y1_1,y1_2…]…]

  • labels – Names of the axes [x-axis, y-axis]

  • fig_types – List of type extension(s) of saved figures

queue_script_result(folder, name, header, result)

Queue a result of a script to be saved in the result directory once the monitor completes.

save_IV_ROOT_file(folder, name, x_data, y_data, titles, rpath)

Creates the ROOT file containing IV scan data for uploading to Panthera

name - desired name of the ROOT file. File MUST contain the string “run” titles - “;” separated string contains plot and axes titles e.g. “title; x_title; y_title” x_data - array of data for x axis (lists or numpy arrays will be converted) y_data - array of data for y axis (lists or numpy arrays will be converted) rpath - root file path. Format = “Detector/Board_0/OpticalGroup_0/Hybrid_0”

save_SLDO_ROOT_file(folder, name, x_data, y_data, module_name, hybrid, chip_ids)

Creates the ROOT file containing SLDO scan data for uploading to Panthera

name - desired name of the ROOT file titles - “;” separated string contains plot and axes titles e.g. “title; x_title; y_title” x_data - array of data for x axis (lists or numpy arrays will be converted) y_data - array of data for y axis (MUST BE NUMPY ARRAY) chip_ids - string list of chip.id values e.g. [‘15’, ‘14’, ‘13’, ‘12’] rpath - root file path. Format = “Detector/Board_0/OpticalGroup_0/Hybrid_0”

save_monitoring_result(monitor)

Save a monitoring result in the result directory.

Parameters:

monitor – a monitors.monitor.Monitor-compliant monitor object.

save_plot(folder, name, x_data, y_data, axes, labels, errors, fig_types)

Actually handles to plot generation, called from queue_plot_simple See there for :param:

save_script_result(folder, name, header, result)

Should help saving the results from a test in the results folder.