Skip to content

[PWGCF] Femto Sigma0 implementation: builder, table producer, ppSigma0 task - #18723

Open
yakparo wants to merge 6 commits into
AliceO2Group:masterfrom
yakparo:sigma0builder
Open

yakparo wants to merge 6 commits into
AliceO2Group:masterfrom
yakparo:sigma0builder

Conversation

@yakparo

@yakparo yakparo commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions

Copy link
Copy Markdown

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

@github-actions github-actions Bot changed the title Femto Sigma0 implementation: builder, table producer, ppSigma0 task [PWGCF] Femto Sigma0 implementation: builder, table producer, ppSigma0 task Nov 13, 2026
@yakparo
yakparo marked this pull request as ready for review November 13, 2026 06:29
@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for be49428 at 2026-11-13 07:30:

No log files found

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/o2 for be49428 at 2026-11-13 07:50:

## sw/BUILD/O2-latest/log
2026-11-13T07:49:35.209+0100 [61325:140554152803968] [executioncontext.cpp:739] [ERROR] Failed to download output blob e5d511c38df4775d4f73fdda31ac5aa87d7b178a825fada5e12f7c1742efbce2: 13: Blob absent from sink after replication: Object not found
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for be49428 at 2026-11-13 07:51:

## 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 3 errors and 8 warnings.'
Found 3 errors and 8 warnings.
++ [[ 3 -gt 0 ]]
++ cat /sw/BUILD/83febe54fa5b052ceb3375f772bf76bcd29c5d71/O2Physics-code-check/errors.txt
PWGCF/Femto/Core/sigma0Builder.h:267:84: error: no header providing "o2::framework::HistType" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGCF/Femto/Core/sigma0HistManager.h:486:20: error: a template argument list is expected after a name prefixed by the template keyword [clang-diagnostic-missing-template-arg-list-after-template-kw]
PWGCF/Femto/TableProducer/femtoSigma0Producer.cxx:43:44: error: no header providing "o2::framework::OutputObjHandlingPolicy" is directly included [misc-include-cleaner,-warnings-as-errors]
++ [[ 8 -gt 0 ]]
++ cat /sw/BUILD/83febe54fa5b052ceb3375f772bf76bcd29c5d71/O2Physics-code-check/warnings.txt
PWGCF/Femto/Core/sigma0Builder.h:180:3: warning: function 'checkFilters' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGCF/Femto/Core/sigma0Builder.h:264:38: 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]
PWGCF/Femto/Core/tripletHistManager.h:697:26: warning: statement should be inside braces [readability-braces-around-statements]
PWGCF/Femto/Core/tripletHistManager.h:699:26: warning: statement should be inside braces [readability-braces-around-statements]
PWGCF/Femto/Core/tripletHistManager.h:701:26: warning: statement should be inside braces [readability-braces-around-statements]
PWGCF/Femto/Core/tripletHistManager.h:816:26: warning: statement should be inside braces [readability-braces-around-statements]
PWGCF/Femto/Core/tripletHistManager.h:818:26: warning: statement should be inside braces [readability-braces-around-statements]
PWGCF/Femto/Core/tripletHistManager.h:820:26: warning: statement should be inside braces [readability-braces-around-statements]
++ [[ 3 -gt 0 ]]
++ exit 1
--

Full log here.

@ariedel-cern ariedel-cern 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 @yakparo ,
many thanks for preparing this PR. There are some issues with the data model of the sigma0 and the builder.
Here are the 2 main points:

  • It does not provide useful information to store the index of the daughter lambda and its decay products for the sigma0. I would suggest doing it the way we do it for cascades, where we only store the indices of the daughter tracks. That is all the information necessary for pair cleaning/CPR/CTR.
  • Please check how TwoTrackResonance/TwoPhotonResonance builder are implemented. Apply selections on the daughters before they even enter the builder. Applying filters and bitmask by hand is way slower than using the Filter and Partitioning features of the O2 framework

DECLARE_SOA_INDEX_COLUMN_FULL(Photon, photon, int32_t, FPhotons, "_photon"); ///< row in FPhotons
// id columns for Lambda daughter tracks
DECLARE_SOA_INDEX_COLUMN_FULL(PosDau, posDau, int32_t, FTracks, "_PosDau"); //! index column for positive daughter track
DECLARE_SOA_INDEX_COLUMN_FULL(NegDau, negDau, int32_t, FTracks, "_NegDau"); //! index column for negative daughter track

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.

I am not sure all these indices are necessary. For example, for Cascade we only store the indices to the the daughter tracks (the secondary lambda we dont care about much and the when we we do pair cleaning or CPR, we always check on the track level). So I would remove here the index of the lambda

PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(femto-sigma0-producer

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.

Please rename the task to femto-producer-sigma0 to use the same convention as for the other producer tasks

sigma0builder::ConfSigma0Tables tables;
sigma0builder::Sigma0Builder sigma0Builder;

HistogramRegistry registry{"Sigma0", {}, OutputObjHandlingPolicy::AnalysisObject};

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.

Use a more descriptive name like FemtoProducerSigma0

// {
// sigma0Builder.fillSigma0s(products, lambdas, photons, tracks);
// }
void process(Lambdas const& lambdas, Photons const& photons, o2::aod::FTracks const& tracks, o2::aod::FCols const& /**/, o2::aod::FColMasks const& /**/, o2::aod::FTrackMasks const& /**/)

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 does not seem correct. Like this you would pare every lambda with every photon in every 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.

You have to subscribe to the collision iterate first to group the other tables by the collision index. then you can pare all particle in one collision to search for sigma0 candidates.

#include "PWGCF/Femto/Core/pairCleaner.h"
#include "PWGCF/Femto/Core/particleCleaner.h"
#include "PWGCF/Femto/Core/partitions.h"
// #include "PWGCF/Femto/Core/photonHistManager.h"

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.

Please done leave code commented

using FSigma0s = FSigma0s_001;

DECLARE_SOA_TABLE_STAGED_VERSIONED(FSigma0Masks_001, "FSIGMA0MASK", 1, //! sigma0 masks
femtosigma0s::Mask);

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.

Here you should store the bitmask of the daugher lambda and photon

// Preselect photons once and group their row indices by collision.
std::unordered_map<int64_t, std::vector<int64_t>> photonRowsPerCollision;
for (const auto& photon : photons) {
if (selectPhoton(photon)) {

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.

Don't do it like that. Specify a selection bit for the lambda and photon, and then partition them before feeding them to the builder. Please check how the twotrackresonancebuilder or the twophotonresonance builder implements the reconstruction of resonances.

return;
}

mPhotonMask = filter.photonMask.value;

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.

Filters for the daughters should be applied outside of the builder with a Filter

}

template <typename T>
bool selectLambda(T const& lambda)

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.

Remove, This should all happen, filtering and partioning should happen outside of the builder

template <typename TProducts, typename TLambda, typename TPhoton, typename TPosDau, typename TNegDau>
bool buildSigma0(TProducts& products, TLambda const& lambda, TPhoton const& photon, TPosDau const& posDau, TNegDau const& negDau)
{
const float lambdaPt = std::abs(lambda.signedPt());

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.

Please use ROOT::Math::PtEtaPhiMVector and then cache pt/eta/phi as class variables. Please check how twotrackresonance producer is implemented

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