-
Notifications
You must be signed in to change notification settings - Fork 4
Analysis scripts
Pflib has a wide variety of data analysis and plotting Python scripts, located in the ana/ directory. These scripts serve to interpret the data gathered via pftool DAQ functions. This page contains the documentation for some of them.
- RMSD - root-mean-square deviation, equivalent to standard deviation. In the scripts often referred to as RMS;
The pedestal/averagesplot.py script allows the user to determine the mean pedestal values across link 0 (channels 0-35) and link 1 (channels 36-71). The code also calculates the RMSD across samples of each channel and across each link. For example, if the pedestals were taken with a 100 samples per channel, the channel-wise RMSD would be the stddev of the 100 samples. The link-wise RMSD would be the stddev of the mean pedestal values of each link. The link-wise RMSD can be saved as a csv file.
Both the mean pedestal values and the channel-wise RMSD can be plotted for each link, as seen in examples below:
To engage with the different functions of the script, the user needs to provide an initial run setting. These can be found by running python3 averagesplot.py -h. The current settings are:
-
-pd- Path to directory for saved figures; -
-lc- Mark the first pedestal file as pre-lowering and second as post-lowering; -
-rms- Calculate and save the RMS of the mean pedestals for each link - provide a file path.
An example that engages all the settings would be:
python3 averagesplot.py [pedestals.csv] [pedestals_lowered.csv] -pd [/plot_directory/] -lc -rms [link-wise-RMSD-results.csv]
The charge/time-scan-evaluation.py is designed for analysis of both peak and pedestal ADC alignment in time-scan data. The peak-ADC alignment serves to ensure all channels show a similar ADC response to the same CALIB, i.e. that they have the same gain. Moreover, the script provides the option to track the pedestal alignment from the time-scan data (pedestals assumed to be the minima). This can be used for comparison with the pedestal-alignment results. Similarly to mean pedestal evaluation, the script uses RMSD as the primary evaluation metric. The link-wise RMSD (stddev of mean peak-ADC values across each link) can be calculated and saved to a csv file, while the channel-wise RMSD (stddev of N ADC-samples taken on each channel) is plotted.
Ideally, time-scan data files taken on all channels, across various CALIB values and with multiple samples are provided for analysis. One file should contain only one channel and CALIB, but can (and preferably should!) contain multiple samples.
As an example, the peak-ADC alignment and their channel-wise RMSD results for both links, preCC, could look like this:
To engage with the different functions of the script, the user needs to provide an initial run setting. These can be found by running python3 time-scan-evaluation.py -h. The current settings are:
-
-p- Plot results; -
-tp- Track pedestal values (minima) instead of peaks; -
-rms- Calculate the RMS of the mean-ADC-peak distribution across each link (link-wise RMSD); -
-pd- Figures directory path. If not provided, figures are not saved automatically; -
-csv- Save the RMSD results to a csv with the given path (-h says "fit results" right now, it's a mistake);
An example that engages all the settings would be:
python3 time-scan-evaluation.py [time-scan-data.csv or time-scan-data-folder/*] -p -tp -rms -pd [/plot_directory/] -csv [link-wise-RMSD-results.csv]