Skip to content

[Common] Fix TPC side determination in VDrift correction - #17846

Merged
ddobrigk merged 6 commits into
AliceO2Group:masterfrom
matthias-kleiner:fix-tpc-vdrift-ce-side
Sep 16, 2026
Merged

ddobrigk merged 6 commits into
AliceO2Group:masterfrom
matthias-kleiner:fix-tpc-vdrift-ce-side

Conversation

@matthias-kleiner

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

O2 linter results: ❌ 0 errors, ⚠️ 4 warnings, 🔕 0 disabled

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ddobrigk
ddobrigk previously approved these changes Sep 11, 2026
@ddobrigk

Copy link
Copy Markdown
Collaborator

Hi @matthias-kleiner, thanks a lot for this fix!

However, I was wondering what will happen with data for which the TPC side flags are not stored: this is relevant, since those were added only in February this year. Further, since they were added "adiabatically" by taking unused bits in the flags integer, older datasets will appear to have all tracks only in one side, and thus the fix will break in that situation. Is there perhaps some way in which the TPC side information could be inferred from other parameters that existed already before? For instance, a combination of tgl and the sign of Z (given we store tracks at the position of their innermost update?)... Sorry if I am overlooking something. Thanks again!

The TPCSideA/TPCSideC flags were only added to the AOD format in
February 2026, so datasets produced before that always have neither
bit set. Detect CE-crossing tracks from the track's asymmetric time
margins and otherwise infer the side from a cross-check of Z and tgl
sign, per TPC domain expert guidance, instead of silently skipping
the correction for all tracks in older datasets.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@matthias-kleiner

Copy link
Copy Markdown
Contributor Author

Hi @matthias-kleiner, thanks a lot for this fix!

However, I was wondering what will happen with data for which the TPC side flags are not stored: this is relevant, since those were added only in February this year. Further, since they were added "adiabatically" by taking unused bits in the flags integer, older datasets will appear to have all tracks only in one side, and thus the fix will break in that situation. Is there perhaps some way in which the TPC side information could be inferred from other parameters that existed already before? For instance, a combination of tgl and the sign of Z (given we store tracks at the position of their innermost update?)... Sorry if I am overlooking something. Thanks again!

Hi @ddobrigk ,
I added a fallback solution for the older data as @shahor02 suggested. @shahor02 could you have look if this is correct?

shahor02
shahor02 previously approved these changes Sep 11, 2026
@ddobrigk

Copy link
Copy Markdown
Collaborator

Hi @matthias-kleiner, thanks a lot! I have one question and a request, if I may:

  • Do you know what effect this change has? I would presume this was making us miss valid candidates, so it might recover some efficiency for photon conversions?
  • Could you please add a switch between old and new behaviour, with the default being old behaviour? This will allow for testing without silently changing the result of analysis code that hasn't been touched; then, at a later stage, we can switch the default to new behaviour and send out a notification.

Thanks again - and please only worry about this whenever convenient and don't let me disturb your weekend!

@alibuild

This comment was marked as outdated.

Introduce TPCVDriftManagerParam::useSideBasedCorrection (default off)
to gate the new TPC-side-flag-based correction behind a ConfigurableParam,
settable from any workflow via --configKeyValues without touching each
task that owns a TPCVDriftManager instance. Keeps existing analyses on
the legacy tgl-sign behaviour until explicitly opted in for testing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@matthias-kleiner

Copy link
Copy Markdown
Contributor Author

Hi @matthias-kleiner, thanks a lot! I have one question and a request, if I may:

* Do you know what effect this change has? I would presume this was making us miss valid candidates, so it might recover some efficiency for photon conversions?

* Could you please add a switch between old and new behaviour, with the default being old behaviour? This will allow for testing without silently changing the result of analysis code that hasn't been touched; then, at a later stage, we can switch the default to new behaviour and send out a notification.

Thanks again - and please only worry about this whenever convenient and don't let me disturb your weekend!

Hi @ddobrigk ,
yes, I added a switch that is off by default and the new mode can be activated with --configKeyValues "TPCVDriftManager.useSideBasedCorrection=true"

I think it could in principle recover some efficiency loss: when the sign of the tgl disagrees with the actual TPC side, the old code shifts the tracks Z the wrong way instead of correcting it, which would hurt topological cuts. How much depends on how large the vDrift correction is and how often the vertex position/track topology puts tgl and Z sign at different sign. The best would be to make a direct A/B comparison with the switch.

ddobrigk
ddobrigk previously approved these changes Sep 14, 2026
@ddobrigk
ddobrigk enabled auto-merge (squash) September 14, 2026 13:21
@ddobrigk
ddobrigk disabled auto-merge September 14, 2026 15:13
@alibuild

This comment was marked as outdated.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for ec64032 at 2026-09-14 21:21:

## sw/BUILD/O2-latest/log
2026-09-14T20:41:05.054+0200 [12977:140600946638464] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "FindMissingBlobs()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:05.267+0200 [13009:139799094967936] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "FindMissingBlobs()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:05.680+0200 [14209:139676759957120] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "FindMissingBlobs()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:06.203+0200 [14258:140323275574912] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "FindMissingBlobs()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:06.254+0200 [13860:139935192100480] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "FindMissingBlobs()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:06.455+0200 [13946:139718285192832] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "FindMissingBlobs()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:07.004+0200 [14231:140185064038016] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "FindMissingBlobs()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:05.427+0200 [14353:140685187571328] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ActionCache.GetActionResult()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:05.427+0200 [14353:140685187571328] [executioncontext.cpp:544] [ERROR] Error while querying action cache at "http://localhost:8980": 14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused
2026-09-14T20:41:07.322+0200 [14353:140685187571328] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "FindMissingBlobs()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv6:%5B::1%5D:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:07.711+0200 [14296:139984763260544] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "FindMissingBlobs()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:07.950+0200 [14318:140257726860928] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "FindMissingBlobs()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:08.061+0200 [13629:139742445203072] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "FindMissingBlobs()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:08.680+0200 [14000:140065189060224] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "FindMissingBlobs()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:08.717+0200 [14116:139965710360192] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "FindMissingBlobs()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:06.676+0200 [14426:139627675717248] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ActionCache.GetActionResult()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:06.677+0200 [14426:139627675717248] [executioncontext.cpp:544] [ERROR] Error while querying action cache at "http://localhost:8980": 14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused
2026-09-14T20:41:08.796+0200 [14426:139627675717248] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "FindMissingBlobs()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv6:%5B::1%5D:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:06.233+0200 [14403:139817020845696] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ActionCache.GetActionResult()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:06.234+0200 [14403:139817020845696] [executioncontext.cpp:544] [ERROR] Error while querying action cache at "http://localhost:8980": 14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused
2026-09-14T20:41:09.986+0200 [14403:139817020845696] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "FindMissingBlobs()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv6:%5B::1%5D:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:06.756+0200 [14457:139858708840064] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ActionCache.GetActionResult()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:06.756+0200 [14457:139858708840064] [executioncontext.cpp:544] [ERROR] Error while querying action cache at "http://localhost:8980": 14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused
2026-09-14T20:41:07.051+0200 [14480:140277197049472] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ActionCache.GetActionResult()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:07.051+0200 [14480:140277197049472] [executioncontext.cpp:544] [ERROR] Error while querying action cache at "http://localhost:8980": 14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused
2026-09-14T20:41:08.551+0200 [14605:140070003326592] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ActionCache.GetActionResult()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:08.551+0200 [14605:140070003326592] [executioncontext.cpp:544] [ERROR] Error while querying action cache at "http://localhost:8980": 14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused
2026-09-14T20:41:07.734+0200 [14542:140060338204288] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ActionCache.GetActionResult()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:07.734+0200 [14542:140060338204288] [executioncontext.cpp:544] [ERROR] Error while querying action cache at "http://localhost:8980": 14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused
2026-09-14T20:41:07.453+0200 [14514:140033991216768] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ActionCache.GetActionResult()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:07.454+0200 [14514:140033991216768] [executioncontext.cpp:544] [ERROR] Error while querying action cache at "http://localhost:8980": 14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused
2026-09-14T20:41:08.727+0200 [14626:139693054312064] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ActionCache.GetActionResult()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:08.727+0200 [14626:139693054312064] [executioncontext.cpp:544] [ERROR] Error while querying action cache at "http://localhost:8980": 14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused
2026-09-14T20:41:06.270+0200 [14374:139708890369664] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ActionCache.GetActionResult()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-14T20:41:06.270+0200 [14374:139708890369664] [executioncontext.cpp:544] [ERROR] Error while querying action cache at "http://localhost:8980": 14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused


## sw/BUILD/O2Physics-latest/log
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

This comment was marked as outdated.

@romainschotter

Copy link
Copy Markdown
Collaborator

Hi @matthias-kleiner !

Thank you very much for the PR!

I have taken the liberty to try out your changes in order to test whether the configurable is available in the propagationService configuration and it turns out that it won't appear in the configuration. As far as I understand, it is because the configurable has been introduced here via O2ParamDef, which declares only a static member, that needs to be defined in a source file via O2ParamImpl (which does not exist in the PR). If the file would exist, the other issue is that the TPCDriftManager is declared as o2physics_add_header_only_library, which prevents to link the source file with O2ParamImpl and prevents the task calling the TPCDriftManager to compile (hence the compilation error).

The simplest alternative is maybe to add the variable mUseSideBasedCorrection as a private data member of the class, along side a setter function in order to set the value to true or false. In this way, we can later add a configurable in any task using the TPCVDriftManager (propagationService, photonconversionbuilder,...) in order to enable/disable the new side-based correction. If it helps, I have added comments with the changes to be made.

My 2 cents.

Comment thread Common/Core/TPCVDriftManager.h Outdated
Comment thread Common/Core/TPCVDriftManager.h Outdated
Comment thread Common/Core/TPCVDriftManager.h
Comment thread Common/Core/TPCVDriftManager.h Outdated
Comment thread Common/Core/TPCVDriftManager.h
…e-based correction switch

O2ParamDef only declares the static sInstance member; defining it
requires O2ParamImpl in a compiled .cxx, but TPCVDriftManager is a
header-only library with none, so Instance() left an unresolved
symbol for every consumer. Switch to a plain member + setter, as
suggested in review; tasks using TPCVDriftManager can later expose
this via their own Configurable.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@matthias-kleiner

Copy link
Copy Markdown
Contributor Author

Hi @matthias-kleiner !

Thank you very much for the PR!

I have taken the liberty to try out your changes in order to test whether the configurable is available in the propagationService configuration and it turns out that it won't appear in the configuration. As far as I understand, it is because the configurable has been introduced here via O2ParamDef, which declares only a static member, that needs to be defined in a source file via O2ParamImpl (which does not exist in the PR). If the file would exist, the other issue is that the TPCDriftManager is declared as o2physics_add_header_only_library, which prevents to link the source file with O2ParamImpl and prevents the task calling the TPCDriftManager to compile (hence the compilation error).

The simplest alternative is maybe to add the variable mUseSideBasedCorrection as a private data member of the class, along side a setter function in order to set the value to true or false. In this way, we can later add a configurable in any task using the TPCVDriftManager (propagationService, photonconversionbuilder,...) in order to enable/disable the new side-based correction. If it helps, I have added comments with the changes to be made.

My 2 cents.

Hi @romainschotter ,
many thanks for checking it, you are indeed correct. I have changed it as you suggested to a simple setter that is false per default.

@ddobrigk

Copy link
Copy Markdown
Collaborator

Many, many thanks @matthias-kleiner ! (and @romainschotter for taking a look too). Will approve

ddobrigk
ddobrigk previously approved these changes Sep 15, 2026
@ddobrigk
ddobrigk enabled auto-merge (squash) September 15, 2026 07:40
@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for 0757bf5 at 2026-09-15 09:42:

No log files found

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 0757bf5 at 2026-09-15 09:44:

No log files found

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/o2 for 0757bf5 at 2026-09-15 09:45:

No log files found

Full log here.

@ddobrigk
ddobrigk merged commit db83481 into AliceO2Group:master Sep 16, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

5 participants