MIP calibration

In order to have a first calibration of each cell/tile within the calorimeter to the same physical level, a MIP (minimum ionizing particle) calibration needs to be performed. This ideally is done using cosmic or beam muons. On average a muon will leave the same amount of energy in each tile. However, these values are not discrete but rather follow a Landau-Gauss distribution, where the maximum of that distribution reflects the "MIP"-scale. By estimating the MIP scale on a channel by channel basis, small differences in the response of the SiPM, coupling of the Tile to the SiPM, losses ... can be corrected for and a uniform response for each tile can be reached. Using the mip scale also data among different readout systems can be compared as each of them afterwards can be expressed in mip/tile energy for instance.

When we are taking taking data we are reading out every channel for every event, regardless whether the channel was hit by a particle or not (meaning w/o zero or pedestal suppression). This can introduc some difficulties for the our fitting algorithms, as the pedestal peak could be larger in amplitude than the actual signal distribution one is after. In order to still allow automized fitting to some degree for the MIP calibration at different Vop, we devised a local muon trigger strategy. For this we are using the fact that a muon on average will always leave approximately the same signal in every tile (a minimum ionizing signal), hence we can use adjacent tiles to trigger on the average mip response in for instance the 2 tiles before and the two tiles after the tile one is currently investigating.


General MIP-Calibration steps

Transferring the pedestal calibrations to a different run

The extraction of the MIP scale is a somewhat iterative process, as it get easier the cleaner your sample is, meaning if the pedestal (with its additional noise) is very close to the actual MIP peak its getting more difficult to fit the MIP-peak correctly in an automated fashion. Thus ideally the pedestal calibration (where it is & how wide it is) are taken from dedicated runs which have no other signals in them. As described in the section Pedestal extraction. The corresponding calibration obtained like that can then be applied to the muon or cosmics run as follows:

The calibration file obtained from a different run PedestalCalib_$RUNNR1.root is being applied to the input file raw_$RUNNR2.root. As before the data is then copied in full to a separate output file (rawPed_$RUNNR2.root ) together with the calib-object from the provided calibration file. To check the correct application of the file several QA plots are produced.

The calibration object can be printed to an external text file using the option -a, which will write the calib-object to a file with the same name as defined in -o, but ending in _calib.txt.

It is also possible to overwrite the calibration which is being loaded from PedestalCalib_$RUNNR1.root by adding the option -A $EXTCALIB.txt and providing a text file of that name in the same format as the output of the -a option.

During the transfer of the pedestal calibrations it is also possible to either evaluate the bad channels or apply an external bad channel map.

An example of such a bad channel map and its format can be found herearrow-up-right

The various BC flags are encoded as follows:

  • 0: bad

  • 1: always lower mip

  • 2: sometimes lower mip

  • 3: good

All channels not listed in the BC map will be assumed to be good and the calib-object created accordingly. Please read what is written printed as info in the shell during execution this is normally useful and will give you an idea whether things are running correctly. If a bad channel map was supposed to be calculated or has been provided the following plot will be created.

Bad channel map: red (3): good channels, yellow (2): semi-good channels, light blue (1): mostly bad channels, dark blue (0): dead channel.

The option -e allows you to force the executable to draw more plots for your information, like the individual spectra of each channel per layer.

CAEN HG spectra for layer 11.
CAEN HG spectra for layer 17. Different shades of gray indicate different Bad Channel flags (the darker the worse).
CAEN LG spectra for layer 11.
CAEN LG spectra for layer 17. Different shades of gray indicate different Bad Channel flags (the darker the worse).

The original data per tile & event will not be modified in this process, it is a true copy process. The corresponding routine being executed can be found here:

bool Analyses::TransferCalib(void) in Analyses.ccarrow-up-right.

If your muon runs were for instance done with multiple positions of the beam and you plan to apply the same pedestals to them you can simply hadd the raw files and afterwards run the calibration transfer, i.e.:

HGCROC specific handling

For the HGCROC-data the calibration transfer is handled a little bit differently as the raw waveforms are being reevaluated in this step.

During this transfer process the pedestal values of the waveforms are reset with the following priority:

Afterwards the IntegratedADC value is also reevaluted. In the current version no true waveform fit is being performed but rather the maximum ADC out of all samples is taken as ADC value from here-on out.

Additional QA plots are also produced to ascertain the correct application of the pedestal values and visualize the ADC-waveforms as function of number of samples. Such plots are produced for two cases a) without any selections or b) if the ToA of the corresponding channel was larger than 0 . The ToA for the 2025 data taking campaign was configured such that it should have fired slightly below the average mip signal. Either of these plots are however only produced if any of the extended plotting options is enabled.

Waveform representation as obtained from the TransferCalib running. No event or signal selection criteria are applied.
Waveform representation as obtained from the TransferCalib running for waveforms which have a non-zero ToA.

Moreover, the correction for the TOA offset is performed if the option -G $TOAOFFSETFILE is used. With the $TOAOFFSETFILE=../configs/TB2025/ToAOffsets_TB2025_HadRun.csv for instance. How to generate that offset file is described in the TOA phase extraction section. In order to check that this correction has been applied additional plots vs TOA as well as waveforms per asic half are generated.

These plots show the corrected distributions of what has been previous shown in TOA phase extraction section. Clearly highlighting the improved understanding of the data. Moreover, the linearized TOA distribution before and after correction is shown expressed in ns. In order to do so an average time resolution of 25./1024 ns is assumed.

Uncorrected linearized TOA in ns.
Corrected linearized TOA in ns.

This TOA correction is necessary should we ever want to perform a more sophisticated waveform fit or correction, besides the maximum ADC evaluation.


Estimation of MIP scale for a single run

Step 1

The estimation of the mip scale can be an iterative process, the first step towards a correct mip-calibration object can be executed as follows:

This should ideally be done on using a $rawPedWBC_$RUNNR.root file which already contains the flagging for the bad channels in order to reduce the amount of time fitting channels which are dead or not fully working. In addition to the defined output file it also produces a rather extensive histogram output file, named as usual by the same name ending in _hists.root. The option -s is the primary trigger to start the estimation of the mip-scale for each cell. It is implemented in:

bool Analyses::GetScaling(void) in Analyses.ccarrow-up-right.

This function processes the full event tree twice and tries to fit the MIP peak in two different versions. In the first iteration over the data for each cell a histogram is filled for both HG and LG without any kind of trigger selection correcting the ADC values for their respective pedestal values. When running over HGCROC data currently only one of the two is filled, the HG-ADC, which is equivalent to the lower energy range of the HGCROC readout. The higher energy equivalent of the HGCROC data cannot calibrated using mips.

Afterwards a Landau-Gauss-function is fit to every HG-spectrum (CAEN) & ADC-spectrum (HGCROC data) and if the fit succeeds a first value for the maximum of the Landau-Gauss as well as its width is stored in the calibration object which is read from the input file. Should the fit fail for instance because the pedestal (noise) peak is too large or too close, no values are stored in the calib-objects. Overview plots showing the respective values during the first iteration are also generated

FWHM of the fits of the Landau-Gauss distribution, after the first iteration.
Gaussian sigma of the Landau-Gauss distribution, after the first iteration.
Most probable value of the Landau distribution after the first iteration.
Width of the Landau distribution, after the first iteration.
Maximum of the Landau-Gauss distribution after the first iteration. White "bin" indicate fit failures in the first iteration. The average value for all channels is given in the top left corner (<MaxHG> = 214).

In addition the linear relation between the LG & HG is evaluated and its slope stored in the calibration objects for the CAEN processing case.

LG-HG correlation for each cell in layer 0 for cross-calibration of the two read-out scales.
Summary plot of the slope of the HG-LG correlation.
Summary plot of the slope of the LG-HG correlation

In the second part of the routine the data tree is processed once more now knowing for a significant fraction of the tiles how LG and HG are related as well as what the average MIP position ought to be.

Using this information local trigger primitives are being calculated. Taking into account the signals in n layers before and after the current cell (same row & column, different layer). The basis for the trigger primitive calculation can be found here:

double CalculateLocalMuonTrigg(Calib, TRandom3*, int, int, double) in Event.ccarrow-up-right

It combines the information based on the ADC value in the HG (low energy) and LG (high energy) and forming a combined average signal of n*2 tiles in a row. The tile under investigation is then flagged as local muon triggered tile if facMin*avMIP < ADC HG < facMax*avMIP. A rather loose selection is done in this step as potentially the avMIP is still biased, if not all channels could be fit reliably in the first iteration. For the 2024 CAEN data the respective factors are:

This suppresses the pedestal peak by a rather large amount and allows for a more stable fitting of the mip-peaks for the correspondingly selected tile-events. While leaving the mip-signal region largely undisturbed.

Number of local muon triggers in each tile, total number of events collectd in the run shown in the top left corner.
Suppression of the pedestal peak around 0.
Suppresion of the signal peak in the signal region.
Trigger primitive distribution for the cells in layer 9, shaded area indicates muon triggered events.

The evaluated trigger primitives are stored in the new output for event and tile, allowing to reevalulate the trigger in subsequent iterations with stricter selection criteria.

The corresponding HG and LG spectra for the locally muon triggered events are then fitted again with a Landau-Gauss function and if successful the corresponding calibration values are updated.

HG spectra for all events (blue) and locally muon triggered events (red) together with the fitted Landau-Gauss function in case the fit did not fail. Fits are displayed in either dark blue (fit of muon triggered failed, but full distribution succeeded) or in dark red (fit of muon triggered succeeded).

As the selection of the triggers is rather course still the fits might still not perfectly describe the mip-signal region. This particularly applies for tiles which the beam wasn't directly pointing at (edges). The same monitoring plots for the fit parameters are created in the 2nd iteration as well and the equivalent LG plots as well.

Maximum of the Landau-Gauss distribution for the HG signal after the first iteration. White "bins" indicate fit failures in the first iteration. The average value for all channels is given in the top left corner (222.4)
Maximum of the Landau-Gauss distribution for the LG signal after the second iteration. White "bin" indicate fit failures in the first iteration. The average value for all channels is given in the top left corner (16.6)

The respective fitting routines for the Landau-Gauss functions can be found in

in TileSpecta.ccarrow-up-right.

The same evalulation steps are performed in case of the HGCROC data processing, however only the low energy equivalent is being fitted (ADC). Hence no cross-correlations are being evaluated between ADC and TOT. The relevant calibration parameter stored for the MIP scale is the ScaleH and its width ScaleWidthH .

Step 2

The second step relies on the output objects of Step 1 (which include the trigger primitives for each cell). It can be started as follows:

This file again will copy each time the original data tree from rawPedAndMuonWBC_$RUNNR.root and updates the calib objects which are provided in the same file, writing the original data tree and new calib object to rawPedAndMuonWBCImp_$RUNNR.root.

It follows the same procedure as the second part of step 1, basing trigger selection criteria on the inputed calib objects and their respective average mip scale, however the minimum and maximum factors for the trigger selection are significantly tightened. For the 2024 data the respective factors are:

This allows for a significantly better noise suppression and thus easier fitting.

The detailed implementation can be found in:

bool Analyses::GetImprovedScaling(void) in Analyses.ccarrow-up-right.

The step 2 can be repeated as often as necessary on the output created in the previous iteration of step 2, until the fitting converges for a maximum of cells.

As the data of the HGCROC max ADC values fluctates on a bin-by-bin basis more than it physically should a constant 10% systematic uncertainty is added to each bin in order to allow the Landau-Gauss fits to converge. The reason for the unphysical fluctuations is still under investigation.

To ease this judgement the following lines can be found in the shell output:

Indicating the average mip values for HG and LG before and after the current iteration as well as the calibratable channels. If the before and after are close enough it can be assumed that the fitting cannot be improved without manual intervention. In case of HGCROC data processing no LG mip range is available hence that value will be 0 or nan and does not need to be taking into account.

Otherwise a very similar set of plots is produced as for the second part of Step 1, which should be looked at in detail to ensure good quality of fits.


CAEN data

September 2023 data

No scripts have been created yet.

October 2023 data

No scripts have been created yet.

August 2024 data

The primary script for the muon calibration of this data set is as for the pedestal runCalibration_2024.sh, in order to obtain the calibrations for a specific scan the following commands need to be executed in order. The next command should only be executed if the outputs of the previous step have been checked.

Please have a look which options for the 2nd argument are available to select different data sets.


HGCROC Data

August 2024

A starting point for the calibration of the 2024 HGCROC data has been assembled in the follwing scripts, however running it needs to be taken with care as there were significant difficulties during the data taking and hence the data interpretation is not as straightforward.

Either option calibMuon or calibMuonT (truncated) shoud be used.

November 2025

A comprehensive calibration script for the 2025 has been prepared and can be run in the same manner as for the pedestals. Feel free to comment in the relevant runs, which you would like to analyze.

After successfully calibrating the data using the scripts above and following the steps until no significant change in the average HG mip can be seen anymore you can create a much smaller copy of the calibration file only by using the script stripCalib_2025.sh . As with all the others make sure your username and data location are added and then uncomment the data set you need with the correct iteration output. Feel free to update with your favorite options, if needed.

Last updated