Skip to content

Commit 698ba44

Browse files
authored
Merge pull request #376 from altsybee/master
added description of bcOccup tables in evSel Ch.; mention crossROF for pp 2026
2 parents d7c719e + a9e6385 commit 698ba44

1 file changed

Lines changed: 69 additions & 15 deletions

File tree

‎docs/analysis-tools/EventSelection.md‎

Lines changed: 69 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,31 @@ title: Event Selection
55

66
# Table of contents:
77

8-
* [Event selection service wagon](#event-selection-service-wagon)
9-
* [Timestamp module](#timestamp-module)
10-
* [Event selection module](#event-selection-module)
11-
* [Basic usage in user tasks](#basic-usage-in-user-tasks)
12-
* [Trigger aliases](#trigger-aliases)
13-
* [Event selection criteria](#event-selection-criteria)
14-
* [Time Frame and ITS ROF border cuts](#time-frame-and-its-rof-border-cuts)
15-
* [Occupancy estimation](#occupancy-estimation)
16-
* [Rejection of events with dead zones in ITS](#rejection-of-events-with-dead-zones-in-its)
17-
* [Usage of RCT flags](#usage-of-rct-flags)
18-
* [Found bunch crossings](#found-bunch-crossings)
19-
* [Configurables](#configurables)
20-
* [Event selection decisions for Run 2](#event-selection-decisions-for-run-2)
21-
* [Luminosity module](#luminosity-module)
8+
- [Table of contents:](#table-of-contents)
9+
- [Event selection service wagon](#event-selection-service-wagon)
10+
- [Timestamp module](#timestamp-module)
11+
- [Event selection module](#event-selection-module)
12+
- [Basic usage in user tasks](#basic-usage-in-user-tasks)
13+
- [Trigger aliases](#trigger-aliases)
14+
- [Event selection criteria](#event-selection-criteria)
15+
- [Time Frame and ITS ROF border cuts](#time-frame-and-its-rof-border-cuts)
16+
- [Time Frame borders](#time-frame-borders)
17+
- [ITS Readout Frame borders](#its-readout-frame-borders)
18+
- [Integration into event selection](#integration-into-event-selection)
19+
- [Occupancy estimation](#occupancy-estimation)
20+
- [Occupancy estimators](#occupancy-estimators)
21+
- [Occupancy selection bits](#occupancy-selection-bits)
22+
- [Occupancy wrt bunch crossings](#occupancy-wrt-bunch-crossings)
23+
- [Discussion](#discussion)
24+
- [Rejection of events with dead zones in ITS](#rejection-of-events-with-dead-zones-in-its)
25+
- [Problem](#problem)
26+
- [Using special event selection bits](#using-special-event-selection-bits)
27+
- [Usage of RCT flags](#usage-of-rct-flags)
28+
- [Found bunch crossings](#found-bunch-crossings)
29+
- [Configurables](#configurables)
30+
- [Event selection decisions for Run 2](#event-selection-decisions-for-run-2)
31+
- [Remarks](#remarks)
32+
- [Luminosity module](#luminosity-module)
2233

2334
# Event selection service wagon
2435

@@ -111,6 +122,8 @@ In general, one has to follow the following steps:
111122
112123
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).
113124
125+
> [!NOTE]
126+
> An exception for the 2026 pp data: the `kNoITSROFrameBorder` bit was excluded from `sel8` for this period because reconstruction was performed with the ITS cross-ROF mode enabled, which should almost completely eliminate the ITS ROF border effect. Note, however, that the ROF border effect is still present for the MFT readout frames!
114127
* run your tasks in stack with event-selection-service task:
115128
116129
``` bash
@@ -332,7 +345,7 @@ _Notes:_
332345
- Both occupancy estimators are pre-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).
333346
- In the occupancy calculation, multiplicities of nearby collisions are "weighted" according to their time separation from a collision-of-interest, to reflect the "severity" of their influence on that collision
334347
- 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), event loss ~1.2%.
335-
348+
- An additional column was added to evSel table in [Dec 2025](https://github.com/AliceO2Group/O2Physics/pull/14202) - the **median time** of occupancy from nearby events (i.e. the dt at which the counter of occupancy around a given event in a predefined time window becomes >=0.5 from the total occupancy), as discussed [here](https://indico.cern.ch/event/1568262/#1-study-of-the-tpc-occupancy-e). The getter: `occupancyMedianTime()`.
336349
337350
### Occupancy selection bits
338351
@@ -355,6 +368,47 @@ if (col.selection_bit(o2::aod::evsel::kNoCollInTimeRangeNarrow)) { /* do analysi
355368
```
356369
357370
371+
### Occupancy wrt bunch crossings
372+
373+
The occupancy can also be obtained per **bunch crossing** (e.g. for UPC studies), with the same estimators, time window and thresholds as for collisions (since [PR 12/11/2026](https://github.com/AliceO2Group/O2Physics/pull/18689)). Two tables are produced by the event selection service (only if subscribed to by a task):
374+
- `aod::BcOccs`: joinable with `aod::BCs`, one row per BC of the BC table;
375+
- `aod::BcOccsAll`: not joinable, values are calculated for every BC of the Time Frames in the dataframe (also BCs not stored in AO2D). The table is large (114048 rows per 32-orbit TF), so request it only when needed.
376+
377+
The same getters and bits described for per-collision occupancy can also be used for per-BC occupancy studies. The following additional getters are available:
378+
379+
| **Getter** | **Meaning** |
380+
|------------|-------------|
381+
| `occupancyFlags_bit(bit)` | `kNoCollInTimeRangeNarrow/Strict/Standard`, `kNoCollInRofStrict/Standard`, `kNoHighMultCollInPrevRof`, `kUpcMode` (enum `aod::bcocc::BcOccupancyFlags`) |
382+
| `numCollsInBC()` | number of collisions found in this BC |
383+
| `numCollsInRof()` | number of collisions found in the ITS ROF of this BC |
384+
385+
**Differences from the per-collision values:**
386+
- all collisions found in the BC are excluded from its occupancy (for a collision, only the collision itself is excluded);
387+
- no vZ for BCs, so the close-vZ veto in `kNoCollInRofStandard` is not applied;
388+
- the flags are stored in a separate 8-bit bitmap: bit numbers differ from `aod::evsel`;
389+
- `kUpcMode` (filled for all BCs): the ITS ROF of this BC has no collisions, or has collisions reconstructed in the UPC mode of ITS (`Vertex::Flags::UPCMode`).
390+
391+
**Usage:**
392+
393+
``` c++
394+
// occupancy for BCs of the BC table
395+
void process(soa::Join<aod::BCs, aod::BcOccs> const& bcs) {
396+
for (const auto& bc : bcs) {
397+
if (bc.trackOccupancyInTimeRange() >= 0 && bc.occupancyFlags_bit(o2::aod::bcocc::kNoCollInTimeRangeNarrow)) { /* do analysis */ }
398+
}
399+
}
400+
```
401+
For `aod::BcOccsAll`, a fast lookup by global BC is provided:
402+
``` c++
403+
// occupancy for any BC of the TFs in the DF: O(1) lookup by global BC, no search and no CCDB needed
404+
aod::bcocc::BcOccAllIndex bcOccAllIndexed(bcOccsAll); // once per dataframe
405+
if (bcOccAllIndexed.contains(bc.globalBC())) {
406+
auto occ = bcOccAllIndexed[bc.globalBC()]; // iterator of aod::BcOccsAll
407+
bool isUpcModeRof = occ.occupancyFlags_bit(o2::aod::bcocc::kUpcMode); // example; other occupancy getters can be used as well
408+
}
409+
```
410+
411+
358412
### Discussion
359413
360414
More details on occupancy in Pb-Pb can be found in the [report at the APW 2024](https://indico.cern.ch/event/1462154/#7-occupancy-effects), where the concepts and observations are explained (while some figures and indicated values might be outdated).

0 commit comments

Comments
 (0)