please do not use this algorithm unless you really have to
Calibration of TDCPix matrix
Instructions for calibration of TDCPix matrix.
S - curve
The basis of calibration is obtaining the S - curve for each pixel. The S - curve here is the dependence: number of registered "hits" vs. threshold voltage. The TDCPix matrix is designed in such a way that one can only set the threshold voltage for each column pair (even and odd sub columns) but not for individual pixel. That's why it is crucial to set the threshold voltage so that all pixels in the column are efficient.
The TDCPix chip has a specific procedure for calibration. Electronics allows for sending test pulses to the individual pixel (charge injection) with variable charge injection level. If the threshold voltage is set to be too high, the test pulse will not be registered. The lower charge injection level, the lower threshold voltage is needed. On the contrary, the threshold voltage can not be set too low because of noise.
Analysis of the S - curves is aimed for finding the optimal value of the threshold voltage for each column.
Algorithm
The algorithm for obtaining the S - curve is implemented in the executable .../TDCPixReadOut/Tools/bin/calibration
The implementation is briefly discussed below in section Code.
Usage of the app:
./calibration <row> (-1 for all) <column> (-1 for all) [<subcolumn> <Qcal> <start Vt2> <step Vt2>]
where
row = 0..44
- address of the row of interest or -1
for scanning through all rows.
column = 0..19
- address of the column pair of interest or -1
for scanning through all column pairs.
Other arguments are optional but one should take into account that they are positional.
subcolumn = 0 or 1
- even/odd sub column selector
Qcal = int
- charge injection level in arb. u. The range should be 30 - 150
start Vt2 = int < 255
- starting point for the threshold voltage scan
step Vt2 = int
- increment for threshold voltage scanning
Recommended usage example
./calibration 13 -1 0 120 150 1
This command will launch scanning through each odd sub column within 13
row with charge injection level of 120
starting from Vth = 150
with increment of 1
It is highly recommended to use scanning through each column within one row at the time, due to features discussed in section Code <- this comment is outdated
Now one can run
./calibration -1 -1 0 100 2
Scan through the whole matrix
Output
The output is the set of S - curves plotted on TGraphs stored in output.root
file in the directory ../tdcpix_var/data/CERNGTK_00000000<run_n>
. Each TGraph is named: row N; col M; subcol K
Also there is a set of 2-d histograms for each column in the output file. They demonstrate N_hits(row_n, v_th)
dependencies.
In case of software crashes during operation the information WILL NOT be written in the ROOT file, although it WILL be written after manual loop break by Ctrl + C
To avoid the information loss data is continuously being written in Row number counter's loop. The data structure is a set of text files for each voltage threshold. Each file is a map of received hits from every pixel in the matrix.
Code
The code is based on B. Velghe's pulse_fe.cpp
code. The structure is in following.
-
Setup a new run. Control interface initialization. Setup output directory and files
-
Global configuration. Reset matrix, setting global config, tdcpix config and pulse generator config.
-
Main loop. Contains 3 counters.
Vt value counter | Row number counter | Column number counter
Vt value -> For every row of interest (or just one) -> Reinitialize matrix, turn off all pixels -> Turn on and make available for calibration pixel(s) in the current row and each column of interest (or just one) -> Vt + dVt.
After testing the conclusion has been done - it is possible to do ./calibration -1 -1
(whole matrix) only with great voltage increment. If the app is running for too long - it crashes.
-/-/-/-/-/-/-/-/-/-/-/ update
Now it is fixed. The problematic pixel was manually excluded from calibration procedure. The software works more stable (but not completely due to other random problems occurring sometimes).
-/-/-/-/-/-/-/-/-/-/-/