nectarchain.trr_test_suite.linearity.main#
- main()[source]#
The
main()function is the entry point of the linearity test script. It parses the command-line arguments, processes the specified runs, and generates plots to visualize the linearity and charge resolution of the detector. The function performs the following key steps: 1. Parses the command-line arguments using theget_args()function, which sets up the argument parser and handles the input parameters. 2. Iterates through the specified run list, processing each run using theLinearityTestToolclass. This tool initializes, sets up, starts, and finishes the processing for each run, returning the relevant output data. 3. Normalizes the high-gain and low-gain charge values using the charge value at 0.01 transmission. 4. Generates three subplots: - The first subplot shows the estimated charge vs. the true charge, with the fitted linear function for both high-gain and low-gain channels. - The second subplot shows the residuals between the estimated and true charge, as a percentage. - The third subplot shows the ratio of high-gain to low-gain charge, with a fitted linear function. 5. Saves the generated plots to the specified output directory, and optionally saves temporary plot files for a GUI. 6. Generates an additional plot to visualize the charge resolution, including the statistical limit. 7. Saves the charge resolution plot to the specified output directory, and optionally saves a temporary plot file for a GUI.