Repository navigation
[Common,DPG] add occupancy wrt bunch crossings (tables BcOccs, BcOccsAll) - #18689
Merged
Merged
Conversation
added BC occupancy configurables and updated occupancy calculation logic to include new BC occupancy structures.
|
O2 linter results: ❌ 0 errors, |
Collaborator
|
Error while checking build/O2Physics/code-check for 4abc96e at 2026-11-11 15:00: Full log here. |
Collaborator
|
Error while checking build/O2Physics/o2 for 2c46716 at 2026-11-11 16:52: Full log here. |
Collaborator
|
Error while checking build/O2Physics/code-check for 2c46716 at 2026-11-11 16:54: Full log here. |
Collaborator
|
Error while checking build/O2Physics/staging for 2c46716 at 2026-11-11 17:08: Full log here. |
Clarified output description in comments.
dsekihat
approved these changes
Nov 12, 2026
altsybee
enabled auto-merge (squash)
November 12, 2026 12:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Occupancy wrt bunch crossings: tables
BcOccsandBcOccsAllRefactored OccupancyCalculator
calculateForCollision()andcalculateForBC()EvSels: the per-collision results remain bit-identical. Also, nothing changes for the users who use existing machinery.Occupancy wrt BCs
Same estimators, time window, thresholds and median time as in
EvSels, but calculated wrt a BC instead of a collision.Two tables added to
Common/DataModel/EventSelection.h, both produced byo2-analysis-event-selection-service:BcOccs, joinable withaod::BCs: one row per BC of the BC table.bcoccOpts.amIneeded(-1 auto, 0 no, 1 yes) andbcoccOpts.bcsForOccupancy(0 - all BCs stored in AO2D tables, 1 - BCs with FT0, 2 - TVX, 3 - colliding; other BCs get -1).BcOccsAll, not joinable: every BC of the TFs present in the DF, including BCs without an entry inaod::BCs(e.g. for UPC studies). Rows are in increasing order of global BC, with the columnglobalBC().bcoccAllOpts.amIneededandbcoccAllOpts.bcsForOccupancy(0 - all BCs in TFs, also BCs not stored in AO2D, 1 - colliding BCs).With the default
amIneeded = -1, each table is produced only when a task subscribes to it. The BC and event selection, which provide the inputs, are then switched on automatically.Differences from the collision-level values:
numCollsInBC), while for a per-collision occupancy calculation, only the collision itself is excluded: other collisions in the same BC are included;kNoCollInRofStandardis not applied (only the FT0C-multiplicity condition);aod::bcocc::BcOccupancyFlags; bit numbers differ fromaod::evsel);bcsForOccupancyget occupancy -1 and all occupancy flags 0 (kUpcModeis filled for all BCs).trackOccupancyInTimeRange()ft0cOccupancyInTimeRange()occupancyMedianTime()occupancyFlags_bit(bit)kNoCollInTimeRangeNarrow/Strict/Standard,kNoCollInRofStrict/Standard,kNoHighMultCollInPrevRof,kUpcMode(enumBcOccupancyFlags, one 8-bit bitmap)occupancyFlags_bit(kUpcMode)numCollsInBC()numCollsInRof()kUpcMode(for UPC studies): tells whether the ITS ROF containing this BC was reconstructed in the UPC mode.(collision.flags() & Vertex::Flags::UPCMode) != 0. A BC has no such flag, so it is taken from the collisions in its ITS ROF:numCollsInRof() == 0): for such BCs we also artificially assign an "effective UPC mode" (useful in UPC analyses).numCollsInRof()and the in-ROF vetoes).aod::BCFlags(bitbc::ITSUPCMode) has a similar per-BC flag, taken directly from the ITS ROF records, but only for the BCs stored inaod::BCs.Usage
QA:
DPG/Tasks/AOTEvent/bcOccupancyQa.cxx(o2-analysis-bc-occupancy-qa)o2-analysis-event-selection-service | o2-analysis-bc-occupancy-qa):processBcOccsAll: QA ofBcOccsAll, with the cross-check ofBcOccAllIndex;processBcOccs: QA ofBcOccs(joined withaod::BCs);processBcOccsVsBcOccsAll: for the BCs ofaod::BCs,BcOccsis compared with theBcOccsAllentry of the same BC (found withBcOccAllIndex): the values should be identical.DPG/Tasks/AOTEvent/macros/plotBcOccupancyQa.CreadsAnalysisResults.root, prints a summary and writes a multi-page PDF and to a .root file:root -l -b -q 'plotBcOccupancyQa.C("AnalysisResults.root")'Example QA: