From 26889fa7ffe0fcc78435202a361cf4ab48ad840c Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Wed, 27 Aug 2025 11:19:23 +0200 Subject: [PATCH 1/2] add switch to select only negative charges also in MC --- PWGLF/TableProducer/Nuspex/ebyeMaker.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx index 9f01ecdb1a5..15d667882e2 100644 --- a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx +++ b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx @@ -854,8 +854,11 @@ struct EbyeMaker { continue; auto pdgCode = mcPart.pdgCode(); auto genPt = std::hypot(mcPart.px(), mcPart.py()); - if ((std::abs(pdgCode) == PDG_t::kPiPlus || std::abs(pdgCode) == PDG_t::kElectron || std::abs(pdgCode) == PDG_t::kMuonMinus || std::abs(pdgCode) == PDG_t::kKPlus || std::abs(pdgCode) == PDG_t::kProton) && mcPart.isPhysicalPrimary() && genPt > ptMin[0] && genPt < ptMax[0]) - nChPartGen++; + if ((std::abs(pdgCode) == PDG_t::kPiPlus || std::abs(pdgCode) == PDG_t::kElectron || std::abs(pdgCode) == PDG_t::kMuonMinus || std::abs(pdgCode) == PDG_t::kKPlus || std::abs(pdgCode) == PDG_t::kProton) && mcPart.isPhysicalPrimary() && genPt > ptMin[0] && genPt < ptMax[0]) { + int ch = (pdgCode == PDG_t::kPiPlus || pdgCode == -PDG_t::kElectron || pdgCode == -PDG_t::kMuonMinus || pdgCode == PDG_t::kKPlus || PDG_t::kProton) ? 1 : -1; + if ((ch < 0 && countOnlyNegTrk) || !countOnlyNegTrk) + nChPartGen++; + } if (std::abs(pdgCode) == PDG_t::kLambda0) { if (!mcPart.isPhysicalPrimary() && !mcPart.has_mothers()) continue; From 3e2bf4c2a07f9fa6e2611ea31ea25bf92dc1c8ea Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Wed, 27 Aug 2025 12:07:32 +0200 Subject: [PATCH 2/2] fix conditional statement --- PWGLF/TableProducer/Nuspex/ebyeMaker.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx index 15d667882e2..8c1c58e272a 100644 --- a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx +++ b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx @@ -855,7 +855,7 @@ struct EbyeMaker { auto pdgCode = mcPart.pdgCode(); auto genPt = std::hypot(mcPart.px(), mcPart.py()); if ((std::abs(pdgCode) == PDG_t::kPiPlus || std::abs(pdgCode) == PDG_t::kElectron || std::abs(pdgCode) == PDG_t::kMuonMinus || std::abs(pdgCode) == PDG_t::kKPlus || std::abs(pdgCode) == PDG_t::kProton) && mcPart.isPhysicalPrimary() && genPt > ptMin[0] && genPt < ptMax[0]) { - int ch = (pdgCode == PDG_t::kPiPlus || pdgCode == -PDG_t::kElectron || pdgCode == -PDG_t::kMuonMinus || pdgCode == PDG_t::kKPlus || PDG_t::kProton) ? 1 : -1; + int ch = (pdgCode == PDG_t::kPiPlus || pdgCode == -PDG_t::kElectron || pdgCode == -PDG_t::kMuonMinus || pdgCode == PDG_t::kKPlus || pdgCode == PDG_t::kProton) ? 1 : -1; if ((ch < 0 && countOnlyNegTrk) || !countOnlyNegTrk) nChPartGen++; }