Skip to content

Conversation

@feisenhu
Copy link
Collaborator

…InBeautyDecay()

Trying to differentiate in case of the MC signal b2c2e whether only one or possibly two/more charmed hadrons were produced in the decay of the beauty hadron.

So additional decay types were added: b2cc2e_b2c2e and b2cc2e_b2cc2e

@jjungIKF @rbailhac Could I ask you to check this changes, and if you agree with the implementation?

@github-actions github-actions bot added the pwgem label Feb 12, 2026
@github-actions github-actions bot changed the title Differentiate between b2c2e and b2cc2e, add function hasNCharmHadrons… [PWGEM] Differentiate between b2c2e and b2cc2e, add function hasNCharmHadrons… Feb 12, 2026
mothers_pdg2.shrink_to_fit();
return static_cast<int>(EM_HFeeType::kBCe_BCe); // b->c->e and b->c->e, decay type = 1
int n_c_from_b1 = hasNCharmHadronsInBeautyDecay(p1, mcparticles);
int n_c_from_b2 = hasNCharmHadronsInBeautyDecay(p2, mcparticles);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Dear Florian.
I am not sure this implementation would be backward compatible.
To me, the code looks like while we were before looking at the sum of all the decays, you now implemented a granularity to select decays with multiple charm quarks from 1 b quark.
So, simply running a task that is configured without this new feature would reduce the decay type 1. I think this is not how a new feature should be implemented. Also, it seems you did not test this before, as the compilation failed.
In general, I would prefer it if you changed the central code, there would at least be a test that the default behaviour from before is not changed by a new implementation.
Could you check this locally first please?

Copy link
Collaborator Author

@feisenhu feisenhu Feb 12, 2026

Choose a reason for hiding this comment

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

It was tested.
It just appears that I have missed one line when adding the changes for the commit in patch mode.

Yes the decay type 1 (b2c2l) will be reduced by the amount of signal which has more than one charmed hadron in the decay of the beauty hadron.

Currently I don't see an alternative on how to implement this, without touching the decay type,
as the decision on the decay type is made in the IsHF() function of the MCUtilities.h and the information about the decay history is no longer available when filling the histograms in the fillRecHistograms().

One could discuss, whether the mcparticles should be parsed to the fillRecHistograms() function. This would allow me to select the signal within the function hasNCharmHadronsInBeautyDecay() by calling the new function there, but when trying to stay consistent with the current code this is not possible.

And if preferred, I can also add the histograms for b2cc2l_b2c2l and b2cc2l_b2ccl for all tasks.
That way no information should be lost and one can sum up all cases to come back to the inclusive one.

If you have any other suggestions please let me know.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi Sebastian,
Hi Florian,
By doing grep -rnw . -e kBCe_BCe, I see that Tasks/studyMCTruth.cxx, Tasks/studyDCAFitter.cxx, Core/DileptonMC.h are using this variable. If there is no other solution, you could for the tasks which do not need the separation do for example for studyMCTruth.cxx L 300:

switch (hfll_type) {
case static_cast(EM_HFeeType::kBCe_BCe): // ULS
fRegistry.fill(HIST("Pair/") + HIST(evNames[evtype]) + HIST("bbbar/") + HIST(dileptonSigns[signtype]) + HIST("hMvsPt"), v12.M(), v12.Pt());

case static_cast(EM_HFeeType::kBCCe_BCe): // ULS
fRegistry.fill(HIST("Pair/") + HIST(evNames[evtype-3]) + HIST("bbbar/") + HIST(dileptonSigns[signtype]) + HIST("hMvsPt"), v12.M(), v12.Pt());

case static_cast(EM_HFeeType::kBCCe_BCCe): // ULS
fRegistry.fill(HIST("Pair/") + HIST(evNames[evtype-4]) + HIST("bbbar/") + HIST(dileptonSigns[signtype]) + HIST("hMvsPt"), v12.M(), v12.Pt());
....
}

So that the output do not change for this task. Something similar but a bit difference can be done for evaluateAcceptance.cxx L 295, studyDCAFitter.cxx L534, L786, DileptonNC.h L1733, L1917, L2435.
Please check with your recent O2Physics that there is no further cases.
My two cents,
Raphaelle

Copy link
Collaborator

@dsekihat dsekihat Feb 12, 2026

Choose a reason for hiding this comment

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

Hi Raphaelle, Florian,
I think Sebastian's point is opposite. He wants to keep DileptonMC.h unchanged. Here, I agree with Sebastian.
Can I modify your PR? I have an idea to minimize the impact and total modification.
best regards, Daiki

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hey Daiki, yes please go ahead, if you have a solution to modify this in a different way.

@alibuild
Copy link
Collaborator

Error while checking build/O2Physics/o2 for 700f069 at 2026-02-12 17:29:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/14941-slc9_x86-64/0/PWGEM/Dilepton/Utils/MCUtilities.h:513:1: error: control reaches end of non-void function [-Werror=return-type]
/sw/SOURCES/O2Physics/14941-slc9_x86-64/0/PWGEM/Dilepton/Utils/MCUtilities.h:513:1: error: control reaches end of non-void function [-Werror=return-type]
/sw/SOURCES/O2Physics/14941-slc9_x86-64/0/PWGEM/Dilepton/Utils/MCUtilities.h:513:1: error: control reaches end of non-void function [-Werror=return-type]
/sw/SOURCES/O2Physics/14941-slc9_x86-64/0/PWGEM/Dilepton/Utils/MCUtilities.h:513:1: error: control reaches end of non-void function [-Werror=return-type]
/sw/SOURCES/O2Physics/14941-slc9_x86-64/0/PWGEM/Dilepton/Utils/MCUtilities.h:513:1: error: control reaches end of non-void function [-Werror=return-type]
/sw/SOURCES/O2Physics/14941-slc9_x86-64/0/PWGEM/Dilepton/Utils/MCUtilities.h:513:1: error: control reaches end of non-void function [-Werror=return-type]
ninja: build stopped: subcommand failed.

Full log here.

@alibuild
Copy link
Collaborator

Error while checking build/O2Physics/o2 for 6fd19f4 at 2026-02-12 21:48:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/14941-slc9_x86-64/0/PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx:335:3: error: too many initializers for 'const std::string_view [20]' {aka 'const std::basic_string_view<char> [20]'}
/sw/SOURCES/O2Physics/14941-slc9_x86-64/0/PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx:1007:78: error: array subscript value '21' is outside the bounds of array 'checkMCPairTemplate<o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron, o2::soa::Filtered<o2::soa::JoinFull<o2::aod::Hash<1837103245>, o2::soa::Table<o2::aod::Hash<3050461119>, o2::aod::Hash<53502331>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<1214737701>, o2::aod::Hash<917241922>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<1217328006>, o2::aod::Hash<533975101>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<4037642082>, o2::aod::Hash<465328510>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<1456056182>, o2::aod::Hash<1973153968>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<4249665064>, o2::aod::Hash<1094581291>, o2::aod::Hash<2286545062> > > >, o2::soa::JoinFull<o2::aod::Hash<1837103245>, o2::soa::Table<o2::aod::Hash<2464919702>, o2::aod::Hash<1817680297>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<2714585608>, o2::aod::Hash<932072256>, o2::aod::Hash<2286545062> > > >::dilepton_source_types' of type 'const std::string_view [20]' {aka 'const std::basic_string_view<char> [20]'}
/sw/SOURCES/O2Physics/14941-slc9_x86-64/0/PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx:1009:78: error: array subscript value '21' is outside the bounds of array 'checkMCPairTemplate<o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron, o2::soa::Filtered<o2::soa::JoinFull<o2::aod::Hash<1837103245>, o2::soa::Table<o2::aod::Hash<3050461119>, o2::aod::Hash<53502331>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<1214737701>, o2::aod::Hash<917241922>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<1217328006>, o2::aod::Hash<533975101>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<4037642082>, o2::aod::Hash<465328510>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<1456056182>, o2::aod::Hash<1973153968>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<4249665064>, o2::aod::Hash<1094581291>, o2::aod::Hash<2286545062> > > >, o2::soa::JoinFull<o2::aod::Hash<1837103245>, o2::soa::Table<o2::aod::Hash<2464919702>, o2::aod::Hash<1817680297>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<2714585608>, o2::aod::Hash<932072256>, o2::aod::Hash<2286545062> > > >::dilepton_source_types' of type 'const std::string_view [20]' {aka 'const std::basic_string_view<char> [20]'}
/sw/SOURCES/O2Physics/14941-slc9_x86-64/0/PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx:1011:78: error: array subscript value '21' is outside the bounds of array 'checkMCPairTemplate<o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron, o2::soa::Filtered<o2::soa::JoinFull<o2::aod::Hash<1837103245>, o2::soa::Table<o2::aod::Hash<3050461119>, o2::aod::Hash<53502331>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<1214737701>, o2::aod::Hash<917241922>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<1217328006>, o2::aod::Hash<533975101>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<4037642082>, o2::aod::Hash<465328510>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<1456056182>, o2::aod::Hash<1973153968>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<4249665064>, o2::aod::Hash<1094581291>, o2::aod::Hash<2286545062> > > >, o2::soa::JoinFull<o2::aod::Hash<1837103245>, o2::soa::Table<o2::aod::Hash<2464919702>, o2::aod::Hash<1817680297>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<2714585608>, o2::aod::Hash<932072256>, o2::aod::Hash<2286545062> > > >::dilepton_source_types' of type 'const std::string_view [20]' {aka 'const std::basic_string_view<char> [20]'}
ninja: build stopped: subcommand failed.

Full log here.

@dsekihat
Copy link
Collaborator

dsekihat commented Feb 12, 2026

Hi Florian, I modified MCUtilities.h and checkMCPairTemplate.cxx. You should call IsHF<true>(...) to enable more differential study in checkMCPairTemplate.cxx. The default value is false to keep backward compatibility in other codes.
In addition, I fixed static constexpr std::string_view dilepton_source_types[20] to static constexpr std::string_view dilepton_source_types[22], because you added more type names.

@feisenhu
Copy link
Collaborator Author

Yes, by introducing a boolean as template helps keeping the backward compatibility.
Thank you, for your help.

@rbailhac
Copy link
Collaborator

Thanks Daiki ! Elegant way to solve this....

@feisenhu feisenhu enabled auto-merge (squash) February 13, 2026 08:44
Copy link
Collaborator

@alibuild alibuild left a comment

Choose a reason for hiding this comment

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

Auto-approving on behalf of @feisenhu.

@feisenhu feisenhu merged commit 835ba29 into AliceO2Group:master Feb 13, 2026
11 checks passed
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.

5 participants