An important characteristic parameter of a SiPM is the gain. The gain value is solely dependent on the distance between the peaks.
- This software performs the gain calibration for the AHCAL. It takes rootfiles from the standard LED runs (with applied LED voltages) as input and also the pedestal file (.tsv) which is acquired from pedestal extraction, in order to produce ADC Spectrums for individual channels.
- Then it performs a MultiGaussian Fit on the Spectra.
For doing this we need to take several LED runs in forced trigger mode for several LED Voltages. The optimal voltage is priori unknown and varies for every channel. One reasonable range is [5700-6000 mV] since each SiPM response may vary.
Filling the histograms and making the Pedestal Offset correction
and the offset correction is done memory cell by memory cell in this part:
2. Check the spectrum to see if it is fitable or not
The position of the peaks is found via TSpectrum . The TSpectrum is class from ROOT which is able to study any spectrum and find the maximum number of candidates to be peaks in the data (pseudo-peaks).
The CheckSpectrum function checks if there are minimum number of pseudo-peaks needed for the gain calibration and the pseudo-peaks are well resolved and if the distance between two pseudo peaks is of similar distances. If this is the case, then a full fit to the data of a multigaussian is performed(approximately) using the output information of the checks as input information to start the fit.
Another check that is done is the called "Mean Condition" which basically ask for ADC spectrums no saturated (mean < 1000-3000 ADC ticks depending of the tiles/SiPMs/boards...)
3. Fitting method
The Fit is in the form :
It also performs a Fast Fourier Transform (FFT) fit in order to get a comparison with another method.
Instructions to run the code
The input file names need to have the LED voltage value in the name in order to read it and use it to create the output files. This is done in the GainRunFolderParser.h, in this line:
since the program is expecting a file name like *LEDXXXXmV*.root where XXXX is the LED voltage in mV.
To run the program:
and execute by:
The third last argument tells us whether we are running in HG/LG mode.
If there is a VCALIB, the runnumber is not needed.
If you want to use the runnumber, put VCALIB to -1.
The output consist in several files:
TestXXXX.root : contains results related to the quality of the fits
HighSignalXXXX.root: contains all the ADC histograms (for all channels and chips)
Plot_compXXXX.root: contains the fitted histograms and the histograms that satisfy some minimum requirements .
gainfits_XXXX.tsv: text file with the gain values. Five rows: Chip, channel, gain (multigaussian), gain (FFT), errorgain (FFT)
Where XXXX is the LED voltage in mV.
Example of results
Here I show an example of gain fit for channel 29 of chip 7691 for a specific LED voltage of 6000mV, X-axis: ADC ticks and Y-axis: Entries.