Skip to content

ROC Calibration

Andreas Pettersson edited this page Dec 19, 2025 · 6 revisions

Make sure the firmware is loaded, if not: sudo fw-loader load hcal-zcu102

Setup the ROC: cd to pflib/build ./pftool –z

DAQ.SETUP.STANDARD

EXPERT.ELINKS.AUTO

When asked whether or not to save the settings to the ROC, chose YES.

Take a pedestal run and plot it:

DAQ.PEDESTAL

cd ../ana/pedestal/
python violinplot.py ../../build/pedestal_{RUNNUMBER}.csv -o NAME_pedestal.png --ylim 100 300
init_pedestal

Pedestal trimming: trim_inv

./pftool –z
TASKS.LEVEL_PEDESTALS

Allow this to apply the changes to the ROC.

Take another pedestal: leveled_pedestal

See more info on the TASKS tab of this wiki.

Pedestal trimming: Inv_vref

NOTE! THIS METHOD DOES NOT CURRENTLY WORK FOR LINK 1!

TASKS.INV_VREF_SCAN
Number of events per point:  [1] 1
Filename:  [inv_vref_scan_20251010_123843.csv] 
Channel to scan on link 0 [17] 
Channel to scan on link 1 [51] 

(See more info on the TASKS tab of this wiki. )

cd pflib/ana/inv_vref
inv_vref_align.py with inv_vref_scan.csv

that should have been outputted in build folder

Example of usage:

python3 inv_vref_align.py -f ../../build/inv_vref_scan_20251010_080328.csv -o inv_vref_10oct.yaml -t 100

This will take the linear range of the scan and find (performing a linear fit) the inv_vref that gives the desired pedestal ADC target (-t argument).

The output will be stored in a yaml:

REFERENCEVOLTAGE_0:
  INV_VREF: 524
REFERENCEVOLTAGE_1:
  INV_VREF: 502

Apply the inv_vref values:

Go back to build

> ROC.LOAD
--- This command expects a YAML file with page names, parameter names and their values.
Filename: inv_vref_10oct.yaml
Update all parameter values on the chip using the defaults in the manual for any values not provided?  (Y/N)  [N] N

Take a new pedestal:

trimmed_pedestal

TOA alignment

TOA_VREF

First we align the link-wise parameter TOA_VREF which sets a common TOA voltage threshold.

Run

TASKS.TOA_VREF_SCAN

TRIM_TOA

Second, we align the channel-wise parameter TRIM_TOA which trims the TOA voltage threshold for each channel individually.

Run

TASKS.TRIM_TOA_SCAN

Now the TOA is calibrated, which sets us up for aligning the TOT.

TOT alignment

As in the case of TOA, we begin by setting the link-wise parameter TOT_VREF which sets a common TOT voltage threshold. However, the script here will set the TRIM_TOT parameter as well.

Run

TASKS.TOT_SCAN

The script sets a link-wise parameter TOT_VREF first, making sure that the voltage threshold is above a target threshold. The target threshold corresponds to some chosen ADC value that we have hardcoded in the script. Next we set the channel-wise parameter TRIM_TOT, which trims the threshold down for each channel. The method relies on that the pedestals are aligned and the TOA is calibrated, otherwise the TRIM_TOT parameter will run out of range, and the TOT won't trigger.

...

Clone this wiki locally