Skip to content

[Common] Add ML-based MFT–MCH matching - #18737

Open
syano0822 wants to merge 5 commits into
AliceO2Group:masterfrom
syano0822:prep/mft-mch-matching-20261110
Open

syano0822 wants to merge 5 commits into
AliceO2Group:masterfrom
syano0822:prep/mft-mch-matching-20261110

Conversation

@syano0822

Copy link
Copy Markdown
Contributor

Extend MFT–MCH matching for data and MC.

  • Add configurable training-sample and evaluation modes for Same/Mixed candidate output and ONNX inference.
  • Support NN, XGBoost and configurable χ² matching with one-to-one assignment.
  • Include ambiguous MFT candidates through collision reassociation.
  • Store single-muon and Same/Mixed dimuon THnSparse outputs with configurable axes and cuts.
  • Add MC matching, decay-muon and particle-origin labels.

Add Common/Core/MftMchMatching.h to share candidate construction, track propagation, matching, ONNX inference and dimuon calculations between the data and MC workflows. This keeps their reconstruction and selection logic consistent and avoids duplicated implementations.

Extend the existing Common/DataModel/MatchMFTMuonData.h with the table definitions required by these workflows.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

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

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for 088646b at 2026-11-13 17:34:

## sw/BUILD/O2Physics-latest/log
/sw/slc9_x86-64/GCC-Toolchain/v14.2.0-alice2-1/include/c++/14.2.0/bits/stl_algobase.h:452:30: error: 'void* __builtin_memmove(void*, const void*, long unsigned int)' writing between 9 and 9223372036854775800 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/o2 for 088646b at 2026-11-13 17:39:

## sw/BUILD/O2Physics-latest/log
/sw/slc9_x86-64/GCC-Toolchain/v14.2.0-alice2-1/include/c++/14.2.0/bits/stl_algobase.h:452:30: error: 'void* __builtin_memmove(void*, const void*, long unsigned int)' writing between 9 and 9223372036854775800 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 088646b at 2026-11-13 19:36:

## 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 36 errors and 52 warnings.'
Found 36 errors and 52 warnings.
++ [[ 36 -gt 0 ]]
++ cat /sw/BUILD/d9bc513400768425bac8f72ed62d6df56b9206ca/O2Physics-code-check/errors.txt
Common/Core/MftMchMatching.h:19:1: error: included header CutsLibrary.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:20:1: error: included header VarManager.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:25:1: error: included header Centrality.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:26:1: error: included header CollisionAssociationTables.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:28:1: error: included header MatchMFTFT0.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:29:1: error: included header MatchMFTMuonData.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:30:1: error: included header Multiplicity.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:31:1: error: included header model.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:41:1: error: included header GRPMagField.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:54:1: error: included header TimingInfo.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:77:1: error: included header TMatrixDSymEigen.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:85:1: error: included header RtypesCore.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:94:1: error: included header deque is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:100:1: error: included header map is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:102:1: error: included header numeric is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:105:1: error: included header set is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:110:1: error: included header type_traits is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:111:1: error: included header unordered_map is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:804:5: error: no header providing "LOGF" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:985:10: error: no header providing "gGeoManager" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:1079:7: error: no header providing "LOG" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:1950:41: error: no header providing "TH1" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:2026:36: error: no header providing "std::ios" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:2211:29: error: no header providing "boost::property_tree::ptree" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:3221:63: error: redundant explicit casting to the same type 'int64_t' (aka 'long') as the sub-expression, remove this casting [readability-redundant-casting,-warnings-as-errors]
Common/Core/MftMchMatching.h:5800:35: error: no header providing "o2::framework::EndOfStreamContext" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:5902:54: error: no header providing "o2::framework::ConfigContext" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:5944:89: error: no header providing "o2::framework::WorkflowSpec" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:6008:31: error: no header providing "TAxis" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/TableProducer/match-mft-mch-data-mc.cxx:29:61: error: no header providing "o2::framework::VariantType" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/TableProducer/match-mft-mch-data-mc.cxx:68:13: error: no header providing "TNamed" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/TableProducer/match-mft-mch-data-mc.cxx:385:10: error: no header providing "o2::framework::AxisSpec" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/TableProducer/match-mft-mch-data-mc.cxx:570:103: error: no header providing "o2::constants::physics::MassMuon" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/TableProducer/match-mft-mch-data.cxx:21:21: error: no header providing "std::vector" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/TableProducer/match-mft-mch-data.cxx:23:61: error: no header providing "o2::framework::VariantType" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGDQ/Core/VarManager.h:69:10: error: 'KFPTrack.h' file not found [clang-diagnostic-error]
[0 more errors; see full log]

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/o2 for c931fec at 2026-11-14 01:24:

## sw/BUILD/O2Physics-latest/log
/sw/slc9_x86-64/GCC-Toolchain/v14.2.0-alice2-1/include/c++/14.2.0/bits/stl_algobase.h:452:30: error: 'void* __builtin_memmove(void*, const void*, long unsigned int)' writing between 9 and 9223372036854775800 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for c931fec at 2026-11-14 01:25:

## sw/BUILD/O2Physics-latest/log
/sw/slc9_x86-64/GCC-Toolchain/v14.2.0-alice2-1/include/c++/14.2.0/bits/stl_algobase.h:452:30: error: 'void* __builtin_memmove(void*, const void*, long unsigned int)' writing between 9 and 9223372036854775800 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
ninja: build stopped: subcommand failed.

Full log here.

@syano0822 syano0822 changed the title [Common] Add ML-based MFT–MCH matching and dimuon analysis [Common] Add ML-based MFT–MCH matching Nov 14, 2026
@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for eae2787 at 2026-11-14 02:05:

## 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 36 errors and 52 warnings.'
Found 36 errors and 52 warnings.
++ [[ 36 -gt 0 ]]
++ cat /sw/BUILD/9157999dbd4c0de6102b63b176e57690a1b74776/O2Physics-code-check/errors.txt
Common/Core/MftMchMatching.h:19:1: error: included header CutsLibrary.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:20:1: error: included header VarManager.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:25:1: error: included header Centrality.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:26:1: error: included header CollisionAssociationTables.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:28:1: error: included header MatchMFTFT0.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:29:1: error: included header MatchMFTMuonData.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:30:1: error: included header Multiplicity.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:31:1: error: included header model.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:41:1: error: included header GRPMagField.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:54:1: error: included header TimingInfo.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:77:1: error: included header TMatrixDSymEigen.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:85:1: error: included header RtypesCore.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:94:1: error: included header deque is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:100:1: error: included header map is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:102:1: error: included header numeric is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:105:1: error: included header set is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:110:1: error: included header type_traits is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:111:1: error: included header unordered_map is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:804:5: error: no header providing "LOGF" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:985:10: error: no header providing "gGeoManager" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:1079:7: error: no header providing "LOG" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:1950:41: error: no header providing "TH1" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:2026:36: error: no header providing "std::ios" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:2211:29: error: no header providing "boost::property_tree::ptree" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:3221:63: error: redundant explicit casting to the same type 'int64_t' (aka 'long') as the sub-expression, remove this casting [readability-redundant-casting,-warnings-as-errors]
Common/Core/MftMchMatching.h:5800:35: error: no header providing "o2::framework::EndOfStreamContext" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:5902:54: error: no header providing "o2::framework::ConfigContext" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:5944:89: error: no header providing "o2::framework::WorkflowSpec" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:6008:31: error: no header providing "TAxis" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/TableProducer/match-mft-mch-data-mc.cxx:29:61: error: no header providing "o2::framework::VariantType" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/TableProducer/match-mft-mch-data-mc.cxx:68:13: error: no header providing "TNamed" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/TableProducer/match-mft-mch-data-mc.cxx:385:10: error: no header providing "o2::framework::AxisSpec" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/TableProducer/match-mft-mch-data-mc.cxx:570:103: error: no header providing "o2::constants::physics::MassMuon" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/TableProducer/match-mft-mch-data.cxx:21:21: error: no header providing "std::vector" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/TableProducer/match-mft-mch-data.cxx:23:61: error: no header providing "o2::framework::VariantType" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGDQ/Core/VarManager.h:69:10: error: 'KFPTrack.h' file not found [clang-diagnostic-error]
[0 more errors; see full log]

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for c931fec at 2026-11-14 02:08:

## 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 36 errors and 52 warnings.'
Found 36 errors and 52 warnings.
++ [[ 36 -gt 0 ]]
++ cat /sw/BUILD/93d8558ca2ca8ae3137d14bd4cebe95b0f95a5c2/O2Physics-code-check/errors.txt
Common/Core/MftMchMatching.h:19:1: error: included header CutsLibrary.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:20:1: error: included header VarManager.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:25:1: error: included header Centrality.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:26:1: error: included header CollisionAssociationTables.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:28:1: error: included header MatchMFTFT0.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:29:1: error: included header MatchMFTMuonData.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:30:1: error: included header Multiplicity.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:31:1: error: included header model.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:41:1: error: included header GRPMagField.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:54:1: error: included header TimingInfo.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:77:1: error: included header TMatrixDSymEigen.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:85:1: error: included header RtypesCore.h is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:94:1: error: included header deque is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:100:1: error: included header map is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:102:1: error: included header numeric is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:105:1: error: included header set is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:110:1: error: included header type_traits is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:111:1: error: included header unordered_map is not used directly [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:804:5: error: no header providing "LOGF" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:985:10: error: no header providing "gGeoManager" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:1079:7: error: no header providing "LOG" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:1950:41: error: no header providing "TH1" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:2026:36: error: no header providing "std::ios" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:2211:29: error: no header providing "boost::property_tree::ptree" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:3221:63: error: redundant explicit casting to the same type 'int64_t' (aka 'long') as the sub-expression, remove this casting [readability-redundant-casting,-warnings-as-errors]
Common/Core/MftMchMatching.h:5800:35: error: no header providing "o2::framework::EndOfStreamContext" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:5902:54: error: no header providing "o2::framework::ConfigContext" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:5944:89: error: no header providing "o2::framework::WorkflowSpec" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/Core/MftMchMatching.h:6008:31: error: no header providing "TAxis" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/TableProducer/match-mft-mch-data-mc.cxx:29:61: error: no header providing "o2::framework::VariantType" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/TableProducer/match-mft-mch-data-mc.cxx:68:13: error: no header providing "TNamed" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/TableProducer/match-mft-mch-data-mc.cxx:385:10: error: no header providing "o2::framework::AxisSpec" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/TableProducer/match-mft-mch-data-mc.cxx:570:103: error: no header providing "o2::constants::physics::MassMuon" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/TableProducer/match-mft-mch-data.cxx:21:21: error: no header providing "std::vector" is directly included [misc-include-cleaner,-warnings-as-errors]
Common/TableProducer/match-mft-mch-data.cxx:23:61: error: no header providing "o2::framework::VariantType" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGDQ/Core/VarManager.h:69:10: error: 'KFPTrack.h' file not found [clang-diagnostic-error]
[0 more errors; see full log]

Full log here.

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

Development

Successfully merging this pull request may close these issues.

2 participants