Skip to content

[ALICE3] Adapt input file handling to new ACTS input format - #17370

Open
lhusova wants to merge 1 commit into
AliceO2Group:masterfrom
lhusova:alice3Dev
Open

[ALICE3] Adapt input file handling to new ACTS input format#17370
lhusova wants to merge 1 commit into
AliceO2Group:masterfrom
lhusova:alice3Dev

Conversation

@lhusova

@lhusova lhusova commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

update of the translator to be consistent with the new ACTS output structure

@github-actions github-actions Bot changed the title Adapt input file handling to new ACTS input format [ALICE3] Adapt input file handling to new ACTS input format Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

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

@njacazio
njacazio marked this pull request as ready for review August 18, 2026 10:36
@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for c7268d8 at 2026-08-18 12:49:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/ALICE3/TableProducer/alice3TrackingTranslator.cxx:573:19: error: unused variable 'm' [-Werror=unused-variable]
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for c7268d8 at 2026-08-18 12:51:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'Found 32 errors and 26 warnings.'
Found 32 errors and 26 warnings.
++ [[ 32 -gt 0 ]]
++ cat /sw/BUILD/8ae862955170c51481b425c6cd89cd5a37f9023c/O2Physics-code-check/errors.txt
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:300:5: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:301:5: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-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:475:34: error: use 'contains' to check for membership [readability-container-contains,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:480:37: error: use 'contains' to check for membership [readability-container-contains,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:482:15: error: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:573:19: error: Value stored to 'm' during its initialization is never read [clang-analyzer-deadcode.DeadStores,-warnings-as-errors]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:573:19: error: unused variable 'm' [clang-diagnostic-unused-variable,-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]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:943:5: error: use auto when initializing with a template cast to avoid duplicating the type name [modernize-use-auto,-warnings-as-errors]
ALICE3/Tasks/alice3Strangeness.cxx:60:8: error: constructor does not initialize these fields: appliedSelectionCheckMask, selectionCheck, selectionCheckPos [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
ALICE3/Tasks/alice3Strangeness.cxx:172:13: error: member 'posDaugDCAselIDx' of type 'const int' is const qualified [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]
ALICE3/Tasks/alice3Strangeness.cxx:173:20: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-warnings-as-errors]
ALICE3/Tasks/alice3Strangeness.cxx:217:11: error: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto,-warnings-as-errors]
++ [[ 26 -gt 0 ]]
++ cat /sw/BUILD/8ae862955170c51481b425c6cd89cd5a37f9023c/O2Physics-code-check/warnings.txt
ALICE3/TableProducer/alice3TrackingTranslator.cxx:706:31: warning: statement should be inside braces [readability-braces-around-statements]
ALICE3/TableProducer/alice3TrackingTranslator.cxx:708:13: warning: statement should be inside braces [readability-braces-around-statements]
ALICE3/Tasks/alice3Strangeness.cxx:443:91: warning: statement should be inside braces [readability-braces-around-statements]
ALICE3/Tasks/alice3Strangeness.cxx:446:91: warning: statement should be inside braces [readability-braces-around-statements]
ALICE3/Tasks/alice3Strangeness.cxx:449:78: warning: statement should be inside braces [readability-braces-around-statements]
ALICE3/Tasks/alice3Strangeness.cxx:452:69: warning: statement should be inside braces [readability-braces-around-statements]
ALICE3/Tasks/alice3Strangeness.cxx:455:158: warning: statement should be inside braces [readability-braces-around-statements]
ALICE3/Tasks/alice3Strangeness.cxx:489:78: warning: statement should be inside braces [readability-braces-around-statements]
[0 more errors; see full log]

Full log here.

@jesgum jesgum left a comment

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.

Hi @lhusova I just have some minor suggestions :-)

void addMCParticle(int collIndex, ParticleStruct& fileParticles, int iParticle, uint8_t flags, int firstMother, int firstDaughter, int numberOfHits)
void addMCParticle(int collIndex, ParticleStruct& fileParticles, int iParticle, uint8_t flags, int firstMother, int firstDaughter, int secondDaughter, int numberOfHits)
{
int mothers[2] = {firstMother, -1};

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.

The array of mother indices stores the first and last index similar to the daughter one, so what I did for with the decayer for one mother, is that i stored the index both first and last. This is what lets you loop over the mother array like we do in the sameMotherCheck

for (const auto& mcParticleMother : mcParticle.template mothers_as<aod::McParticles>())

It might still be okay to keep it like this but I would change it just in case

Suggested change
int mothers[2] = {firstMother, -1};
int mothers[2] = {firstMother, firstMother};


histos.fill(HIST("hV0Building"), 3.0);

// TODO: not all ACTS tracks have MC association, so this check is not possible for all candidates, fix is needed

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.

This is maybe beyond the scope of this PR but would it not be possible to wrap this block into

if (posTrack.has_mcParticle() && negTrack.has_mcParticle()) {
 // de-reference mcparticle
}

From what I remember, all ACTS tracks would not necessarily have an associated MC particle, but if that's the case, the index in aod::McTrackLabels could be set to -1 (maybe it is already). Because what has_mcParticle() checks if the index is greater than zero, so we would never enter this block if there is no associated mcParticle

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/o2 for c7268d8 at 2026-08-18 17:53:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/ALICE3/TableProducer/alice3TrackingTranslator.cxx:573:19: error: unused variable 'm' [-Werror=unused-variable]
ninja: build stopped: subcommand failed.

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