Skip to content

adjustments for TF shifts for productions done with MC-prod-2026-v13 - #16138

Merged
sawenzel merged 2 commits into
AliceO2Group:devfrom
altsybee:dev
Nov 17, 2026
Merged

sawenzel merged 2 commits into
AliceO2Group:devfrom
altsybee:dev

Conversation

@altsybee

@altsybee altsybee commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

It turned out that the MC productions done with the MC-prod-2026-v13 tag are still affected by the TF shift issue described in O2-7220.

This is because the v13 tag used O2PDPSuite::daily-20260929-0000-1, which predates the fix introduced on October 4 to address the issue with the ITS ramp-up offset.

The affected productions were added based on the list extracted from:
https://alimonitor.cern.ch/job_details.jsp?packages=MC-prod-2026-v13

@altsybee
altsybee requested a review from shahor02 as a code owner November 16, 2026 17:25
@altsybee altsybee changed the title fixes for TF shifts for MC-prod-2026-v13 adjustments for TF shifts for productions done with MC-prod-2026-v13 Nov 16, 2026
@sawenzel

sawenzel commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Thanks @altsybee. I see the intent of this. However, I am not a big fan of configuration in code, and in fact there is the danger that the approach is not foolproof (as concluded from a Claude Fable review): the correction does not only depend on the production tag, but also on the TF length and the anchor time of each run.

Since MC-prod-2026-v12, the anchoring shifts the first orbit by the ITS ramp-up duration from ITS/Calib/RampDuration, i.e. by ceil(ramp-up / LHCOrbitMUS) orbits. The correction to undo is this shift mod OrbitsPerTF. The ramp-up is 5 s (56228 orbits) for runs since September 2023, but 90 s and 37 s for earlier 2023 runs. Consider for instance these cases:

Runs Current solution Correct solution
5 s ramp-up, 6 orbits/TF +2 +2
5 s ramp-up, 8, 16 or 32 orbits/TF +4 +4
5 s ramp-up, 128 orbits/TF (in LHC26j18, LHC26j18_G4list, LHC26j6, LHC26h3, LHC26c12, LHC26a5a_gp_v12, LHC26a7) +4 +36
90 s ramp-up, 32 orbits/TF (LHC26j17, anchored to run 535069 of April 2023) +4 +30
128 orbits/TF, anchored after the O2DPG fix 0 (not listed) +64

The last row exists because the O2DPG fix rounds the shift with the data's OrbitsPerTF (32) before --orbitsPerTF is applied. The shift becomes 56256, which is still 64 mod 128. In fact, LHC26a7 alone has 56 runs with 128 orbits per TF, next to runs with 32 and 8, so the +4 fallback cannot be right for it. Also, were LHC26a7, LHC26b10, LHC26e8 and LHC26h2 really produced with v12? Their MCProdInfo entries in CCDB were created before v12 was released (17 September). Before v12 the first orbit was not shifted, so the correct value would be 0.

In addition, there is a unit bug from #15897: sor is in ms, but sor += nOrbitsCorrection * LHCOrbitMUS * 1000 moves it by about 356 s instead of 0.36 ms (i.e. effectively 0). It should be / 1000.. With checkRunDurationLimits enabled in the event selection (off by default), BCs in the first minutes of the run would be rejected.

We could consider attacking these corrections on the CCDB side, as we do usually. For instance, the MCProdInfo objects in Users/a/aliprod/MCProdInfo/<tag> are stored per run, and adjust_from_MC already reads their metadata for OrbitsPerTF. We could add a key such as SOROrbitShift to the affected runs with CcdbApi::updateMetadata, and apply it in adjust_from_MC when present. This gives the right value per run, per TF length and per anchor time, and further corrections need no new O2 tag. We can provide a small tool in O2DPG to set this metadata, together with the fix of the rounding order. What do you think? (pinging also @shahor02 )

@shahor02

Copy link
Copy Markdown
Collaborator

I agree that if the list of productions to handle grows and requires different corrections, we better do this via ccdb.
@sawenzel do you agree to merge this in order to not stop the analyses, and then work out the ccdb solution?

@sawenzel

Copy link
Copy Markdown
Collaborator

I agree that if the list of productions to handle grows and requires different corrections, we better do this via ccdb. @sawenzel do you agree to merge this in order to not stop the analyses, and then work out the ccdb solution?

Yes of course. Let's merge it and I'll follow up separately.

@sawenzel
sawenzel merged commit ca01776 into AliceO2Group:dev Nov 17, 2026
12 checks passed
@altsybee

altsybee commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks a lot, @sawenzel ! (and @claude )
Since the scale of the problem has grown, I agree with the ccdb-based approach, of course.

In addition, there is a unit bug from #15897:

-- but this means we have the same problem also with the productions with MC-prod-2026-v14 which are currently running... Pinging @catalinristea and @alcaliva for this.

We could add a key such as SOROrbitShift to the affected runs

-- if I understand correctly, some MC productions might be re-done in the future (with newer MC prod tags), and then they will have the correct TF positions after the issue with the ITS ramp-up in O2 will be (re-)solved. If it's the case, these future changes should be taken into account somehow, e.g. by storing to the MCProdInfo objects in CCDB also the MC-prod-[year]-v[XYZ] tag, and checking it in the adjust_from_MC routine.

@sawenzel

sawenzel commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

@altsybee : Thanks for your valuable feedback!

@altsybee

altsybee commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Sorry, I thought the comment about the "unit bug" is about the PR AliceO2Group/O2DPG#2489, but it's about the O2Physics PR #15897
-->

  • This issue is minor (sor is used only for mid-run timestamp in event selection; the orbitSOR is much more important and it's correct.)
  • This also means that the MC-prod-2026-v14 tag should be fine (if it's produced with O2 version after Oct 4)

The sor calculation bug is fixed in #16141 , and also the special cases in the extended MC production list (128 orbits per TF, 90 s ramp-up for LHC26j17, indicated in the @claude review) are now considered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants