diff --git a/PWGHF/Core/SelectorCuts.h b/PWGHF/Core/SelectorCuts.h index f0a9ad9034e..0316a8969da 100644 --- a/PWGHF/Core/SelectorCuts.h +++ b/PWGHF/Core/SelectorCuts.h @@ -736,6 +736,63 @@ static const std::vector labelsPt = { static const std::vector labelsCutVar = {"pT Ka from Omegac"}; } // namespace hf_cuts_omegacxic_to_omega_ka +namespace hf_cuts_xic_to_xi_pi +{ +static constexpr int NBinsPt = 11; +static constexpr int NCutVars = 28; +// default values for the pT bin edges (can be used to configure histogram axis) +// offset by 1 from the bin numbers in cuts array +constexpr double BinsPt[NBinsPt + 1] = { + 0.0, + 1.0, + 2.0, + 3.0, + 4.0, + 5.0, + 6.0, + 8.0, + 10.0, + 12.0, + 16.0, + 24.0}; + +auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; + +// default values for the cuts +constexpr double Cuts[NBinsPt][NCutVars] = {{0.2, 0.99, 0.97, 0.99, 0.99, 0.1, 0.2, 1.0, 0.04, 0.06, 0.06, 0.05, 0.3, 70, 60, 100, 120, 250, 250, 0.4, 100, 300, 0., 0., 1.5, 0., 0., 0.4}, /* 0 < pt < 1 */ + {0.5, 0.99, 0.97, 0.99, 0.99, 0.1, 0.2, 1.0, 0.04, 0.06, 0.06, 0.05, 0.3, 70, 60, 100, 120, 250, 250, 0.4, 100, 300, 0., 0., 1.5, 0., 0., 0.4}, /* 1 < pt < 2 */ + {0.5, 0.99, 0.97, 0.99, 0.99, 0.1, 0.2, 1.0, 0.04, 0.06, 0.06, 0.05, 0.3, 70, 60, 100, 120, 250, 250, 0.4, 100, 300, 0., 0., 1.5, 0., 0., 0.4}, /* 2 < pt < 3 */ + {0.5, 0.99, 0.97, 0.99, 0.99, 0.1, 0.2, 1.0, 0.04, 0.06, 0.06, 0.05, 0.3, 70, 60, 100, 120, 250, 250, 0.4, 100, 300, 0., 0., 1.5, 0., 0., 0.4}, /* 3 < pt < 4 */ + {0.5, 0.99, 0.97, 0.99, 0.99, 0.1, 0.2, 1.0, 0.04, 0.06, 0.06, 0.05, 0.3, 70, 60, 100, 120, 250, 250, 0.4, 100, 300, 0., 0., 1.5, 0., 0., 0.4}, /* 4 < pt < 5 */ + {0.5, 0.99, 0.97, 0.99, 0.99, 0.1, 0.2, 1.0, 0.04, 0.06, 0.06, 0.05, 0.3, 70, 60, 100, 120, 250, 250, 0.4, 100, 300, 0., 0., 1.5, 0., 0., 0.4}, /* 5 < pt < 6 */ + {0.5, 0.99, 0.97, 0.99, 0.99, 0.1, 0.2, 1.0, 0.04, 0.06, 0.06, 0.05, 0.3, 70, 60, 100, 120, 250, 250, 0.4, 100, 300, 0., 0., 1.5, 0., 0., 0.4}, /* 6 < pt < 8 */ + {0.5, 0.99, 0.97, 0.99, 0.99, 0.1, 0.2, 1.0, 0.04, 0.06, 0.06, 0.05, 0.3, 70, 60, 100, 120, 250, 250, 0.4, 100, 300, 0., 0., 1.5, 0., 0., 0.4}, /* 8 < pt < 10 */ + {0.5, 0.99, 0.97, 0.99, 0.99, 0.1, 0.2, 1.0, 0.04, 0.06, 0.06, 0.05, 0.3, 70, 60, 100, 120, 250, 250, 0.4, 100, 300, 0., 0., 1.5, 0., 0., 0.4}, /* 10 < pt < 12 */ + {0.5, 0.99, 0.97, 0.99, 0.99, 0.1, 0.2, 1.0, 0.04, 0.06, 0.06, 0.05, 0.3, 70, 60, 100, 120, 250, 250, 0.4, 100, 300, 0., 0., 1.5, 0., 0., 0.4}, /* 12 < pt < 16 */ + {0.5, 0.99, 0.97, 0.99, 0.99, 0.1, 0.2, 1.0, 0.04, 0.06, 0.06, 0.05, 0.3, 70, 60, 100, 120, 250, 250, 0.4, 100, 300, 0., 0., 1.5, 0., 0., 0.4}}; /* 16 < pt < 24 */ + +// row labels +static const std::vector labelsPt = { + "pT bin 0", + "pT bin 1", + "pT bin 2", + "pT bin 3", + "pT bin 4", + "pT bin 5", + "pT bin 6", + "pT bin 7", + "pT bin 8", + "pT bin 9", + "pT bin 10"}; + +// column labels +static const std::vector labelsCutVar = {"ptPiFromCharmBaryon", "cosPACasc", "cosPAV0", "cosPaCascToXic", "cosPaV0ToCasc", + "dcaCharmBaryonDau", "dcaCascDau", "dcaV0Dau", "dcaXYToPvCascDau", "dcaXYToPvV0Dau0", "dcaXYToPvV0Dau1", "kfDcaXYPiFromXic", "kfDcaXYCascToPv", + "chi2GeoXic", "chi2GeoCasc", "chi2GeoV0", + "chi2TopoXicToPv", "chi2TopoPiFromXicToPv", "chi2TopoCascToPv", "chi2TopoV0ToPv", "chi2TopoV0ToCasc", "chi2TopoCascToXic", + "cascldl", "v0ldl", "decayLenXYXic", "decayLenXYCasc", "decayLenXYLambda", "cTauXic"}; +} // namespace hf_cuts_xic_to_xi_pi + namespace hf_cuts_xic_to_p_k_pi { static constexpr int NBinsPt = 10; diff --git a/PWGHF/D2H/Tasks/CMakeLists.txt b/PWGHF/D2H/Tasks/CMakeLists.txt index 53b22dfe969..3e1d565d1ea 100644 --- a/PWGHF/D2H/Tasks/CMakeLists.txt +++ b/PWGHF/D2H/Tasks/CMakeLists.txt @@ -138,3 +138,8 @@ o2physics_add_dpl_workflow(task-xicc SOURCES taskXicc.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(task-xic0-to-xi-pi + SOURCES taskXic0ToXiPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) \ No newline at end of file diff --git a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx index ee401849761..b6ab03aa3ab 100644 --- a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx @@ -622,7 +622,7 @@ struct HfTaskFlowCharmHadrons { float phiCand = 0.; if constexpr (std::is_same_v || std::is_same_v) { - ptCand = candidate.kfptXic(); + ptCand = RecoDecay::sqrtSumOfSquares(candidate.pxCharmBaryon(), candidate.pyCharmBaryon()); phiCand = std::atan2(candidate.pxCharmBaryon(), candidate.pyCharmBaryon()); } else { ptCand = candidate.pt(); diff --git a/PWGHF/D2H/Tasks/taskXic0ToXiPi.cxx b/PWGHF/D2H/Tasks/taskXic0ToXiPi.cxx new file mode 100644 index 00000000000..431a9685b9d --- /dev/null +++ b/PWGHF/D2H/Tasks/taskXic0ToXiPi.cxx @@ -0,0 +1,344 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file taskXic0ToXiPi.cxx +/// \brief Task for Ξc^0 → Ξ∓ π± Kf analysis +/// \author Tao Fang , Central China Normal University +/// \author Ran Tu , Fudan University + +#include "PWGHF/Core/CentralityEstimation.h" +#include "PWGHF/Core/HfHelper.h" +#include "PWGHF/Core/SelectorCuts.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" + +#include +#include +#include + +#include + +using namespace o2; +using namespace o2::analysis; +using namespace o2::framework; +using namespace o2::framework::expressions; + +/// Xic0 analysis task + +struct HfTaskXic0ToXiPi { + // ML inference + Configurable applyMl{"applyMl", false, "Flag to apply ML selections"}; + Configurable fillCent{"fillCent", false, "Flag to fill centrality information"}; + Configurable yCandGenMax{"yCandGenMax", 0.8, "max. gen particle rapidity"}; + Configurable yCandRecMax{"yCandRecMax", 0.8, "max. cand. rapidity"}; + + HfHelper hfHelper; + SliceCache cache; + + using TracksMc = soa::Join; + + using Xic0CandsKF = soa::Filtered>; + using Xic0CandsMcKF = soa::Filtered>; + + using Xic0CandsMlKF = soa::Filtered>; + using Xic0CandsMlMcKF = soa::Filtered>; + + using Xic0Gen = soa::Filtered>; + + using CollisionsWithEvSels = soa::Join; + using CollisionsWithFT0C = soa::Join; + using CollisionsWithFT0M = soa::Join; + using CollisionsWithMcLabels = soa::Join; + + Filter filterSelectXic0Candidates = aod::hf_sel_toxipi::resultSelections == true; + Filter filterXicMatchedRec = nabs(aod::hf_cand_xic0_omegac0::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_xic0_omegac0::DecayType::XiczeroToXiPi)); + Filter filterXicMatchedGen = nabs(aod::hf_cand_xic0_omegac0::flagMcMatchGen) == static_cast(BIT(aod::hf_cand_xic0_omegac0::DecayType::XiczeroToXiPi)); + Preslice candXicKFPerCollision = aod::hf_cand_xic0_omegac0::collisionId; + Preslice candXicKFMlPerCollision = aod::hf_cand_xic0_omegac0::collisionId; + + PresliceUnsorted colPerMcCollision = aod::mccollisionlabel::mcCollisionId; + + // ThnSparse for ML outputScores and Vars + ConfigurableAxis thnConfigAxisPromptScore{"thnConfigAxisPromptScore", {100, 0, 1}, "Prompt score bins"}; + ConfigurableAxis thnConfigAxisMass{"thnConfigAxisMass", {120, 2.4, 3.1}, "Cand. inv-mass bins"}; + ConfigurableAxis thnConfigAxisPtB{"thnConfigAxisPtB", {1000, 0, 100}, "Cand. beauty mother pTB bins"}; + ConfigurableAxis thnConfigAxisPt{"thnConfigAxisPt", {100, 0, 20}, "Cand. pT bins"}; + ConfigurableAxis thnConfigAxisY{"thnConfigAxisY", {20, -1, 1}, "Cand. rapidity bins"}; + ConfigurableAxis thnConfigAxisCent{"thnConfigAxisCent", {100, 0, 100}, "Centrality bins"}; + ConfigurableAxis thnConfigAxisPtPion{"thnConfigAxisPtPion", {100, 0, 10}, "PtPion from Xic0 bins"}; + ConfigurableAxis thnConfigAxisOrigin{"thnConfigAxisOrigin", {3, -0.5, 2.5}, "Cand. origin type"}; + ConfigurableAxis thnConfigAxisMatchFlag{"thnConfigAxisMatchFlag", {15, -7.5, 7.5}, "Cand. MC Match Flag type"}; + ConfigurableAxis thnConfigAxisGenPtD{"thnConfigAxisGenPtD", {500, 0, 50}, "Gen Pt D"}; + ConfigurableAxis thnConfigAxisGenPtB{"thnConfigAxisGenPtB", {1000, 0, 100}, "Gen Pt B"}; + ConfigurableAxis thnConfigAxisNumPvContr{"thnConfigAxisNumPvContr", {200, -0.5, 199.5}, "Number of PV contributors"}; + HistogramRegistry registry{"registry", {}}; + + void init(InitContext&) + { + std::array doprocess{doprocessDataWithKFParticle, doprocessMcWithKFParticle, doprocessDataWithKFParticleMl, doprocessMcWithKFParticleMl, doprocessDataWithKFParticleFT0C, doprocessDataWithKFParticleMlFT0C, doprocessDataWithKFParticleFT0M, doprocessDataWithKFParticleMlFT0M}; + if ((std::accumulate(doprocess.begin(), doprocess.end(), 0)) != 1) { + LOGP(fatal, "One and only one process function should be enabled at a time."); + } + + const AxisSpec thnAxisMass{thnConfigAxisMass, "inv. mass (#Xi#pi) (GeV/#it{c}^{2})"}; + const AxisSpec thnAxisPt{thnConfigAxisPt, "#it{p}_{T} (GeV/#it{c})"}; + const AxisSpec thnAxisPtB{thnConfigAxisPtB, "#it{p}_{T}^{B} (GeV/#it{c})"}; + const AxisSpec thnAxisY{thnConfigAxisY, "y"}; + const AxisSpec thnAxisOrigin{thnConfigAxisOrigin, "Origin"}; + const AxisSpec thnAxisMatchFlag{thnConfigAxisMatchFlag, "MatchFlag"}; + const AxisSpec thnAxisGenPtD{thnConfigAxisGenPtD, "#it{p}_{T} (GeV/#it{c})"}; + const AxisSpec thnAxisGenPtB{thnConfigAxisGenPtB, "#it{p}_{T}^{B} (GeV/#it{c})"}; + const AxisSpec thnAxisNumPvContr{thnConfigAxisNumPvContr, "Number of PV contributors"}; + + if (doprocessMcWithKFParticle || doprocessMcWithKFParticleMl) { + std::vector axesAcc = {thnAxisGenPtD, thnAxisGenPtB, thnAxisY, thnAxisOrigin, thnAxisNumPvContr}; + registry.add("hSparseAcc", "Thn for generated Xic0 from charm and beauty", HistType::kTHnSparseD, axesAcc); + registry.get(HIST("hSparseAcc"))->Sumw2(); + } + + std::vector axes = {thnAxisMass, thnAxisPt, thnAxisY}; + if (doprocessMcWithKFParticle || doprocessMcWithKFParticleMl) { + axes.push_back(thnAxisPtB); + axes.push_back(thnAxisOrigin); + axes.push_back(thnAxisMatchFlag); + axes.push_back(thnAxisNumPvContr); + } + if (applyMl) { + const AxisSpec thnAxisPromptScore{thnConfigAxisPromptScore, "BDT score prompt."}; + axes.insert(axes.begin(), thnAxisPromptScore); + registry.add("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsXic0Type", "Thn for Xic0 candidates", HistType::kTHnSparseD, axes); + registry.get(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsXic0Type"))->Sumw2(); + } else { + registry.add("hMassVsPtVsPtBVsYVsOriginVsXic0Type", "Thn for Xic0 candidates", HistType::kTHnSparseF, axes); + registry.get(HIST("hMassVsPtVsPtBVsYVsOriginVsXic0Type"))->Sumw2(); + } + if (fillCent) { + const AxisSpec thnAxisPromptScore{thnConfigAxisPromptScore, "BDT score prompt."}; + const AxisSpec thnAxisCent{thnConfigAxisCent, "Centrality."}; + const AxisSpec thnAxisPtPion{thnConfigAxisPtPion, "Pt of Pion from Xic0."}; + std::vector axesWithBdtCent = {thnAxisPromptScore, thnAxisMass, thnAxisPt, thnAxisY, thnAxisCent, thnAxisPtPion, thnConfigAxisNumPvContr}; + std::vector axesWithCent = {thnAxisMass, thnAxisPt, thnAxisY, thnAxisCent, thnAxisPtPion, thnConfigAxisNumPvContr}; + registry.add("hBdtScoreVsMassVsPtVsYVsCentVsPtPion", "Thn for Xic0 candidates with BDT&Cent&pTpi", HistType::kTHnSparseD, axesWithBdtCent); + registry.add("hMassVsPtVsYVsCentVsPtPion", "Thn for Xic0 candidates with Cent&pTpi", HistType::kTHnSparseD, axesWithCent); + registry.get(HIST("hBdtScoreVsMassVsPtVsYVsCentVsPtPion"))->Sumw2(); + registry.get(HIST("hMassVsPtVsYVsCentVsPtPion"))->Sumw2(); + } + } + + template + void processData(const CandType& candidates, CollType const&) + { + for (const auto& candidate : candidates) { + if (candidate.resultSelections() != true) { + continue; + } + if (yCandRecMax >= 0. && std::abs(candidate.kfRapXic()) > yCandRecMax) { + continue; + } + + if constexpr (applyMl) { + registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsXic0Type"), candidate.mlProbToXiPi()[0], candidate.invMassCharmBaryon(), candidate.kfptXic(), candidate.kfRapXic()); + } else { + registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsXic0Type"), candidate.invMassCharmBaryon(), candidate.kfptXic(), candidate.kfRapXic()); + } + } + } + + template + void processDataCent(const CandType& candidates, CollType const& collisions) + { + for (const auto& collision : collisions) { + + auto thisCollId = collision.globalIndex(); + auto groupedXicCandidates = applyMl + ? candidates.sliceBy(candXicKFMlPerCollision, thisCollId) + : candidates.sliceBy(candXicKFPerCollision, thisCollId); + // auto numPvContributors = collision.numContrib(); + + for (const auto& candidate : groupedXicCandidates) { + if (candidate.resultSelections() != true) { + continue; + } + if (yCandRecMax >= 0. && std::abs(candidate.kfRapXic()) > yCandRecMax) { + continue; + } + + auto numPvContributors = candidate.template collision_as().numContrib(); + float centrality = -999.f; + if constexpr (useCentrality) { + auto const& collision = candidate.template collision_as(); + centrality = o2::hf_centrality::getCentralityColl(collision); + } + double kfptXic = RecoDecay::sqrtSumOfSquares(candidate.pxCharmBaryon(), candidate.pyCharmBaryon()); + double kfptPiFromXic = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()); + if constexpr (applyMl) { + registry.fill(HIST("hBdtScoreVsMassVsPtVsYVsCentVsPtPion"), + candidate.mlProbToXiPi()[0], + candidate.invMassCharmBaryon(), + kfptXic, + candidate.kfRapXic(), + centrality, + kfptPiFromXic, + numPvContributors); + } else { + registry.fill(HIST("hMassVsPtVsYVsCentVsPtPion"), + candidate.invMassCharmBaryon(), + kfptXic, + candidate.kfRapXic(), + centrality, + kfptPiFromXic, + numPvContributors); + } + } + } + } + + template + void processMc(const CandType& candidates, + Xic0Gen const& mcParticles, + TracksMc const&, + CollType const& collisions, + aod::McCollisions const&) + { + // MC rec. + for (const auto& candidate : candidates) { + if (candidate.resultSelections() != true) { + continue; + } + if (yCandRecMax >= 0. && std::abs(candidate.kfRapXic()) > yCandRecMax) { + continue; + } + + auto numPvContributors = candidate.template collision_as().numContrib(); + double kfptXic = RecoDecay::sqrtSumOfSquares(candidate.pxCharmBaryon(), candidate.pyCharmBaryon()); + if constexpr (applyMl) { + registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsXic0Type"), + candidate.mlProbToXiPi()[0], + candidate.invMassCharmBaryon(), + kfptXic, + candidate.kfRapXic(), + candidate.ptBhadMotherPart(), + candidate.originRec(), + candidate.flagMcMatchRec(), + numPvContributors); + } else { + registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsXic0Type"), + candidate.invMassCharmBaryon(), + kfptXic, + candidate.kfRapXic(), + candidate.ptBhadMotherPart(), + candidate.originRec(), + candidate.flagMcMatchRec(), + numPvContributors); + } + } + + // MC gen. + for (const auto& particle : mcParticles) { + if (yCandGenMax >= 0. && std::abs(particle.rapidityCharmBaryonGen()) > yCandGenMax) { + continue; + } + + auto ptGen = particle.pt(); + auto yGen = particle.rapidityCharmBaryonGen(); + + unsigned maxNumContrib = 0; + const auto& recoCollsPerMcColl = collisions.sliceBy(colPerMcCollision, particle.mcCollision().globalIndex()); + for (const auto& recCol : recoCollsPerMcColl) { + maxNumContrib = recCol.numContrib() > maxNumContrib ? recCol.numContrib() : maxNumContrib; + } + + if (particle.originGen() == RecoDecay::OriginType::Prompt) { + registry.fill(HIST("hSparseAcc"), + ptGen, + -1., + yGen, + RecoDecay::OriginType::Prompt, + maxNumContrib); + } else { + float ptGenB = mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); + registry.fill(HIST("hSparseAcc"), + ptGen, + ptGenB, + yGen, + RecoDecay::OriginType::NonPrompt, + maxNumContrib); + } + } + } + + void processDataWithKFParticle(Xic0CandsKF const& candidates, + CollisionsWithEvSels const& collisions) + { + processDataCent(candidates, collisions); + } + PROCESS_SWITCH(HfTaskXic0ToXiPi, processDataWithKFParticle, "process HfTaskXic0ToXiPi with KFParticle", true); + + void processDataWithKFParticleMl(Xic0CandsMlKF const& candidates, + CollisionsWithEvSels const& collisions) + { + processDataCent(candidates, collisions); + } + PROCESS_SWITCH(HfTaskXic0ToXiPi, processDataWithKFParticleMl, "process HfTaskXic0ToXiPi with KFParticle and ML selections", false); + + void processDataWithKFParticleFT0C(Xic0CandsKF const& candidates, + CollisionsWithFT0C const& collisions) + { + processDataCent(candidates, collisions); + } + PROCESS_SWITCH(HfTaskXic0ToXiPi, processDataWithKFParticleFT0C, "process HfTaskXic0ToXiPi with KFParticle and with FT0C centrality", false); + + void processDataWithKFParticleFT0M(Xic0CandsKF const& candidates, + CollisionsWithFT0M const& collisions) + { + processDataCent(candidates, collisions); + } + PROCESS_SWITCH(HfTaskXic0ToXiPi, processDataWithKFParticleFT0M, "process HfTaskXic0ToXiPi with KFParticle and with FT0M centrality", false); + + void processDataWithKFParticleMlFT0C(Xic0CandsMlKF const& candidates, + CollisionsWithFT0C const& collisions) + { + processDataCent(candidates, collisions); + } + PROCESS_SWITCH(HfTaskXic0ToXiPi, processDataWithKFParticleMlFT0C, "process HfTaskXic0ToXiPi with KFParticle and ML selections and with FT0C centrality", false); + + void processDataWithKFParticleMlFT0M(Xic0CandsMlKF const& candidates, + CollisionsWithFT0M const& collisions) + { + processDataCent(candidates, collisions); + } + PROCESS_SWITCH(HfTaskXic0ToXiPi, processDataWithKFParticleMlFT0M, "process HfTaskXic0ToXiPi with KFParticle and ML selections and with FT0M centrality", false); + + void processMcWithKFParticle(Xic0CandsMcKF const& Xic0CandidatesMcKF, + Xic0Gen const& mcParticles, + TracksMc const& tracks, + CollisionsWithMcLabels const& collisions, + aod::McCollisions const& mcCollisions) + { + processMc(Xic0CandidatesMcKF, mcParticles, tracks, collisions, mcCollisions); + } + PROCESS_SWITCH(HfTaskXic0ToXiPi, processMcWithKFParticle, "Process MC with KFParticle", false); + + void processMcWithKFParticleMl(Xic0CandsMlMcKF const& Xic0CandidatesMlMcKF, + Xic0Gen const& mcParticles, + TracksMc const& tracks, + CollisionsWithMcLabels const& collisions, + aod::McCollisions const& mcCollisions) + { + processMc(Xic0CandidatesMlMcKF, mcParticles, tracks, collisions, mcCollisions); + } + PROCESS_SWITCH(HfTaskXic0ToXiPi, processMcWithKFParticleMl, "Process MC with KFParticle and ML selections", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index b1051842f1a..c10d74df58b 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -1486,9 +1486,7 @@ DECLARE_SOA_COLUMN(KfMassOmegac, kfMassOmegac, float); DECLARE_SOA_COLUMN(KfRapOmegac, kfRapOmegac, float); DECLARE_SOA_COLUMN(KfRapXic, kfRapXic, float); DECLARE_SOA_COLUMN(KfptPiFromOmegac, kfptPiFromOmegac, float); -DECLARE_SOA_COLUMN(KfptPiFromXic, kfptPiFromXic, float); DECLARE_SOA_COLUMN(KfptOmegac, kfptOmegac, float); -DECLARE_SOA_COLUMN(KfptXic, kfptXic, float); DECLARE_SOA_COLUMN(CosThetaStarPiFromOmegac, cosThetaStarPiFromOmegac, float); DECLARE_SOA_COLUMN(CosThetaStarPiFromXic, cosThetaStarPiFromXic, float); DECLARE_SOA_COLUMN(V0Ndf, v0Ndf, float); @@ -1738,7 +1736,6 @@ DECLARE_SOA_TABLE(HfCandToOmegaKaKf, "AOD", "HFCANDTOOMEGAKAKF", DECLARE_SOA_TABLE(HfCandToXiPiKf, "AOD", "HFCANDTOXIPIKF", //! o2::soa::Index<>, hf_cand_xic0_omegac0::CollisionId, hf_cand_xic0_omegac0::XPv, hf_cand_xic0_omegac0::YPv, hf_cand_xic0_omegac0::ZPv, - hf_cand_xic0_omegac0::XDecayVtxCharmBaryon, hf_cand_xic0_omegac0::YDecayVtxCharmBaryon, hf_cand_xic0_omegac0::ZDecayVtxCharmBaryon, hf_cand_xic0_omegac0::XDecayVtxCascade, hf_cand_xic0_omegac0::YDecayVtxCascade, hf_cand_xic0_omegac0::ZDecayVtxCascade, hf_cand_xic0_omegac0::XDecayVtxV0, hf_cand_xic0_omegac0::YDecayVtxV0, hf_cand_xic0_omegac0::ZDecayVtxV0, hf_cand_xic0_omegac0::SignDecay, @@ -1750,28 +1747,23 @@ DECLARE_SOA_TABLE(HfCandToXiPiKf, "AOD", "HFCANDTOXIPIKF", //! hf_cand_xic0_omegac0::PxBachFromCasc, hf_cand_xic0_omegac0::PyBachFromCasc, hf_cand_xic0_omegac0::PzBachFromCasc, hf_cand_xic0_omegac0::PxPosV0Dau, hf_cand_xic0_omegac0::PyPosV0Dau, hf_cand_xic0_omegac0::PzPosV0Dau, hf_cand_xic0_omegac0::PxNegV0Dau, hf_cand_xic0_omegac0::PyNegV0Dau, hf_cand_xic0_omegac0::PzNegV0Dau, - hf_cand_xic0_omegac0::ImpactParCascXY, hf_cand_xic0_omegac0::ImpactParBachFromCharmBaryonXY, hf_cand_xic0_omegac0::ImpactParCascZ, hf_cand_xic0_omegac0::ImpactParBachFromCharmBaryonZ, - hf_cand_xic0_omegac0::ErrImpactParCascXY, hf_cand_xic0_omegac0::ErrImpactParBachFromCharmBaryonXY, hf_cand_xic0_omegac0::V0Id, v0data::PosTrackId, v0data::NegTrackId, hf_cand_xic0_omegac0::CascadeId, hf_cand_xic0_omegac0::BachelorFromCharmBaryonId, cascdata::BachelorId, hf_cand_xic0_omegac0::InvMassLambda, hf_cand_xic0_omegac0::InvMassCascade, hf_cand_xic0_omegac0::InvMassCharmBaryon, - hf_cand_xic0_omegac0::CosPAV0, hf_cand_xic0_omegac0::CosPACharmBaryon, hf_cand_xic0_omegac0::CosPACasc, hf_cand_xic0_omegac0::CosPAXYV0, hf_cand_xic0_omegac0::CosPAXYCharmBaryon, hf_cand_xic0_omegac0::CosPAXYCasc, - hf_cand_xic0_omegac0::CTauOmegac, hf_cand_xic0_omegac0::CTauCascade, hf_cand_xic0_omegac0::CTauV0, hf_cand_xic0_omegac0::CTauXic, + hf_cand_xic0_omegac0::CosPAV0, hf_cand_xic0_omegac0::CosPACasc, + hf_cand_xic0_omegac0::CTauCascade, hf_cand_xic0_omegac0::CTauV0, hf_cand_xic0_omegac0::CTauXic, hf_cand_xic0_omegac0::EtaV0PosDau, hf_cand_xic0_omegac0::EtaV0NegDau, hf_cand_xic0_omegac0::EtaBachFromCasc, hf_cand_xic0_omegac0::EtaBachFromCharmBaryon, hf_cand_xic0_omegac0::EtaCharmBaryon, hf_cand_xic0_omegac0::EtaCascade, hf_cand_xic0_omegac0::EtaV0, hf_cand_xic0_omegac0::DcaXYToPvV0Dau0, hf_cand_xic0_omegac0::DcaXYToPvV0Dau1, hf_cand_xic0_omegac0::DcaXYToPvCascDau, - hf_cand_xic0_omegac0::DcaZToPvV0Dau0, hf_cand_xic0_omegac0::DcaZToPvV0Dau1, hf_cand_xic0_omegac0::DcaZToPvCascDau, hf_cand_xic0_omegac0::DcaCascDau, hf_cand_xic0_omegac0::DcaV0Dau, hf_cand_xic0_omegac0::DcaCharmBaryonDau, - hf_cand_xic0_omegac0::DecLenCharmBaryon, hf_cand_xic0_omegac0::DecLenCascade, hf_cand_xic0_omegac0::DecLenV0, hf_cand_xic0_omegac0::ErrorDecayLengthCharmBaryon, hf_cand_xic0_omegac0::ErrorDecayLengthXYCharmBaryon, hf_cand_xic0_omegac0::KfDcaXYPiFromXic, hf_cand_xic0_omegac0::KfDcaXYCascToPv, hf_cand_xic0_omegac0::Chi2GeoV0, hf_cand_xic0_omegac0::Chi2GeoCasc, hf_cand_xic0_omegac0::Chi2GeoXic, hf_cand_xic0_omegac0::Chi2MassV0, hf_cand_xic0_omegac0::Chi2MassCasc, - hf_cand_xic0_omegac0::V0ldl, hf_cand_xic0_omegac0::Cascldl, hf_cand_xic0_omegac0::Xicldl, + hf_cand_xic0_omegac0::V0ldl, hf_cand_xic0_omegac0::Cascldl, hf_cand_xic0_omegac0::Chi2TopoV0ToPv, hf_cand_xic0_omegac0::Chi2TopoCascToPv, hf_cand_xic0_omegac0::Chi2TopoPiFromXicToPv, hf_cand_xic0_omegac0::Chi2TopoXicToPv, hf_cand_xic0_omegac0::Chi2TopoV0ToCasc, hf_cand_xic0_omegac0::Chi2TopoCascToXic, hf_cand_xic0_omegac0::DecayLenXYLambda, hf_cand_xic0_omegac0::DecayLenXYCasc, hf_cand_xic0_omegac0::DecayLenXYXic, - hf_cand_xic0_omegac0::CosPaV0ToCasc, hf_cand_xic0_omegac0::CosPaCascToXic, hf_cand_xic0_omegac0::CosPaXYV0ToCasc, hf_cand_xic0_omegac0::CosPaXYCascToXic, + hf_cand_xic0_omegac0::CosPaV0ToCasc, hf_cand_xic0_omegac0::CosPaCascToXic, hf_cand_xic0_omegac0::KfRapXic, - hf_cand_xic0_omegac0::KfptPiFromXic, hf_cand_xic0_omegac0::KfptXic, hf_cand_xic0_omegac0::CosThetaStarPiFromXic, hf_cand_xic0_omegac0::V0Ndf, hf_cand_xic0_omegac0::CascNdf, hf_cand_xic0_omegac0::XicNdf, hf_cand_xic0_omegac0::MassV0Ndf, hf_cand_xic0_omegac0::MassCascNdf, diff --git a/PWGHF/DataModel/CandidateSelectionTables.h b/PWGHF/DataModel/CandidateSelectionTables.h index 7ad42ab2a2c..7f5786ee1f6 100644 --- a/PWGHF/DataModel/CandidateSelectionTables.h +++ b/PWGHF/DataModel/CandidateSelectionTables.h @@ -375,9 +375,7 @@ DECLARE_SOA_TABLE(HfSelToXiPi, "AOD", "HFSELTOXIPI", hf_sel_toxipi::TofNSigmaPiFromCharmBaryon, hf_sel_toxipi::TofNSigmaPiFromCasc, hf_sel_toxipi::TofNSigmaPiFromLambda, hf_sel_toxipi::TofNSigmaPrFromLambda); DECLARE_SOA_TABLE(HfSelToXiPiKf, "AOD", "HFSELTOXIPIKF", - hf_sel_toxipi::StatusPidCharmBaryon, hf_sel_toxipi::StatusPidCascade, hf_sel_toxipi::StatusPidLambda, - hf_sel_toxipi::StatusInvMassCharmBaryon, hf_sel_toxipi::StatusInvMassCascade, hf_sel_toxipi::StatusInvMassLambda, - hf_sel_toxipi::ResultSelections, hf_sel_toxipi::PidTpcInfoStored, hf_sel_toxipi::PidTofInfoStored, + hf_sel_toxipi::ResultSelections, hf_sel_toxipi::TpcNSigmaPiFromCharmBaryon, hf_sel_toxipi::TpcNSigmaPiFromCasc, hf_sel_toxipi::TpcNSigmaPiFromLambda, hf_sel_toxipi::TpcNSigmaPrFromLambda, hf_sel_toxipi::TofNSigmaPiFromCharmBaryon, hf_sel_toxipi::TofNSigmaPiFromCasc, hf_sel_toxipi::TofNSigmaPiFromLambda, hf_sel_toxipi::TofNSigmaPrFromLambda); diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx index 2042399c372..573d9fb7db4 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx @@ -152,7 +152,8 @@ struct HfCandidateCreatorXic0Omegac0 { using MyV0Table = soa::Join; using MyLFTracksWCov = soa::Join; - using MyKfTracks = soa::Join; + using MyKfTracksIU = soa::Join; + using MyKfTracks = soa::Join; using MyKfCascTable = soa::Join; using KFCascadesLinked = soa::Join; @@ -227,8 +228,6 @@ struct HfCandidateCreatorXic0Omegac0 { float cosPaXYCascToPv; float massV0; float massCasc; - float ptPiFromXic; - float ptXic; float rapXic; float massXic; float cosThetaStarPiFromXic; @@ -249,7 +248,6 @@ struct HfCandidateCreatorXic0Omegac0 { float ctV0; float ctCasc; float ctXic; - float ctOmegac; float chi2MassV0; float chi2MassCasc; float etaXic; @@ -742,7 +740,8 @@ struct HfCandidateCreatorXic0Omegac0 { template void runKfOmegac0CreatorWithKFParticle(Coll const&, aod::BCsWithTimestamps const& /*bcWithTimeStamps*/, - MyKfTracks const&, + MyKfTracksIU const& tracksIU, + MyKfTracks const& tracks, MyKfCascTable const&, KFCascadesLinked const&, aod::HfCascLf2Prongs const& candidates, Hist& hInvMassCharmBaryon, @@ -773,8 +772,8 @@ struct HfCandidateCreatorXic0Omegac0 { df.setBz(magneticField); KFParticle::SetField(magneticField); // bachelor from Omegac0 - auto trackCharmBachelor = cand.prong0_as(); - + auto trackCharmBachelorId = cand.prong0Id(); + auto trackCharmBachelor = tracks.rawIteratorAt(trackCharmBachelorId); auto cascAodElement = cand.cascade_as(); hCascadesCounter->Fill(0); int v0index = cascAodElement.v0Id(); @@ -783,9 +782,12 @@ struct HfCandidateCreatorXic0Omegac0 { } auto casc = cascAodElement.kfCascData_as(); hCascadesCounter->Fill(1); - auto trackCascDauCharged = casc.bachelor_as(); // pion <- xi track - auto trackV0Dau0 = casc.posTrack_as(); // V0 positive daughter track - auto trackV0Dau1 = casc.negTrack_as(); // V0 negative daughter track + auto trackCascDauChargedId = casc.bachelorId(); + auto trackV0Dau0Id = casc.posTrackId(); + auto trackV0Dau1Id = casc.negTrackId(); + auto trackCascDauCharged = tracksIU.rawIteratorAt(trackCascDauChargedId); // pion <- xi track + auto trackV0Dau0 = tracksIU.rawIteratorAt(trackV0Dau0Id); // V0 positive daughter track + auto trackV0Dau1 = tracksIU.rawIteratorAt(trackV0Dau1Id); // V0 negative daughter track auto bachCharge = trackCascDauCharged.signed1Pt() > 0 ? +1 : -1; @@ -1219,7 +1221,8 @@ struct HfCandidateCreatorXic0Omegac0 { template void runKfXic0CreatorWithKFParticle(Coll const&, aod::BCsWithTimestamps const& /*bcWithTimeStamps*/, - MyKfTracks const&, + MyKfTracksIU const& tracksIU, + MyKfTracks const& tracks, MyKfCascTable const&, KFCascadesLinked const&, aod::HfCascLf2Prongs const& candidates, Hist& hInvMassCharmBaryon, @@ -1229,7 +1232,9 @@ struct HfCandidateCreatorXic0Omegac0 { { for (const auto& cand : candidates) { hCandidateCounter->Fill(1); - + if (!TESTBIT(cand.hfflag(), aod::hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi)) { + continue; + } auto collision = cand.collision_as(); float centrality{-1.f}; @@ -1251,8 +1256,8 @@ struct HfCandidateCreatorXic0Omegac0 { df.setBz(magneticField); KFParticle::SetField(magneticField); // bachelor from Xic0 - auto trackCharmBachelor = cand.prong0_as(); - + auto trackCharmBachelorId = cand.prong0Id(); + auto trackCharmBachelor = tracks.rawIteratorAt(trackCharmBachelorId); auto cascAodElement = cand.cascade_as(); hCascadesCounter->Fill(0); int v0index = cascAodElement.v0Id(); @@ -1261,9 +1266,12 @@ struct HfCandidateCreatorXic0Omegac0 { } auto casc = cascAodElement.kfCascData_as(); hCascadesCounter->Fill(1); - auto trackCascDauCharged = casc.bachelor_as(); // pion <- xi track - auto trackV0Dau0 = casc.posTrack_as(); // V0 positive daughter track - auto trackV0Dau1 = casc.negTrack_as(); // V0 negative daughter track + auto trackCascDauChargedId = casc.bachelorId(); + auto trackV0Dau0Id = casc.posTrackId(); + auto trackV0Dau1Id = casc.negTrackId(); + auto trackCascDauCharged = tracksIU.rawIteratorAt(trackCascDauChargedId); // pion <- xi track + auto trackV0Dau0 = tracksIU.rawIteratorAt(trackV0Dau0Id); // V0 positive daughter track + auto trackV0Dau1 = tracksIU.rawIteratorAt(trackV0Dau1Id); // V0 negative daughter track auto bachCharge = trackCascDauCharged.signed1Pt() > 0 ? +1 : -1; @@ -1456,16 +1464,13 @@ struct HfCandidateCreatorXic0Omegac0 { std::array vertexCasc = {kfXi.GetX(), kfXi.GetY(), kfXi.GetZ()}; std::array pVecCascBachelor = {kfBachPionToXi.GetPx(), kfBachPionToXi.GetPy(), kfBachPionToXi.GetPz()}; - auto primaryVertex = getPrimaryVertex(collision); std::array pvCoord = {collision.posX(), collision.posY(), collision.posZ()}; - std::array vertexCharmBaryonFromFitter = {0.0, 0.0, 0.0}; // This variable get from DCAfitter in default process, in KF process it is set as 0. std::array pVecCharmBachelorAsD; pVecCharmBachelorAsD[0] = kfCharmBachPionToXiC.GetPx(); pVecCharmBachelorAsD[1] = kfCharmBachPionToXiC.GetPy(); pVecCharmBachelorAsD[2] = kfCharmBachPionToXiC.GetPz(); std::array pVecCharmBaryon = {kfXiC0.GetPx(), kfXiC0.GetPy(), kfXiC0.GetPz()}; - std::array coordVtxCharmBaryon = {kfXiC0.GetX(), kfXiC0.GetY(), kfXiC0.GetZ()}; auto covVtxCharmBaryon = kfXiC0.CovarianceMatrix(); float covMatrixPV[6]; kfVertex.GetCovarianceMatrix(covMatrixPV); @@ -1473,38 +1478,17 @@ struct HfCandidateCreatorXic0Omegac0 { // impact parameters std::array impactParameterV0Dau0; std::array impactParameterV0Dau1; - std::array impactParameterKaFromCasc; + std::array impactParameterPiFromCasc; o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackParCovV0Dau0, 2.f, matCorr, &impactParameterV0Dau0); o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackParCovV0Dau1, 2.f, matCorr, &impactParameterV0Dau1); - o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, xiDauChargedTrackParCov, 2.f, matCorr, &impactParameterKaFromCasc); + o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, xiDauChargedTrackParCov, 2.f, matCorr, &impactParameterPiFromCasc); float dcaxyV0Dau0 = impactParameterV0Dau0[0]; float dcaxyV0Dau1 = impactParameterV0Dau1[0]; - float dcaxyCascBachelor = impactParameterKaFromCasc[0]; - float dcazV0Dau0 = impactParameterV0Dau0[1]; - float dcazV0Dau1 = impactParameterV0Dau1[1]; - float dcazCascBachelor = impactParameterKaFromCasc[1]; + float dcaxyCascBachelor = impactParameterPiFromCasc[0]; // pseudorapidity float pseudorapCharmBachelor = kfCharmBachPionToXiC.GetEta(); - // impact parameters - o2::dataformats::DCA impactParameterCasc; - o2::dataformats::DCA impactParameterCharmBachelor; - o2::base::Propagator::Instance()->propagateToDCABxByBz(primaryVertex, trackCasc, 2.f, matCorr, &impactParameterCasc); - o2::base::Propagator::Instance()->propagateToDCABxByBz(primaryVertex, trackParVarCharmBachelor, 2.f, matCorr, &impactParameterCharmBachelor); - float impactParBachFromCharmBaryonXY = impactParameterCharmBachelor.getY(); - float impactParBachFromCharmBaryonZ = impactParameterCharmBachelor.getZ(); - - // computing decay length and ctau - float decLenCharmBaryon = RecoDecay::distance(pvCoord, coordVtxCharmBaryon); - float decLenCascade = RecoDecay::distance(coordVtxCharmBaryon, vertexCasc); - float decLenV0 = RecoDecay::distance(vertexCasc, vertexV0); - - double phiCharmBaryon, thetaCharmBaryon; - getPointDirection(std::array{kfV0.GetX(), kfV0.GetY(), kfV0.GetZ()}, coordVtxCharmBaryon, phiCharmBaryon, thetaCharmBaryon); - auto errorDecayLengthCharmBaryon = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phiCharmBaryon, thetaCharmBaryon) + getRotatedCovMatrixXX(covVtxCharmBaryon, phiCharmBaryon, thetaCharmBaryon)); - auto errorDecayLengthXYCharmBaryon = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phiCharmBaryon, 0.) + getRotatedCovMatrixXX(covVtxCharmBaryon, phiCharmBaryon, 0.)); - // fill test histograms hInvMassCharmBaryon->Fill(massXiC0); hCandidateCounter->Fill(3); @@ -1581,42 +1565,26 @@ struct HfCandidateCreatorXic0Omegac0 { kfXic0Candidate.massCasc = massCasc; kfXic0Candidate.massXic = massXiC0; - // KF pT - kfXic0Candidate.ptPiFromXic = kfCharmBachPionToXiC.GetPt(); - kfXic0Candidate.ptXic = kfXiC0.GetPt(); - // KF rapidity kfXic0Candidate.rapXic = kfXiC0.GetRapidity(); // KF cosThetaStar - kfXic0Candidate.cosThetaStarPiFromXic = cosThetaStarFromKF(0, 4332, 211, 3312, kfCharmBachPionToXiC, kfXiToXiC); + kfXic0Candidate.cosThetaStarPiFromXic = cosThetaStarFromKF(0, 4132, 211, 3312, kfCharmBachPionToXiC, kfXiToXiC); // KF ct - kfXic0Candidate.ctV0 = kfV0.GetLifeTime(); - kfXic0Candidate.ctCasc = kfXi.GetLifeTime(); - kfXic0Candidate.ctXic = kfXiC0.GetLifeTime(); - kfXic0Candidate.ctOmegac = kfXiC0.GetLifeTime(); - + kfXic0Candidate.ctV0 = kfV0ToCasc.GetLifeTime(); + kfXic0Candidate.ctCasc = kfXiToXiC.GetLifeTime(); + kfXic0Candidate.ctXic = kfXic0ToPv.GetLifeTime(); // KF eta kfXic0Candidate.etaXic = kfXiC0.GetEta(); // fill KF hist registry.fill(HIST("hKFParticleCascBachTopoChi2"), cascBachTopoChi2); - registry.fill(HIST("hKFParticleV0TopoChi2"), kfXic0Candidate.chi2NdfTopoV0ToCasc); - registry.fill(HIST("hKFParticleCascTopoChi2"), kfXic0Candidate.chi2NdfTopoCascToXic); - registry.fill(HIST("hKFParticleDcaCharmBaryonDau"), kfXic0Candidate.kfDcaXicDau); - registry.fill(HIST("hKFParticleDcaXYCascBachToPv"), dcaxyCascBachelor); - registry.fill(HIST("hKFParticleDcaXYV0DauPosToPv"), dcaxyV0Dau0); - registry.fill(HIST("hKFParticleDcaXYV0DauNegToPv"), dcaxyV0Dau1); - registry.fill(HIST("hKfLambda_ldl"), kfXic0Candidate.ldlV0); - registry.fill(HIST("hKfXi_ldl"), kfXic0Candidate.ldlCasc); registry.fill(HIST("hKfXiC0_ldl"), kfXic0Candidate.ldlXic); - registry.fill(HIST("hDcaXYCascadeToPVKf"), kfXic0Candidate.kfDcaXYCascToPv); // fill kf table kfCandidateXicData(collision.globalIndex(), pvCoord[0], pvCoord[1], pvCoord[2], - vertexCharmBaryonFromFitter[0], vertexCharmBaryonFromFitter[1], vertexCharmBaryonFromFitter[2], vertexCasc[0], vertexCasc[1], vertexCasc[2], vertexV0[0], vertexV0[1], vertexV0[2], trackCascDauCharged.sign(), @@ -1628,28 +1596,23 @@ struct HfCandidateCreatorXic0Omegac0 { pVecCascBachelor[0], pVecCascBachelor[1], pVecCascBachelor[2], pVecV0Dau0[0], pVecV0Dau0[1], pVecV0Dau0[2], pVecV0Dau1[0], pVecV0Dau1[1], pVecV0Dau1[2], - impactParameterCasc.getY(), impactParBachFromCharmBaryonXY, - impactParameterCasc.getZ(), impactParBachFromCharmBaryonZ, - std::sqrt(impactParameterCasc.getSigmaY2()), std::sqrt(impactParameterCharmBachelor.getSigmaY2()), v0index, casc.posTrackId(), casc.negTrackId(), casc.cascadeId(), trackCharmBachelor.globalIndex(), casc.bachelorId(), kfXic0Candidate.massV0, kfXic0Candidate.massCasc, kfXic0Candidate.massXic, - kfXic0Candidate.cosPaV0ToPv, kfXic0Candidate.cosPaXicToPv, kfXic0Candidate.cosPaCascToPv, kfXic0Candidate.cosPaXYV0ToPv, kfXic0Candidate.cosPaXYXicToPv, kfXic0Candidate.cosPaXYCascToPv, - kfXic0Candidate.ctOmegac, kfXic0Candidate.ctCasc, kfXic0Candidate.ctV0, kfXic0Candidate.ctXic, + kfXic0Candidate.cosPaV0ToPv, kfXic0Candidate.cosPaCascToPv, + kfXic0Candidate.ctCasc, kfXic0Candidate.ctV0, kfXic0Candidate.ctXic, pseudorapV0Dau0, pseudorapV0Dau1, pseudorapCascBachelor, pseudorapCharmBachelor, kfXic0Candidate.etaXic, kfXi.GetEta(), kfV0.GetEta(), dcaxyV0Dau0, dcaxyV0Dau1, dcaxyCascBachelor, - dcazV0Dau0, dcazV0Dau1, dcazCascBachelor, kfXic0Candidate.kfDcaCascDau, kfXic0Candidate.kfDcaV0Dau, kfXic0Candidate.kfDcaXicDau, - decLenCharmBaryon, decLenCascade, decLenV0, errorDecayLengthCharmBaryon, errorDecayLengthXYCharmBaryon, kfXic0Candidate.kfDcaXYPiFromXic, kfXic0Candidate.kfDcaXYCascToPv, kfXic0Candidate.chi2GeoV0, kfXic0Candidate.chi2GeoCasc, kfXic0Candidate.chi2GeoXic, kfXic0Candidate.chi2MassV0, kfXic0Candidate.chi2MassCasc, - kfXic0Candidate.ldlV0, kfXic0Candidate.ldlCasc, kfXic0Candidate.ldlXic, + kfXic0Candidate.ldlV0, kfXic0Candidate.ldlCasc, kfXic0Candidate.chi2NdfTopoV0ToPv, kfXic0Candidate.chi2NdfTopoCascToPv, kfXic0Candidate.chi2NdfTopoPiFromXicToPv, kfXic0Candidate.chi2NdfTopoXicToPv, kfXic0Candidate.chi2NdfTopoV0ToCasc, kfXic0Candidate.chi2NdfTopoCascToXic, kfXic0Candidate.decayLenXYLambda, kfXic0Candidate.decayLenXYCasc, kfXic0Candidate.decayLenXYXic, - kfXic0Candidate.cosPaV0ToCasc, kfXic0Candidate.cosPaCascToXic, kfXic0Candidate.cosPaXYV0ToCasc, kfXic0Candidate.cosPaXYCascToXic, - kfXic0Candidate.rapXic, kfXic0Candidate.ptPiFromXic, kfXic0Candidate.ptXic, + kfXic0Candidate.cosPaV0ToCasc, kfXic0Candidate.cosPaCascToXic, + kfXic0Candidate.rapXic, kfXic0Candidate.cosThetaStarPiFromXic, v0NDF, cascNDF, charmbaryonNDF, v0Ndfm, cascNdfm, v0Chi2OverNdf, cascChi2OverNdf, charmbaryonChi2OverNdf, v0Chi2OverNdfm, cascChi2OverNdfm); @@ -1672,7 +1635,8 @@ struct HfCandidateCreatorXic0Omegac0 { template void runOmegac0Xic0ToOmegaKaCreatorWithKFParticle(Coll const&, aod::BCsWithTimestamps const& /*bcWithTimeStamps*/, - MyKfTracks const&, + MyKfTracksIU const& tracksIU, + MyKfTracks const& tracks, MyKfCascTable const&, KFCascadesLinked const&, aod::HfCascLf2Prongs const& candidates, Hist& hInvMassCharmBaryon, @@ -1713,11 +1677,15 @@ struct HfCandidateCreatorXic0Omegac0 { hCascadesCounter->Fill(1); // convert KaonFromCharm&KaFromOmega&V0DauPos&V0DauNeg tracks into KFParticle object - auto trackKaFromCharm = cand.prong0_as(); - auto trackKaFromOmega = casc.bachelor_as(); // Ka <- Omega track - auto trackV0DauPos = casc.posTrack_as(); // V0 positive daughter track - auto trackV0DauNeg = casc.negTrack_as(); // V0 negative daughter track - auto KaFromOmegaCharge = trackKaFromOmega.sign(); + auto trackCharmBachelorId = cand.prong0Id(); + auto trackKaFromCharm = tracks.rawIteratorAt(trackCharmBachelorId); + auto trackCascDauChargedId = casc.bachelorId(); + auto trackV0Dau0Id = casc.posTrackId(); + auto trackV0Dau1Id = casc.negTrackId(); + auto trackKaFromOmega = tracksIU.rawIteratorAt(trackCascDauChargedId); // Ka <- Omega track + auto trackV0DauPos = tracksIU.rawIteratorAt(trackV0Dau0Id); // V0 positive daughter track + auto trackV0DauNeg = tracksIU.rawIteratorAt(trackV0Dau1Id); // V0 negative daughter track + auto kaFromOmegaCharge = trackKaFromOmega.sign(); auto signOmega = casc.sign(); KFPTrack kfpTrackKaFromCharm = createKFPTrackFromTrack(trackKaFromCharm); @@ -1731,7 +1699,7 @@ struct HfCandidateCreatorXic0Omegac0 { KFParticle kfPiFromXiRej(kfpTrackKaFromOmega, kPiMinus); // rej KFParticle kfKaFromCharm(kfpTrackKaFromCharm, kKPlus); - if (signOmega == 0 || KaFromOmegaCharge == 0 || KaFromOmegaCharge != signOmega) { + if (signOmega == 0 || kaFromOmegaCharge == 0 || kaFromOmegaCharge != signOmega) { continue; } // convert for Pos and Neg Particles @@ -2035,34 +2003,37 @@ struct HfCandidateCreatorXic0Omegac0 { void processNoCentOmegacToOmegaPiWithKFParticle(soa::Join const& collisions, aod::BCsWithTimestamps const& bcWithTimeStamps, + MyKfTracksIU const& tracksIU, MyKfTracks const& tracks, MyKfCascTable const& cascades, KFCascadesLinked const& cascadeLinks, aod::HfCascLf2Prongs const& candidates) { - runKfOmegac0CreatorWithKFParticle(collisions, bcWithTimeStamps, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToOmegaPi, hFitterStatusToOmegaPi, hCandidateCounterToOmegaPi, hCascadesCounterToOmegaPi); + runKfOmegac0CreatorWithKFParticle(collisions, bcWithTimeStamps, tracksIU, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToOmegaPi, hFitterStatusToOmegaPi, hCandidateCounterToOmegaPi, hCascadesCounterToOmegaPi); } PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0, processNoCentOmegacToOmegaPiWithKFParticle, "Run candidate creator w/o centrality selections for Omegac0 To omega pi decay channel using KFParticle", false); void processNoCentOmegac0Xic0ToOmegaKaCreatorWithKFParticle(soa::Join const& collisions, aod::BCsWithTimestamps const& bcWithTimeStamps, + MyKfTracksIU const& tracksIU, MyKfTracks const& tracks, MyKfCascTable const& cascades, KFCascadesLinked const& cascadeLinks, aod::HfCascLf2Prongs const& candidates) { - runOmegac0Xic0ToOmegaKaCreatorWithKFParticle(collisions, bcWithTimeStamps, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToOmegaK, hFitterStatusToOmegaK, hCandidateCounterToOmegaK, hCascadesCounterToOmegaK); + runOmegac0Xic0ToOmegaKaCreatorWithKFParticle(collisions, bcWithTimeStamps, tracksIU, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToOmegaK, hFitterStatusToOmegaK, hCandidateCounterToOmegaK, hCascadesCounterToOmegaK); } PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0, processNoCentOmegac0Xic0ToOmegaKaCreatorWithKFParticle, "Run candidate creator w/o centrality selections for Omegac0 To omega ka decay channel using KFParticle", false); void processNoCentXicToXiPiWithKFParticle(soa::Join const& collisions, aod::BCsWithTimestamps const& bcWithTimeStamps, + MyKfTracksIU const& tracksIU, MyKfTracks const& tracks, MyKfCascTable const& cascades, KFCascadesLinked const& cascadeLinks, aod::HfCascLf2Prongs const& candidates) { - runKfXic0CreatorWithKFParticle(collisions, bcWithTimeStamps, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToXiPi, hFitterStatusToXiPi, hCandidateCounterToXiPi, hCascadesCounterToXiPi); + runKfXic0CreatorWithKFParticle(collisions, bcWithTimeStamps, tracksIU, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToXiPi, hFitterStatusToXiPi, hCandidateCounterToXiPi, hCascadesCounterToXiPi); } PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0, processNoCentXicToXiPiWithKFParticle, "Run candidate creator w/o centrality selections for Xic0 To Xi pi decay channel using KFParticle", false); @@ -2105,34 +2076,37 @@ struct HfCandidateCreatorXic0Omegac0 { void processCentFT0COmegacToOmegaPiWithKFParticle(soa::Join const& collisions, aod::BCsWithTimestamps const& bcWithTimeStamps, + MyKfTracksIU const& tracksIU, MyKfTracks const& tracks, MyKfCascTable const& cascades, KFCascadesLinked const& cascadeLinks, aod::HfCascLf2Prongs const& candidates) { - runKfOmegac0CreatorWithKFParticle(collisions, bcWithTimeStamps, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToOmegaPi, hFitterStatusToOmegaPi, hCandidateCounterToOmegaPi, hCascadesCounterToOmegaPi); + runKfOmegac0CreatorWithKFParticle(collisions, bcWithTimeStamps, tracksIU, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToOmegaPi, hFitterStatusToOmegaPi, hCandidateCounterToOmegaPi, hCascadesCounterToOmegaPi); } PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0, processCentFT0COmegacToOmegaPiWithKFParticle, "Run candidate creator w/o centrality selections for Omegac0 To omega pi decay channel using KFParticle", false); void processCentFT0COmegac0Xic0ToOmegaKaCreatorWithKFParticle(soa::Join const& collisions, aod::BCsWithTimestamps const& bcWithTimeStamps, + MyKfTracksIU const& tracksIU, MyKfTracks const& tracks, MyKfCascTable const& cascades, KFCascadesLinked const& cascadeLinks, aod::HfCascLf2Prongs const& candidates) { - runOmegac0Xic0ToOmegaKaCreatorWithKFParticle(collisions, bcWithTimeStamps, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToOmegaK, hFitterStatusToOmegaK, hCandidateCounterToOmegaK, hCascadesCounterToOmegaK); + runOmegac0Xic0ToOmegaKaCreatorWithKFParticle(collisions, bcWithTimeStamps, tracksIU, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToOmegaK, hFitterStatusToOmegaK, hCandidateCounterToOmegaK, hCascadesCounterToOmegaK); } PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0, processCentFT0COmegac0Xic0ToOmegaKaCreatorWithKFParticle, "Run candidate creator w/o centrality selections for Omegac0 To omega ka decay channel using KFParticle", false); void processCentFT0CXicToXiPiWithKFParticle(soa::Join const& collisions, aod::BCsWithTimestamps const& bcWithTimeStamps, + MyKfTracksIU const& tracksIU, MyKfTracks const& tracks, MyKfCascTable const& cascades, KFCascadesLinked const& cascadeLinks, aod::HfCascLf2Prongs const& candidates) { - runKfXic0CreatorWithKFParticle(collisions, bcWithTimeStamps, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToXiPi, hFitterStatusToXiPi, hCandidateCounterToXiPi, hCascadesCounterToXiPi); + runKfXic0CreatorWithKFParticle(collisions, bcWithTimeStamps, tracksIU, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToXiPi, hFitterStatusToXiPi, hCandidateCounterToXiPi, hCascadesCounterToXiPi); } PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0, processCentFT0CXicToXiPiWithKFParticle, "Run candidate creator w FT0C centrality selections for Xic0 To Xi pi decay channel using KFParticle", false); @@ -2175,34 +2149,37 @@ struct HfCandidateCreatorXic0Omegac0 { void processCentFT0MOmegacToOmegaPiWithKFParticle(soa::Join const& collisions, aod::BCsWithTimestamps const& bcWithTimeStamps, + MyKfTracksIU const& tracksIU, MyKfTracks const& tracks, MyKfCascTable const& cascades, KFCascadesLinked const& cascadeLinks, aod::HfCascLf2Prongs const& candidates) { - runKfOmegac0CreatorWithKFParticle(collisions, bcWithTimeStamps, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToOmegaPi, hFitterStatusToOmegaPi, hCandidateCounterToOmegaPi, hCascadesCounterToOmegaPi); + runKfOmegac0CreatorWithKFParticle(collisions, bcWithTimeStamps, tracksIU, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToOmegaPi, hFitterStatusToOmegaPi, hCandidateCounterToOmegaPi, hCascadesCounterToOmegaPi); } PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0, processCentFT0MOmegacToOmegaPiWithKFParticle, "Run candidate creator w/o centrality selections for Omegac0 To omega pi decay channel using KFParticle", false); void processCentFT0MOmegac0Xic0ToOmegaKaCreatorWithKFParticle(soa::Join const& collisions, aod::BCsWithTimestamps const& bcWithTimeStamps, + MyKfTracksIU const& tracksIU, MyKfTracks const& tracks, MyKfCascTable const& cascades, KFCascadesLinked const& cascadeLinks, aod::HfCascLf2Prongs const& candidates) { - runOmegac0Xic0ToOmegaKaCreatorWithKFParticle(collisions, bcWithTimeStamps, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToOmegaK, hFitterStatusToOmegaK, hCandidateCounterToOmegaK, hCascadesCounterToOmegaK); + runOmegac0Xic0ToOmegaKaCreatorWithKFParticle(collisions, bcWithTimeStamps, tracksIU, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToOmegaK, hFitterStatusToOmegaK, hCandidateCounterToOmegaK, hCascadesCounterToOmegaK); } PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0, processCentFT0MOmegac0Xic0ToOmegaKaCreatorWithKFParticle, "Run candidate creator w/o centrality selections for Omegac0 To omega ka decay channel using KFParticle", false); void processCentFT0MXicToXiPiWithKFParticle(soa::Join const& collisions, aod::BCsWithTimestamps const& bcWithTimeStamps, + MyKfTracksIU const& tracksIU, MyKfTracks const& tracks, MyKfCascTable const& cascades, KFCascadesLinked const& cascadeLinks, aod::HfCascLf2Prongs const& candidates) { - runKfXic0CreatorWithKFParticle(collisions, bcWithTimeStamps, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToXiPi, hFitterStatusToXiPi, hCandidateCounterToXiPi, hCascadesCounterToXiPi); + runKfXic0CreatorWithKFParticle(collisions, bcWithTimeStamps, tracksIU, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToXiPi, hFitterStatusToXiPi, hCandidateCounterToXiPi, hCascadesCounterToXiPi); } PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0, processCentFT0MXicToXiPiWithKFParticle, "Run candidate creator w FT0M centrality selections for Xic0 To Xi pi decay channel using KFParticle", false); diff --git a/PWGHF/TableProducer/candidateSelectorXic0ToXiPiKf.cxx b/PWGHF/TableProducer/candidateSelectorXic0ToXiPiKf.cxx index 5d8a8f055e1..88824d4d75d 100644 --- a/PWGHF/TableProducer/candidateSelectorXic0ToXiPiKf.cxx +++ b/PWGHF/TableProducer/candidateSelectorXic0ToXiPiKf.cxx @@ -63,16 +63,15 @@ struct HfCandidateSelectorXic0ToXiPiKf { Produces hfSelToXiPi; Produces hfMlToXiPi; - // LF analysis selections + // kinematic selections + Configurable etaTrackCharmBachMax{"etaTrackCharmBachMax", 0.8, "Max absolute value of eta for charm baryon bachelor"}; + Configurable etaTrackLFDauMax{"etaTrackLFDauMax", 0.8, "Max absolute value of eta for V0 and cascade daughters"}; + Configurable ptPiFromCascMin{"ptPiFromCascMin", 0.15, "Min pT pion <- casc"}; + + // minimum radius cut (LFcut) Configurable radiusCascMin{"radiusCascMin", 0.5, "Min cascade radius"}; Configurable radiusV0Min{"radiusV0Min", 1.1, "Min V0 radius"}; - Configurable cosPAV0Min{"cosPAV0Min", 0.97, "Min valueCosPA V0"}; - Configurable cosPACascMin{"cosPACascMin", 0.97, "Min value CosPA cascade"}; - Configurable dcaCascDauMax{"dcaCascDauMax", 1.0, "Max DCA cascade daughters"}; - Configurable dcaV0DauMax{"dcaV0DauMax", 1.0, "Max DCA V0 daughters"}; - Configurable dcaBachToPvMin{"dcaBachToPvMin", 0.04, "DCA Bach To PV"}; - Configurable dcaNegToPvMin{"dcaNegToPvMin", 0.06, "DCA Neg To PV"}; - Configurable dcaPosToPvMin{"dcaPosToPvMin", 0.06, "DCA Pos To PV"}; + Configurable v0MassWindow{"v0MassWindow", 0.01, "V0 mass window"}; Configurable cascadeMassWindow{"cascadeMassWindow", 0.01, "Cascade mass window"}; Configurable applyTrkSelLf{"applyTrkSelLf", true, "Apply track selection for LF daughters"}; @@ -81,27 +80,6 @@ struct HfCandidateSelectorXic0ToXiPiKf { Configurable invMassCharmBaryonMin{"invMassCharmBaryonMin", 2.0, "Lower limit invariant mass spectrum charm baryon"}; // 2.4 Omegac0 only Configurable invMassCharmBaryonMax{"invMassCharmBaryonMax", 3.1, "Upper limit invariant mass spectrum charm baryon"}; - // kinematic selections - Configurable etaTrackCharmBachMax{"etaTrackCharmBachMax", 0.8, "Max absolute value of eta for charm baryon bachelor"}; - Configurable etaTrackLFDauMax{"etaTrackLFDauMax", 1.0, "Max absolute value of eta for V0 and cascade daughters"}; - Configurable ptPiFromCascMin{"ptPiFromCascMin", 0.15, "Min pT pion <- casc"}; - Configurable ptPiFromCharmBaryonMin{"ptPiFromCharmBaryonMin", 0.2, "Min pT pi <- charm baryon"}; - - Configurable impactParameterXYPiFromCharmBaryonMin{"impactParameterXYPiFromCharmBaryonMin", 0., "Min dcaxy pi from charm baryon track to PV"}; - Configurable impactParameterXYPiFromCharmBaryonMax{"impactParameterXYPiFromCharmBaryonMax", 10., "Max dcaxy pi from charm baryon track to PV"}; - Configurable impactParameterZPiFromCharmBaryonMin{"impactParameterZPiFromCharmBaryonMin", 0., "Min dcaz pi from charm baryon track to PV"}; - Configurable impactParameterZPiFromCharmBaryonMax{"impactParameterZPiFromCharmBaryonMax", 10., "Max dcaz pi from charm baryon track to PV"}; - - Configurable impactParameterXYCascMin{"impactParameterXYCascMin", 0., "Min dcaxy cascade track to PV"}; - Configurable impactParameterXYCascMax{"impactParameterXYCascMax", 10., "Max dcaxy cascade track to PV"}; - Configurable impactParameterZCascMin{"impactParameterZCascMin", 0., "Min dcaz cascade track to PV"}; - Configurable impactParameterZCascMax{"impactParameterZCascMax", 10., "Max dcaz cascade track to PV"}; - - Configurable ptCandMin{"ptCandMin", 0., "Lower bound of candidate pT"}; - Configurable ptCandMax{"ptCandMax", 50., "Upper bound of candidate pT"}; - - Configurable dcaCharmBaryonDauMax{"dcaCharmBaryonDauMax", 2.0, "Max DCA charm baryon daughters"}; - // PID options Configurable usePidTpcOnly{"usePidTpcOnly", false, "Perform PID using only TPC"}; Configurable usePidTpcTofCombined{"usePidTpcTofCombined", true, "Perform PID using TPC & TOF"}; @@ -122,12 +100,12 @@ struct HfCandidateSelectorXic0ToXiPiKf { Configurable ptPrPidTofMin{"ptPrPidTofMin", -1, "Lower bound of track pT for TOF PID for proton selection"}; Configurable ptPrPidTofMax{"ptPrPidTofMax", 9999.9, "Upper bound of track pT for TOF PID for proton selection"}; - Configurable nSigmaTofPrMax{"nSigmaTofPrMax", 3., "Nsigma cut on TOF only for proton selection"}; + Configurable nSigmaTofPrMax{"nSigmaTofPrMax", 5., "Nsigma cut on TOF only for proton selection"}; Configurable nSigmaTofCombinedPrMax{"nSigmaTofCombinedPrMax", 0., "Nsigma cut on TOF combined with TPC for proton selection"}; Configurable ptPiPidTofMin{"ptPiPidTofMin", -1, "Lower bound of track pT for TOF PID for pion selection"}; Configurable ptPiPidTofMax{"ptPiPidTofMax", 9999.9, "Upper bound of track pT for TOF PID for pion selection"}; - Configurable nSigmaTofPiMax{"nSigmaTofPiMax", 3., "Nsigma cut on TOF only for pion selection"}; + Configurable nSigmaTofPiMax{"nSigmaTofPiMax", 5., "Nsigma cut on TOF only for pion selection"}; Configurable nSigmaTofCombinedPiMax{"nSigmaTofCombinedPiMax", 0., "Nsigma cut on TOF combined with TOF for pion selection"}; // detector clusters selections @@ -139,6 +117,10 @@ struct HfCandidateSelectorXic0ToXiPiKf { Configurable nClustersItsInnBarrMin{"nClustersItsInnBarrMin", 1, "Minimum number of ITS clusters in inner barrel requirement for pi <- charm baryon"}; Configurable itsChi2PerClusterMax{"itsChi2PerClusterMax", 36, "Maximum value of chi2 fit over ITS clusters for pi <- charm baryon"}; + // topological cuts + Configurable> binsPt{"binsPt", std::vector{hf_cuts_xic_to_xi_pi::vecBinsPt}, "pT bin limits"}; + Configurable> cuts{"cuts", {hf_cuts_xic_to_xi_pi::Cuts[0], hf_cuts_xic_to_xi_pi::NBinsPt, hf_cuts_xic_to_xi_pi::NCutVars, hf_cuts_xic_to_xi_pi::labelsPt, hf_cuts_xic_to_xi_pi::labelsCutVar}, "Xic0 candidate selection per pT bin"}; + // ML inference Configurable applyMl{"applyMl", true, "Flag to apply ML selections"}; Configurable> binsPtMl{"binsPtMl", std::vector{hf_cuts_ml::vecBinsPt}, "pT bin limits for ML application"}; @@ -185,39 +167,25 @@ struct HfCandidateSelectorXic0ToXiPiKf { selectorPion.setRangeNSigmaTofCondTpc(-nSigmaTofCombinedPiMax, nSigmaTofCombinedPiMax); const AxisSpec axisSel{2, -0.5, 1.5, "status"}; - - registry.add("hSelPID", "hSelPID;status;entries", {HistType::kTH1D, {{12, 0., 12.}}}); - registry.add("hStatusCheck", "Check consecutive selections status;status;entries", {HistType::kTH1D, {{12, 0., 12.}}}); - - // for QA of the selections (bin 0 -> candidates that did not pass the selection, bin 1 -> candidates that passed the selection) + registry.add("hStatusCheck", "Check consecutive selections status;status;entries", {HistType::kTH1D, {{3, 0., 3.}}}); + // sign of candidates registry.add("hSelSignDec", "hSelSignDec;status;entries", {HistType::kTH1D, {axisSel}}); - registry.add("hSelEtaPosV0Dau", "hSelEtaPosV0Dau;status;entries", {HistType::kTH1D, {axisSel}}); - registry.add("hSelEtaNegV0Dau", "hSelEtaNegV0Dau;status;entries", {HistType::kTH1D, {axisSel}}); - registry.add("hSelEtaPiFromCasc", "hSelEtaPiFromCasc;status;entries", {HistType::kTH1D, {axisSel}}); - registry.add("hSelEtaPiFromCharm", "hSelEtaPiFromCharm;status;entries", {HistType::kTH1D, {axisSel}}); + // basic selections (bin 0 -> candidates that did not pass the selection, bin 1 -> candidates that passed the selection) + registry.add("hSelPtPiFromCasc", "hSelPtPiFromCasc;status;entries", {HistType::kTH1D, {axisSel}}); registry.add("hSelRadCasc", "hSelRadCasc;status;entries", {HistType::kTH1D, {axisSel}}); registry.add("hSelRadV0", "hSelRadV0;status;entries", {HistType::kTH1D, {axisSel}}); - registry.add("hSelCosPACasc", "hSelCosPACasc;status;entries", {HistType::kTH1D, {axisSel}}); - registry.add("hSelCosPAV0", "hSelCosPAV0;status;entries", {HistType::kTH1D, {axisSel}}); - registry.add("hSelDCACascDau", "hSelDCACascDau;status;entries", {HistType::kTH1D, {axisSel}}); - registry.add("hSelDCAV0Dau", "hSelDCAV0Dau;status;entries", {HistType::kTH1D, {axisSel}}); - registry.add("hSelDCACharmDau", "hSelDCACharmDau;status;entries", {HistType::kTH1D, {axisSel}}); - registry.add("hSelDCAXYPrimPi", "hSelDCAXYPrimPi;status;entries", {HistType::kTH1D, {axisSel}}); - registry.add("hSelDCAZPrimPi", "hSelDCAZPrimPi;status;entries", {HistType::kTH1D, {axisSel}}); - registry.add("hSelDCAXYCasc", "hSelDCAXYCasc;status;entries", {HistType::kTH1D, {axisSel}}); - registry.add("hSelDCAZCasc", "hSelDCAZCasc;status;entries", {HistType::kTH1D, {axisSel}}); - registry.add("hSelPtPiFromCasc", "hSelPtPiFromCasc;status;entries", {HistType::kTH1D, {axisSel}}); - registry.add("hSelPtPiFromCharm", "hSelPtPiFromCharm;status;entries", {HistType::kTH1D, {axisSel}}); + + // TPC and ITS selections (bin 0 -> candidates that did not pass the selection, bin 1 -> candidates that passed the selection) registry.add("hSelTPCQualityPiFromCharm", "hSelTPCQualityPiFromCharm;status;entries", {HistType::kTH1D, {axisSel}}); registry.add("hSelTPCQualityPiFromLam", "hSelTPCQualityPiFromLam;status;entries", {HistType::kTH1D, {axisSel}}); registry.add("hSelTPCQualityPrFromLam", "hSelTPCQualityPrFromLam;status;entries", {HistType::kTH1D, {axisSel}}); registry.add("hSelTPCQualityPiFromCasc", "hSelTPCQualityPiFromCasc;status;entries", {HistType::kTH1D, {axisSel}}); registry.add("hSelITSQualityPiFromCharm", "hSelITSQualityPiFromCharm;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelPID", "hSelPID;status;entries", {HistType::kTH1D, {{12, 0., 12.}}}); registry.add("hSelMassLam", "hSelMassLam;status;entries", {HistType::kTH1D, {axisSel}}); registry.add("hSelMassCasc", "hSelMassCasc;status;entries", {HistType::kTH1D, {axisSel}}); registry.add("hSelMassCharmBaryon", "hSelMassCharmBaryon;status;entries", {HistType::kTH1D, {axisSel}}); - registry.add("hSelDcaXYToPvV0Daughters", "hSelDcaXYToPvV0Daughters;status;entries", {HistType::kTH1D, {axisSel}}); - registry.add("hSelDcaXYToPvPiFromCasc", "hSelDcaXYToPvPiFromCasc;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelMlXic0", "hSelMlXic0;status;entries", {HistType::kTH1D, {axisSel}}); if (applyMl) { hfMlResponse.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl); @@ -240,6 +208,8 @@ struct HfCandidateSelectorXic0ToXiPiKf { // looping over charm baryon candidates for (const auto& candidate : candidates) { + outputMlXic0ToXiPiKf.clear(); + auto ptCand = RecoDecay::pt(candidate.pxCharmBaryon(), candidate.pyCharmBaryon()); bool resultSelections = true; // True if the candidate passes all the selections, False otherwise @@ -271,29 +241,15 @@ struct HfCandidateSelectorXic0ToXiPiKf { double etaV0NegDau = candidate.etaV0NegDau(); double etaPiFromCasc = candidate.etaBachFromCasc(); double etaPiFromCharmBaryon = candidate.etaBachFromCharmBaryon(); - if (std::abs(etaV0PosDau) > etaTrackLFDauMax) { - resultSelections = false; - registry.fill(HIST("hSelEtaPosV0Dau"), 0); - } else { - registry.fill(HIST("hSelEtaPosV0Dau"), 1); - } - if (std::abs(etaV0NegDau) > etaTrackLFDauMax) { - resultSelections = false; - registry.fill(HIST("hSelEtaNegV0Dau"), 0); - } else { - registry.fill(HIST("hSelEtaNegV0Dau"), 1); - } - if (std::abs(etaPiFromCasc) > etaTrackLFDauMax) { + if (std::abs(etaV0PosDau) > etaTrackLFDauMax || std::abs(etaV0NegDau) > etaTrackLFDauMax || std::abs(etaPiFromCasc) > etaTrackLFDauMax || std::abs(etaPiFromCharmBaryon) > etaTrackCharmBachMax) { resultSelections = false; - registry.fill(HIST("hSelEtaPiFromCasc"), 0); - } else { - registry.fill(HIST("hSelEtaPiFromCasc"), 1); } - if (std::abs(etaPiFromCharmBaryon) > etaTrackCharmBachMax) { + double ptPiFromCasc = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCasc(), candidate.pyBachFromCasc()); + if (std::abs(ptPiFromCasc) < ptPiFromCascMin) { resultSelections = false; - registry.fill(HIST("hSelEtaPiFromCharm"), 0); + registry.fill(HIST("hSelPtPiFromCasc"), 0); } else { - registry.fill(HIST("hSelEtaPiFromCharm"), 1); + registry.fill(HIST("hSelPtPiFromCasc"), 1); } // minimum radius cut (LFcut) @@ -310,103 +266,6 @@ struct HfCandidateSelectorXic0ToXiPiKf { registry.fill(HIST("hSelRadV0"), 1); } - // cosPA (LFcut) - if (candidate.cosPACasc() < cosPACascMin) { - resultSelections = false; - registry.fill(HIST("hSelCosPACasc"), 0); - } else { - registry.fill(HIST("hSelCosPACasc"), 1); - } - if (candidate.cosPAV0() < cosPAV0Min) { - resultSelections = false; - registry.fill(HIST("hSelCosPAV0"), 0); - } else { - registry.fill(HIST("hSelCosPAV0"), 1); - } - - // cascade and v0 daughters dca cut (LF cut) - if (candidate.dcaCascDau() > dcaCascDauMax) { - resultSelections = false; - registry.fill(HIST("hSelDCACascDau"), 0); - } else { - registry.fill(HIST("hSelDCACascDau"), 1); - } - - if (candidate.dcaV0Dau() > dcaV0DauMax) { - resultSelections = false; - registry.fill(HIST("hSelDCAV0Dau"), 0); - } else { - registry.fill(HIST("hSelDCAV0Dau"), 1); - } - - // dca charm baryon daughters cut - if (candidate.dcaCharmBaryonDau() > dcaCharmBaryonDauMax) { - resultSelections = false; - registry.fill(HIST("hSelDCACharmDau"), 0); - } else { - registry.fill(HIST("hSelDCACharmDau"), 1); - } - - // dcaXY v0 daughters to PV cut - if (std::abs(candidate.dcaXYToPvV0Dau0()) < dcaPosToPvMin || std::abs(candidate.dcaXYToPvV0Dau1()) < dcaNegToPvMin) { - resultSelections = false; - registry.fill(HIST("hSelDcaXYToPvV0Daughters"), 0); - } else { - registry.fill(HIST("hSelDcaXYToPvV0Daughters"), 1); - } - - // dcaXY ka <-- cascade to PV cut - if (std::abs(candidate.dcaXYToPvCascDau()) < dcaBachToPvMin) { - resultSelections = false; - registry.fill(HIST("hSelDcaXYToPvPiFromCasc"), 0); - } else { - registry.fill(HIST("hSelDcaXYToPvPiFromCasc"), 1); - } - - // cut on charm bachelor pion dcaXY and dcaZ - if ((std::abs(candidate.impactParBachFromCharmBaryonXY()) < impactParameterXYPiFromCharmBaryonMin) || (std::abs(candidate.impactParBachFromCharmBaryonXY()) > impactParameterXYPiFromCharmBaryonMax)) { - resultSelections = false; - registry.fill(HIST("hSelDCAXYPrimPi"), 0); - } else { - registry.fill(HIST("hSelDCAXYPrimPi"), 1); - } - if ((std::abs(candidate.impactParBachFromCharmBaryonZ()) < impactParameterZPiFromCharmBaryonMin) || (std::abs(candidate.impactParBachFromCharmBaryonZ()) > impactParameterZPiFromCharmBaryonMax)) { - resultSelections = false; - registry.fill(HIST("hSelDCAZPrimPi"), 0); - } else { - registry.fill(HIST("hSelDCAZPrimPi"), 1); - } - - // cut on cascade dcaXY and dcaZ - if ((std::abs(candidate.impactParCascXY()) < impactParameterXYCascMin) || (std::abs(candidate.impactParCascXY()) > impactParameterXYCascMax)) { - resultSelections = false; - registry.fill(HIST("hSelDCAXYCasc"), 0); - } else { - registry.fill(HIST("hSelDCAXYCasc"), 1); - } - if ((std::abs(candidate.impactParCascZ()) < impactParameterZCascMin) || (std::abs(candidate.impactParCascZ()) > impactParameterZCascMax)) { - resultSelections = false; - registry.fill(HIST("hSelDCAZCasc"), 0); - } else { - registry.fill(HIST("hSelDCAZCasc"), 1); - } - - // pT selections - double ptPiFromCasc = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCasc(), candidate.pyBachFromCasc()); - double ptPiFromCharmBaryon = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()); - if (std::abs(ptPiFromCasc) < ptPiFromCascMin) { - resultSelections = false; - registry.fill(HIST("hSelPtPiFromCasc"), 0); - } else { - registry.fill(HIST("hSelPtPiFromCasc"), 1); - } - if (std::abs(ptPiFromCharmBaryon) < ptPiFromCharmBaryonMin) { - resultSelections = false; - registry.fill(HIST("hSelPtPiFromCharm"), 0); - } else { - registry.fill(HIST("hSelPtPiFromCharm"), 1); - } - // TPC clusters selections if (applyTrkSelLf) { if (!isSelectedTrackTpcQuality(trackPiFromLam, nClustersTpcMin, nTpcCrossedRowsMin, tpcCrossedRowsOverFindableClustersRatioMin, tpcChi2PerClusterMax)) { @@ -515,9 +374,9 @@ struct HfCandidateSelectorXic0ToXiPiKf { if (statusPidPrFromLam == TrackSelectorPID::Accepted && statusPidPiFromLam == TrackSelectorPID::Accepted && statusPidPiFromCasc == TrackSelectorPID::Accepted && statusPidPiFromCharmBaryon == TrackSelectorPID::Accepted) { statusPidCharmBaryon = true; - if (resultSelections) { - registry.fill(HIST("hStatusCheck"), 2.5); - } + } else { + registry.fill(HIST("hStatusCheck"), 2.5); + resultSelections = false; } // invariant mass cuts @@ -529,48 +388,46 @@ struct HfCandidateSelectorXic0ToXiPiKf { double invMassCascade = candidate.invMassCascade(); double invMassCharmBaryon = candidate.invMassCharmBaryon(); - if (std::abs(invMassLambda - o2::constants::physics::MassLambda0) < v0MassWindow) { - statusInvMassLambda = true; - registry.fill(HIST("hSelMassLam"), 1); - if (statusPidLambda && statusPidCascade && statusPidCharmBaryon && resultSelections) { - registry.fill(HIST("hStatusCheck"), 3.5); + if (resultSelections) { + resultSelections = selectionTopolKf(candidate); + if (std::abs(invMassLambda - o2::constants::physics::MassLambda0) < v0MassWindow) { + statusInvMassLambda = true; + registry.fill(HIST("hSelMassLam"), 1); + } else { + resultSelections = false; + registry.fill(HIST("hSelMassLam"), 0); } - } else { - registry.fill(HIST("hSelMassLam"), 0); - } - if (std::abs(invMassCascade - o2::constants::physics::MassXiMinus) < cascadeMassWindow) { - statusInvMassCascade = true; - registry.fill(HIST("hSelMassCasc"), 1); - if (statusPidLambda && statusPidCascade && statusPidCharmBaryon && statusInvMassLambda && resultSelections) { - registry.fill(HIST("hStatusCheck"), 4.5); + if (std::abs(invMassCascade - o2::constants::physics::MassXiMinus) < cascadeMassWindow) { + statusInvMassCascade = true; + registry.fill(HIST("hSelMassCasc"), 1); + } else { + resultSelections = false; + registry.fill(HIST("hSelMassCasc"), 0); } - } else { - registry.fill(HIST("hSelMassCasc"), 0); - } - if ((invMassCharmBaryon >= invMassCharmBaryonMin) && (invMassCharmBaryon <= invMassCharmBaryonMax)) { - statusInvMassCharmBaryon = true; - registry.fill(HIST("hSelMassCharmBaryon"), 1); - if (statusPidLambda && statusPidCascade && statusPidCharmBaryon && statusInvMassLambda && statusInvMassCascade && resultSelections) { - registry.fill(HIST("hStatusCheck"), 5.5); + if ((invMassCharmBaryon >= invMassCharmBaryonMin) && (invMassCharmBaryon <= invMassCharmBaryonMax)) { + statusInvMassCharmBaryon = true; + registry.fill(HIST("hSelMassCharmBaryon"), 1); + } else { + resultSelections = false; + registry.fill(HIST("hSelMassCharmBaryon"), 0); } - } else { - registry.fill(HIST("hSelMassCharmBaryon"), 0); } - // ML selections if (applyMl) { bool isSelectedMlXic0 = false; std::vector inputFeaturesXic0 = hfMlResponse.getInputFeatures(candidate, trackPiFromLam, trackPiFromCasc, trackPiFromCharm); - isSelectedMlXic0 = hfMlResponse.isSelectedMl(inputFeaturesXic0, ptCand, outputMlXic0ToXiPiKf); - if (!isSelectedMlXic0) { - continue; + if (!resultSelections) { + hfMlToXiPi(outputMlXic0ToXiPiKf); + } else { + isSelectedMlXic0 = hfMlResponse.isSelectedMl(inputFeaturesXic0, ptCand, outputMlXic0ToXiPiKf); + registry.fill(HIST("hSelMlXic0"), isSelectedMlXic0); + hfMlToXiPi(outputMlXic0ToXiPiKf); } - hfMlToXiPi(outputMlXic0ToXiPiKf); } - hfSelToXiPi(statusPidCharmBaryon, statusPidCascade, statusPidLambda, statusInvMassCharmBaryon, statusInvMassCascade, statusInvMassLambda, resultSelections, infoTpcStored, infoTofStored, + hfSelToXiPi(resultSelections, trackPiFromCharm.tpcNSigmaPi(), trackPiFromCasc.tpcNSigmaPi(), trackPiFromLam.tpcNSigmaPi(), trackPrFromLam.tpcNSigmaPr(), trackPiFromCharm.tofNSigmaPi(), trackPiFromCasc.tofNSigmaPi(), trackPiFromLam.tofNSigmaPi(), trackPrFromLam.tofNSigmaPr()); @@ -618,6 +475,125 @@ struct HfCandidateSelectorXic0ToXiPiKf { } } } // end process + + /// \param candidate is candidate + /// \return true if candidate passes all cuts + template + bool selectionTopolKf(const T& candidate) + { + auto candpT = RecoDecay::pt(candidate.pxCharmBaryon(), candidate.pyCharmBaryon()); + + int pTBin = findBin(binsPt, candpT); + if (pTBin == -1) { + return false; + } + + double ptPiFromCharmBaryon = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()); + if (ptPiFromCharmBaryon <= cuts->get(pTBin, "ptPiFromCharmBaryon")) { + return false; + } + + // cosPA (LFcut) + if (candidate.cosPACasc() < cuts->get(pTBin, "cosPACasc")) { + return false; + } + if (candidate.cosPAV0() < cuts->get(pTBin, "cosPAV0")) { + return false; + } + if (candidate.cosPaCascToXic() < cuts->get(pTBin, "cosPaCascToXic")) { + return false; + } + if (candidate.cosPaV0ToCasc() < cuts->get(pTBin, "cosPaV0ToCasc")) { + return false; + } + + // dca cut + if (candidate.dcaCharmBaryonDau() > cuts->get(pTBin, "dcaCharmBaryonDau")) { + return false; + } + if (candidate.dcaCascDau() > cuts->get(pTBin, "dcaCascDau")) { + return false; + } + + if (candidate.dcaV0Dau() > cuts->get(pTBin, "dcaV0Dau")) { + return false; + } + + // dcaXY pion <-- cascade to PV cut + if (std::abs(candidate.dcaXYToPvCascDau()) < cuts->get(pTBin, "dcaXYToPvCascDau")) { + return false; + } + + // dcaXY v0 daughters to PV cut + if (std::abs(candidate.dcaXYToPvV0Dau0()) < cuts->get(pTBin, "dcaXYToPvV0Dau0") || std::abs(candidate.dcaXYToPvV0Dau1()) < cuts->get(pTBin, "dcaXYToPvV0Dau0")) { + return false; + } + + // dacXY pion <-- Xic0 to PV cut + if (std::abs(candidate.kfDcaXYPiFromXic()) > cuts->get(pTBin, "kfDcaXYPiFromXic")) { + return false; + } + + // dacXY cascade to PV cut + if (std::abs(candidate.kfDcaXYCascToPv()) > cuts->get(pTBin, "kfDcaXYCascToPv")) { + return false; + } + + // Chi2Geo + if (candidate.chi2GeoXic() < 0 || candidate.chi2GeoXic() > cuts->get(pTBin, "chi2GeoXic")) { + return false; + } + if (candidate.chi2GeoCasc() < 0 || candidate.chi2GeoCasc() > cuts->get(pTBin, "chi2GeoCasc")) { + return false; + } + if (candidate.chi2GeoV0() < 0 || candidate.chi2GeoV0() > cuts->get(pTBin, "chi2GeoV0")) { + return false; + } + + // Chi2Topo + if (candidate.chi2TopoXicToPv() < 0 || candidate.chi2TopoXicToPv() > cuts->get(pTBin, "chi2TopoXicToPv")) { + return false; + } + if (candidate.chi2TopoPiFromXicToPv() < 0 || candidate.chi2TopoPiFromXicToPv() > cuts->get(pTBin, "chi2TopoPiFromXicToPv")) { + return false; + } + if (candidate.chi2TopoCascToPv() < 0 || candidate.chi2TopoCascToPv() > cuts->get(pTBin, "chi2TopoCascToPv")) { + return false; + } + if (candidate.chi2TopoV0ToPv() > 0 && candidate.chi2TopoV0ToPv() < cuts->get(pTBin, "chi2TopoV0ToPv")) { + return false; + } + if (candidate.chi2TopoV0ToCasc() < 0 || candidate.chi2TopoV0ToCasc() > cuts->get(pTBin, "chi2TopoV0ToCasc")) { + return false; + } + if (candidate.chi2TopoCascToXic() < 0 || candidate.chi2TopoCascToXic() > cuts->get(pTBin, "chi2TopoCascToXic")) { + return false; + } + + // ldl + if (candidate.cascldl() < cuts->get(pTBin, "cascldl")) { + return false; + } + if (candidate.v0ldl() < cuts->get(pTBin, "v0ldl")) { + return false; + } + // decay length + if (std::abs(candidate.decayLenXYXic()) > cuts->get(pTBin, "decayLenXYXic")) { + return false; + } + if (std::abs(candidate.decayLenXYCasc()) < cuts->get(pTBin, "decayLenXYCasc")) { + return false; + } + if (std::abs(candidate.decayLenXYLambda()) < cuts->get(pTBin, "decayLenXYLambda")) { + return false; + } + // ctau + if (std::abs(candidate.cTauXic()) > cuts->get(pTBin, "cTauXic")) { + return false; + } + return true; + } + }; // end struct WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx b/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx index ae0e919967a..b959f4bf65e 100644 --- a/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx +++ b/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx @@ -49,6 +49,7 @@ DECLARE_SOA_COLUMN(DcaXYToPvV0Dau0, dcaXYToPvV0Dau0, float); DECLARE_SOA_COLUMN(DcaXYToPvV0Dau1, dcaXYToPvV0Dau1, float); DECLARE_SOA_COLUMN(DcaXYToPvCascDau, dcaXYToPvCascDau, float); DECLARE_SOA_COLUMN(DcaCascDau, dcaCascDau, float); +DECLARE_SOA_COLUMN(DcaV0Dau, dcaV0Dau, float); DECLARE_SOA_COLUMN(DcaCharmBaryonDau, dcaCharmBaryonDau, float); // from creator - MC DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); // reconstruction level @@ -74,7 +75,6 @@ DECLARE_SOA_COLUMN(Chi2MassV0, chi2MassV0, float); DECLARE_SOA_COLUMN(Chi2MassCasc, chi2MassCasc, float); DECLARE_SOA_COLUMN(V0ldl, v0ldl, float); DECLARE_SOA_COLUMN(Cascldl, cascldl, float); -DECLARE_SOA_COLUMN(Xicldl, xicldl, float); DECLARE_SOA_COLUMN(Chi2TopoV0ToPv, chi2TopoV0ToPv, float); DECLARE_SOA_COLUMN(Chi2TopoCascToPv, chi2TopoCascToPv, float); DECLARE_SOA_COLUMN(Chi2TopoPiFromXicToPv, chi2TopoPiFromXicToPv, float); @@ -88,7 +88,6 @@ DECLARE_SOA_COLUMN(CosPaV0ToCasc, cosPaV0ToCasc, float); DECLARE_SOA_COLUMN(CosPaV0ToPv, cosPaV0ToPv, float); DECLARE_SOA_COLUMN(CosPaCascToXic, cosPaCascToXic, float); DECLARE_SOA_COLUMN(CosPaCascToPv, cosPaCascToPv, float); -DECLARE_SOA_COLUMN(CosPaXicToPv, cosPaXicToPv, float); DECLARE_SOA_COLUMN(KfRapXic, kfRapXic, float); DECLARE_SOA_COLUMN(KfptPiFromXic, kfptPiFromXic, float); DECLARE_SOA_COLUMN(KfptXic, kfptXic, float); @@ -112,15 +111,15 @@ DECLARE_SOA_TABLE(HfKfXicFulls, "AOD", "HFKFXICFULL", full::Centrality, full::TpcNSigmaPiFromCharmBaryon, full::TofNSigmaPiFromCharmBaryon, full::TpcNSigmaPiFromCasc, full::TofNSigmaPiFromCasc, full::TpcNSigmaPiFromLambda, full::TofNSigmaPiFromLambda, full::TpcNSigmaPrFromLambda, full::TofNSigmaPrFromLambda, - full::KfDcaXYPiFromXic, full::DcaCascDau, full::DcaCharmBaryonDau, full::KfDcaXYCascToPv, + full::KfDcaXYPiFromXic, full::DcaCascDau, full::DcaV0Dau, full::DcaCharmBaryonDau, full::KfDcaXYCascToPv, full::DcaXYToPvV0Dau0, full::DcaXYToPvV0Dau1, full::DcaXYToPvCascDau, full::Chi2GeoV0, full::Chi2GeoCasc, full::Chi2GeoXic, full::Chi2MassV0, full::Chi2MassCasc, - full::V0ldl, full::Cascldl, full::Xicldl, + full::V0ldl, full::Cascldl, full::Chi2TopoV0ToPv, full::Chi2TopoCascToPv, full::Chi2TopoPiFromXicToPv, full::Chi2TopoXicToPv, full::Chi2TopoV0ToCasc, full::Chi2TopoCascToXic, full::DecayLenXYLambda, full::DecayLenXYCasc, full::DecayLenXYXic, - full::CosPaV0ToCasc, full::CosPaV0ToPv, full::CosPaCascToXic, full::CosPaCascToPv, full::CosPaXicToPv, + full::CosPaV0ToCasc, full::CosPaV0ToPv, full::CosPaCascToXic, full::CosPaCascToPv, full::InvMassLambda, full::InvMassCascade, full::InvMassCharmBaryon, full::KfRapXic, full::KfptPiFromXic, full::KfptXic, full::CosThetaStarPiFromXic, full::CtXic, full::EtaXic, @@ -145,22 +144,31 @@ struct HfTreeCreatorXic0ToXiPiKf { using MyEventTableWithFT0M = soa::Join; using MyEventTableWithNTracksPV = soa::Join; + HistogramRegistry registry{"registry"}; // for QA of selections + void init(InitContext const&) { + registry.add("hPiFromXic0ItsChi2NCls", "hItsChi2NCls;status;entries", {HistType::kTH1D, {{1000, 0.0f, 10.0f}}}); + registry.add("hPiFromCacsItsChi2NCls", "hItsChi2NCls;status;entries", {HistType::kTH1D, {{1000, 0.0f, 10.0f}}}); + registry.add("hV0Dau0ItsChi2NCls", "hItsChi2NCls;status;entries", {HistType::kTH1D, {{1000, 0.0f, 10.0f}}}); + registry.add("hV0Dau1ItsChi2NCls", "hItsChi2NCls;status;entries", {HistType::kTH1D, {{1000, 0.0f, 10.0f}}}); } template void fillKfCandidate(const T& candidate, int8_t flagMc, int8_t debugMc, int8_t originMc, bool collisionMatched) { - if (candidate.resultSelections() && candidate.statusPidCharmBaryon() && candidate.statusInvMassLambda() && candidate.statusInvMassCascade() && candidate.statusInvMassCharmBaryon()) { + if (candidate.resultSelections()) { float centrality = -999.f; if constexpr (useCentrality) { auto const& collision = candidate.template collision_as(); centrality = o2::hf_centrality::getCentralityColl(collision); } - + registry.fill(HIST("hPiFromXic0ItsChi2NCls"), candidate.template bachelorFromCharmBaryon_as().itsChi2NCl()); + registry.fill(HIST("hPiFromCacsItsChi2NCls"), candidate.template bachelor_as().itsChi2NCl()); + registry.fill(HIST("hV0Dau0ItsChi2NCls"), candidate.template posTrack_as().itsChi2NCl()); + registry.fill(HIST("hV0Dau1ItsChi2NCls"), candidate.template negTrack_as().itsChi2NCl()); rowKfCandidate( centrality, candidate.tpcNSigmaPiFromCharmBaryon(), @@ -173,6 +181,7 @@ struct HfTreeCreatorXic0ToXiPiKf { candidate.tofNSigmaPrFromLambda(), candidate.kfDcaXYPiFromXic(), candidate.dcaCascDau(), + candidate.dcaV0Dau(), candidate.dcaCharmBaryonDau(), candidate.kfDcaXYCascToPv(), candidate.dcaXYToPvV0Dau0(), @@ -185,7 +194,6 @@ struct HfTreeCreatorXic0ToXiPiKf { candidate.chi2MassCasc(), candidate.v0ldl(), candidate.cascldl(), - candidate.xicldl(), candidate.chi2TopoV0ToPv(), candidate.chi2TopoCascToPv(), candidate.chi2TopoPiFromXicToPv(), @@ -199,13 +207,12 @@ struct HfTreeCreatorXic0ToXiPiKf { candidate.cosPAV0(), candidate.cosPaCascToXic(), candidate.cosPACasc(), - candidate.cosPACharmBaryon(), candidate.invMassLambda(), candidate.invMassCascade(), candidate.invMassCharmBaryon(), candidate.kfRapXic(), - candidate.kfptPiFromXic(), - candidate.kfptXic(), + RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()), + RecoDecay::sqrtSumOfSquares(candidate.pxCharmBaryon(), candidate.pyCharmBaryon()), candidate.cosThetaStarPiFromXic(), candidate.cTauXic(), candidate.etaCharmBaryon(),