Skip to content

Commit 5aa8355

Browse files
[FIT]: [AFIT-37] Add FT0 aging monitoring post-processing (#2620)
* feat: add graph helper * chore: docstring changes * feat: move AmpPerChannel to prod hists in aging * feat: add aging laser post proc task * chore: add example workflow for aging trending * doc: extend README * feat: changes to task config * chore: updated workflow * feat: change custom param config * feat: BC-based approach to ref channel fitting * feat: proper histogram binning * FIT: Publish relative aging histograms - Add amplitude histograms that are normalized with the amplitudes collected just after the last aging correction --------- Co-authored-by: mvishiu11 <jakubmuszynski2103@gmail.com>
1 parent c617feb commit 5aa8355

File tree

9 files changed

+808
-30
lines changed

9 files changed

+808
-30
lines changed

Modules/FIT/FT0/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
add_library(O2QcFT0)
44

55
target_sources(O2QcFT0 PRIVATE src/AgingLaserTask.cxx
6+
src/AgingLaserPostProcTask.cxx
67
src/DigitQcTask.cxx
78
src/GenericCheck.cxx
89
src/CFDEffCheck.cxx
@@ -34,6 +35,7 @@ install(TARGETS O2QcFT0
3435

3536
add_root_dictionary(O2QcFT0
3637
HEADERS include/FT0/AgingLaserTask.h
38+
include/FT0/AgingLaserPostProcTask.h
3739
include/FT0/DigitQcTask.h
3840
include/FT0/PostProcTask.h
3941
include/FT0/CFDEffCheck.h

Modules/FIT/FT0/README.md

Lines changed: 153 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,169 @@
11
# FT0 quality control
22

3-
## Aging monitoring
3+
# Aging monitoring
44

5-
The aging monitoring of FT0 is performed by 1 minute long laser runs that should be launched after each beam dump. A dedicated QC task is analyzing the laser data: `o2::quality_control_modules::ft0::AgingLaserTask`.
5+
_The following documentation consern FT0 aging **monitoring**. Software to deduce the aging **correction** will come later._
66

7-
At the moment the QC task is adapted to the FT0 laser calibration system (LCS) and the monitoring of the FT0 aging. If needed, the task can be generalized to work with other FIT detectors.
7+
The aging monitoring of FT0 is performed by 1 minute long laser runs that are launched after each beam dump.
88

9-
### Monitoring principles
9+
Dedicated QC tasks analyze the data:
10+
11+
- `o2::quality_control_modules::ft0::AgingLaserTask` - raw collection of the data
12+
- `o2::quality_control_modules::ft0::AgingLaserPostProc` - post processing of the data
13+
- `o2::quality_control::postprocessing::SliceTrendingTask` - trending of the post processing data
14+
15+
At the moment, the QC task is adapted to the FT0 laser calibration system (LCS) and the monitoring of the FT0 aging. If needed, the task can be generalized to work with other FIT detectors.
16+
17+
## Monitoring principles
1018

1119
The schematics of the LCS is shown below. Per laser pulse, there will be two signals in each reference channel and one signal in each detector channel. The signals are separated in time by well defined delays, so one can identify them by BC ID.
1220

1321
<img src="images/lcs.png" width="500px">
1422

23+
The basic idea is to monitor the amplitudes seen in the detector during the laser runs. The reference channels don't age and the amplitudes in these are used as a normalization factor for the detector channel amplitudes.
24+
1525
More information about the LCS and the hardware side of the aging monitoring can be found [here](https://indico.cern.ch/event/1229241/contributions/5172798/attachments/2561719/4420583/Ageing-related%20tasks.pdf).
1626

17-
### `AgingLaserTask` configuration
27+
---
28+
29+
## Aging monitoring QC tasks
30+
31+
### AgingLaserTask
32+
33+
The `AgingLaserTask` task collects the raw data from the laser runs.
34+
35+
**Procedure:**
36+
37+
* Selects laser events with specific BC IDs
38+
* Separately identifies:
39+
* detector channel laser signals
40+
* reference channel signals, separating the two signals per laser pulse
41+
* Fills per-channel **amplitude** and **time** histograms, both ADCs together as well as separated by ADC
42+
* (Optional) produces a rich set of debug histograms
43+
44+
This task is the *producer* of the raw per-channel spectra used later in post-processing.
45+
46+
#### Input
47+
48+
* Digits and channel streams, specified in the config as
49+
50+
```json
51+
"dataSource": {
52+
"type": "direct",
53+
"query": "digits:FT0/DIGITSBC/0;channels:FT0/DIGITSCH/0"
54+
},
55+
```
56+
57+
#### Configuration
58+
59+
An example configuration can be found in [etc/ft0-aging-laser.json](https://github.com/AliceO2Group/QualityControl/blob/master/Modules/FIT/FT0/etc/ft0-aging-laser.json). The task parameters are listed in the table below.
60+
61+
| Key | Type | Default | Meaning |
62+
| ------------------------ | -----------: | ----------------: | --------------------------------------------------------------- |
63+
| `detectorChannelIDs` | list `uint8` | | Detector channels to monitor, omit to use all |
64+
| `referenceChannelIDs` | list `uint8` | `208,209,210,211` | Reference channels to monitor |
65+
| `detectorAmpCut` | int | `0` | Minimum amplitude for detector channels (**currently not applied**) |
66+
| `referenceAmpCut` | int | `100` | Minimum amplitude for reference channels (suppress noise cross-talk) |
67+
| `laserTriggerBCs` | list `int` | `0,1783` | BCs where the laser is fired |
68+
| `detectorBCdelay` | int | `131` | BC delay from laser pulse to detector signal |
69+
| `referencePeak1BCdelays` | list `int` | `115,115,115,115` | BC delay from laser pulse to the first reference channel signal |
70+
| `referencePeak2BCdelays` | list `int` | `136,142,135,141` | BC delay from laser pulse to the second reference channel signal |
71+
| `debug` | bool | `false` | Enable extra (heavy) debug histograms. |
72+
73+
> The BC delays and channel ID ranges are stable and set by hardware; adjust only if the LCS changes.
74+
75+
#### Output
76+
77+
| Name | Type | Description |
78+
|--------------------------|------|------------------------------------------------------------------|
79+
| `AmpPerChannel` | TH2I | Amplitude distribution per channel (both ADCs) |
80+
| `AmpPerChannelADC0` | TH2I | Amplitude distribution per channel for ADC0 |
81+
| `AmpPerChannelADC1` | TH2I | Amplitude distribution per channel for ADC1 |
82+
| `AmpPerChannelPeak1ADC0` | TH2I | Amplitude distribution per channel for the first peak with ADC0 |
83+
| `AmpPerChannelPeak1ADC1` | TH2I | Amplitude distribution per channel for the first peak with ADC1 |
84+
| `AmpPerChannelPeak2ADC0` | TH2I | Amplitude distribution per channel for the second peak with ADC0 |
85+
| `AmpPerChannelPeak2ADC1` | TH2I | Amplitude distribution per channel for the second peak with ADC1 |
86+
| `TimePerChannel` | TH2I | Time distribution per channel (both ADCs) |
87+
| `TimePerChannelPeak1` | TH2I | Time distribution per channel for the first peak (both ADCs) |
88+
| `TimePerChannelPeak2` | TH2I | Time distribution per channel for the second peak (both ADCs) |
89+
90+
> A set of debug histograms can be set if the `debug` parameter is set to `true`. See the task header file for the definition of these histograms.
91+
92+
#### TODO
93+
94+
- The MO's should be distinguished by:
95+
- Gain setting (number of ADC channels per MIP)
96+
- In the future we will fetch this from CCDB, but at the moment we pass the value via the QC config.
97+
- The gain could be stored in the MO metadata. This can then be used as we wish in the post processing.
98+
- B field -> We decided not to care about this (???)
99+
- Can be fetched from GRP in CCDB (?)
100+
- Should we have some out-of-bunch checking as part of a LCS sanity check?
101+
102+
### AgingLaserPostProcTask
103+
104+
The `AgingLaserPostProc` task reads the output from the `AgingLaserTask` and produces output suitable for aging monitoring.
105+
106+
#### Input
107+
108+
* From the QC repository path `FT0/MO/AgingLaser`:
109+
* `AmpPerChannel` (TH2): amplitude (ADC) vs channel
110+
111+
#### Algorithm
112+
113+
1. **Reference normalization**
114+
* For each configured reference channel:
115+
* Project its slice amplitude distribtion `AmpPerChannel``TH1`
116+
* Find the maximum `x_max`
117+
* Fit a Gaussian in `[(1−fracWindowLow)·x_max, (1+fracWindowHigh)·x_max]` → mean `μ_ref`.
118+
* `norm = average(μ_ref)` over all successful fits.
119+
2. **Per-channel value**
120+
* For **every** detector channel:
121+
* Find the global maximum `x_max`.
122+
* In the same fractional window around `x_max`, compute **weighted mean**
123+
`⟨x⟩ = Σ w_i x_i / Σ w_i` with weights `w_i = bin content`.
124+
* Store `value = ⟨x⟩ / norm`.
125+
* Store `value_corrected = value / value_after_last_aging_correction`
126+
3. **Publish four TH1F MOs**
127+
* `AmpPerChannelNormWeightedMeanA`: 96 bins, channels 0–95.
128+
* `AmpPerChannelNormWeightedMeanC`: 112 bins, channels 96–207.
129+
* `AmpPerChannelNormWeightedMeanCorrectedA`: 96 bins, channels 0–95. Normalized with amplitudes from the last aging correction.
130+
* `AmpPerChannelNormWeightedMeanCorrectedC`: 112 bins, channels 96–207. Normalized with amplitudes from the last aging correction.
131+
4. **In case of a "reset" run - publish two more TH1F MOs**
132+
* `AmpPerChannelNormWeightedMeanAfterLastCorrectionA`: 96 bins, channels 0–95. Used as normalization to deduce relative aging since last aging correction.
133+
* `AmpPerChannelNormWeightedMeanAfterLastCorrectionC`: 112 bins, channels 96–207. Used as normalization to deduce relative aging since last aging correction.
134+
135+
> Tip: when booking the C-side histogram use upper edge **208** (exclusive) with 112 bins to avoid off-by-one bin widths.
136+
137+
#### Configuration
138+
139+
| Key | Type | Default | Meaning |
140+
|--------------------------|--------------:|----------------------------:|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
141+
| `reset` | bool | false | To be set true (only) on the scans following aging corrections. The amplitudes are stored in an additional path, and are used for normalization in following laser scans. |
142+
| `useDeadChannelMap` | bool | true | If true, channels marked dead in the dead channel map are not processed |
143+
| `ignoreDetectorChannels` | list `uint_8` | | Detector channels to ignore |
144+
| `ignoreRefChannels` | list `uint8` | | Reference channels to ignore |
145+
| `fracWindowLow` | double | `0.25` | Low fractional window for the Gaussian fits |
146+
| `fracWindowHigh` | double | `0.25` | High fractional window for the Gaussian fits |
147+
| `agingLaserTaskPath` | string | `FT0/MO/AgingLaser` | Path to the AgingLaser task output in QCDB |
148+
| `agingLaserPostProcPath` | string | `FT0/MO/AgingLaserPostProc` | Path to the AgingLaserPostProc task output in QCDB |
149+
150+
#### Output
151+
152+
| Name | Type | Description |
153+
| ---- | ---- | ----------- |
154+
| `AmpPerChannelNormWeightedMeanA` | TH1F | Weighted means of A-side amplitudes normalized with reference channel amplitudes |
155+
| `AmpPerChannelNormWeightedMeanC` | TH1F | Weighted means of C-side amplitudes normalized with reference channel amplitudes |
156+
| `AmpPerChannelNormWeightedMeanCorrectedA` | TH1F | AmpPerChannelNormWeightedMeanA normalized with the same values from last aging correction |
157+
| `AmpPerChannelNormWeightedMeanCorrectedC` | TH1F | AmpPerChannelNormWeightedMeanC normalized with the same values from last aging correction |
158+
| `AmpPerChannelNormWeightedMeanAfterLastCorrectionA` | TH1F | AmpPerChannelNormWeightedMeanA from the last aging correction |
159+
| `AmpPerChannelNormWeightedMeanAfterLastCorrectionC` | TH1F | AmpPerChannelNormWeightedMeanC from the last aging correction |
160+
161+
#### Trending
18162

19-
An example configuration can be found in `etc/ft0-aging-laser.json`. The task parameters are:
163+
Having four output MOs from the `AgingLaserPostProcTask`, allows us to create four time series, one per side. An example QC configuration that accomplishes this is in [`etc/ft0-aging-laser-postproc.json`](https://github.com/AliceO2Group/QualityControl/blob/master/Modules/FIT/FT0/etc/ft0-aging-laser-postproc.json).
20164

21-
- `detectorChannelIDs`: list of detector channels to be monitored. Omit this parameter to use all.
22-
- `referenceChannelIDs`: the reference channel IDs, should be: "208, 209, 210, 211".
23-
- `detectorAmpCut`: Lower cut on the detector amplitude in ADC ch, default "0". **TODO**: this has no effect at the moment.
24-
- `referenceAmpCut`: Lower cut on the reference channel amplitude in ADC ch to ignore cross talk, default "100".
25-
- `laserTriggerBCs`: list of BCs when the laser fires, should be "0, 1783".
26-
- `detectorBCdelay`: amount of BCs after the laser trigger BCs when the laser pulse is expected in the detector, should be "131".
27-
- `referencePeak1BCdelays`: amount of BCs after the laser trigger BCs when the first laser pulse is expected in the reference channels, should be "115, 115, 115, 115". One value per reference channel, even though they will be the same with the current LCS setup.
28-
- `referencePeak2BCdelays`: amount of BCs after the laser trigger BCs when the second laser pulse is expected in the reference channels, should be "136, 142, 135, 141". One value per reference channel.
29-
- `debug`: If true, an additional set of plots can be produced for debugging purposes, default "false".
165+
#### Notes & gotchas
30166

31-
The channel ID and BC values delays are rather fixed and should not change unless the LCS changes significantly.
167+
* **Off-by-one binning (C side)**: for channels `96–207` you need **112 bins** and an **exclusive** upper edge at `208`. Using `207` with 112 bins yields non-unit bin width and will trip histogram helpers.
168+
* **Reference fits**: if all Gaussian fits fail, the post-processing update exits early and publishes nothing for that cycle.
32169

33-
**TODO**: should we apply the amplitude cuts in the SliceTrendingTask instead?

0 commit comments

Comments
 (0)