Skip to content

Commit 26889fa

Browse files
authored
add switch to select only negative charges also in MC
1 parent 552ad72 commit 26889fa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,8 +854,11 @@ struct EbyeMaker {
854854
continue;
855855
auto pdgCode = mcPart.pdgCode();
856856
auto genPt = std::hypot(mcPart.px(), mcPart.py());
857-
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])
858-
nChPartGen++;
857+
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]) {
858+
int ch = (pdgCode == PDG_t::kPiPlus || pdgCode == -PDG_t::kElectron || pdgCode == -PDG_t::kMuonMinus || pdgCode == PDG_t::kKPlus || PDG_t::kProton) ? 1 : -1;
859+
if ((ch < 0 && countOnlyNegTrk) || !countOnlyNegTrk)
860+
nChPartGen++;
861+
}
859862
if (std::abs(pdgCode) == PDG_t::kLambda0) {
860863
if (!mcPart.isPhysicalPrimary() && !mcPart.has_mothers())
861864
continue;

0 commit comments

Comments
 (0)