From 54b4548b05026db919fb4e8a1ad9af4f92d3d892 Mon Sep 17 00:00:00 2001 From: yuanzhe Date: Mon, 4 Aug 2025 17:53:02 +0200 Subject: [PATCH 1/2] Fix signal check for hypertriton kink --- PWGLF/DataModel/LFHyperNucleiKinkTables.h | 4 +- .../Nuspex/hyperkinkRecoTask.cxx | 55 ++++++++++++++----- 2 files changed, 44 insertions(+), 15 deletions(-) diff --git a/PWGLF/DataModel/LFHyperNucleiKinkTables.h b/PWGLF/DataModel/LFHyperNucleiKinkTables.h index 3f064f5225f..a661e4dec32 100644 --- a/PWGLF/DataModel/LFHyperNucleiKinkTables.h +++ b/PWGLF/DataModel/LFHyperNucleiKinkTables.h @@ -95,7 +95,9 @@ DECLARE_SOA_TABLE(HypKinkCand, "AOD", "HYPKINKCANDS", hyperkink::PxDaugSV, hyperkink::PyDaugSV, hyperkink::PzDaugSV, hyperkink::DcaMothPv, hyperkink::DcaDaugPv, hyperkink::DcaKinkTopo, hyperkink::ItsChi2Moth, hyperkink::ItsClusterSizesMoth, hyperkink::ItsClusterSizesDaug, - hyperkink::NSigmaTPCDaug, hyperkink::NSigmaITSDaug, hyperkink::NSigmaTOFDaug); + hyperkink::NSigmaTPCDaug, hyperkink::NSigmaITSDaug, hyperkink::NSigmaTOFDaug, + hyperkink::PxMothPV, hyperkink::PyMothPV, hyperkink::PzMothPV, + hyperkink::UpdatePxMothPV, hyperkink::UpdatePyMothPV, hyperkink::UpdatePzMothPV); DECLARE_SOA_TABLE(MCHypKinkCand, "AOD", "MCHYPKINKCANDS", o2::soa::Index<>, diff --git a/PWGLF/TableProducer/Nuspex/hyperkinkRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hyperkinkRecoTask.cxx index 7d2d3fe82e6..2d463ab7e5a 100644 --- a/PWGLF/TableProducer/Nuspex/hyperkinkRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hyperkinkRecoTask.cxx @@ -458,19 +458,22 @@ struct HyperkinkRecoTask { const AxisSpec vertexZAxis{100, -15., 15., "vtx_{Z} [cm]"}; const AxisSpec ptAxis{50, -10, 10, "#it{p}_{T} (GeV/#it{c})"}; const AxisSpec nSigmaAxis{120, -6.f, 6.f, "n#sigma"}; - const AxisSpec massAxis{100, 3.85, 4.25, "m (GeV/#it{c}^{2})"}; + AxisSpec massAxis(100, 2.94, 3.2, "m (GeV/#it{c}^{2})"); + if (hypoMoth == kHyperhelium4sigma) { + massAxis = AxisSpec{100, 3.85, 4.25, "m (GeV/#it{c}^{2})"}; + } const AxisSpec diffPtAxis{200, -10.f, 10.f, "#Delta #it{p}_{T} (GeV/#it{c})"}; const AxisSpec diffPzAxis{200, -10.f, 10.f, "#Delta #it{p}_{z} (GeV/#it{c})"}; const AxisSpec radiusAxis{40, 0.f, 40.f, "R (cm)"}; registry.add("hEventCounter", "hEventCounter", HistType::kTH1F, {{2, 0, 2}}); registry.add("hVertexZCollision", "hVertexZCollision", HistType::kTH1F, {vertexZAxis}); - registry.add("hCandidateCounter", "hCandidateCounter", HistType::kTH1F, {{3, 0, 3}}); + registry.add("hCandidateCounter", "hCandidateCounter", HistType::kTH1F, {{4, 0, 4}}); if (doprocessMC == true) { itsResponse.setMCDefaultParameters(); - registry.add("hTrueCandidateCounter", "hTrueCandidateCounter", HistType::kTH1F, {{3, 0, 3}}); + registry.add("hTrueCandidateCounter", "hTrueCandidateCounter", HistType::kTH1F, {{4, 0, 4}}); registry.add("hDiffSVx", ";#Delta x (cm);", HistType::kTH1F, {{200, -10, 10}}); registry.add("hDiffSVy", ";#Delta y (cm);", HistType::kTH1F, {{200, -10, 10}}); registry.add("hDiffSVz", ";#Delta z (cm);", HistType::kTH1F, {{200, -10, 10}}); @@ -663,8 +666,6 @@ struct HyperkinkRecoTask { auto bc = collision.bc_as(); initCCDB(bc); auto motherTrack = kinkCand.trackMoth_as(); - HypKinkCandidate hypkinkCand; - fillCandidate(hypkinkCand, collision, kinkCand, motherTrack, daugTrack); float nSigmaTOF = -999.f; if (daugTrack.hasTOF() && daugTrack.has_collision()) { auto originalDaugCol = daugTrack.collision_as(); @@ -673,6 +674,10 @@ struct HyperkinkRecoTask { if (std::abs(nSigmaTOF) > cutTOFNSigmaDaug) { continue; } + + registry.fill(HIST("hCandidateCounter"), 2); + HypKinkCandidate hypkinkCand; + fillCandidate(hypkinkCand, collision, kinkCand, motherTrack, daugTrack); hypkinkCand.nSigmaTOFDaug = nSigmaTOF; o2::dataformats::VertexBase primaryVtx = {{collision.posX(), collision.posY(), collision.posZ()}, {collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ()}}; @@ -698,7 +703,9 @@ struct HyperkinkRecoTask { hypkinkCand.momDaugSV[0], hypkinkCand.momDaugSV[1], hypkinkCand.momDaugSV[2], hypkinkCand.dcaXYMothPv, hypkinkCand.dcaXYDaugPv, hypkinkCand.dcaKinkTopo, hypkinkCand.chi2ITSMoth, hypkinkCand.itsClusterSizeMoth, hypkinkCand.itsClusterSizeDaug, - hypkinkCand.nSigmaTPCDaug, hypkinkCand.nSigmaITSDaug, hypkinkCand.nSigmaTOFDaug); + hypkinkCand.nSigmaTPCDaug, hypkinkCand.nSigmaITSDaug, hypkinkCand.nSigmaTOFDaug, + hypkinkCand.momMothPV[0], hypkinkCand.momMothPV[1], hypkinkCand.momMothPV[2], + hypkinkCand.updateMomMothPV[0], hypkinkCand.updateMomMothPV[1], hypkinkCand.updateMomMothPV[2]); } } PROCESS_SWITCH(HyperkinkRecoTask, processData, "process data", true); @@ -773,8 +780,6 @@ struct HyperkinkRecoTask { auto bc = collision.bc_as(); initCCDB(bc); - HypKinkCandidate hypkinkCand; - fillCandidate(hypkinkCand, collision, kinkCand, motherTrack, daugTrack); float nSigmaTOF = -999.f; if (daugTrack.hasTOF() && daugTrack.has_collision()) { auto originalDaugCol = daugTrack.collision_as(); @@ -791,6 +796,13 @@ struct HyperkinkRecoTask { if (std::abs(nSigmaTOF) > cutTOFNSigmaDaug) { continue; } + registry.fill(HIST("hCandidateCounter"), 3); + if (isKinkSignal) { + registry.fill(HIST("hTrueCandidateCounter"), 3); + } + + HypKinkCandidate hypkinkCand; + fillCandidate(hypkinkCand, collision, kinkCand, motherTrack, daugTrack); hypkinkCand.nSigmaTOFDaug = nSigmaTOF; std::array posDecVtx = {kinkCand.xDecVtx() + collision.posX(), kinkCand.yDecVtx() + collision.posY(), kinkCand.zDecVtx() + collision.posZ()}; @@ -862,10 +874,22 @@ struct HyperkinkRecoTask { // fill kink signals which are not reconstructed for (auto const& mcparticle : particlesMC) { - auto dChannel = He4SDecay::getDecayChannel(mcparticle, dauIDList); - if (dChannel != He4SDecay::k2body) { + bool isKinkSignal = false; + if (hypoMoth == kHypertriton) { + auto dChannel = H3LDecay::getDecayChannel(mcparticle, dauIDList); + if (dChannel == H3LDecay::k2bodyNeutral) { + isKinkSignal = true; + } + } else if (hypoMoth == kHyperhelium4sigma) { + auto dChannel = He4SDecay::getDecayChannel(mcparticle, dauIDList); + if (dChannel == He4SDecay::k2body) { + isKinkSignal = true; + } + } + if (!isKinkSignal) { continue; } + if (std::find(mcPartIndices.begin(), mcPartIndices.end(), mcparticle.globalIndex()) != mcPartIndices.end()) { continue; } @@ -928,6 +952,7 @@ struct HyperkinkQa { o2::aod::ITSResponse itsResponse; + int charge = 1; float massMoth = 999.f; float massChargedDaug = 999.f; float massNeutralDaug = 999.f; @@ -941,6 +966,7 @@ struct HyperkinkQa { itsResponse.setMCDefaultParameters(); if (hypoMoth == kHypertriton) { + charge = 1; massMoth = o2::constants::physics::MassHyperTriton; massChargedDaug = o2::constants::physics::MassTriton; massNeutralDaug = o2::constants::physics::MassPi0; @@ -949,6 +975,7 @@ struct HyperkinkQa { pdgDaug[kDaugNeutral] = PDG_t::kPi0; pidTypeDaug = o2::track::PID::Triton; } else if (hypoMoth == kHyperhelium4sigma) { + charge = 2; massMoth = o2::constants::physics::MassHyperHelium4Sigma; massChargedDaug = o2::constants::physics::MassAlpha; massNeutralDaug = o2::constants::physics::MassPi0; @@ -986,8 +1013,8 @@ struct HyperkinkQa { hGenHyperMothCounter->GetXaxis()->SetBinLabel(3, "AntiMatter"); hGenHyperMothCounter->GetXaxis()->SetBinLabel(4, "t + #pi^{0}"); hGenHyperMothCounter->GetXaxis()->SetBinLabel(5, "#bar{t} + #pi^{0}"); - hGenHyperMothCounter->GetXaxis()->SetBinLabel(6, "he3 + #pi^{-}"); - hGenHyperMothCounter->GetXaxis()->SetBinLabel(7, "#bar{he3} + #pi^{+}"); + hGenHyperMothCounter->GetXaxis()->SetBinLabel(6, "{}^{3}He + #pi^{-}"); + hGenHyperMothCounter->GetXaxis()->SetBinLabel(7, "{}^{3}#bar{He} + #pi^{+}"); hGenHyperMothCounter->GetXaxis()->SetBinLabel(8, "d + p + #pi^{-}"); hGenHyperMothCounter->GetXaxis()->SetBinLabel(9, "#bar{d} + #bar{p} + #pi^{+}"); hGenHyperMothCounter->GetXaxis()->SetBinLabel(10, "Others"); @@ -1043,7 +1070,7 @@ struct HyperkinkQa { hist->GetXaxis()->SetBinLabel(6, "TPC Ncls"); hist->GetXaxis()->SetBinLabel(7, "TPC n#sigma"); hist->GetXaxis()->SetBinLabel(8, "ITS hits"); - hist->GetXaxis()->SetBinLabel(9, "has TOF)"); + hist->GetXaxis()->SetBinLabel(9, "has TOF"); } recoQAHist.add("hMothIsPVContributer", "", HistType::kTH1F, {{2, 0.f, 2.f}}); @@ -1279,7 +1306,7 @@ struct HyperkinkQa { auto motherTrack = tracks.rawIteratorAt(mcPartIndices[mcparticle.globalIndex()]); bool isGoodMother = motherTrackCheck(motherTrack, hMothCounter); float svR = RecoDecay::sqrtSumOfSquares(svPos[0], svPos[1]); - float diffpt = mcparticle.pt() - 2 * motherTrack.pt(); + float diffpt = mcparticle.pt() - charge * motherTrack.pt(); recoQAHist.fill(HIST("h2TrueMotherDiffPtVsTrueSVR"), svR, diffpt); recoQAHist.fill(HIST("h2TrueMotherDiffEtaVsTrueSVR"), svR, mcparticle.eta() - motherTrack.eta()); From f340d64d09a3fb428e2d36ed1c9809d12d355d72 Mon Sep 17 00:00:00 2001 From: yuanzhe Date: Mon, 4 Aug 2025 19:04:09 +0200 Subject: [PATCH 2/2] Fix fill of datamodel --- PWGLF/TableProducer/Nuspex/hyperkinkRecoTask.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/hyperkinkRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hyperkinkRecoTask.cxx index 2d463ab7e5a..9614d561dc0 100644 --- a/PWGLF/TableProducer/Nuspex/hyperkinkRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hyperkinkRecoTask.cxx @@ -838,8 +838,6 @@ struct HyperkinkRecoTask { hypkinkCand.isSignal = true; hypkinkCand.isSignalReco = true; - hypkinkCand.isCollReco = true; - hypkinkCand.isSurvEvSelection = true; fillCandidateMCInfo(hypkinkCand, mcMothTrack, mcDaugTrack, mcNeutTrack); mcPartIndices.push_back(mcMothTrack.globalIndex()); @@ -850,6 +848,9 @@ struct HyperkinkRecoTask { registry.fill(HIST("hDCAZMothToRecSV"), dcaInfo[1]); } + hypkinkCand.isCollReco = true; + hypkinkCand.isSurvEvSelection = true; + outputMCTable( mBz > 0 ? 1 : -1, hypkinkCand.posPV[0], hypkinkCand.posPV[1], hypkinkCand.posPV[2],