Skip to content

[ALICE3] Added Multiplicity estimator task for ALICE3 - #17540

Open
axti98 wants to merge 8 commits into
AliceO2Group:masterfrom
axti98:Alice3MultDev
Open

[ALICE3] Added Multiplicity estimator task for ALICE3#17540
axti98 wants to merge 8 commits into
AliceO2Group:masterfrom
axti98:Alice3MultDev

Conversation

@axti98

@axti98 axti98 commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Added basic multiplicity estimator task in preparation for PbPb studies and multiplicity dependent studies. Currently, two estimator types are implemented:

  • Global Tracks: Any track with certain DCA, nSiliconHits and reconstruction flag. Properties are configurable
  • PVContributors: Any track that has contributed to the fit of the primary vertex. For now, this is actually every track with isReconstructed = true, since the full track array is passed to the computeVertex function. Might be adjusted later.
  • MCTruth estimation: All charged physical primaries from the generator and in the |eta| intervals 2.5, 1.25, and 0.9

Necessary changes in the TrackingTranslator because of data model change as well as in OTF Tracker

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown

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

Please consider the following formatting changes to AliceO2Group#17540
@axti98
axti98 marked this pull request as ready for review August 21, 2026 12:46
trackParCov.getSigma1Pt2());
tableMcTrackLabels(trackParCov.mcLabel, 0);
tableTracksExtraA3(trackParCov.nSiliconHits, trackParCov.nTPCHits, trackParCov.trackType);
tableTracksExtraA3(trackParCov.nSiliconHits, trackParCov.nTPCHits, trackParCov.trackType, true);

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.

shouldn't it be only if the track is a contributor?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I think I misunderstood something earlier. I have implemented it now that every track that contributed has a flag now which is checked in the table filling


auto charge = 0.;
auto* p = pdg->GetParticle(mcParticle.pdgCode());
if (p != nullptr) {

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I count it in several eta intervals, I would not use this function since then we have to loop again for each eta interval over all tracks which is quite inefficient?

multMC(numMCParticles, numMCParticlesEta25, numMCParticlesEta125, numMCParticlesEta09);
}

void processDummy(const aod::Collision&)

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.

why do you need the dummy?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Its sometimes more convenient on hyperloop to have a dummy process so you don't need to remove the task all the time

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 2427e80 at 2026-08-21 15:01:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'Found 55 errors and 52 warnings.'
Found 55 errors and 52 warnings.
++ [[ 55 -gt 0 ]]
++ cat /sw/BUILD/b82bcdeea63421624213d9aee1fcfc315e2ff357/O2Physics-code-check/errors.txt
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:109:9: error: function-like macro 'getHist' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:110:28: error: macro argument should be enclosed in parentheses [bugprone-macro-parentheses,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:111:9: error: variadic macro 'fillHist' used; consider using a 'constexpr' variadic template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:116:9: error: variadic macro 'insertHist' used; consider using a 'constexpr' variadic template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:131:8: error: constructor does not initialize these fields: thisCascade, thisV0, pdgDB, ccdb [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:274:9: error: constructor does not initialize these fields: mcLabel, isDecayDau, isWeakDecayDau, isUsedInCascading, nSiliconHits, nTPCHits, trackType [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:408:15: error: member 'timeResolutionNs' of type 'const float' is const qualified [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:409:15: error: member 'nsToMus' of type 'const float' is const qualified [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:410:15: error: member 'timeResolutionUs' of type 'const float' is const qualified [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:707:26: error: do not use static_cast to downcast from a base to a derived class; use dynamic_cast instead [cppcoreguidelines-pro-type-static-cast-downcast,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:761:53: error: repeated branch body in conditional chain [bugprone-branch-clone,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:769:56: error: repeated branch body in conditional chain [bugprone-branch-clone,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:789:36: error: the parameter 'particle' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:796:11: error: variable 'sna' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:796:16: error: variable 'csa' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:840:39: error: the parameter 'particle' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:893:90: error: the const qualified parameter 'histPath' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:954:5: error: uninitialized record type: 'isReco' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:955:5: error: uninitialized record type: 'nHitsCascadeProngs' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:956:5: error: uninitialized record type: 'nSiliconHitsCascadeProngs' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:957:5: error: uninitialized record type: 'nTPCHitsCascadeProngs' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1100:9: error: uninitialized record type: 'pos' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1101:9: error: uninitialized record type: 'posCascade' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1102:9: error: uninitialized record type: 'posP' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1103:9: error: uninitialized record type: 'negP' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1104:9: error: uninitialized record type: 'bachP' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1222:15: error: uninitialized record type: 'posClusterCandidate' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1275:9: error: uninitialized record type: 'pCasc' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1276:9: error: uninitialized record type: 'pBach' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1277:9: error: uninitialized record type: 'pV0' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1333:11: error: redundant condition 'reconstructedCascade' [bugprone-redundant-branch-condition,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1432:23: error: unused local variable 'histPath' of type 'const std::string' (aka 'const basic_string<char>') [bugprone-unused-local-non-trivial-variable,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1590:9: error: uninitialized record type: 'pos' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1591:9: error: uninitialized record type: 'posP' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1592:9: error: uninitialized record type: 'negP' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1753:32: error: slicing object from type 'TrackAlice3' to 'TrackParametrizationWithError<>' discards 40 bytes of state [cppcoreguidelines-slicing,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:2003:89: error: narrowing conversion from 'float' to 'int' [bugprone-narrowing-conversions,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:2012:61: error: narrowing conversion from 'float' to 'int' [bugprone-narrowing-conversions,-warnings-as-errors]
ALICE3/TableProducer/alice3Multiplicity.cxx:34:1: error: included header TH1.h is not used directly [misc-include-cleaner,-warnings-as-errors]
ALICE3/TableProducer/alice3Multiplicity.cxx:45:8: error: constructor does not initialize these fields: pdg [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:54:9: error: variable 'inputPath' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:88:9: error: function-like macro 'SETADDRESS' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
[0 more errors; see full log]

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for a8c7c4f at 2026-08-24 12:48:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/ALICE3/TableProducer/alice3TrackingTranslator.cxx:711:27: error: no match for call to '(o2::framework::Produces<o2::soa::Table<o2::aod::Hash<2060730016>, o2::aod::Hash<444252584>, o2::aod::Hash<2286545062> > >) (uint32_t&, int, int, bool, int)'
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:2227:20: error: expected primary-expression before ',' token
ninja: build stopped: subcommand failed.

Full log here.

@axti98
axti98 requested a review from njacazio August 24, 2026 11:03
@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 5cdbb84 at 2026-08-24 17:00:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'Found 26 errors and 34 warnings.'
Found 26 errors and 34 warnings.
++ [[ 26 -gt 0 ]]
++ cat /sw/BUILD/bda14d3f771ace341ba56f1a8daf9d69c2988026/O2Physics-code-check/errors.txt
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:266:9: error: constructor does not initialize these fields: trackType [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:426:107: error: the parameter 'axisSpecs' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:785:7: error: switch has 2 consecutive identical branches [bugprone-branch-clone,-warnings-as-errors]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1348:11: error: redundant condition 'reconstructedCascade' [bugprone-redundant-branch-condition,-warnings-as-errors]
ALICE3/TableProducer/alice3Multiplicity.cxx:34:1: error: included header TH1.h is not used directly [misc-include-cleaner,-warnings-as-errors]
ALICE3/TableProducer/alice3Multiplicity.cxx:45:8: error: constructor does not initialize these fields: pdg [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:49:1: error: included header algorithm is not used directly [misc-include-cleaner,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:59:9: error: variable 'inputPath' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:110:9: error: function-like macro 'SETADDRESS' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:111:44: error: macro argument should be enclosed in parentheses [bugprone-macro-parentheses,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:112:58: error: macro argument should be enclosed in parentheses [bugprone-macro-parentheses,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:116:5: error: constructor does not initialize these fields: mTree [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:116:28: error: the parameter 'filename' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:116:50: error: the parameter 'treename' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:140:77: error: parameter 'filename' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:140:87: error: parameter 'treename' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:183:75: error: parameter 'filename' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:183:85: error: parameter 'treename' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:217:74: error: parameter 'filename' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:217:84: error: parameter 'treename' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:291:73: error: parameter 'filename' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:291:83: error: parameter 'treename' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:331:20: error: variable 'file' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:332:22: error: do not use static_cast to downcast from a base to a derived class; use dynamic_cast instead [cppcoreguidelines-pro-type-static-cast-downcast,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:587:29: error: no header providing "M_PI" is directly included [misc-include-cleaner,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:593:42: error: no header providing "o2::constants::math::Almost1" is directly included [misc-include-cleaner,-warnings-as-errors]
++ [[ 34 -gt 0 ]]
++ cat /sw/BUILD/bda14d3f771ace341ba56f1a8daf9d69c2988026/O2Physics-code-check/warnings.txt
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:104:10: warning: inclusion of deprecated C++ header 'math.h'; consider using 'cmath' instead [modernize-deprecated-headers]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:263:20: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:293:5: warning: function 'getTimeMUS' should be marked [[nodiscard]] [modernize-use-nodiscard]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:295:20: warning: initializer for member 'timeEst' is redundant [readability-redundant-member-init]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:450:27: warning: use starts_with instead of find [modernize-use-starts-ends-with]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:730:5: warning: use auto when initializing with new to avoid duplicating the type name [modernize-use-auto]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1060:9: warning: do not use 'else' after 'continue' [readability-else-after-return]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1143:19: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1255:15: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1288:92: warning: redundant boolean literal in ternary expression result [readability-simplify-boolean-expr]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1962:57: warning: statement should be inside braces [readability-braces-around-statements]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1964:55: warning: statement should be inside braces [readability-braces-around-statements]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1966:54: warning: statement should be inside braces [readability-braces-around-statements]
ALICE3/TableProducer/OTF/onTheFlyTracker.cxx:1968:55: warning: statement should be inside braces [readability-braces-around-statements]
[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.

3 participants