Skip to content

Add study of trigphase window for MIP measurement + plot tools

Izaak Neutelings requested to merge trigphase_study into master

TrigPhase study

This PR adds a new HGCALTrigTimeAnalysis.py script. The main purpose is to study the behavior of the signal pulse inside the trigger time window, in order to understand its stability and optimize/finetune the HGCALMIPScaleAnalysis.findBestTrigTimePerChannel algorithm that finds a trigphase window [tpmin,tpmax] to get a MIP signal that has enough statistics for the fit and is unbiased.

The HGCALTrigTimeAnalysis class/script is a subclass of HGCALMIPScaleAnalysis, because it relies on the output of the same histofiller (namely, the 3D histogram en of energy vs. trigphase vs. channel). The main analyze function is based on HGCALMIPScaleAnalysis.findBestTrigTimePerChannel, inserting a bunch of histograms & graphs to study the behavior of the pulse and algorithm.

Output

For each Relay, the output if the modules is collected in a single ROOT file for convenience. Some interactive examples are shown on CERNBox: https://cernbox.cern.ch/s/CCI0l3ZJ1MVNivC

The content includes 1D, 2D histograms vs. channel index or trigphase:

  • noise threshold (Emin = loc + krms*rms),
  • mean energy;
  • profile of the energy (averaged over channels or trigphase);
  • the limits of the automatically chosen trigphase window (tpmin & tpmax), which depends on choice of krms and maxDrop, and is automatically computed for each channel separately;
  • "error code": 1/2=empty, 3=no mean, 4=no window;
  • a plot subdirectory with wafer/hex plots;
  • ...

Note the tags:

  • _Ecut means that only a noise threshold, i.e. lower cut on energy, Emin, is applied.
  • _tpcut means that the automatically recognized triggerphase window is applied, such that only energy hits within this window is included. Note this window is different for each channel. Comparison of the intervals is shown below.

Scherm_afbeelding_2024-11-20_om_23.16.26 Scherm_afbeelding_2024-11-20_om_23.15.55 Scherm_afbeelding_2024-11-20_om_23.38.34 Scherm_afbeelding_2024-11-20_om_23.38.15

Plots

The new plotTrigTime.py script collects the output of different modules/relays and compares them in various ways. Some examples of the the energy profile (averaged over changels) vs. trigphase are shown below:

Sometimes the profiles are much lower or higher, so to compare the profile shape (the important thing for computation of the trigphase window), the plots are also normalized (_norm in the name, or y-axis with ymax<0.1).

Scherm_afbeelding_2024-11-20_om_23.17.12 Scherm_afbeelding_2024-11-20_om_23.17.37 Scherm_afbeelding_2024-11-20_om_23.18.12

Update to HGCALMIPScaleAnalysis

Based on the first quick studies of the trigphase window, I also propose some a small tweaks to the HGCALMIPScaleAnalysis to gain a better signal:

  1. It would be better to apply an upper cut on energy (Emax) when computing the noise mean (loc) and RMS (rms), to prevent the noise threshold (Emin cut) to be biased to larger values.
  2. Change hardcoded default krms=2 to krms=4. Too low (krms<=3), and the signal is drowned by the gaussian tails of the noise. Too large (krms>=5), you cut away part of the signal, and it seems to flatten the pulse shape (profile of the energy averaged of channels), because the averages in the tails get biased to larger values.
  3. We need to study the default maxDrop=0.95. It can probably be loosened in order to gain more signal, at the small cost of biasing the MPV of the MIP Landau.
  4. [EDIT]: We should exclude the first default bin with trigphase<1, which sometimes has the maximum mean, and can be picked up as the lower limit tpmin of the trigger window.

This PR include (1) and (2) already, plus some small tweaks to HGCALMIPScaleAnalysis.findBestTrigTimePerChannel.

Plotting tools

This PR also

  1. separates the plotly tools from python/plot/wafer.py to python/plot/wafer_plotly.py to avoid compatibility issues;
  2. add more general ROOT plotting tools in python/plot/utils.py to extract/style/create histograms, or compare them in plots (as shown above).

Instructions

To run is quite fast. Simply do:

python3 scripts/HGCALTrigTimeAnalysis.py -r $r -i /eos/cms/store/group/dpg_hgcal/tb_hgcal/2024/hgcalrd/SepTB2024/ --skipHistoFiller --krms 5 --doHexPlots

# many runs
for r in 1726347199 1726518879 1726593188 1726954855 1727132796 1727204018 1727206292; do python3 scripts/HGCALTrigTimeAnalysis.py -r $r -i /eos/cms/store/group/dpg_hgcal/tb_hgcal/2024/hgcalrd/SepTB2024/ --skipHistoFiller --krms 4 --doHexPlots; done

To create plots:

python3 scripts/plotTrigTime.py

See -h for more options.

Edited by Izaak Neutelings

Merge request reports

Loading