Skip to content

Commit 4e2c00e

Browse files
FIT: Publish relative aging histograms
- Add amplitude histograms that are normalized with the amplitudes collected just after the last aging correction
1 parent feb9362 commit 4e2c00e

File tree

5 files changed

+380
-160
lines changed

5 files changed

+380
-160
lines changed

Modules/FIT/FT0/README.md

Lines changed: 106 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,154 +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

1727
---
1828

29+
## Aging monitoring QC tasks
30+
1931
### AgingLaserTask
2032

21-
#### What it does (high level)
33+
The `AgingLaserTask` task collects the raw data from the laser runs.
2234

23-
* Selects laser events in specific bunch crossings (BCs).
24-
* Separately identifies:
35+
**Procedure:**
2536

26-
* detector-channel laser signals,
27-
* reference-channel peak-1 and peak-2 signals (two per laser shot).
28-
* Fills per-channel **amplitude** and **time** histograms, split by ADC where relevant.
29-
* (Optional) Produces a rich set of debug histograms.
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
3043

31-
This task is the *producer* of the raw per-channel spectra used later by post-processing.
44+
This task is the *producer* of the raw per-channel spectra used later in post-processing.
3245

33-
#### Inputs
46+
#### Input
3447

35-
* Digits and channel streams (from workflow config), e.g.
48+
* Digits and channel streams, specified in the config as
3649

37-
```
38-
digits: FT0/DIGITSBC/0
39-
channels: FT0/DIGITSCH/0
50+
```json
51+
"dataSource": {
52+
"type": "direct",
53+
"query": "digits:FT0/DIGITSBC/0;channels:FT0/DIGITSCH/0"
54+
},
4055
```
4156

4257
#### Configuration
4358

44-
Example: `etc/ft0-aging-laser.json`.
45-
46-
| Key | Type | Default | Meaning |
47-
| ------------------------ | -----------: | ----------------: | -------------------------------------------------------------- |
48-
| `detectorChannelIDs` | list `uint8` | all `0–207` | Detector channels to monitor. |
49-
| `referenceChannelIDs` | list `uint8` | `208,209,210,211` | Reference (laser monitor) channels. |
50-
| `detectorAmpCut` | int | `0` | Minimum ADC for detector channels (**currently not applied**). |
51-
| `referenceAmpCut` | int | `100` | Minimum ADC for reference channels (suppress cross-talk). |
52-
| `laserTriggerBCs` | list `int` | `0,1783` | BCs where the laser is triggered. |
53-
| `detectorBCdelay` | int | `131` | BC shift from trigger to detector signal. |
54-
| `referencePeak1BCdelays` | list `int` | `115,115,115,115` | BC shifts for ref. peak-1 (per reference channel). |
55-
| `referencePeak2BCdelays` | list `int` | `136,142,135,141` | BC shifts for ref. peak-2 (per reference channel). |
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 |
5671
| `debug` | bool | `false` | Enable extra (heavy) debug histograms. |
5772

58-
> The BC delays and channel ID ranges are hardware-driven and stable; adjust only if the LCS timing changes.
59-
60-
#### Outputs (Monitor Objects)
73+
> The BC delays and channel ID ranges are stable and set by hardware; adjust only if the LCS changes.
6174
62-
Always produced (names correspond to *amplitude/time vs channel*; all TH2I unless noted):
75+
#### Output
6376

64-
* **Amplitude vs channel**
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) |
6589

66-
* `AmpPerChannel` - used by postprocessing task
67-
* `AmpVsChADC0` - detector + reference, ADC0
68-
* `AmpVsChADC1` - detector + reference, ADC1
69-
* `AmpVsChPeak1ADC0` / `AmpVsChPeak1ADC1` - reference peak-1
70-
* `AmpVsChPeak2ADC0` / `AmpVsChPeak2ADC1` - reference peak-2
71-
* **Time vs channel**
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.
7291
73-
* `TimeVsCh` - detector + reference
74-
* `TimeVsChPeak1` - reference peak-1 (both ADCs)
75-
* `TimeVsChPeak2` - reference peak-2 (both ADCs)
92+
#### TODO
7693

77-
Debug (enabled with `debug=true`; types indicated):
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?
78101

79-
* **Reference-channel 1D spectra (per channel, TH1I)**
80-
amplitude: `mMapDebugHistAmp*` (for all/ADC0/ADC1/peak1/peak2/combos)
81-
time: `mMapDebugHistTimePeak{1,2}*`
82-
* **Time vs channel (TH2I)**: `DebugTimeVsChADC{0,1}`, `DebugTimeVsChPeak{1,2}ADC{0,1}`
83-
* **BC distributions (TH1I)**: `DebugBC*`, split by detector/reference, ADC and with/without amplitude cuts
84-
* **Amplitude vs BC (TH2I)** per reference channel: `mMapDebugHistAmpVsBC*`
85-
86-
> Note: the “time vs BC” debug maps are intentionally disabled in local-batch to avoid ROOT I/O size issues.
87-
88-
---
102+
### AgingLaserPostProcTask
89103

90-
# AgingLaserPostProcTask
104+
The `AgingLaserPostProc` task reads the output from the `AgingLaserTask` and produces output suitable for aging monitoring.
91105

92-
`o2::quality_control_modules::ft0::AgingLaserPostProcTask`
93-
94-
#### Purpose
95-
96-
Reduce the raw per-channel amplitude spectra to **one scalar per channel** representing the **weighted-mean amplitude**, normalized to the reference channels. Output is split into two histograms: A-side (channels 0–95) and C-side (channels 96–207).
97-
98-
#### Inputs
106+
#### Input
99107

100108
* From the QC repository path `FT0/MO/AgingLaser`:
109+
* `AmpPerChannel` (TH2): amplitude (ADC) vs channel
101110

102-
* `AmpPerChannel` (TH2): amplitude (ADC) vs channel, aggregated by the task.
103-
*(If you renamed the source MO, adjust the retrieval in the task config.)*
104-
105-
#### Algorithm (per update)
111+
#### Algorithm
106112

107113
1. **Reference normalization**
108-
109114
* For each configured reference channel:
110-
111-
* Project its slice `AmpPerChannel(ch)``TH1`.
112-
* In `[adcSearchMin, adcSearchMax]` find the maximum `x_max`.
113-
* Fit a Gaussian in `[(1−a)·x_max, (1+b)·x_max]` → mean `μ_ref`.
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`.
114118
* `norm = average(μ_ref)` over all successful fits.
115119
2. **Per-channel value**
116-
117120
* For **every** detector channel:
118-
119121
* Find the global maximum `x_max`.
120122
* In the same fractional window around `x_max`, compute **weighted mean**
121123
`⟨x⟩ = Σ w_i x_i / Σ w_i` with weights `w_i = bin content`.
122124
* Store `value = ⟨x⟩ / norm`.
123-
3. **Publish two TH1F MOs**
124-
125+
* Store `value_corrected = value / value_after_last_aging_correction`
126+
3. **Publish four TH1F MOs**
125127
* `AmpPerChannelNormWeightedMeanA`: 96 bins, channels 0–95.
126128
* `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.
127134

128135
> Tip: when booking the C-side histogram use upper edge **208** (exclusive) with 112 bins to avoid off-by-one bin widths.
129136
130-
#### Configuration (extendedTaskParameters)
137+
#### Configuration
131138

132-
| Key | Type | Default | Meaning |
133-
| --------------------- | -----------: | --------: | ---------------------------------------------- |
134-
| `detectorChannelIDs` | list `uint8` | `0–207` | Detector channels to process (subset allowed). |
135-
| `referenceChannelIDs` | list `uint8` | `208–210` | Reference channels used for normalization. |
136-
| `adcSearchMin` | double | `150` | Lower ADC for reference peak search. |
137-
| `adcSearchMax` | double | `600` | Upper ADC for reference peak search. |
138-
| `fracWindowA` | double | `0.25` | Low fractional window, `a` in `(1−a)·x_max`. |
139-
| `fracWindowB` | double | `0.25` | High fractional window, `b` in `(1+b)·x_max`. |
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 |
140149

141-
#### Output objects (names & types)
150+
#### Output
142151

143-
* `FT0/MO/AgingLaserPostProc/AmpPerChannelNormWeightedMeanA` (TH1F)
144-
* `FT0/MO/AgingLaserPostProc/AmpPerChannelNormWeightedMeanC` (TH1F)
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 |
145160

146-
#### Trending (example)
161+
#### Trending
147162

148-
Having two output MOs, allows us to create two time series, one per side. An example workflow that accomplishes this is in `etc/ft0-aging-laser-postproc.json`.
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).
149164

150165
#### Notes & gotchas
151166

152167
* **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.
153-
* **Reference fits**: if all Gaussian fits fail, the post-proc update exits early and publishes nothing for that cycle.
154-
* **Amplitude cuts**: `detectorAmpCut` is currently not used by the task’s filling logic; if you need a cut in the derived quantity, apply it in post-processing or trending.
168+
* **Reference fits**: if all Gaussian fits fail, the post-processing update exits early and publishes nothing for that cycle.
169+

0 commit comments

Comments
 (0)