Skip to content

[PWGCF] Change nsigma TOF selections to optional cuts, force bit=1 when no TOF is found - #17315

Open
allesgrau wants to merge 9 commits into
AliceO2Group:masterfrom
allesgrau:tof-selection-dau-bach
Open

[PWGCF] Change nsigma TOF selections to optional cuts, force bit=1 when no TOF is found#17315
allesgrau wants to merge 9 commits into
AliceO2Group:masterfrom
allesgrau:tof-selection-dau-bach

Conversation

@allesgrau

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

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

Comment thread PWGCF/Femto/Core/cascadeBuilder.h Outdated
o2::framework::Configurable<std::vector<float>> posDauTof{"posDauTof", {}, "Maximum |nsimga_Pion/Proton| TOF for positive daughter tracks"}; \
o2::framework::Configurable<std::vector<float>> negDauTof{"negDauTof", {}, "Maximum |nsigma_Pion/Proton| TOF for negative daughter tracks"};
o2::framework::Configurable<std::vector<float>> negDauTof{"negDauTof", {}, "Maximum |nsigma_Pion/Proton| TOF for negative daughter tracks"}; \
o2::framework::Configurable<bool> requireTof{"requireTof", false, "If true, only keep candidates whose daughters have a TOF signal"};

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 would introduce 2 new configurables

  • The first one you have, i.e. making TOF a minimal (true) or optional (false) selection
  • The second configurable should be called like "keepTracksWithoutTof", such that daughters without TOF can be kept

Comment thread PWGCF/Femto/Core/cascadeBuilder.h Outdated
mOmegaMassUpperLimit = filter.rejectMassOmegaMax.value;
this->addSelection(kBachelorTpcPion, cascadeSelectionNames.at(kBachelorTpcPion), config.bachelorTpcPion.value, limits::kAbsUpperLimit, true, true, false);
this->addSelection(kBachelorTofPion, cascadeSelectionNames.at(kBachelorTofPion), config.bachelorTofPion.value, limits::kAbsUpperLimit, true, true, false);
this->addSelection(kBachelorTofPion, cascadeSelectionNames.at(kBachelorTofPion), config.bachelorTofPion.value, limits::kAbsUpperLimit, true, false, false);

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 the flag should be set according to "requireTof" from the configuration

Comment thread PWGCF/Femto/Core/cascadeBuilder.h Outdated
mXiMassUpperLimit = filter.rejectMassXiMax.value;
this->addSelection(kBachelorTpcKaon, cascadeSelectionNames.at(kBachelorTpcKaon), config.bachelorTpcKaon.value, limits::kAbsUpperLimit, true, true, false);
this->addSelection(kBachelorTofKaon, cascadeSelectionNames.at(kBachelorTofKaon), config.bachelorTofKaon.value, limits::kAbsUpperLimit, true, true, false);
this->addSelection(kBachelorTofKaon, cascadeSelectionNames.at(kBachelorTofKaon), config.bachelorTofKaon.value, limits::kAbsUpperLimit, true, false, false);

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.

same as above

Comment thread PWGCF/Femto/Core/cascadeBuilder.h Outdated
if (bachelor.hasTOF()) {
this->evaluateObservable(kBachelorTofPion, bachelor.tofNSigmaPi());
this->evaluateObservable(kBachelorTofKaon, bachelor.tofNSigmaKa());
} else if (!mRequireTof) {

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 then check against the flag whether to keep tracks without Tof or not
Also, the limit to check against should be 0 (since it is a AbsUpperCut, so the only value which should alwasy succeed is 0. Using max value would always fail)

@ariedel-cern

Copy link
Copy Markdown
Collaborator

Hi @allesgrau ,
many thanks for the PR. I think the PR still needs some work. I commented here only the cascade builder, but the same comments apply also for the V0 builder.

Please consider the following formatting changes to AliceO2Group#17315
@alibuild

alibuild commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for 6a167d5 at 2026-08-04 23:35:

No log files found

Full log here.

#include <array>
#include <cmath>
#include <cstdint>
#include <limits>

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 include is no longer needed. Same in V0Builder

this->evaluateObservable(kBachelorTofPion, bachelor.tofNSigmaPi());
this->evaluateObservable(kBachelorTofKaon, bachelor.tofNSigmaKa());
} else if (mKeepTracksWithoutTof) {
this->setBitmask(kBachelorTofPion, 0);

@ariedel-cern ariedel-cern Aug 5, 2026

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 call would set the bitmask itself to 0, i.e. the selection would not be passed, which is what we want to avoid in this branch if the track has no TOF.
You have to call here

this->evaluateObservable(kBachelorTofPion, 0);

Like this we compare 0 against all the limits (which are positive definite), so all bits in the bitmask will be set to 1.
This applies to all other calls below (and in the V0Builder).

@alibuild

alibuild commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 6a167d5 at 2026-08-05 09:45:

## sw/BUILD/O2-latest/log
CMake Error in Detectors/Base/CMakeLists.txt:

Full log here.

@alibuild

alibuild commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/o2 for 6a167d5 at 2026-08-05 10:32:

## sw/BUILD/O2-latest/log
CMake Error in Detectors/Base/CMakeLists.txt:

Full log here.

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.

3 participants