Skip to content

Commit 4079d7a

Browse files
authored
Merge pull request #324 from altsybee/master
update of event selection docs - TF & ROF border cuts, etc.
2 parents 9950d14 + 7993c08 commit 4079d7a

File tree

1 file changed

+145
-42
lines changed

1 file changed

+145
-42
lines changed

docs/analysis-tools/EventSelection.md

Lines changed: 145 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The timestamp task is needed to fill the table with timestamps. Timestamp contai
1111

1212
Since the Timestamps table has an entry per bunch crossing it can be joined with table BC. The join is defined by o2::aod::BCsWithTimestamps (see list of defined [joins and iterators](https://aliceo2group.github.io/analysis-framework/docs/datamodel/joinsAndIterators.html#list-of-joins-and-iterators)).
1313

14-
## Event selection
14+
## Event selection basics
1515

1616
Table of contents:
1717

@@ -94,7 +94,7 @@ In general, one has to follow the following steps:
9494
}
9595
```
9696
97-
Note that sel8 selection based on FT0A & FT0C requirement is not mandatory in Run 3 pilot beam data. It might be safer to work with unbiased sample.
97+
The `sel8` event selection bit is a logical _and_ between the `kIsTriggerTVX` bit (based on FT0A & FT0C requirement, with time-based constraints on the vertex position), and (since April 2024) `kNoTimeFrameBorder` and `kNoITSROFrameBorder` bits - see [below](#integration-into-event-selection).
9898
9999
* run your tasks in stack with timestamp and event-selection tasks:
100100
@@ -161,42 +161,58 @@ Full list of event selection criteria can be found in [`Common/CCDB/EventSelecti
161161
162162
``` c++
163163
enum EventSelectionFlags {
164-
kIsBBV0A = 0, // cell-averaged time in V0A in beam-beam window
165-
kIsBBV0C, // cell-averaged time in V0C in beam-beam window (for Run 2 only)
166-
kIsBBFDA, // cell-averaged time in FDA (or AD in Run2) in beam-beam window
167-
kIsBBFDC, // cell-averaged time in FDC (or AD in Run2) in beam-beam window
168-
kIsBBT0A, // cell-averaged time in T0A in beam-beam window
169-
kIsBBT0C, // cell-averaged time in T0C in beam-beam window
170-
kNoBGV0A, // cell-averaged time in V0A in beam-gas window
171-
kNoBGV0C, // cell-averaged time in V0C in beam-gas window (for Run 2 only)
172-
kNoBGFDA, // cell-averaged time in FDA (AD in Run2) in beam-gas window
173-
kNoBGFDC, // cell-averaged time in FDC (AD in Run2) in beam-gas window
174-
kNoBGT0A, // cell-averaged time in T0A in beam-gas window
175-
kNoBGT0C, // cell-averaged time in T0C in beam-gas window
176-
kIsBBZNA, // time in common ZNA channel in beam-beam window
177-
kIsBBZNC, // time in common ZNC channel in beam-beam window
178-
kIsBBZAC, // time in ZNA and ZNC in beam-beam window - circular cut in ZNA-ZNC plane
179-
kNoBGZNA, // time in common ZNA channel is outside of beam-gas window
180-
kNoBGZNC, // time in common ZNC channel is outside of beam-gas window
181-
kNoV0MOnVsOfPileup, // no out-of-bunch pileup according to online-vs-offline VOM correlation
182-
kNoSPDOnVsOfPileup, // no out-of-bunch pileup according to online-vs-offline SPD correlation
183-
kNoV0Casymmetry, // no beam-gas according to correlation of V0C multiplicities in V0C3 and V0C012
184-
kIsGoodTimeRange, // good time range
185-
kNoIncompleteDAQ, // complete event according to DAQ flags
186-
kNoTPCLaserWarmUp, // no TPC laser warm-up event (used in Run 1)
187-
kNoTPCHVdip, // no TPC HV dip
188-
kNoPileupFromSPD, // no pileup according to SPD vertexer
189-
kNoV0PFPileup, // no out-of-bunch pileup according to V0 past-future info
190-
kNoSPDClsVsTklBG, // no beam-gas according to cluster-vs-tracklet correlation
191-
kNoV0C012vsTklBG, // no beam-gas according to V0C012-vs-tracklet correlation
192-
kNoInconsistentVtx, // no inconsistency in SPD and Track vertices
193-
kNoPileupInMultBins, // no pileup according to multiplicity-differential pileup checks
194-
kNoPileupMV, // no pileup according to multi-vertexer
195-
kNoPileupTPC, // no pileup in TPC
196-
kIsTriggerTVX, // FT0 vertex (acceptable FT0C-FT0A time difference) at trigger level
197-
kIsINT1, // SPDGFO >= 1 || V0A || V0C
198-
kNsel // counter
199-
};
164+
kIsBBV0A = 0, // cell-averaged time in V0A in beam-beam window
165+
kIsBBV0C, // cell-averaged time in V0C in beam-beam window (for Run 2 only)
166+
kIsBBFDA, // cell-averaged time in FDA (or AD in Run2) in beam-beam window
167+
kIsBBFDC, // cell-averaged time in FDC (or AD in Run2) in beam-beam window
168+
kIsBBT0A, // cell-averaged time in T0A in beam-beam window
169+
kIsBBT0C, // cell-averaged time in T0C in beam-beam window
170+
kNoBGV0A, // cell-averaged time in V0A in beam-gas window
171+
kNoBGV0C, // cell-averaged time in V0C in beam-gas window (for Run 2 only)
172+
kNoBGFDA, // cell-averaged time in FDA (AD in Run2) in beam-gas window
173+
kNoBGFDC, // cell-averaged time in FDC (AD in Run2) in beam-gas window
174+
kNoBGT0A, // cell-averaged time in T0A in beam-gas window
175+
kNoBGT0C, // cell-averaged time in T0C in beam-gas window
176+
kIsBBZNA, // time in common ZNA channel in beam-beam window
177+
kIsBBZNC, // time in common ZNC channel in beam-beam window
178+
kIsBBZAC, // time in ZNA and ZNC in beam-beam window - circular cut in ZNA-ZNC plane
179+
kNoBGZNA, // time in common ZNA channel is outside of beam-gas window
180+
kNoBGZNC, // time in common ZNC channel is outside of beam-gas window
181+
kNoV0MOnVsOfPileup, // no out-of-bunch pileup according to online-vs-offline VOM correlation
182+
kNoSPDOnVsOfPileup, // no out-of-bunch pileup according to online-vs-offline SPD correlation
183+
kNoV0Casymmetry, // no beam-gas according to correlation of V0C multiplicities in V0C3 and V0C012
184+
kIsGoodTimeRange, // good time range
185+
kNoIncompleteDAQ, // complete event according to DAQ flags
186+
kNoTPCLaserWarmUp, // no TPC laser warm-up event (used in Run 1)
187+
kNoTPCHVdip, // no TPC HV dip
188+
kNoPileupFromSPD, // no pileup according to SPD vertexer
189+
kNoV0PFPileup, // no out-of-bunch pileup according to V0 past-future info
190+
kNoSPDClsVsTklBG, // no beam-gas according to cluster-vs-tracklet correlation
191+
kNoV0C012vsTklBG, // no beam-gas according to V0C012-vs-tracklet correlation
192+
kNoInconsistentVtx, // no inconsistency in SPD and Track vertices
193+
kNoPileupInMultBins, // no pileup according to multiplicity-differential pileup checks
194+
kNoPileupMV, // no pileup according to multi-vertexer
195+
kNoPileupTPC, // no pileup in TPC
196+
kIsTriggerTVX, // FT0 vertex (acceptable FT0C-FT0A time difference) at trigger level
197+
kIsINT1, // SPDGFO >= 1 || V0A || V0C
198+
kNoITSROFrameBorder, // bunch crossing is far from ITS RO Frame border
199+
kNoTimeFrameBorder, // bunch crossing is far from Time Frame borders
200+
kNoSameBunchPileup, // reject collisions in case of pileup with another collision in the same foundBC
201+
kIsGoodZvtxFT0vsPV, // small difference between z-vertex from PV and from FT0
202+
kIsVertexITSTPC, // at least one ITS-TPC track (reject vertices built from ITS-only tracks)
203+
kIsVertexTOFmatched, // at least one of vertex contributors is matched to TOF
204+
kIsVertexTRDmatched, // at least one of vertex contributors is matched to TRD
205+
kNoCollInTimeRangeNarrow, // no other collisions in specified time range (narrower than Strict)
206+
kNoCollInTimeRangeStrict, // no other collisions in specified time range
207+
kNoCollInTimeRangeStandard, // no other collisions in specified time range with per-collision multiplicity above threshold
208+
kNoCollInRofStrict, // no other collisions in this Readout Frame
209+
kNoCollInRofStandard, // no other collisions in this Readout Frame with per-collision multiplicity above threshold
210+
kNoHighMultCollInPrevRof, // veto an event if FT0C amplitude in previous ITS ROF is above threshold
211+
kIsGoodITSLayer3, // number of inactive chips on ITS layer 3 is below maximum allowed value
212+
kIsGoodITSLayer0123, // numbers of inactive chips on ITS layers 0-3 are below maximum allowed values
213+
kIsGoodITSLayersAll, // numbers of inactive chips on all ITS layers are below maximum allowed values
214+
kNsel // counter
215+
}; // (as of October 2025)
200216
```
201217
202218
Technically there are three types of criteria:
@@ -367,10 +383,59 @@ One can set other configurables in the json file. This json file has to be provi
367383
* EvSel table might be also useful in user tasks relying on beam-beam and beam-gas decisions in forward detectors, e.g. in UPC tasks.
368384
369385
386+
## Time Frame and ITS ROF border cuts
387+
388+
### Time Frame borders
389+
390+
In Run 3 and 4, ALICE operates in **continuous readout mode**, where data are stored in **Time Frames (TFs)** that correspond to 32 LHC orbits, ≈ 2.9 ms (_note:_ in 2022 pp TFs were longer - 128 LHC orbits), and each TF is **reconstructed independently**.
391+
392+
Because the drift time of electrions in the TPC is **≈ 100 μs**, collisions near the end of a TF **lack full information**, resulting in a depletion of vertex contributors and a drop in ITS+TPC tracking efficiency during the last ≈ 1.1 LHC orbits of the TF (LHC orbit is ≈89 μs).
393+
Additional effect happens at the **beginning of the next TF**, when the reconstruction starts when the electrons from pre-TF collisions are still drifting.
394+
395+
**Mitigation in event selection**:
396+
- A dedicated event-selection bit `kNoTimeFrameBorder` was introduced (February 2024) to reject events close to TF edges:
397+
- Cuts ≈ **300 bunch crossings (BCs)** at the start and ≈ **4000 BCs** at the end of each TF.
398+
- Corresponds to ≈ **3.7% event loss** for 2023–25 data.
399+
- This cut ensures full TPC drift information for all accepted events, removing TF-edge artefacts in vertex and track distributions.
400+
- Usage in analysis:
401+
``` c++
402+
if (col.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { /* do analysis */ }
403+
```
404+
405+
406+
### ITS Readout Frame borders
407+
408+
- Although the global readout is continuous, the ITS2 detector is read out in **discrete Readout Frames (ROFs)**:
409+
- in **pp:** 18 ROFs per LHC orbit, each ≈ 5 μs (198 BCs)
410+
- in **Pb–Pb:** 6 ROFs per orbit, ≈ 15 μs each (594 BCs)
411+
- Cluster losses occur at ROF boundaries due to the **ALPIDE chip’s time-walk effect**:
412+
- hits from an interaction in ROF *i* may appear only in ROF *i + 1*
413+
- this causes a sharp drop in ITS cluster and track counts at ROF edges.
414+
- The effect is **particle-dependent**, e.g. protons (larger dE/dx) are recorded earlier than pions—leading to small PID-dependent distortions near borders.
415+
416+
**Mitigation in event selection**
417+
- The selection bit `kNoITSROFrameBorder` rejects events near ITS ROF edges:
418+
- removes collisions within **10 BCs** at the beginning and **20 BCs** at the end of each ROF
419+
- it correponds to ≈ 15 % of BCs in pp and ≈5 % of BCs in Pb–Pb (corresponding event losses depend on the LHC filling scheme)
420+
- Usage in analysis:
421+
``` c++
422+
if (col.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { /* do analysis */ }
423+
```
424+
- Note that this cut also helps to remove collisions at the ROF borders in the MFT detector (where the same chips as in the ITS are used, and ROFs in the MFT are aligned in time to the ITS ROFs).
425+
426+
More details on the TF and ROF border effects and cuts can be found e.g. in slides 2-17 of [presentation (November 2024)](https://indico.cern.ch/event/1453901/timetable/#6-event-selection-in-run3).
427+
428+
429+
430+
### Integration into event selection
431+
- Since April 2024, both the **Time Frame border** and **ITS Readout Frame border** cuts are combined with the ``kIsTriggerTVX`` condition via logical _and_ in the `sel8` event-selection bit, ensuring events used for analysis are free from TF and ROF boundary artifacts.
432+
433+
434+
370435
371436
## Occupancy estimation
372437
373-
In ALICE Run 3 Pb–Pb collisions, **occupancy** in the TPC refers to the contamination of an event’s TPC clusters by signals from other nearby collisions within the TPC drift time window.
438+
In ALICE Run 3 Pb–Pb collisions, **occupancy effects** in the TPC refer to the deterioration of the quality of an event’s TPC clusters by signals from other nearby collisions within the TPC drift time window.
374439
375440
- The TPC has a long drift time (~100 µs), so clusters from particles originated from multiple collisions can overlap in the detector.
376441
- Higher occupancy worsens:
@@ -392,7 +457,7 @@ A single-value "integrated" occupancy estimator for a given collision can be cal
392457
Notes:
393458
- Both occupancy estimators are calculated per each collision in the event selection routine, [EventSelectionModule.h](https://github.com/AliceO2Group/O2Physics/blob/daily-20251029-0000/Common/Tools/EventSelectionModule.h#L1361).
394459
- In the occupancy calculation, multiplicities of nearby collisions are "weighted" according to their time separation from a collision-of-interest.
395-
- Estimators return the value of `-1` if a given collision is close to Time Frame borders (so, not enough information for the occupancy calculation, while we need information within -40 µs...+100 µs time range wrt a given collision).
460+
- Estimators return `-1` if a given collision is close to Time Frame borders (so, not enough information for the occupancy calculation, while we need information within -40 µs...+100 µs time range wrt a given collision).
396461
397462
398463
### Occupancy selection bits
@@ -412,7 +477,7 @@ The following table summarizes the event selection bits used to mitigate occupan
412477
413478
These bits can be used as follows:
414479
``` c++
415-
if (col.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStrict)) { /* do analysis */ }
480+
if (col.selection_bit(o2::aod::evsel::kNoCollInTimeRangeNarrow)) { /* do analysis */ }
416481
```
417482
418483
@@ -423,12 +488,50 @@ More details on occupancy in Pb-Pb can be found in the [report at the APW 2024](
423488
Tight cuts on occupancy improve quality (better S/B, cleaner PID, less bias in kinematics), but reduce event statistics.
424489
425490
However, sensitivity to the occupancy effects depends on analysis.
426-
Therefore, the suggested approach is to study how results of a given analysi change as a function of occupancy: one may try several occupancy "bins", e.g. `[0,500), (500, 1000), (1000-2000), (2000-4000)`, etc.,
491+
Therefore, the suggested approach is to study how results of a given analysi change as a function of occupancy: one may try several occupancy "bins", e.g. `[0,500), [500, 1000), [1000-2000), [2000-4000)`, etc.,
427492
and, in addition, apply occupancy selection bits, e.g. `kNoCollInTimeRangeNarrow` to eliminate the bc-collision mismatches, or `kNoCollInTimeRangeStandard` to make a further cleaunup.
428493
429494
Note that TPC-related occupancy effects are most pronounced in Pb–Pb runs, however, the tools described above can also be used for occupancy studies in pp and light-ion runs.
430495
431496
497+
498+
## Rejection of events with dead zones in ITS
499+
500+
### Problem
501+
502+
- The ITS occasionally develops **“holes” in acceptance** lasting about **6–8 seconds**, visible as gaps in φ distributions on time-dependent plots.
503+
- These are caused by **reboots of ITS staves**, typically triggered by recovery of failed **lanes** (groups of 7 chips sharing one data link). When a lane fails, the **full stave** becomes temporarily blind while the DCS recovers it.
504+
- The issue affects, in particular, **ITS Layer 3**, which is critical for achieving four consecutive ITS hits in tracking.
505+
- These dead periods correlate also with **drops in ITS–TPC matching efficiency**.
506+
- The effect appears both in **Pb–Pb** and **pp** data.
507+
508+
### Using special event selection bits
509+
510+
To reject events recorded during the affected time intervals, several event selection bits were introduced in O2Physics ([PR #9038](https://github.com/AliceO2Group/O2Physics/pull/9038), Dec 2024):
511+
```
512+
kIsGoodITSLayer3, // number of inactive chips on ITS layer 3 is below maximum allowed value
513+
kIsGoodITSLayer0123, // numbers of inactive chips on ITS layers 0-3 are below maximum allowed values
514+
kIsGoodITSLayersAll, // numbers of inactive chips on all ITS layers are below maximum allowed values
515+
```
516+
517+
Example usage:
518+
```cpp
519+
if (col.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) {
520+
// do analysis
521+
}
522+
```
523+
This particular bit `kIsGoodITSLayersAll` ensures that all ITS layers are in a good state (i.e. no rebooting **staves**; note that at the same time some **chips** can be inactive).
524+
525+
The logic behind these cuts uses [CCDB maps of dead chips](https://nvalle.web.cern.ch/its/dmap/) and defines per-layer thresholds for allowed inactive chips:
526+
```cpp
527+
maxInactiveChipsPerLayer = {8, 8, 8, 111, 111, 195, 195};
528+
```
529+
If any layer exceeds its threshold, the event is flagged as **bad** (likely during a stave reboot).
530+
531+
Applying this cut removes time intervals with dead ITS staves and, correspondingly, the large acceptance holes, significantly flattening time-dependent observables, like the **2- and 4-particle correlators** in Pb-Pb.
532+
Note that in pp the `kIsGoodITSLayersAll` bit can reject a huge fraction of events (the holes in pp are more frequent), however, the `kIsGoodITSLayer0123` bit can be tried (e.g. to study the effects from the rebooting staves on the DCA).
533+
534+
432535
## Usage of RCT flags
433536
434537
(to be updated)

0 commit comments

Comments
 (0)