Skip to content

[PWGEM] Add new overlay mixed event - #18621

Merged
jokonig merged 6 commits into
AliceO2Group:masterfrom
Steffimro:photon-overlay-mixed-event
Nov 7, 2026
Merged

jokonig merged 6 commits into
AliceO2Group:masterfrom
Steffimro:photon-overlay-mixed-event

Conversation

@Steffimro

Copy link
Copy Markdown
Contributor

The reason behind this pull request: Close photon pairs at small q_inv are affected by reconstruction effects
that the standard mixed event cannot reproduce: legs of two nearby conversions can be paired the wrong way (swaps), one conversion can be split into two photons, and photons compete for the same legs in the deduplication. The new mixed event rebuilds the photons of two overlaid events with the same code as the same event, so these effects enter the same and the mixed event alike.

For this to be realized two new tasks have been introduced the photon-mixed-event-producer and photon-conversion-builder-mixed. The latter is just a second round of the photon-conversion-builder. It runs over processMixed and processMixedDerived (TODO: see how this might be achievable with linked derived data).

Adjustments in the builder (all new outputs are off by default, so nothing changed for the user if not activated.)

Since recent runs over the full data set also caused some CPU issues the run 1 with finder was optimized realized and tested that the output did not change (sorting of tracks in a time window + order of cuts was optimized so heavy propagation is done mostly on tracks which do not cause issues).

The builder stores now - storeLegCov: V0LegsCov, the leg parameters and covariance given to the
V0 fit (input of the mixer). storeFreeLegs: PCMFreeLegs, tracks that pass the leg cuts and are the leg of no stored photon. storeFreeLegIds: PCMFreeLegIds, the same free legs as AO2D track indices only, for linked derived data (track index stored as the difference to the previous row TODO: need to finalize the mixing task that it can run over the linked derived data).

Tables and event tasks

  • gammaTables.h: the tables above, their Tmp and Mix twins, and PCMMixCollisions / PCMMixLegs.
  • create-emevent-photon: storeVertex writes EMEventsXY / EMEventsCov (needed by the mixer on derived data).
  • associate-photon-to-emevent: processPCMFreeLegs adds the derived event index of each free leg (PCMFreeLegEMEventIds).
  • V0PhotonCut: psi_pair and KF chi2 QA histograms, filled only if thephoton table has these columns.

@github-actions github-actions Bot added pwgem datamodel photon Photon and neutral meson PAG label labels Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

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

@github-actions github-actions Bot changed the title Add new overlay mixed event [PWGEM] Add new overlay mixed event Nov 6, 2026
@Steffimro
Steffimro marked this pull request as ready for review November 6, 2026 12:58
kEvent_JJ = 3,
};

Configurable<bool> storeVertex{"storeVertex", false, "write EMEventsXY and EMEventsCov (primary vertex x, y, covariance, chi2), joinable to PMEvents: needed by the co-reconstructed mixed event on derived data (photon-mixed-event-producer processDerived)"};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since a new feature of the frame work will let us actually disable writing of tables, I think it would be good to rename the config and rephrase the info that this is just about filling the table. Currently the table will be written anyways.

@alibuild

alibuild commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for f3950d4 at 2026-11-06 14:26:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'To reproduce the results below locally, run: '\''aliBuild build O2Physics-code-check -e ALIBUILD_BASE_HASH=upstream/master'\''.'
To reproduce the results below locally, run: 'aliBuild build O2Physics-code-check -e ALIBUILD_BASE_HASH=upstream/master'.
++ echo 'To apply all automatic fixes, add the '\''-e O2PHYSICS_CHECKER_FIX=1'\'' option.'
To apply all automatic fixes, add the '-e O2PHYSICS_CHECKER_FIX=1' option.
++ echo 'See the documentation for more details at: <https://aliceo2group.github.io/analysis-framework/docs/tools/#running-with-o2physics-code-check>.'
See the documentation for more details at: <https://aliceo2group.github.io/analysis-framework/docs/tools/#running-with-o2physics-code-check>.
++ echo 'Found 10 errors and 38 warnings.'
Found 10 errors and 38 warnings.
++ [[ 10 -gt 0 ]]
++ cat /sw/BUILD/9f14597ee38bd135d13adbaf97e9b7ff27b43207/O2Physics-code-check/errors.txt
PWGEM/PhotonMeson/TableProducer/photonMixedEventProducer.cxx:40:1: error: included header TPDGCode.h is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGEM/PhotonMeson/TableProducer/photonMixedEventProducer.cxx:139:46: error: no header providing "o2::framework::OutputObjHandlingPolicy" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGEM/PhotonMeson/TableProducer/photonMixedEventProducer.cxx:393:61: error: no header providing "o2::aod::track::ITS" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGEM/PhotonMeson/TableProducer/photonMixedEventProducer.cxx:394:61: error: no header providing "o2::aod::track::TPC" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGEM/PhotonMeson/TableProducer/photonMixedEventProducer.cxx:611:9: error: 'push_back' is called inside a loop; consider pre-allocating the container capacity before the loop [performance-inefficient-vector-operation,-warnings-as-errors]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:67:1: error: included header TrackParametrization.h is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:235:14: error: no header providing "o2::track::TrackParCov" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:2894:26: error: no header providing "o2::track::TrackPar" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:3709:92: error: no header providing "std::milli" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGEM/PhotonMeson/Tasks/photonhbt.cxx:4800:26: error: no header providing "std::next" is directly included [misc-include-cleaner,-warnings-as-errors]
++ [[ 38 -gt 0 ]]
++ cat /sw/BUILD/9f14597ee38bd135d13adbaf97e9b7ff27b43207/O2Physics-code-check/warnings.txt
PWGEM/PhotonMeson/DataModel/gammaTables.h:304:30: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
PWGEM/PhotonMeson/TableProducer/photonMixedEventProducer.cxx:305:23: warning: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay]
PWGEM/PhotonMeson/TableProducer/photonMixedEventProducer.cxx:393:29: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
PWGEM/PhotonMeson/TableProducer/photonMixedEventProducer.cxx:394:29: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:204:3: warning: function 'posX' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:205:3: warning: function 'posY' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:206:3: warning: function 'posZ' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:207:3: warning: function 'covXX' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:208:3: warning: function 'covXY' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:209:3: warning: function 'covXZ' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:210:3: warning: function 'covYY' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:211:3: warning: function 'covYZ' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:212:3: warning: function 'covZZ' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:213:3: warning: function 'chi2' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:214:3: warning: function 'numContrib' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:1856:29: warning: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:2976:15: warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:3083:15: warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:3296:11: warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:3665:17: warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:3693:19: warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:4545:32: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
PWGEM/PhotonMeson/Tasks/photonhbt.cxx:4560:11: warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]
PWGEM/PhotonMeson/Tasks/photonhbt.cxx:4569:108: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
[0 more errors; see full log]

Full log here.

@alibuild

alibuild commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 08136eb at 2026-11-06 17:22:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'To reproduce the results below locally, run: '\''aliBuild build O2Physics-code-check -e ALIBUILD_BASE_HASH=upstream/master'\''.'
To reproduce the results below locally, run: 'aliBuild build O2Physics-code-check -e ALIBUILD_BASE_HASH=upstream/master'.
++ echo 'To apply all automatic fixes, add the '\''-e O2PHYSICS_CHECKER_FIX=1'\'' option.'
To apply all automatic fixes, add the '-e O2PHYSICS_CHECKER_FIX=1' option.
++ echo 'See the documentation for more details at: <https://aliceo2group.github.io/analysis-framework/docs/tools/#running-with-o2physics-code-check>.'
See the documentation for more details at: <https://aliceo2group.github.io/analysis-framework/docs/tools/#running-with-o2physics-code-check>.
++ echo 'Found 4 errors and 38 warnings.'
Found 4 errors and 38 warnings.
++ [[ 4 -gt 0 ]]
++ cat /sw/BUILD/61c75e6def5b4ac162b093ae951114affa6f58a4/O2Physics-code-check/errors.txt
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:67:1: error: included header TrackParametrization.h is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:235:14: error: no header providing "o2::track::TrackParCov" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:2894:26: error: no header providing "o2::track::TrackPar" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:3711:92: error: no header providing "std::milli" is directly included [misc-include-cleaner,-warnings-as-errors]
++ [[ 38 -gt 0 ]]
++ cat /sw/BUILD/61c75e6def5b4ac162b093ae951114affa6f58a4/O2Physics-code-check/warnings.txt
PWGEM/PhotonMeson/DataModel/gammaTables.h:304:30: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
PWGEM/PhotonMeson/TableProducer/photonMixedEventProducer.cxx:306:23: warning: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay]
PWGEM/PhotonMeson/TableProducer/photonMixedEventProducer.cxx:394:29: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
PWGEM/PhotonMeson/TableProducer/photonMixedEventProducer.cxx:395:29: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:204:3: warning: function 'posX' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:205:3: warning: function 'posY' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:206:3: warning: function 'posZ' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:207:3: warning: function 'covXX' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:208:3: warning: function 'covXY' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:209:3: warning: function 'covXZ' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:210:3: warning: function 'covYY' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:211:3: warning: function 'covYZ' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:212:3: warning: function 'covZZ' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:213:3: warning: function 'chi2' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:214:3: warning: function 'numContrib' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:1856:29: warning: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:2978:15: warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:3085:15: warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:3298:11: warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:3667:17: warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:3695:19: warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]
PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h:4547:32: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
PWGEM/PhotonMeson/Tasks/photonhbt.cxx:4561:11: warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]
PWGEM/PhotonMeson/Tasks/photonhbt.cxx:4570:108: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
PWGEM/PhotonMeson/Tasks/photonhbt.cxx:4570:124: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
PWGEM/PhotonMeson/Tasks/photonhbt.cxx:4579:99: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
PWGEM/PhotonMeson/Tasks/photonhbt.cxx:4579:115: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
PWGEM/PhotonMeson/Tasks/photonhbt.cxx:4579:150: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
PWGEM/PhotonMeson/Tasks/photonhbt.cxx:4579:164: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
PWGEM/PhotonMeson/Tasks/photonhbt.cxx:4615:11: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
[0 more errors; see full log]

Full log here.

@jokonig
jokonig merged commit e62d786 into AliceO2Group:master Nov 7, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

datamodel photon Photon and neutral meson PAG label pwgem

Development

Successfully merging this pull request may close these issues.

4 participants