diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index 96c09ee3cb1..84ae5f76087 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -646,114 +646,112 @@ struct HfElectronSelectionWithTpcEmcal { isEmbEta = true; // eta->pi0->gamma-> e } - auto const& mother = particleMc.mothers_first_as(); - - if (std::abs(mother.pdgCode()) == kEta || std::abs(mother.pdgCode()) == kPi0 || std::abs(mother.pdgCode()) == kGamma) { - registry.fill(HIST("hMcgenAllNonHfeElectron"), particleMc.pt()); - auto const& gmother = mother.mothers_first_as(); - auto const& ggmother = gmother.mothers_first_as(); - auto const& gggmother = ggmother.mothers_first_as(); - - // cases to consider: eta->e, eta->pi0->e, eta->gamma->e, eta->pi0->gamma->e, pi0->e, pi0->gamma->e - - //================= eta->e ====================================== - if (std::abs(mother.pdgCode()) == kEta) { - if (mother.isPhysicalPrimary()) { - if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbEta = true; - } - } - //================= eta->pi0->e ====================================== - - if (std::abs(mother.pdgCode()) == kPi0) { - if (mother.isPhysicalPrimary()) { - if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbPi0 = true; // pi0 -> e - } + auto const& mother = particleMc.mothers_first_as(); - if (std::abs(gmother.pdgCode()) == kEta) { - if (gmother.isPhysicalPrimary()) { - if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbEta = true; // eta->pi0-> e - } - } - } - - /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ - if (std::abs(mother.pdgCode()) == kGamma) { - if (std::abs(gmother.pdgCode()) == kEta) { - if (gmother.isPhysicalPrimary()) { - if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbEta = true; // eta->gamma-> e - } - } + if (std::abs(mother.pdgCode()) == kEta || std::abs(mother.pdgCode()) == kPi0 || std::abs(mother.pdgCode()) == kGamma) { + registry.fill(HIST("hMcgenAllNonHfeElectron"), particleMc.pt()); + auto const& gmother = mother.mothers_first_as(); + auto const& ggmother = gmother.mothers_first_as(); + auto const& gggmother = ggmother.mothers_first_as(); - if (std::abs(gmother.pdgCode()) == kPi0) { - if (gmother.isPhysicalPrimary()) { - if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbPi0 = true; // pi0-> gamma-> e - } + // cases to consider: eta->e, eta->pi0->e, eta->gamma->e, eta->pi0->gamma->e, pi0->e, pi0->gamma->e + + //================= eta->e ====================================== + if (std::abs(mother.pdgCode()) == kEta) { + if (mother.isPhysicalPrimary()) { + if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbEta = true; + } + } + //================= eta->pi0->e ====================================== + + if (std::abs(mother.pdgCode()) == kPi0) { + if (mother.isPhysicalPrimary()) { + if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbPi0 = true; // pi0 -> e + } + + if (std::abs(gmother.pdgCode()) == kEta) { + if (gmother.isPhysicalPrimary()) { + if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbEta = true; // eta->pi0-> e + } + } + } - if (std::abs(ggmother.pdgCode()) == kEta) { - if (ggmother.isPhysicalPrimary()) { - if ((std::abs(gggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gggmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gggmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; + /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ + if (std::abs(mother.pdgCode()) == kGamma) { + if (std::abs(gmother.pdgCode()) == kEta) { + if (gmother.isPhysicalPrimary()) { + if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbEta = true; // eta->gamma-> e + } + } + + if (std::abs(gmother.pdgCode()) == kPi0) { + if (gmother.isPhysicalPrimary()) { + if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbPi0 = true; // pi0-> gamma-> e + } + + if (std::abs(ggmother.pdgCode()) == kEta) { + if (ggmother.isPhysicalPrimary()) { + if ((std::abs(gggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gggmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(gggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gggmother.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbEta = true; // eta->pi0->gamma-> e + } + } + } + + if (isEmbPi0 || isEmbEta) { + registry.fill(HIST("hMcgenNonHfeElectron"), particleMc.pt()); + isNonHfe = true; + if (isEmbPi0) { + + registry.fill(HIST("hPi0eEmbTrkPt"), particleMc.pt()); + } + if (isEmbEta) { + registry.fill(HIST("hEtaeEmbTrkPt"), particleMc.pt()); + } + } + if (isEmbPi0 || isEmbEta) { + registry.fill(HIST("hMcgenNonHfeElectron"), particleMc.pt()); + isNonHfe = true; + if (isEmbPi0) { + + registry.fill(HIST("hPi0eEmbTrkPt"), particleMc.pt()); + } + if (isEmbEta) { + registry.fill(HIST("hEtaeEmbTrkPt"), particleMc.pt()); + } + } + } + hfGenElectronSel(mcCollision.globalIndex(), particleMc.globalIndex(), particleMc.eta(), particleMc.phi(), particleMc.pt(), isNonHfe); + } } - isEmbEta = true; // eta->pi0->gamma-> e } + PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processMcGen, "Process MC Gen mode", false); + }; + WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) + { + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } - } - - if (isEmbPi0 || isEmbEta) { - registry.fill(HIST("hMcgenNonHfeElectron"), particleMc.pt()); - isNonHfe = true; - if (isEmbPi0) { - - registry.fill(HIST("hPi0eEmbTrkPt"), particleMc.pt()); - } - if (isEmbEta) { - registry.fill(HIST("hEtaeEmbTrkPt"), particleMc.pt()); - } - - } - if (isEmbPi0 || isEmbEta) { - registry.fill(HIST("hMcgenNonHfeElectron"), particleMc.pt()); - isNonHfe = true; - if (isEmbPi0) { - - registry.fill(HIST("hPi0eEmbTrkPt"), particleMc.pt()); - } - if (isEmbEta) { - registry.fill(HIST("hEtaeEmbTrkPt"), particleMc.pt()); - - } - } - } - - hfGenElectronSel(mcCollision.globalIndex(), particleMc.globalIndex(), particleMc.eta(), particleMc.phi(), particleMc.pt(), isNonHfe); - } - } - } - PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processMcGen, "Process MC Gen mode", false); -}; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} \ No newline at end of file + \ No newline at end of file