Skip to content

Conversation

@FDUEnrich
Copy link
Contributor

No description provided.

@github-actions
Copy link

github-actions bot commented May 21, 2025

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

@github-actions github-actions bot changed the title Fix vector error in candidateSelectorOmegac0ToOmegaPi.cxx [PWGHF] Fix vector error in candidateSelectorOmegac0ToOmegaPi.cxx May 21, 2025
@vkucera
Copy link
Collaborator

vkucera commented May 21, 2025

Can you please explain the error that is fixed by this PR?

@FDUEnrich
Copy link
Contributor Author

Can you please explain the error that is fixed by this PR?

Hi Vit. The reason is that if we don't apply ML, std::vector outputMlOmegac would be an empty vector. If I fill outputMlOmegac[0] with other variables(such as Invmass). This will result in out-of-bounds access on a null vector.

@vkucera
Copy link
Collaborator

vkucera commented May 22, 2025

Can you please explain the error that is fixed by this PR?

Hi Vit. The reason is that if we don't apply ML, std::vector outputMlOmegac would be an empty vector. If I fill outputMlOmegac[0] with other variables(such as Invmass). This will result in out-of-bounds access on a null vector.

  1. It is not clear to me why you need to store outputMlOmegac[0] in the HfSelToOmegaPi table when the full outputMlOmegac vector is already stored in the HfMlSelOmegacToOmegaPi table.
  2. If you really need to store it, you can simply replace outputMlOmegac[0] with outputMlOmegac.size() > 0 ? outputMlOmegac[0] : -1.f.

@vkucera vkucera marked this pull request as draft May 22, 2025 16:38
Copy link
Collaborator

@fgrosa fgrosa left a comment

Choose a reason for hiding this comment

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

Hi @FDUEnrich @vkucera I would suggest to store directly the vector with BDT scores as done for the other channels (see

DECLARE_SOA_COLUMN(MlProbD0, mlProbD0, std::vector<float>); //!
DECLARE_SOA_COLUMN(MlProbD0bar, mlProbD0bar, std::vector<float>); //!
} // namespace hf_sel_candidate_d0
DECLARE_SOA_TABLE(HfSelD0, "AOD", "HFSELD0", //!
hf_sel_candidate_d0::IsSelD0,
hf_sel_candidate_d0::IsSelD0bar,
hf_sel_candidate_d0::IsRecoHfFlag,
hf_sel_candidate_d0::IsRecoTopol,
hf_sel_candidate_d0::IsRecoCand,
hf_sel_candidate_d0::IsRecoPid);
DECLARE_SOA_TABLE(HfMlD0, "AOD", "HFMLD0", //!
hf_sel_candidate_d0::MlProbD0,
hf_sel_candidate_d0::MlProbD0bar);
) in a separated joinable table. First of all, this gives the flexibility to use binary or multi class classification without changing data model, then it makes easier the inclusion of the OmegaC in already existing common code (i.e. flow task). In this way one does not even care about the size of the vector, even if empty.

@fgrosa
Copy link
Collaborator

fgrosa commented May 28, 2025

Hi @FDUEnrich do the last commits include everything you wanted to implement, or will you still add the ML table?

@FDUEnrich
Copy link
Contributor Author

Hi @FDUEnrich do the last commits include everything you wanted to implement, or will you still add the ML table?
Hi Fabrizio, yes. I'm still testing. I think I can fix this bug first. And add centrality and ML-joined table next time. When the test done I will open Ready for review. Tks

@FDUEnrich FDUEnrich marked this pull request as ready for review May 28, 2025 12:32
Please consider the following formatting changes to AliceO2Group#11286
@fgrosa fgrosa merged commit aa263d0 into AliceO2Group:master May 30, 2025
11 of 12 checks passed
@FDUEnrich FDUEnrich deleted the Fix-vector-error branch June 3, 2025 11:30
jinhyunni pushed a commit to jinhyunni/O2Physics that referenced this pull request Jun 11, 2025
hernasab pushed a commit to hernasab/O2Physics that referenced this pull request Jun 11, 2025
EmilGorm pushed a commit to EmilGorm/O2Physics that referenced this pull request Jun 12, 2025
prottayCMT pushed a commit to prottayCMT/O2Physics2024 that referenced this pull request Jun 12, 2025
ddobrigk pushed a commit to ddobrigk/O2Physics that referenced this pull request Jun 14, 2025
smaff92 pushed a commit to smaff92/O2Physics that referenced this pull request Jun 17, 2025
ddobrigk pushed a commit to ddobrigk/O2Physics that referenced this pull request Jul 16, 2025
alibuild added a commit to alibuild/O2Physics that referenced this pull request Aug 11, 2025
jloemker pushed a commit to jloemker/O2Physics that referenced this pull request Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

4 participants