Skip to content

Scanning

Configuration

Chip can be added for scan using fec_load function.

fec = sc.fec_load(rx_fid, tx_fid, cfg_fname)
parameters:

  • rx_fid - rx link fid for the chip
  • tx_fid - tx link fid for the chip
  • fname - json file with YARR chip configuration.

return parameter is a fec object, which can be used to access chip directly.

By default script is loading quad connected to device: 0 at tx: 0, rx: 0, 4, 8, 12.
Config files are expected to be in pyconfig/chips and named as chip1.json, chip2.json, chip3.json, chip4.json.
Corresponding chips are accessible as fec1, fec2, fec3, fec4.

For different setup, one can modify accordingly run_sendcmd.py script.

The fec object can be used to modify fields on-the-fly in the python interactive mode:

>>> fec.write_field(name, value)
parameters:

  • name - name of the field
  • value - value to set

Field names are consistent with one used in YARR.

Examples:

>>> fec.write_field('CmlBias0', 1000)
>>> fec.write_field('CmlBias1', 0)

Readout script

Orion allows to run both direct and data merging modes. This can be configured by setting --mode argument.

Readout can run permanently, no need to restart it between scans.

By default readout is configured to subscribe to device 0 links: 0x0, 0x4, 0x8, 0xC. This can be modified by changing dev and rx_list variables.

The readout part should run in a separate terminal:

python ./run_readout.py --mode direct
If everything runs properly, one should see log like below, which updates every second:
  11:51:43 ┃         itk.readout ┃    fid: 0x1000000000000000 recv: 0, buff: 0 bytes
  11:51:43 ┃         itk.readout ┃    fid: 0x1000000000040000 recv: 0, buff: 0 bytes
  11:51:43 ┃         itk.readout ┃    fid: 0x1000000000080000 recv: 0, buff: 0 bytes
  11:51:43 ┃         itk.readout ┃    fid: 0x10000000000c0000 recv: 0, buff: 0 bytes

Scanning script

Scanning tool allows to perform various scans by setting --scan argument.

This version of run_scanner.py script allows to perform digital and analog scans.

For digital scan run scanning script in interactive mode in separate terminal:

python -i ./run_scanner.py --mode direct --scan digital
If everything runs properly, one should get reply like below:
help()
repower_init()
quad_config_init()
quad_confi_global()
quad_confi_pixels()
send_prescan
make_scan()
full_scan()
>>>
Scripts allows to perform each configuration steps independently. For complete scan in interactive mode run full_scan(), which includes all steps: repowering, configuration and scan itself.

Scan Results

After performing digital/analog scan, one have to get reply in readout terminal like:

 02:09:40 ┃      rd53b.monoproc ┃  fid: 0x1000000000080000 SCAN START
 02:09:40 ┃         itk.readout ┃    fid: 0x1000000000000000 recv: 3310080, buff: 0 bytes
 02:09:41 ┃         itk.readout ┃    fid: 0x1000000000000000 recv: 12245928, buff: 0 bytes
 02:09:42 ┃         itk.readout ┃    fid: 0x1000000000000000 recv: 20962160, buff: 0 bytes
 02:09:43 ┃         itk.readout ┃    fid: 0x1000000000000000 recv: 29811984, buff: 0 bytes
 02:09:44 ┃         itk.readout ┃    fid: 0x1000000000000000 recv: 38280864, buff: 0 bytes
 02:09:44 ┃      rd53b.monoproc ┃  fid: 0x1000000000000000 SCAN STOP
 02:09:44 ┃       rd53b.evtproc ┃  scan time: 4.57 sec, rate: 68.9 Mbps
 02:09:44 ┃       rd53b.evtproc ┃  tval: 100, All pixels are good.
 02:09:44 ┃       rd53b.evtproc ┃  save data: 0.03 sec

Event processor rd53b.evtproc already analyses data during readout and provides basic on-the-fly checks.

If all pixels hits are equal it is reported that All pixels are good (even if some triggers lost), otherwice will be reported Error in pixels.

More detailed analysis and plotting can be performed with stored scan data.

Scan results are stored in *.json file separately for each front-end.

Naming convention is occmap_fid<fid>.json for direct mode and occmap_fid<fid>_FE<fe>.json for data merging mode.

Each file contains the following information:

  • scan_time – pure scanning time in ms, does not include chip configuration and data processing/saving time.
  • trig_tags – statistics of received triggers per tag, each should be trig_count * iter_count
  • trig_hits – statistics of hits per trigger tag. For good digital/analog scan should be 15360000 = 400 * 384
  • data – hitmap matrix for pixels. Dimention is data[384][400] (by convention, rows are listed first; and columns, second). In case of perfect scan all data values should be equal to trig_count.

Example of perfect scan is listed below:

{
  "chip": "name",
  "scan_time": 4571,
  "trig_tags": [6400,6400,6400,6400,6400,6400,6400,6400,6400,6400,6400,6400,6400,6400,6400,6400],
  "trig_hits": [0,0,0,0,0,0,0,0,0,15360000,0,0,0,0,0,0],
  "data": [
    [100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,...,100],
    [100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,...,100],
    ...
    [100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,...,100]
  ]
}

Plotting

Plotting scripts to generate occupancy map for digital and analog scans are located in orion/plotting folder.

From pyconfig folder plot for a single chip can be generated as

python ../plotting/plot_occmap.py -p -c chip -f ../data/last_scan/occmap_fid1000000000000000.json -u 103 -l 97
the occmap_fid1000000000000000.pdf file will be created in orion/data/last_scan. In case of perfect scan it should looks like

occmap_chip.svg

For quad module, one can execute command

python ../plotting/plot_occmap_quad.py -p -q name -u 103 -l 97 \
  --fe1 ../data/last_scan/occmap_fid1000000000000000.json \
  --fe2 ../data/last_scan/occmap_fid1000000000040000.json \
  --fe3 ../data/last_scan/occmap_fid1000000000080000.json \
  --fe4 ../data/last_scan/occmap_fid10000000000c0000.json \
  -f ../data/last_scan/occmap_quad
the occmap_quad.pdf file will be created in orion/data/last_scan folder. In case of perfect scan, it should looks like:

occmap_quad.svg

For more details about plotting tools you can read plotting section.