Skip to content

Commit 37b3c19

Browse files
authored
add Mc gen for non hf
1 parent c1c1c41 commit 37b3c19

File tree

1 file changed

+74
-54
lines changed

1 file changed

+74
-54
lines changed

PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx

Lines changed: 74 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -562,74 +562,94 @@ struct HfElectronSelectionWithTpcEmcal {
562562
bool isEmbEta = false;
563563
bool isEmbPi0 = false;
564564

565-
if (particleMc.has_mothers()) {
566-
// Check first mother
567-
auto const& mother = particleMc.mothers_first_as<aod::McParticles>();
568-
569-
if (std::abs(mother.pdgCode()) == kEta || std::abs(mother.pdgCode()) == kPi0 || std::abs(mother.pdgCode()) == kGamma) {
570-
registry.fill(HIST("hMcgenAllNonHfeElectron"), particleMc.pt());
571-
if (mother.has_mothers()) {
572-
auto const& gmother = mother.mothers_first_as<aod::McParticles>();
573-
if (gmother.has_mothers()) {
574-
auto const& ggmother = gmother.mothers_first_as<aod::McParticles>();
575-
576-
// cases to consider: eta->e, eta->pi0->e, eta->gamma->e, eta->pi0->gamma->e, pi0->e, pi0->gamma->e
577-
578-
//================= eta->e ======================================
579-
if (std::abs(mother.pdgCode()) == kEta) {
580-
if (mother.isPhysicalPrimary()) {
581-
isEmbEta = true;
582-
}
583-
}
584-
//================= eta->pi0->e ======================================
565+
// Check first mother
566+
auto const& mother = particleMc.mothers_first_as<aod::McParticles>();
567+
568+
if (std::abs(mother.pdgCode()) == kEta || std::abs(mother.pdgCode()) == kPi0 || std::abs(mother.pdgCode()) == kGamma) {
569+
registry.fill(HIST("hMcgenAllNonHfeElectron"), particleMc.pt());
570+
auto const& gmother = mother.mothers_first_as<aod::McParticles>();
571+
auto const& ggmother = gmother.mothers_first_as<aod::McParticles>();
572+
auto const& gggmother = ggmother.mothers_first_as<aod::McParticles>();
573+
574+
// cases to consider: eta->e, eta->pi0->e, eta->gamma->e, eta->pi0->gamma->e, pi0->e, pi0->gamma->e
575+
576+
//================= eta->e ======================================
577+
if (std::abs(mother.pdgCode()) == kEta) {
578+
if (mother.isPhysicalPrimary()) {
579+
if ((std::abs(gmother.pdgCode()) >= 400 && std::abs(gmother.pdgCode()) < 600) ||
580+
(std::abs(gmother.pdgCode()) >= 4000 && std::abs(gmother.pdgCode()) < 6000)) {
581+
continue;
582+
}
583+
isEmbEta = true;
584+
}
585+
}
586+
//================= eta->pi0->e ======================================
585587

586-
if (std::abs(mother.pdgCode()) == kPi0) {
587-
if (mother.isPhysicalPrimary()) {
588-
isEmbPi0 = true; // pi0 -> e
589-
}
588+
if (std::abs(mother.pdgCode()) == kPi0) {
589+
if (mother.isPhysicalPrimary()) {
590+
if ((std::abs(gmother.pdgCode()) >= 400 && std::abs(gmother.pdgCode()) < 600) ||
591+
(std::abs(gmother.pdgCode()) >= 4000 && std::abs(gmother.pdgCode()) < 6000)) {
592+
continue;
593+
}
594+
isEmbPi0 = true; // pi0 -> e
595+
}
590596

591-
if (std::abs(gmother.pdgCode()) == kEta) {
592-
if (gmother.isPhysicalPrimary()) {
593-
isEmbEta = true; // eta->pi0-> e
594-
}
595-
}
597+
if (std::abs(gmother.pdgCode()) == kEta) {
598+
if (gmother.isPhysicalPrimary()) {
599+
if ((std::abs(ggmother.pdgCode()) >= 400 && std::abs(ggmother.pdgCode()) < 600) ||
600+
(std::abs(ggmother.pdgCode()) >= 4000 && std::abs(ggmother.pdgCode()) < 6000)) {
601+
continue;
596602
}
603+
isEmbEta = true; // eta->pi0-> e
604+
}
605+
}
606+
}
597607

598-
/// ==================================== eta->gamma->e and eta->pi0->gamma->e============
599-
if (std::abs(mother.pdgCode()) == kGamma) {
600-
if (std::abs(gmother.pdgCode()) == kEta) {
601-
if (gmother.isPhysicalPrimary()) {
602-
isEmbEta = true; // eta->gamma-> e
603-
}
604-
}
608+
/// ==================================== eta->gamma->e and eta->pi0->gamma->e============
609+
if (std::abs(mother.pdgCode()) == kGamma) {
610+
if (std::abs(gmother.pdgCode()) == kEta) {
611+
if (gmother.isPhysicalPrimary()) {
612+
if ((std::abs(ggmother.pdgCode()) >= 400 && std::abs(ggmother.pdgCode()) < 600) ||
613+
(std::abs(ggmother.pdgCode()) >= 4000 && std::abs(ggmother.pdgCode()) < 6000)) {
614+
continue;
615+
}
616+
isEmbEta = true; // eta->gamma-> e
617+
}
618+
}
605619

606-
if (std::abs(gmother.pdgCode()) == kPi0) {
607-
if (gmother.isPhysicalPrimary()) {
608-
isEmbPi0 = true; // pi0-> gamma-> e
609-
}
620+
if (std::abs(gmother.pdgCode()) == kPi0) {
621+
if (gmother.isPhysicalPrimary()) {
622+
if ((std::abs(ggmother.pdgCode()) >= 400 && std::abs(ggmother.pdgCode()) < 600) ||
623+
(std::abs(ggmother.pdgCode()) >= 4000 && std::abs(ggmother.pdgCode()) < 6000)) {
624+
continue;
625+
}
626+
isEmbPi0 = true; // pi0-> gamma-> e
627+
}
610628

611-
if (std::abs(ggmother.pdgCode()) == kEta) {
612-
if (ggmother.isPhysicalPrimary()) {
613-
isEmbEta = true; // eta->pi0->gamma-> e
614-
}
615-
}
629+
if (std::abs(ggmother.pdgCode()) == kEta) {
630+
if (ggmother.isPhysicalPrimary()) {
631+
if ((std::abs(gggmother.pdgCode()) >= 400 && std::abs(gggmother.pdgCode()) < 600) ||
632+
(std::abs(gggmother.pdgCode()) >= 4000 && std::abs(gggmother.pdgCode()) < 6000)) {
633+
continue;
616634
}
635+
isEmbEta = true; // eta->pi0->gamma-> e
617636
}
618637
}
619638
}
620639
}
621-
}
622-
if (isEmbPi0 || isEmbEta) {
623-
registry.fill(HIST("hMcgenNonHfeElectron"), particleMc.pt());
624-
isNonHfe = true;
625-
if (isEmbPi0) {
640+
if (isEmbPi0 || isEmbEta) {
641+
registry.fill(HIST("hMcgenNonHfeElectron"), particleMc.pt());
642+
isNonHfe = true;
643+
if (isEmbPi0) {
626644

627-
registry.fill(HIST("hPi0eEmbTrkPt"), particleMc.pt());
628-
}
629-
if (isEmbEta) {
630-
registry.fill(HIST("hEtaeEmbTrkPt"), particleMc.pt());
645+
registry.fill(HIST("hPi0eEmbTrkPt"), particleMc.pt());
646+
}
647+
if (isEmbEta) {
648+
registry.fill(HIST("hEtaeEmbTrkPt"), particleMc.pt());
649+
}
631650
}
632651
}
652+
633653
hfGenElectronSel(mcCollision.globalIndex(), particleMc.globalIndex(), particleMc.eta(), particleMc.phi(), particleMc.pt(), isNonHfe);
634654
}
635655
}

0 commit comments

Comments
 (0)