Skip to content

WIP: Tot calibration

Marija Glisic requested to merge TOTcalibration into devel

Merging the calibration scan code to master, to allow for extracting the measured charge to ToT data of the Rd53 FE at a per-pixel level. Comments on code are below.

configs/scans/rd53a/diff_calibrationscan.json: The calibration scan runs multiple tot scans for various injection charges (InjVcalDiff at line 43-47). For a calibration scan with fine granularity, a step size of 10 injVcalDiff (~100 electrons) has worked well.

src/libFei4/Fei4Analysis.cpp: PixelTotMap creates a map of TOT measurements per injection charge, indexed per pixel #. It is created and filled in init() of the TotAnalysis loop.
JohnDoe_0_PixelTotMap The end() function of TotAnalysis holds much of the code to extract the measured ToT to charge data. The histogram avgTotVsCharge plots the measured ToT per injection charge averaged over all pixels. JohnDoe_0_avgTotVsCharge Extracting the ToT-measured charge data is done by indexing over each pixel, and only if the pixel was not masked. (lines 420-421). The historgam measQOut is the ToT-measured charge conversion table, indexed by pixel.

  • Example of measured charges of one pixel (in measQOut.json), in order of Tot 1-15: [1032.109619140625, 1249.3858642578126, 1411.8720703125, 1722.46826171875, 2191.406982421875, 2828.806884765625, 3736.468994140625, 4936.9755859375, 6341.99609375, 7854.03466796875, 9532.6669921875, 11629.0771484375, 14482.3701171875, 18797.6171875, 28546.193359375]. JohnDoe_0_measQOut

To create this, a temporary histogram for a single pixel is filled with the measured integer ToT values per injection charge (line 423-428). Then, for each integer ToT value, the measured charge and RMS values are calculated (starting line 431) and stored in histograms measQOut and measQRMSOut. example of a pixel's measQOut.json output below:

  • for a masked pixel: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
  • for unmasked pixel: [1044.939208984375, 1292.3836669921876, 1569.5985107421876, 1945.9842529296876, 2471.12158203125, 3187.1826171875, 4110.873046875, 5381.01123046875, 6901.28466796875, 8467.6748046875, 10124.052734375, 12328.5498046875, 15605.7626953125, 20556.228515625, 29365.04296875] (using Vcal units of charge)

The measured charge per integer ToT can be incomplete, aka, the pixel never measured a particular ToT value, so there isn’t data available to calculate a measured charge value (recording instead a ‘zero'). Instead, the measured charge value is extrapolated from a linear fit using other measured charge values. This extrapolation starts at line 452.

  • Example: if measQOut for ToT 1-5 is [0, 2, 3, 0, 5] then extrapolating with a linear fit gives [1, 2, 3, 4, 5] so that no ToTs are missing measured charge values.

In the case of a middle hole (e.g. [1, 2, 0, 4, 5] where the hole is at the ToT=3 index) print a message . The quantity of middle holes can be reduced by decreasing the injectionVcal step size in diff_calibrationscan.json (with injVCalDiff=10, middle holes are rare, 2 pixels out of 25k pixels). The message will report how many pixels had middle holes to the user.

src/libFei4/include/Fei4Analysis.h This was modified to include pixelTotMap and RMSTotVsCharge histograms.

src/libRd53a/include/Rd53a.h and src/libYarr/include/FrontEnd.h Added the function getMaskPixel to return if pixel of a given row and column is masked or not. This is called in the end function of TotAnalysis.

Edited by Marija Glisic

Merge request reports