Skip to content

Commit d8cfa84

Browse files
authored
[PWGCF] FemtoUniverse: Fix doFractionsMCTruth function (#14555)
1 parent b617ecd commit d8cfa84

File tree

1 file changed

+33
-25
lines changed

1 file changed

+33
-25
lines changed

PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -882,40 +882,48 @@ struct FemtoUniversePairTaskTrackTrackMultKtExtended {
882882
/// \tparam isMC: enables Monte Carlo truth specific histograms
883883
/// \param groupPartsOne partition for the first particle passed by the process function
884884
/// \param groupPartsTwo partition for the second particle passed by the process function
885-
template <bool isMC, bool doFractions, typename PartitionType>
885+
template <bool isMC, typename PartitionType>
886886
void doFractionsMCTruth(PartitionType groupPartsOne, PartitionType groupPartsTwo, int ContType)
887887
{
888-
889-
for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) {
890-
891-
int pdgCodePartOne = static_cast<int>(p1.pidCut());
892-
const auto& pdgParticleOne = pdg->GetParticle(pdgCodePartOne);
893-
int pdgCodePartTwo = static_cast<int>(p2.pidCut());
894-
const auto& pdgParticleTwo = pdg->GetParticle(pdgCodePartTwo);
895-
switch (ContType) {
896-
case 1: {
888+
switch (ContType) {
889+
case 1: {
890+
for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) {
891+
int pdgCodePartOne = static_cast<int>(p1.pidCut());
892+
const auto& pdgParticleOne = pdg->GetParticle(pdgCodePartOne);
893+
int pdgCodePartTwo = static_cast<int>(p2.pidCut());
894+
const auto& pdgParticleTwo = pdg->GetParticle(pdgCodePartTwo);
897895
if (pdgParticleOne && pdgParticleTwo && (pdgCodePartOne == trackonefilter.confPDGCodePartOne) && (pdgCodePartTwo == tracktwofilter.confPDGCodePartTwo)) {
898-
continue;
896+
mixedMultRegistryPM.fill(HIST("MCtruth/motherParticle"), p1.tempFitVar(), p2.tempFitVar());
899897
}
900-
mixedMultRegistryPM.fill(HIST("MCtruth/motherParticle"), p1.tempFitVar(), p2.tempFitVar());
901-
break;
902898
}
903-
case 2: {
899+
break;
900+
}
901+
case 2: {
902+
for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsOne))) {
903+
int pdgCodePartOne = static_cast<int>(p1.pidCut());
904+
const auto& pdgParticleOne = pdg->GetParticle(pdgCodePartOne);
905+
int pdgCodePartTwo = static_cast<int>(p2.pidCut());
906+
const auto& pdgParticleTwo = pdg->GetParticle(pdgCodePartTwo);
904907
if (pdgParticleOne && pdgParticleTwo && (pdgCodePartOne == trackonefilter.confPDGCodePartOne) && (pdgCodePartTwo == trackonefilter.confPDGCodePartOne)) {
905-
continue;
908+
mixedMultRegistryPP.fill(HIST("MCtruth/motherParticle"), p1.tempFitVar(), p2.tempFitVar());
906909
}
907-
mixedMultRegistryPP.fill(HIST("MCtruth/motherParticle"), p1.tempFitVar(), p2.tempFitVar());
908-
break;
909910
}
910-
case 3: {
911+
break;
912+
}
913+
case 3: {
914+
for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsTwo, groupPartsTwo))) {
915+
int pdgCodePartOne = static_cast<int>(p1.pidCut());
916+
const auto& pdgParticleOne = pdg->GetParticle(pdgCodePartOne);
917+
int pdgCodePartTwo = static_cast<int>(p2.pidCut());
918+
const auto& pdgParticleTwo = pdg->GetParticle(pdgCodePartTwo);
911919
if (pdgParticleOne && pdgParticleTwo && (pdgCodePartOne == tracktwofilter.confPDGCodePartTwo) && (pdgCodePartTwo == tracktwofilter.confPDGCodePartTwo)) {
912-
continue;
920+
mixedMultRegistryMM.fill(HIST("MCtruth/motherParticle"), p1.tempFitVar(), p2.tempFitVar());
913921
}
914-
mixedMultRegistryMM.fill(HIST("MCtruth/motherParticle"), p1.tempFitVar(), p2.tempFitVar());
915922
}
916-
default:
917-
break;
923+
break;
918924
}
925+
default:
926+
break;
919927
}
920928
}
921929

@@ -942,13 +950,13 @@ struct FemtoUniversePairTaskTrackTrackMultKtExtended {
942950
auto groupPartsOne = partsOneMCTruth->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache);
943951
auto groupPartsTwo = partsTwoMCTruth->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache);
944952
if (processPair.cfgProcessPM) {
945-
doFractionsMCTruth<true, true>(groupPartsOne, groupPartsTwo, 1);
953+
doFractionsMCTruth<true>(groupPartsOne, groupPartsTwo, 1);
946954
}
947955
if (processPair.cfgProcessPP) {
948-
doFractionsMCTruth<true, true>(groupPartsOne, groupPartsOne, 2);
956+
doFractionsMCTruth<true>(groupPartsOne, groupPartsOne, 2);
949957
}
950958
if (processPair.cfgProcessMM) {
951-
doFractionsMCTruth<true, true>(groupPartsTwo, groupPartsTwo, 3);
959+
doFractionsMCTruth<true>(groupPartsTwo, groupPartsTwo, 3);
952960
}
953961
}
954962
}

0 commit comments

Comments
 (0)