In external trigger mode
This procedure is made to extract the pedestal value for each channel as well as the memory-cell offsets. Typically, the input for this program is from a LED scan with 0 mV voltage. These kind of runs is what we call as pedestal runs. For every channel, a specific distribution is saved. A gaussian-like distribution centered in 200-300 ADC ticks (depends on the prototype) created mainly by dark rate and electronic noise. Here is a typical example of a pedestal run:
For data files obtained with the HDMI/USB based single layer Labview
The root file needs to be obtained from software!
For data files obtained in testbeam
This is for slcio files obtained from testbeam during LED scans!
This is slightly different as files are obtained from the multi-layer HDMI DAQ and the data format is saved in slcio. One has to convert the "raw" slcio file into the correct root file format. For this Marlin needs to be used to convert the slcio to root.
You will need these files:
Modify the input and output in the steering file and then you can run the conversion with
The output rootfile will have the needed format for the pedestal extraction.
The program pedestal_memcell takes a root file as input and provide a .tsv file as output containing the Mean/RMS pedestal with all memory cells (from 1 to 16) as also the relative shift of memory cells compared to the 2nd memory, starting from 1, not from 0. For the data obtained with the USB DAQ, the memory cells order is inverted, so the offset is calculated with respect memory cell 15 (the previous to the last one).
The program needs a input file (root file) and the output folder (where a text file with all pedestal offsets is written).
To compile the program and run it:
The main output file (pedestal_offsets_in.tsv) looks like:
A second file, Plots_comp.root, is saved. It contains the pedestal distributions for all channels, chips and memory cells.
Depending of your input data format, the memory cells are ordered in one way or the other. In LED external trigger scans, the first memory cell is always zero (known bug of Spiroc 2b). If we using the USB Labview, the first memory cell filled with data is the last one sent to the PC, so is the last one in the output file shown above (you can see that last written memory cell has an offset of ~230). Using the HDMI Labview, the memory cell output is well sorted. Therefore, to calculate the offset, we have to chose as a reference one memory cell that always works, in this case memory cell 2nd (15th in USB labview) over 16th which is always filled.
Pedestal offset correction
The output file of the pedestal calculation, pedestal_offsets_in.tsv, is used to perform pedestal offset correction. This is very important, especially for the gain calibration measurements since we want to see the single pixel spectrum and measure the distance between pixels (in ADC). If the pedestal offset correction is not performed, the single pixel spectra peaks are wider since every memory cell noise average is a bit shifted with respect to the others. This shift is not always in the same direction.
In auto-trigger mode
Physics data needs to be used here. There is a difference between external/autotrigger pedestals! AT Pedestal extraction described in section MIP Calibration