Skip to content

[PWGHF] Implement checks for correlated backgrounds and for B->J/Psi(->ee)X decays in B->J/Psi workflow#17034

Open
fchinu wants to merge 2 commits into
AliceO2Group:masterfrom
fchinu:b0tojpsikstar
Open

[PWGHF] Implement checks for correlated backgrounds and for B->J/Psi(->ee)X decays in B->J/Psi workflow#17034
fchinu wants to merge 2 commits into
AliceO2Group:masterfrom
fchinu:b0tojpsikstar

Conversation

@fchinu

@fchinu fchinu commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions github-actions Bot added the pwghf PWG-HF label Jul 13, 2026
@github-actions github-actions Bot changed the title Implement checks for correlated backgrounds and for B->J/Psi(->ee)X decays in B->J/Psi workflow [PWGHF] Implement checks for correlated backgrounds and for B->J/Psi(->ee)X decays in B->J/Psi workflow Jul 13, 2026
@github-actions

Copy link
Copy Markdown

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

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/o2 for f8f1a3d at 2026-07-13 10:00:

## sw/BUILD/O2Physics-latest/log
c++: fatal error: Killed signal terminated program cc1plus
c++: fatal error: Killed signal terminated program cc1plus
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for f8f1a3d at 2026-07-13 11:31:

## sw/BUILD/O2Physics-latest/log
c++: fatal error: Killed signal terminated program cc1plus
c++: fatal error: Killed signal terminated program cc1plus
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

alibuild commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for efde8ae at 2026-07-14 00:20:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'Found 8 errors and 0 warnings.'
Found 8 errors and 0 warnings.
++ [[ 8 -gt 0 ]]
++ cat /sw/BUILD/5666abe464e6f62d04bcac0d6dcb8fe89e3f6507/O2Physics-code-check/errors.txt
PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx:105:65: error: variable 'partlyRecoDecayMapMuMu' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx:110:65: error: variable 'partlyRecoDecayMapEE' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx:241:52: error: 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,-warnings-as-errors]
PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx:259:60: error: 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,-warnings-as-errors]
PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx:214:52: error: 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,-warnings-as-errors]
PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx:231:60: error: 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,-warnings-as-errors]
PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx:239:52: error: 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,-warnings-as-errors]
PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx:256:60: error: 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,-warnings-as-errors]
++ [[ 0 -gt 0 ]]
++ [[ 8 -gt 0 ]]
++ exit 1
--

Full log here.

@fgrosa fgrosa 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.

Thanks @fchinu! A couple of comments below

Comment on lines +231 to +232
if (std::accumulate(doProcess.begin(), doProcess.end(), 0) == 0) {
LOGP(fatal, "Enable at least one process function, please fix your configuration!");

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.

Is more than one process function enabled allowed?

Comment on lines +553 to +584
// Partly reconstructed decays, i.e. the 3 prongs have a common b-hadron ancestor
// convention: final state particles are prong0,1,2
if (!flag) {
auto particleProng0 = vecDaughtersB[0].mcParticle();
auto particleProng1 = vecDaughtersB[1].mcParticle();
auto particleProng2 = vecDaughtersB[2].mcParticle();
// b-hadron hypothesis
std::array<int, 3> const bHadronMotherHypos = {Pdg::kB0, Pdg::kBS, Pdg::kLambdaB0};

for (const auto& bHadronMotherHypo : bHadronMotherHypos) {
int const index0Mother = RecoDecay::getMother(particlesMc, particleProng0, bHadronMotherHypo, true);
int const index1Mother = RecoDecay::getMother(particlesMc, particleProng1, bHadronMotherHypo, true);
int const index2Mother = RecoDecay::getMother(particlesMc, particleProng2, bHadronMotherHypo, true);

// look for common b-hadron ancestor
if (index0Mother > -1 && index1Mother > -1 && index2Mother > -1) {
if (index0Mother == index1Mother && index1Mother == index2Mother) {
int pdgCodeBeautyMother = particlesMc.rawIteratorAt(index0Mother).pdgCode();
// look for common J/psi-hadron mother among prongs 0, 1 and 2
int const index0JpsiMother = RecoDecay::getMother(particlesMc, particleProng0, Pdg::kJPsi, true, &sign, 1);
int const index1JpsiMother = RecoDecay::getMother(particlesMc, particleProng1, Pdg::kJPsi, true, &sign, 1);
if (index0JpsiMother > -1 && index1JpsiMother > -1 && index0JpsiMother == index1JpsiMother) {
if (std::abs(particleProng0.pdgCode()) == kMuonMinus && std::abs(particleProng1.pdgCode()) == kMuonMinus) {
flag = partlyRecoDecayMapMuMu[std::abs(pdgCodeBeautyMother)];
} else if (std::abs(particleProng0.pdgCode()) == kElectron && std::abs(particleProng1.pdgCode()) == kElectron) {
flag = partlyRecoDecayMapEE[std::abs(pdgCodeBeautyMother)];
}
break;
}
}
}
}

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.

In principle this could be done more easily with the function

template <bool acceptFlavourOscillation = false, bool checkProcess = false, bool acceptIncompleteReco = false, bool acceptTrackDecay = false, bool acceptTrackIntWithMaterial = false, std::size_t N, typename T, typename U>
static int getMatchedMCRec(const T& particlesMC,

enabling the acceptIncompleteReco flag, or am I missing something?
It can also be modified in a subsequent PR in case

if (checkDecayTypeMc) {
// B+ → J/Psi K+ → (e+e-) K+
if (!flag) {
indexRec = RecoDecay::getMatchedMCRec<true, false, false, true, true>(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2]}, Pdg::kBPlus, std::array{-kElectron, +kElectron, +kKPlus}, true, &sign, 3);

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 the only important comment: we have to accept incomplete decays, because we often have a photon emitted which ends up in the decay chain (in particular for the EE channel, but also with MuMu if I am not mistaken)

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for efde8ae at 2026-07-14 01:24:

## sw/BUILD/O2Physics-latest/log
c++: fatal error: Killed signal terminated program cc1plus
c++: fatal error: Killed signal terminated program cc1plus
c++: fatal error: Killed signal terminated program cc1plus
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

Labels

pwghf PWG-HF

Development

Successfully merging this pull request may close these issues.

3 participants