From 4ad9d5e02583c9dd410c526e7f113c2ff4772184 Mon Sep 17 00:00:00 2001 From: FDUEnrich <23210190047@m.fudan.edu.cn> Date: Wed, 25 Jun 2025 18:36:06 +0800 Subject: [PATCH 01/22] Update CandidateReconstructionTables.h --- .../DataModel/CandidateReconstructionTables.h | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index fd296e328f6..041b7d3d3f1 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -1402,6 +1402,50 @@ DECLARE_SOA_COLUMN(ErrorDecayLengthCharmBaryon, errorDecayLengthCharmBaryon, flo DECLARE_SOA_COLUMN(ErrorDecayLengthXYCharmBaryon, errorDecayLengthXYCharmBaryon, float); // KFParticle results +DECLARE_SOA_COLUMN(XPvKf, xPvKf, float); +DECLARE_SOA_COLUMN(YPvKf, yPvKf, float); +DECLARE_SOA_COLUMN(ZPvKf, zPvKf, float); +DECLARE_SOA_COLUMN(XDecayVtxV0Kf, xDecayVtxV0Kf, float); +DECLARE_SOA_COLUMN(YDecayVtxV0Kf, yDecayVtxV0Kf, float); +DECLARE_SOA_COLUMN(ZDecayVtxV0Kf, zDecayVtxV0Kf, float); +DECLARE_SOA_COLUMN(XDecayVtxCascadeKf, xDecayVtxCascadeKf, float); +DECLARE_SOA_COLUMN(YDecayVtxCascadeKf, yDecayVtxCascadeKf, float); +DECLARE_SOA_COLUMN(ZDecayVtxCascadeKf, zDecayVtxCascadeKf, float); +DECLARE_SOA_COLUMN(PxLambdaKf, pxLambdaKf, float); +DECLARE_SOA_COLUMN(PyLambdaKf, pyLambdaKf, float); +DECLARE_SOA_COLUMN(PzLambdaKf, pzLambdaKf, float); +DECLARE_SOA_COLUMN(PxCascKf, pxCascKf, float); +DECLARE_SOA_COLUMN(PyCascKf, pyCascKf, float); +DECLARE_SOA_COLUMN(PzCascKf, pzCascKf, float); +DECLARE_SOA_COLUMN(XDecayVtxOmegaKaKf, xDecayVtxOmegaKaKf, float); +DECLARE_SOA_COLUMN(YDecayVtxOmegaKaKf, yDecayVtxOmegaKaKf, float); +DECLARE_SOA_COLUMN(ZDecayVtxOmegaKaKf, zDecayVtxOmegaKaKf, float); +DECLARE_SOA_COLUMN(PxOmegaKaKf, pxOmegaKaKf, float); +DECLARE_SOA_COLUMN(PyOmegaKaKf, pyOmegaKaKf, float); +DECLARE_SOA_COLUMN(PzOmegaKaKf, pzOmegaKaKf, float); +DECLARE_SOA_COLUMN(EtaV0DauPr, etaV0DauPr, float); +DECLARE_SOA_COLUMN(EtaV0DauPi, etaV0DauPi, float); +DECLARE_SOA_COLUMN(InvMassCascadeRej, invMassCascadeRej, float); +DECLARE_SOA_COLUMN(InvMassLambdaErr, invMassLambdaErr, float); +DECLARE_SOA_COLUMN(InvMassCascadeErr, invMassCascadeErr, float); +DECLARE_SOA_COLUMN(InvMassCascadeRejErr, invMassCascadeRejErr, float); +DECLARE_SOA_COLUMN(InvMassCharmBaryonErr, invMassCharmBaryonErr, float); +DECLARE_SOA_COLUMN(CTauOmegaKa, cTauOmegaKa, float); +DECLARE_SOA_COLUMN(Chi2GeoOmegaKa, chi2GeoOmegaKa, float); +DECLARE_SOA_COLUMN(OmegaKaldl, omegaKaldl, float); +DECLARE_SOA_COLUMN(Chi2TopoKaFromOmegaKaToPv, chi2TopoKaFromOmegaKaToPv, float); +DECLARE_SOA_COLUMN(Chi2TopoOmegaKaToPv, chi2TopoOmegaKaToPv, float); +DECLARE_SOA_COLUMN(Chi2TopoKaToCasc, chi2TopoKaToCasc, float); +DECLARE_SOA_COLUMN(Chi2TopoCascToOmegaKa, chi2TopoCascToOmegaKa, float); +DECLARE_SOA_COLUMN(Chi2TopoKaToOmegaKa, chi2TopoKaToOmegaKa, float); +DECLARE_SOA_COLUMN(CosPaCascToOmegaKa, cosPaCascToOmegaKa, float); +DECLARE_SOA_COLUMN(CosPaXYCascToOmegaKa, cosPaXYCascToOmegaKa, float); +DECLARE_SOA_COLUMN(KfRapOmegaKa, kfRapOmegaKa, float); +DECLARE_SOA_COLUMN(KfPtKaFromOmegaKa, kfPtKaFromOmegaKa, float); +DECLARE_SOA_COLUMN(KfPtOmega, kfPtOmega, float); +DECLARE_SOA_COLUMN(KfPtOmegaKa, kfPtOmegaKa, float); +DECLARE_SOA_COLUMN(CosThetaStarKaFromOemgac, cosThetaStarKaFromOemgac, float); +DECLARE_SOA_COLUMN(CosThetaStarKaFromXic, cosThetaStarKaFromXic, float); DECLARE_SOA_COLUMN(KfDcaXYPiFromOmegac, kfDcaXYPiFromOmegac, float); DECLARE_SOA_COLUMN(KfDcaXYPiFromXic, kfDcaXYPiFromXic, float); DECLARE_SOA_COLUMN(KfDcaXYCascToPv, kfDcaXYCascToPv, float); @@ -1658,6 +1702,38 @@ DECLARE_SOA_TABLE(HfOmegacKf, "AOD", "HFOMEGACKF", //! hf_cand_xic0_omegac0::V0Chi2OverNdf, hf_cand_xic0_omegac0::CascChi2OverNdf, hf_cand_xic0_omegac0::OmegacChi2OverNdf, hf_cand_xic0_omegac0::MassV0Chi2OverNdf, hf_cand_xic0_omegac0::MassCascChi2OverNdf, hf_cand_xic0_omegac0::CascRejectInvmass); +// OmegaKa reconstruct by KFParticle +DECLARE_SOA_TABLE(HfCandToOmegaKaKf, "AOD", "HFCANDTOOMEGAKAKF", + 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::XPvKf, hf_cand_xic0_omegac0::YPvKf, hf_cand_xic0_omegac0::ZPvKf, + hf_cand_xic0_omegac0::XDecayVtxV0, hf_cand_xic0_omegac0::YDecayVtxV0, hf_cand_xic0_omegac0::ZDecayVtxV0, + hf_cand_xic0_omegac0::PxLambda, hf_cand_xic0_omegac0::PyLambda, hf_cand_xic0_omegac0::PzLambda, + hf_cand_xic0_omegac0::XDecayVtxCascade, hf_cand_xic0_omegac0::YDecayVtxCascade, hf_cand_xic0_omegac0::ZDecayVtxCascade, + hf_cand_xic0_omegac0::PxCasc, hf_cand_xic0_omegac0::PyCasc, hf_cand_xic0_omegac0::PzCasc, + hf_cand_xic0_omegac0::XDecayVtxV0Kf, hf_cand_xic0_omegac0::YDecayVtxV0Kf, hf_cand_xic0_omegac0::ZDecayVtxV0Kf, + hf_cand_xic0_omegac0::PxLambdaKf, hf_cand_xic0_omegac0::PyLambdaKf, hf_cand_xic0_omegac0::PzLambdaKf, + hf_cand_xic0_omegac0::XDecayVtxCascadeKf, hf_cand_xic0_omegac0::YDecayVtxCascadeKf, hf_cand_xic0_omegac0::ZDecayVtxCascadeKf, + hf_cand_xic0_omegac0::PxCascKf, hf_cand_xic0_omegac0::PyCascKf, hf_cand_xic0_omegac0::PzCascKf, + hf_cand_xic0_omegac0::XDecayVtxOmegaKaKf, hf_cand_xic0_omegac0::YDecayVtxOmegaKaKf, hf_cand_xic0_omegac0::ZDecayVtxOmegaKaKf, + hf_cand_xic0_omegac0::PxOmegaKaKf, hf_cand_xic0_omegac0::PyOmegaKaKf, hf_cand_xic0_omegac0::PzOmegaKaKf, + hf_cand_xic0_omegac0::SignDecay, hf_cand_xic0_omegac0::EtaV0DauPr, hf_cand_xic0_omegac0::EtaV0DauPi, hf_cand_xic0_omegac0::EtaBachFromCasc, + hf_cand_xic0_omegac0::EtaBachFromCharmBaryon, hf_cand_xic0_omegac0::EtaV0, hf_cand_xic0_omegac0::EtaCascade, hf_cand_xic0_omegac0::EtaCharmBaryon, + hf_cand_xic0_omegac0::KfRapOmegaKa, hf_cand_xic0_omegac0::ImpactParBachFromCharmBaryonXY, hf_cand_xic0_omegac0::ErrImpactParBachFromCharmBaryonXY, hf_cand_xic0_omegac0::ImpactParCascXY, hf_cand_xic0_omegac0::ErrImpactParCascXY, + hf_cand_xic0_omegac0::DcaV0Dau, hf_cand_xic0_omegac0::DcaCascDau, hf_cand_xic0_omegac0::DcaCharmBaryonDau, + hf_cand_xic0_omegac0::CosPAV0, hf_cand_xic0_omegac0::CosPACasc, hf_cand_xic0_omegac0::CosPACharmBaryon, hf_cand_xic0_omegac0::CosPAXYV0, hf_cand_xic0_omegac0::CosPAXYCasc, hf_cand_xic0_omegac0::CosPAXYCharmBaryon, + hf_cand_xic0_omegac0::CosPaV0ToCasc, hf_cand_xic0_omegac0::CosPaCascToOmegaKa, hf_cand_xic0_omegac0::CosPaXYV0ToCasc, hf_cand_xic0_omegac0::CosPaXYCascToOmegaKa, + hf_cand_xic0_omegac0::Chi2GeoV0, hf_cand_xic0_omegac0::Chi2GeoCasc, hf_cand_xic0_omegac0::Chi2GeoOmegaKa, + hf_cand_xic0_omegac0::MassV0Chi2OverNdf, hf_cand_xic0_omegac0::MassCascChi2OverNdf, + hf_cand_xic0_omegac0::Chi2TopoV0ToCasc, hf_cand_xic0_omegac0::Chi2TopoKaToCasc, hf_cand_xic0_omegac0::Chi2TopoKaToOmegaKa, hf_cand_xic0_omegac0::Chi2TopoCascToOmegaKa, + hf_cand_xic0_omegac0::Chi2TopoV0ToPv, hf_cand_xic0_omegac0::Chi2TopoCascToPv, hf_cand_xic0_omegac0::Chi2TopoKaFromOmegaKaToPv, hf_cand_xic0_omegac0::Chi2TopoOmegaKaToPv, + hf_cand_xic0_omegac0::V0ldl, hf_cand_xic0_omegac0::Cascldl, hf_cand_xic0_omegac0::OmegaKaldl, + hf_cand_xic0_omegac0::DecLenV0, hf_cand_xic0_omegac0::DecLenCascade, hf_cand_xic0_omegac0::DecLenCharmBaryon, + hf_cand_xic0_omegac0::InvMassLambda, hf_cand_xic0_omegac0::InvMassLambdaErr, hf_cand_xic0_omegac0::InvMassCascade, hf_cand_xic0_omegac0::InvMassCascadeErr, hf_cand_xic0_omegac0::InvMassCascadeRej, hf_cand_xic0_omegac0::InvMassCascadeRejErr, hf_cand_xic0_omegac0::InvMassCharmBaryon, hf_cand_xic0_omegac0::InvMassCharmBaryonErr, + hf_cand_xic0_omegac0::KfPtOmegaKa, hf_cand_xic0_omegac0::KfPtKaFromOmegaKa, hf_cand_xic0_omegac0::KfPtOmega, + hf_cand_xic0_omegac0::CosThetaStarKaFromOemgac, hf_cand_xic0_omegac0::CosThetaStarKaFromXic, hf_cand_xic0_omegac0::CTauV0, hf_cand_xic0_omegac0::CTauCascade, hf_cand_xic0_omegac0::CTauOmegaKa, + hf_cand_xic0_omegac0::V0Id, v0data::PosTrackId, v0data::NegTrackId, hf_cand_xic0_omegac0::CascadeId, cascdata::BachelorId, hf_cand_xic0_omegac0::BachelorFromCharmBaryonId); + 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, From 9068c2c4a150436afb58c4422d77d84daff2f818 Mon Sep 17 00:00:00 2001 From: FDUEnrich <23210190047@m.fudan.edu.cn> Date: Wed, 25 Jun 2025 18:40:07 +0800 Subject: [PATCH 02/22] Update CandidateSelectionTables.h --- PWGHF/DataModel/CandidateSelectionTables.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/PWGHF/DataModel/CandidateSelectionTables.h b/PWGHF/DataModel/CandidateSelectionTables.h index 0ac6ffa1a98..3250f88ff5d 100644 --- a/PWGHF/DataModel/CandidateSelectionTables.h +++ b/PWGHF/DataModel/CandidateSelectionTables.h @@ -386,12 +386,12 @@ DECLARE_SOA_COLUMN(StatusInvMassCascade, statusInvMassCascade, bool); DECLARE_SOA_COLUMN(StatusInvMassCharmBaryon, statusInvMassCharmBaryon, bool); DECLARE_SOA_COLUMN(ResultSelections, resultSelections, bool); DECLARE_SOA_COLUMN(TpcNSigmaPiFromCharmBaryon, tpcNSigmaPiFromCharmBaryon, float); -// DECLARE_SOA_COLUMN(TpcNSigmaKaFromCharmBaryon, tpcNSigmaKaFromCharmBaryon, float); +DECLARE_SOA_COLUMN(TpcNSigmaKaFromCharmBaryon, tpcNSigmaKaFromCharmBaryon, float); DECLARE_SOA_COLUMN(TpcNSigmaKaFromCasc, tpcNSigmaKaFromCasc, float); DECLARE_SOA_COLUMN(TpcNSigmaPiFromLambda, tpcNSigmaPiFromLambda, float); DECLARE_SOA_COLUMN(TpcNSigmaPrFromLambda, tpcNSigmaPrFromLambda, float); DECLARE_SOA_COLUMN(TofNSigmaPiFromCharmBaryon, tofNSigmaPiFromCharmBaryon, float); -// DECLARE_SOA_COLUMN(TofNSigmaKaFromCharmBaryon, tofNSigmaKaFromCharmBaryon, float); +DECLARE_SOA_COLUMN(TofNSigmaKaFromCharmBaryon, tofNSigmaKaFromCharmBaryon, float); DECLARE_SOA_COLUMN(TofNSigmaKaFromCasc, tofNSigmaKaFromCasc, float); DECLARE_SOA_COLUMN(TofNSigmaPiFromLambda, tofNSigmaPiFromLambda, float); DECLARE_SOA_COLUMN(TofNSigmaPrFromLambda, tofNSigmaPrFromLambda, float); @@ -408,6 +408,13 @@ DECLARE_SOA_TABLE(HfSelToOmegaPi, "AOD", "HFSELTOOMEPI", hf_sel_toomegapi::TpcNSigmaPiFromCharmBaryon, hf_sel_toomegapi::TpcNSigmaKaFromCasc, hf_sel_toomegapi::TpcNSigmaPiFromLambda, hf_sel_toomegapi::TpcNSigmaPrFromLambda, hf_sel_toomegapi::TofNSigmaPiFromCharmBaryon, hf_sel_toomegapi::TofNSigmaKaFromCasc, hf_sel_toomegapi::TofNSigmaPiFromLambda, hf_sel_toomegapi::TofNSigmaPrFromLambda); +DECLARE_SOA_TABLE(HfSelToOmegaKaKf, "AOD", "HFSELTOOMEGAKAKF", + hf_sel_toomegapi::StatusPidLambda, hf_sel_toomegapi::StatusPidCascade, hf_sel_toomegapi::StatusPidCharmBaryon, + hf_sel_toomegapi::StatusInvMassLambda, hf_sel_toomegapi::StatusInvMassCascade, hf_sel_toomegapi::StatusInvMassCharmBaryon, + hf_sel_toomegapi::ResultSelections, hf_sel_toomegapi::PidTpcInfoStored, hf_sel_toomegapi::PidTofInfoStored, + hf_sel_toomegapi::TpcNSigmaKaFromCharmBaryon, hf_sel_toomegapi::TpcNSigmaKaFromCasc, hf_sel_toomegapi::TpcNSigmaPiFromLambda, hf_sel_toomegapi::TpcNSigmaPrFromLambda, + hf_sel_toomegapi::TofNSigmaKaFromCharmBaryon, hf_sel_toomegapi::TofNSigmaKaFromCasc, hf_sel_toomegapi::TofNSigmaPiFromLambda, hf_sel_toomegapi::TofNSigmaPrFromLambda); + DECLARE_SOA_TABLE(HfMlSelOmegacToOmegaPi, "AOD", "HFMLOMEGAC", //! hf_sel_toomegapi::MlProbOmegac); namespace hf_sel_toomegaka From 6a0b50141f0e854ff6551ee1852eec41ca60df88 Mon Sep 17 00:00:00 2001 From: FDUEnrich <23210190047@m.fudan.edu.cn> Date: Wed, 25 Jun 2025 18:45:24 +0800 Subject: [PATCH 03/22] Update candidateCreatorXic0Omegac0.cxx --- .../candidateCreatorXic0Omegac0.cxx | 414 +++++++++++++++++- 1 file changed, 391 insertions(+), 23 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx index 754272af541..47fa2af3bc2 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx @@ -27,42 +27,41 @@ #include /// includes KFParticle -#include "KFParticle.h" -#include "KFParticleBase.h" -#include "KFPTrack.h" -#include "KFPVertex.h" -#include "KFVertex.h" +#include "PWGHF/Core/CentralityEstimation.h" +#include "PWGHF/Core/SelectorCuts.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/Utils/utilsBfieldCCDB.h" +#include "PWGHF/Utils/utilsEvSelHf.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/DataModel/mcCentrality.h" + +#include "Common/Core/RecoDecay.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/CollisionAssociationTables.h" +#include "Common/DataModel/EventSelection.h" +#include "Tools/KFparticle/KFUtilities.h" #include "CCDB/BasicCCDBManager.h" #include "CommonConstants/PhysicsConstants.h" +#include "DCAFitter/DCAFitterN.h" #include "DataFormatsParameters/GRPMagField.h" #include "DataFormatsParameters/GRPObject.h" -#include "DCAFitter/DCAFitterN.h" #include "DetectorsBase/Propagator.h" +#include "Framework/ASoAHelpers.h" #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/runDataProcessing.h" #include "Framework/RunningWorkflowInfo.h" +#include "Framework/runDataProcessing.h" #include "ReconstructionDataFormats/DCA.h" #include "ReconstructionDataFormats/Track.h" #include "ReconstructionDataFormats/V0.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/CollisionAssociationTables.h" -#include "Common/DataModel/EventSelection.h" -#include "Tools/KFparticle/KFUtilities.h" - -#include "PWGLF/DataModel/LFStrangenessTables.h" -#include "PWGLF/DataModel/mcCentrality.h" - -#include "PWGHF/Core/CentralityEstimation.h" -#include "PWGHF/Core/SelectorCuts.h" -#include "PWGHF/DataModel/CandidateReconstructionTables.h" -#include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "PWGHF/Utils/utilsBfieldCCDB.h" -#include "PWGHF/Utils/utilsEvSelHf.h" +#include "KFPTrack.h" +#include "KFPVertex.h" +#include "KFParticle.h" +#include "KFParticleBase.h" +#include "KFVertex.h" using namespace o2; using namespace o2::track; @@ -92,6 +91,7 @@ struct HfCandidateCreatorXic0Omegac0 { Produces kfCandidateData; Produces kfCandidateXicData; Produces rowKfXic0Qa; + Produces kfCandidateOmegaKaData; Configurable propagateToPCA{"propagateToPCA", false, "create tracks version propagated to PCA"}; Configurable useAbsDCA{"useAbsDCA", true, "Minimise abs. distance rather than chi2"}; @@ -105,6 +105,10 @@ struct HfCandidateCreatorXic0Omegac0 { Configurable refitWithMatCorr{"refitWithMatCorr", true, "when doing propagateTracksToVertex, propagate tracks to vtx with material corrections and rerun minimization"}; Configurable rejDiffCollTrack{"rejDiffCollTrack", true, "Reject tracks coming from different collisions"}; Configurable fillAllHist{"fillAllHist", true, "Fill additional KF histograms to check selector cuts"}; + Configurable doCascadePreselection{"doCascadePreselection", true, "Use invariant mass and dcaXY cuts to preselect cascade candidates"}; + Configurable dcaXYToPVCascadeMax{"dcaXYToPVCascadeMax", 3.0, "Max cascade DCA to PV in xy plane"}; + Configurable dcaV0DaughtersMax{"dcaV0DaughtersMax", 1.0, "Max DCA of V0 daughter"}; + Configurable dcaCascDaughtersMax{"dcaCascDaughtersMax", 1.0, "Max DCA of cascade daughter"}; // magnetic field setting from CCDB Configurable isRun2{"isRun2", false, "enable Run 2 or Run 3 GRP objects for magnetic field"}; @@ -118,10 +122,13 @@ struct HfCandidateCreatorXic0Omegac0 { Configurable lambdaMassWindow{"lambdaMassWindow", 0.0075, "Distance from Lambda mass"}; // cascade cuts Configurable massToleranceCascade{"massToleranceCascade", 0.01, "Invariant mass tolerance for cascade"}; + Configurable massToleranceCascadeRej{"massToleranceCascadeRej", 0.01, "Invariant mass tolerance for rejected Xi"}; // for KF particle operation Configurable kfConstructMethod{"kfConstructMethod", 2, "KF Construct Method"}; Configurable kfUseV0MassConstraint{"kfUseV0MassConstraint", false, "KF: use Lambda mass constraint"}; Configurable kfUseCascadeMassConstraint{"kfUseCascadeMassConstraint", false, "KF: use Cascade mass constraint"}; + Configurable constrainToPv{"constrainToPv", false, "Constrain particles to PV"}; + Configurable constrainToMother{"constrainToMother", false, "Constrain daughter particles to mother particles"}; Configurable kfResolutionQA{"kfResolutionQA", false, "KF: KFParticle Quality Assurance"}; HfEventSelection hfEvSel; // event selection and monitoring @@ -1655,6 +1662,334 @@ struct HfCandidateCreatorXic0Omegac0 { } } // loop over LF Cascade-bachelor candidates } + + template + void runOmegac0Xic0ToOmegaKaCreatorWithKFParticle(Coll const&, + aod::BCsWithTimestamps const& /*bcWithTimeStamps*/, + MyKfTracks const&, + MyKfCascTable const&, KFCascadesLinked const&, + aod::HfCascLf2Prongs const& candidates, + Hist& hInvMassCharmBaryon, + Hist& hFitterStatus, + Hist& hCandidateCounter, + Hist& hCascadesCounter) + { + for (const auto& cand : candidates) { + hCandidateCounter->Fill(1); + + //----------------------check if the event is selected----------------------------- + auto collision = cand.collision_as(); + float centrality{-1.f}; + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + if (rejectionMask != 0) { + /// at least one event selection not satisfied --> reject the candidate + continue; + } + + //----------------------Set the magnetic field from ccdb----------------------------- + auto bc = collision.template bc_as(); + if (runNumber != bc.runNumber()) { + LOG(info) << ">>>>>>>>>>>> Current run number: " << runNumber; + initCCDB(bc, runNumber, ccdb, isRun2 ? ccdbPathGrp : ccdbPathGrpMag, lut, isRun2); + magneticField = o2::base::Propagator::Instance()->getNominalBz(); + LOG(info) << ">>>>>>>>>>>> Magnetic field: " << magneticField; + runNumber = bc.runNumber(); + } + KFParticle::SetField(magneticField); + + // Retrieve skimmed cascade and pion tracks + auto cascAodElement = cand.cascade_as(); + hCascadesCounter->Fill(0); + if (!cascAodElement.has_kfCascData()) { + continue; + } + auto casc = cascAodElement.kfCascData_as(); + 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.signed1Pt() > 0 ? +1 : -1; + int signOmega = casc.sign() > 0 ? +1 : -1; + + KFPTrack kfpTrackKaFromCharm = createKFPTrackFromTrack(trackKaFromCharm); + KFPTrack kfpTrackKaFromOmega = createKFPTrackFromTrack(trackKaFromOmega); + KFPTrack kfpTrackV0DauPos = createKFPTrackFromTrack(trackV0DauPos); + KFPTrack kfpTrackV0DauNeg = createKFPTrackFromTrack(trackV0DauNeg); + + KFParticle kfPrFromV0(kfpTrackV0DauPos, kProton); + KFParticle kfPiFromV0(kfpTrackV0DauNeg, kPiMinus); + KFParticle kfKaFromOmega(kfpTrackKaFromOmega, kKMinus); + KFParticle kfPiFromXiRej(kfpTrackKaFromOmega, kPiMinus); // rej + KFParticle kfKaFromCharm(kfpTrackKaFromCharm, kKPlus); + + if (signOmega == 0 || KaFromOmegaCharge == 0 || KaFromOmegaCharge != signOmega) { + continue; + } + // convert for Pos and Neg Particles + if (signOmega > 0) { + kfPiFromV0 = KFParticle(kfpTrackV0DauPos, kPiPlus); + kfPrFromV0 = KFParticle(kfpTrackV0DauNeg, -kProton); + kfKaFromOmega = KFParticle(kfpTrackKaFromOmega, kKPlus); + kfPiFromXiRej = KFParticle(kfpTrackKaFromOmega, kPiPlus); // rej + kfKaFromCharm = KFParticle(kfpTrackKaFromCharm, kKMinus); + } + + if (doCascadePreselection) { + if (std::abs(casc.dcaXYCascToPV()) > dcaXYToPVCascadeMax) { + continue; + } + if (std::abs(casc.dcaV0daughters()) > dcaV0DaughtersMax) { + continue; + } + if (std::abs(casc.dcacascdaughters()) > dcaCascDaughtersMax) { + continue; + } + if (std::abs(casc.mOmega() - MassOmegaMinus) > massToleranceCascade) { + continue; + } + } + + //----------------------info of V0 and cascade tracks from LF-table------------------ + std::array vertexV0 = {casc.xlambda(), casc.ylambda(), casc.zlambda()}; + std::array pVecV0 = {casc.pxlambda(), casc.pylambda(), casc.pzlambda()}; + std::array vertexCasc = {casc.x(), casc.y(), casc.z()}; + std::array pVecCasc = {casc.px(), casc.py(), casc.pz()}; + + // step 1 : construct V0 with KF + const KFParticle* v0Daughters[2] = {&kfPrFromV0, &kfPiFromV0}; + // construct V0 + KFParticle kfV0; + kfV0.SetConstructMethod(kfConstructMethod); + try { + kfV0.Construct(v0Daughters, 2); + } catch (std::runtime_error& e) { + LOG(debug) << "Failed to construct cascade V0 from daughter tracks: " << e.what(); + continue; + } + // mass window cut on lambda before mass constraint + float massLam, sigLam; + kfV0.GetMass(massLam, sigLam); + if (std::abs(massLam - MassLambda0) > lambdaMassWindow) + continue; + // err_mass>0 of Lambda + if (sigLam <= 0) + continue; + // chi2>0 && NDF>0 for selecting Lambda + if ((kfV0.GetNDF() <= 0 || kfV0.GetChi2() <= 0)) + continue; + KFParticle kfV0MassConstrained = kfV0; + kfV0MassConstrained.SetNonlinearMassConstraint(o2::constants::physics::MassLambda); // set mass constrain to Lambda + if (kfUseV0MassConstraint) { + kfV0 = kfV0MassConstrained; + } + kfV0.TransportToDecayVertex(); + + // step 2 : reconstruct cascade(Omega) with KF + const KFParticle* omegaDaugthers[2] = {&kfKaFromOmega, &kfV0}; + const KFParticle* omegaDaugthersRej[2] = {&kfPiFromXiRej, &kfV0}; // rej + // construct cascade + KFParticle kfOmega; + KFParticle kfOmegarej; // rej + kfOmega.SetConstructMethod(kfConstructMethod); + kfOmegarej.SetConstructMethod(kfConstructMethod); // rej + try { + kfOmega.Construct(omegaDaugthers, 2); + kfOmegarej.Construct(omegaDaugthersRej, 2); // rej + } catch (std::runtime_error& e) { + LOG(debug) << "Failed to construct Omega or Omega_rej from V0 and bachelor track: " << e.what(); + continue; + } + float massCasc, sigCasc; + float massCascrej, sigCascrej; + kfOmega.GetMass(massCasc, sigCasc); + kfOmegarej.GetMass(massCascrej, sigCascrej); // rej + // err_massOmega and err_massXiRej > 0 + if (sigCasc <= 0 || sigCascrej <= 0) + continue; + // chi2>0 && NDF>0 + if (kfOmega.GetNDF() <= 0 || kfOmega.GetChi2() <= 0) + continue; + if ((std::abs(massCasc - MassOmegaMinus) > massToleranceCascade) || (std::abs(massCascrej - MassXiMinus) < massToleranceCascadeRej)) + continue; + registry.fill(HIST("hInvMassXiMinus_rej"), massCascrej); // rej: Add competing rejection to minimize misidentified Xi impact. Reject if kfBachPionRej is Pion and the constructed cascade has Xi's invariant mass. + KFParticle kfOmegaMassConstrained = kfOmega; + kfOmegaMassConstrained.SetNonlinearMassConstraint(o2::constants::physics::MassOmegaMinus); // set mass constrain to XiMinus + if (kfUseCascadeMassConstraint) { + // set mass constraint if requested + kfOmega = kfOmegaMassConstrained; + } + registry.fill(HIST("hInvMassXiMinus"), massCasc); + kfOmega.TransportToDecayVertex(); + // rej: Add competing rejection to minimize misidentified Xi impact. Reject if kfBachPionRej is Pion and the constructed cascade has Xi's invariant mass. + + // step 3 : reconstruc OmegaKa with KF + // Create KF charm bach Pion from track + const KFParticle* omegaKaDaugthers[2] = {&kfKaFromCharm, &kfOmega}; + // construct Omegac0 or Xic0 + KFParticle kfOmegaKa; + kfOmegaKa.SetConstructMethod(kfConstructMethod); + try { + kfOmegaKa.Construct(omegaKaDaugthers, 2); + } catch (std::runtime_error& e) { + LOG(debug) << "Failed to construct OmegaKa from Cascade and bachelor pion track: " << e.what(); + continue; + } + float massOmegaKa, sigOmegaKa; + kfOmegaKa.GetMass(massOmegaKa, sigOmegaKa); + if (sigOmegaKa <= 0) + continue; + if (kfOmegaKa.GetNDF() <= 0 || kfOmegaKa.GetChi2() <= 0) + continue; + kfOmegaKa.TransportToDecayVertex(); + hFitterStatus->Fill(0); + hCandidateCounter->Fill(2); + + // initialize primary vertex + KFPVertex kfpVertex = createKFPVertexFromCollision(collision); + float covMatrixPV[6]; + kfpVertex.GetCovarianceMatrix(covMatrixPV); + KFParticle kfPv(kfpVertex); // for calculation of DCAs to PV + + // fill test histograms + hInvMassCharmBaryon->Fill(massOmegaKa); + + // topological constraint of daughter to mother + KFParticle kfKaFromCharmToOmegaKa = kfKaFromCharm; + KFParticle kfOmegaToOmegaKa = kfOmega; + KFParticle kfV0ToOmega = kfV0; + KFParticle kfKaToOmega = kfKaFromOmega; + KFParticle kfPrToV0 = kfPrFromV0; + KFParticle kfPiToV0 = kfPiFromV0; + + kfPrToV0.SetProductionVertex(kfV0); + kfPiToV0.SetProductionVertex(kfV0); + kfV0ToOmega.SetProductionVertex(kfOmega); + kfKaToOmega.SetProductionVertex(kfOmega); + kfKaFromCharmToOmegaKa.SetProductionVertex(kfOmegaKa); + kfOmegaToOmegaKa.SetProductionVertex(kfOmegaKa); + + // topological constraint to PV + // KFParticle to PV + KFParticle kfV0ToPv = kfV0; + KFParticle kfOmegaToPv = kfOmega; + KFParticle kfCharmToPv = kfOmegaKa; + KFParticle kfKaFromCharmToPv = kfKaFromCharm; + + kfV0ToPv.SetProductionVertex(kfPv); + kfOmegaToPv.SetProductionVertex(kfPv); + kfCharmToPv.SetProductionVertex(kfPv); + kfKaFromCharmToPv.SetProductionVertex(kfPv); + + //---------------------calculate physical parameters of OmegaKa candidate---------------------- + + // transport OmegaKa daughters to decay vertex (secondary vertex) + float secondaryVertex[3] = {0.}; + secondaryVertex[0] = kfOmegaKa.GetX(); + secondaryVertex[1] = kfOmegaKa.GetY(); + secondaryVertex[2] = kfOmegaKa.GetZ(); + kfKaFromCharm.TransportToPoint(secondaryVertex); + kfOmega.TransportToPoint(secondaryVertex); + + // get impact parameters of OmegaKa daughters + float impactParameterKaFromCharmXY = 0., errImpactParameterKaFromCharmXY = 0.; + float impactParameterOmegaXY = 0., errImpactParameterOmegaXY = 0.; + kfKaFromCharm.GetDistanceFromVertexXY(kfPv, impactParameterKaFromCharmXY, errImpactParameterKaFromCharmXY); + kfOmega.GetDistanceFromVertexXY(kfPv, impactParameterOmegaXY, errImpactParameterOmegaXY); + + // calculate cosine of pointing angle + float cosPaV0ToPv = cpaFromKF(kfV0, kfPv); + float cosPaCascToPv = cpaFromKF(kfOmega, kfPv); + float cosPaOmegaKaToPv = cpaFromKF(kfOmegaKa, kfPv); + float cosPaXYV0ToPv = cpaXYFromKF(kfV0, kfPv); + float cosPaXYCascToPv = cpaXYFromKF(kfOmega, kfPv); + float cosPaXYOmegaKaToPv = cpaXYFromKF(kfOmegaKa, kfPv); + float cosPaV0ToCasc = cpaFromKF(kfV0, kfOmega); + float cosPaCascToOmegaKa = cpaFromKF(kfOmega, kfOmegaKa); + float cosPaXYV0ToCasc = cpaXYFromKF(kfV0, kfOmega); + float cosPaXYCascToOmegaKa = cpaXYFromKF(kfOmega, kfOmegaKa); + + // Get Chi2Geo/NDF + float chi2GeoV0 = kfV0.GetChi2() / kfV0.GetNDF(); + float chi2GeoCasc = kfOmega.GetChi2() / kfOmega.GetNDF(); + float chi2GeoOmegaKa = kfOmegaKa.GetChi2() / kfOmegaKa.GetNDF(); + + // Get Chi2Topo/NDF + float chi2NdfTopoV0ToCasc = kfV0ToOmega.GetChi2() / kfV0ToOmega.GetNDF(); + float chi2NdfTopoKaToCasc = kfKaToOmega.GetChi2() / kfKaToOmega.GetNDF(); + float chi2NdfTopoKaFromOmegaKaToOmegaKa = kfKaFromCharmToOmegaKa.GetChi2() / kfKaFromCharmToOmegaKa.GetNDF(); + float chi2NdfTopoCascToOmegaKa = kfOmegaToOmegaKa.GetChi2() / kfOmegaToOmegaKa.GetNDF(); + float chi2NdfTopoV0ToPv = kfV0ToPv.GetChi2() / kfV0ToPv.GetNDF(); + float chi2NdfTopoCascToPv = kfOmegaToPv.GetChi2() / kfOmegaToPv.GetNDF(); + float chi2NdfTopoOmegaKaToPv = kfCharmToPv.GetChi2() / kfCharmToPv.GetNDF(); + float chi2NdfTopoKaFromOmegaKaToPv = kfKaFromCharmToPv.GetChi2() / kfKaFromCharmToPv.GetNDF(); + + // Get MassChi2/NDF + auto v0Chi2OverNdfm = kfV0MassConstrained.GetChi2() / kfV0MassConstrained.GetNDF(); + auto cascChi2OverNdfm = kfOmegaMassConstrained.GetChi2() / kfOmegaMassConstrained.GetNDF(); + + // KF ldl + float ldlV0 = ldlFromKF(kfV0, kfPv); + float ldlCasc = ldlFromKF(kfOmega, kfPv); + float ldlOmegaKa = ldlFromKF(kfOmegaKa, kfPv); + + // KF decay length + float decayLxyLam, errDecayLxyLam; + kfV0ToOmega.GetDecayLengthXY(decayLxyLam, errDecayLxyLam); + float decayLxyCasc, errDecayLxyCasc; + kfOmegaToOmegaKa.GetDecayLengthXY(decayLxyCasc, errDecayLxyCasc); + float decayLxyOmegaKa, errDecayLxyOmegaKa; + kfCharmToPv.GetDecayLengthXY(decayLxyOmegaKa, errDecayLxyOmegaKa); + + // KF pT + float ptOmegaKa = kfOmegaKa.GetPt(); + float ptKaFromCharm = kfKaFromCharm.GetPt(); + float ptOmega = kfOmega.GetPt(); + + // KF cosThetaStar + float cosThetaStarKaFromOmegac = cosThetaStarFromKF(0, 4332, 321, 3334, kfKaFromCharmToOmegaKa, kfOmegaToOmegaKa); + float cosThetaStarKaFromXic = cosThetaStarFromKF(0, 4132, 321, 3334, kfKaFromCharmToOmegaKa, kfOmegaToOmegaKa); + + // KF ct + float ctV0 = kfV0ToOmega.GetLifeTime(); + float ctCasc = kfOmegaToOmegaKa.GetLifeTime(); + float ctOmegaKa = kfCharmToPv.GetLifeTime(); + + hCandidateCounter->Fill(3); + + // fill full kf table + kfCandidateOmegaKaData(collision.globalIndex(), + collision.posX(), collision.posY(), collision.posZ(), // PV Coord + kfPv.GetX(), kfPv.GetY(), kfPv.GetZ(), // PV KF + vertexV0[0], vertexV0[1], vertexV0[2], // V0 Vtx from LF-table + pVecV0[0], pVecV0[1], pVecV0[2], // V0 P from LF-table + vertexCasc[0], vertexCasc[1], vertexCasc[2], // Casc Vtx from LF-table + pVecCasc[0], pVecCasc[1], pVecCasc[2], // Casc P from LF-table + kfV0.GetX(), kfV0.GetY(), kfV0.GetZ(), // V0 Vtx KF + kfV0.GetPx(), kfV0.GetPy(), kfV0.GetPz(), // V0 P KF + kfOmega.GetX(), kfOmega.GetY(), kfOmega.GetZ(), // Omega Vtx KF + kfOmega.GetPx(), kfOmega.GetPx(), kfOmega.GetPx(), // Omega Vtx KF + kfOmegaKa.GetX(), kfOmegaKa.GetY(), kfOmegaKa.GetZ(), // OmegaKa Vtx KF (SecondaryVertex) + kfOmegaKa.GetPx(), kfOmegaKa.GetPx(), kfOmegaKa.GetPx(), // OmegaKa P KF + signOmega, // Check Omega sign + kfPrFromV0.GetEta(), kfPiFromV0.GetEta(), kfKaFromOmega.GetEta(), kfKaFromCharm.GetEta(), kfV0.GetEta(), kfOmega.GetEta(), kfOmegaKa.GetEta(), kfOmegaKa.GetRapidity(), // Eta of daughters and mothers. Rapidity of OmegaKa + impactParameterKaFromCharmXY, errImpactParameterKaFromCharmXY, impactParameterOmegaXY, errImpactParameterOmegaXY, // DCAXY of KaFromCharm and Omega + kfPrToV0.GetDistanceFromParticle(kfPiToV0), kfV0ToOmega.GetDistanceFromParticle(kfKaToOmega), kfOmegaToOmegaKa.GetDistanceFromParticle(kfKaFromCharmToOmegaKa), // DCA of daughters + cosPaV0ToPv, cosPaCascToPv, cosPaOmegaKaToPv, cosPaXYV0ToPv, cosPaXYCascToPv, cosPaXYOmegaKaToPv, cosPaV0ToCasc, cosPaCascToOmegaKa, cosPaXYV0ToCasc, cosPaXYCascToOmegaKa, // CosPA of PV and mothers + chi2GeoV0, chi2GeoCasc, chi2GeoOmegaKa, // Chi2Geo/NDF + v0Chi2OverNdfm, cascChi2OverNdfm, // Chi2Mass/NDF + chi2NdfTopoV0ToCasc, chi2NdfTopoKaToCasc, chi2NdfTopoKaFromOmegaKaToOmegaKa, chi2NdfTopoCascToOmegaKa, chi2NdfTopoV0ToPv, chi2NdfTopoCascToPv, chi2NdfTopoKaFromOmegaKaToPv, chi2NdfTopoOmegaKaToPv, // Chi2Topo/NDF + ldlV0, ldlCasc, ldlOmegaKa, // ldl + decayLxyLam, decayLxyCasc, decayLxyOmegaKa, // DecaylengthXY + massLam, sigLam, massCasc, sigCasc, massCascrej, sigCascrej, massOmegaKa, sigOmegaKa, // massKF and masserror + ptOmegaKa, ptKaFromCharm, ptOmega, // pT + cosThetaStarKaFromOmegac, cosThetaStarKaFromXic, ctV0, ctCasc, ctOmegaKa, // cosThetaStar & ct + cascAodElement.v0Id(), casc.posTrackId(), casc.negTrackId(), casc.cascadeId(), casc.bachelorId(), trackKaFromCharm.globalIndex()); + } + } + /// @brief process function w/o centrality selections void processNoCentToXiPi(soa::Join const& collisions, aod::BCsWithTimestamps const& bcWithTimeStamps, @@ -1703,6 +2038,17 @@ struct HfCandidateCreatorXic0Omegac0 { } 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, + MyKfTracks const& tracks, + MyKfCascTable const& cascades, + KFCascadesLinked const& cascadeLinks, + aod::HfCascLf2Prongs const& candidates) + { + runOmegac0Xic0ToOmegaKaCreatorWithKFParticle(collisions, bcWithTimeStamps, 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, MyKfTracks const& tracks, @@ -1762,6 +2108,17 @@ struct HfCandidateCreatorXic0Omegac0 { } 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, + MyKfTracks const& tracks, + MyKfCascTable const& cascades, + KFCascadesLinked const& cascadeLinks, + aod::HfCascLf2Prongs const& candidates) + { + runOmegac0Xic0ToOmegaKaCreatorWithKFParticle(collisions, bcWithTimeStamps, 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, MyKfTracks const& tracks, @@ -1821,6 +2178,17 @@ struct HfCandidateCreatorXic0Omegac0 { } 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, + MyKfTracks const& tracks, + MyKfCascTable const& cascades, + KFCascadesLinked const& cascadeLinks, + aod::HfCascLf2Prongs const& candidates) + { + runOmegac0Xic0ToOmegaKaCreatorWithKFParticle(collisions, bcWithTimeStamps, 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, MyKfTracks const& tracks, From f7912f38016c535cc22eea36d562fdf75c7d6ea6 Mon Sep 17 00:00:00 2001 From: FDUEnrich <23210190047@m.fudan.edu.cn> Date: Wed, 25 Jun 2025 18:48:27 +0800 Subject: [PATCH 04/22] Update candidateSelectorOmegac0ToOmegaPi.cxx --- .../candidateSelectorOmegac0ToOmegaPi.cxx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPi.cxx b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPi.cxx index 24cb43ca348..71f8e47ae95 100644 --- a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPi.cxx @@ -551,20 +551,21 @@ struct HfCandidateSelectorToOmegaPi { registry.fill(HIST("hSelctauOmegac"), 1); } - // Chi2Geo/NDF V0&Casc&Omegac selection - if ((candidate.v0Chi2OverNdf() > KfconfigurableGroup.v0Chi2OverNdfMax) || (candidate.cascChi2OverNdf() > KfconfigurableGroup.cascChi2OverNdfMax) || (candidate.omegacChi2OverNdf() > KfconfigurableGroup.omegacChi2OverNdfMax)) { + // Chi2Geo/NDF V0&Casc&OmegaKa selection + if ((candidate.chi2GeoV0() > KfconfigurableGroup.v0Chi2OverNdfMax) || (candidate.chi2GeoV0() < 0) || (candidate.chi2GeoCasc() > KfconfigurableGroup.cascChi2OverNdfMax) || (candidate.chi2GeoCasc() < 0) || (candidate.chi2GeoOmegaKa() > KfconfigurableGroup.omegaKaChi2OverNdfMax) || (candidate.chi2GeoOmegaKa() < 0)) { resultSelections = false; - registry.fill(HIST("hSelChi2GeooverNDFV0_Casc_Omegac"), 0); + registry.fill(HIST("hSelChi2GeooverNDFV0_Casc_OmegaKa"), 0); } else { - registry.fill(HIST("hSelChi2GeooverNDFV0_Casc_Omegac"), 1); + registry.fill(HIST("hSelChi2GeooverNDFV0_Casc_OmegaKa"), 1); } - - // Chi2Topo/NDF (chi2TopoV0ToCasc chi2TopoOmegacToPv chi2TopoCascToOmegac chi2TopoCascToPv) selection (???????????/NDF of which particle????????) - if ((candidate.chi2TopoV0ToCasc() > KfconfigurableGroup.chi2TopoV0ToCascMax) || (candidate.chi2TopoOmegacToPv() > KfconfigurableGroup.chi2TopoOmegacToPvMax) || (candidate.chi2TopoCascToOmegac() > KfconfigurableGroup.chi2TopoCascToOmegacMax) || (candidate.chi2TopoCascToPv() > KfconfigurableGroup.chi2TopoCascToPvMax)) { + + // Chi2Topo/NDF selection + if ((candidate.chi2TopoV0ToCasc() > KfconfigurableGroup.chi2TopoV0ToCascMax) || (candidate.chi2TopoV0ToCasc() < 0) || (candidate.chi2TopoKaToCasc() > KfconfigurableGroup.chi2TopoKaToCascMax) || (candidate.chi2TopoKaToCasc() < 0) || (candidate.chi2TopoCascToOmegaKa() > KfconfigurableGroup.chi2TopoCascToOmegaKaMax) || (candidate.chi2TopoCascToOmegaKa() < 0) || (candidate.chi2TopoKaToOmegaKa() > KfconfigurableGroup.chi2TopoKaToOmegaKaMax) || (candidate.chi2TopoKaToOmegaKa() < 0) || + (candidate.chi2TopoOmegaKaToPv() > KfconfigurableGroup.chi2TopoOmegaKaToPvMax) || (candidate.chi2TopoOmegaKaToPv() < 0) || (candidate.chi2TopoCascToPv() > KfconfigurableGroup.chi2TopoCascToPvMax) || (candidate.chi2TopoCascToPv() < 0) || (candidate.chi2TopoKaFromOmegaKaToPv() > KfconfigurableGroup.chi2TopoKaFromOmegaKaToPvMax) || (candidate.chi2TopoKaFromOmegaKaToPv() < 0)) { resultSelections = false; - registry.fill(HIST("hSelChi2TopooverNDFV0_Casc_Omegac"), 0); + registry.fill(HIST("hSelChi2TopooverNDFV0_Casc_OmegaKa"), 0); } else { - registry.fill(HIST("hSelChi2TopooverNDFV0_Casc_Omegac"), 1); + registry.fill(HIST("hSelChi2TopooverNDFV0_Casc_OmegaKa"), 1); } // DecaylengthXY of Omegac&Casc&V0 selection From 41be094d502013e49951f6f76b0494f54c070ab4 Mon Sep 17 00:00:00 2001 From: FDUEnrich <23210190047@m.fudan.edu.cn> Date: Wed, 25 Jun 2025 18:50:17 +0800 Subject: [PATCH 05/22] Update CMakeLists.txt --- PWGHF/TableProducer/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PWGHF/TableProducer/CMakeLists.txt b/PWGHF/TableProducer/CMakeLists.txt index 2ec33b5d134..1dddf6f4b76 100644 --- a/PWGHF/TableProducer/CMakeLists.txt +++ b/PWGHF/TableProducer/CMakeLists.txt @@ -172,6 +172,11 @@ o2physics_add_dpl_workflow(candidate-selector-omegac0-to-omega-pi PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(candidate-selector-omegac0-xic0-to-omega-ka + SOURCES candidateSelectorOmegac0Xic0ToOmegaKa.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(candidate-selector-xic0-to-xi-pi-kf SOURCES candidateSelectorXic0ToXiPiKf.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore From dc5e655b1e0d3c7b34b7d3f48c10fe5b98e8eba4 Mon Sep 17 00:00:00 2001 From: FDUEnrich <23210190047@m.fudan.edu.cn> Date: Wed, 25 Jun 2025 18:51:21 +0800 Subject: [PATCH 06/22] Create candidateSelectorOmegac0Xic0ToOmegaKa.cxx --- .../candidateSelectorOmegac0Xic0ToOmegaKa.cxx | 766 ++++++++++++++++++ 1 file changed, 766 insertions(+) create mode 100644 PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx diff --git a/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx b/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx new file mode 100644 index 00000000000..f6c7c4fdb05 --- /dev/null +++ b/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx @@ -0,0 +1,766 @@ +// 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 candidateSelectorOmegaKa0Xic0ToOmegaKa.cxx +/// \brief OmegaKa0 Xic0 → Omega Ka selection task +/// \author Federica Zanone , Heidelberg University +/// \author Ruiqi Yin , Fudan University + +#include "PWGHF/Core/HfMlResponse.h" + +#include "Common/Core/TrackSelection.h" +#include "Common/Core/TrackSelectorPID.h" + +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +#include +#include +// #include "PWGHF/Core/HfMlResponseOmegaKaToOmegaKa.h" +#include "PWGHF/Core/SelectorCuts.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/Utils/utilsAnalysis.h" + +using namespace o2; +using namespace o2::aod; +using namespace o2::framework; +using namespace o2::analysis; + +enum PidInfoStored { + PiFromLam = 0, + PrFromLam, + KaFromCasc, + KaFromCharm +}; + +/// Struct for applying OmegaKa -> Omega Ka selection cuts +struct HfCandidateSelectorToOmegaKa { + Produces hfSelToOmegaKaKf; + // Produces hfMlSelToOmegaKa; + + // LF analysis selections + 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 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"}; + + // limit charm baryon invariant mass spectrum + Configurable invMassCharmBaryonMin{"invMassCharmBaryonMin", 2.0, "Lower limit invariant mass spectrum charm baryon"}; // Xic0:2.470 Omegac0:2.695 + 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", 0.8, "Max absolute value of eta for V0 and cascade daughters"}; + Configurable ptCascMin{"ptCascMin", 0.1, "Min pT kaon <- casc"}; + Configurable ptKaFromCharmBaryonMin{"ptKaFromCharmBaryonMin", 0.2, "Min pT Ka <- charm baryon"}; + + Configurable impactParameterXYKaFromCharmBaryonMin{"impactParameterXYKaFromCharmBaryonMin", 0., "Min dcaxy pi from charm baryon track to PV"}; + Configurable impactParameterXYKaFromCharmBaryonMax{"impactParameterXYKaFromCharmBaryonMax", 10., "Max dcaxy 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 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"}; + + // PID - TPC selections + Configurable ptPiPidTpcMin{"ptPiPidTpcMin", -1, "Lower bound of track pT for TPC PID for pion selection"}; + Configurable ptPiPidTpcMax{"ptPiPidTpcMax", 9999.9, "Upper bound of track pT for TPC PID for pion selection"}; + Configurable nSigmaTpcPiMax{"nSigmaTpcPiMax", 3., "Nsigma cut on TPC only for pion selection"}; + Configurable nSigmaTpcCombinedPiMax{"nSigmaTpcCombinedPiMax", 0., "Nsigma cut on TPC combined with TOF for pion selection"}; + + Configurable ptPrPidTpcMin{"ptPrPidTpcMin", -1, "Lower bound of track pT for TPC PID for proton selection"}; + Configurable ptPrPidTpcMax{"ptPrPidTpcMax", 9999.9, "Upper bound of track pT for TPC PID for proton selection"}; + Configurable nSigmaTpcPrMax{"nSigmaTpcPrMax", 3., "Nsigma cut on TPC only for proton selection"}; + Configurable nSigmaTpcCombinedPrMax{"nSigmaTpcCombinedPrMax", 0., "Nsigma cut on TPC combined with TOF for proton selection"}; + + Configurable ptKaPidTpcMin{"ptKaPidTpcMin", -1, "Lower bound of track pT for TPC PID for kaon selection"}; + Configurable ptKaPidTpcMax{"ptKaPidTpcMax", 9999.9, "Upper bound of track pT for TPC PID for kaon selection"}; + Configurable nSigmaTpcKaMax{"nSigmaTpcKaMax", 3., "Nsigma cut on TPC only for kaon selection"}; + Configurable nSigmaTpcCombinedKaMax{"nSigmaTpcCombinedKaMax", 0., "Nsigma cut on TPC combined with TOF for kaon selection"}; + + // PID - TOF selections + 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 nSigmaTofCombinedPiMax{"nSigmaTofCombinedPiMax", 0., "Nsigma cut on TOF combined with TPC for pion selection"}; + + 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 nSigmaTofCombinedPrMax{"nSigmaTofCombinedPrMax", 0., "Nsigma cut on TOF combined with TPC for proton selection"}; + + Configurable ptKaPidTofMin{"ptKaPidTofMin", -1, "Lower bound of track pT for TOF PID for kaon selection"}; + Configurable ptKaPidTofMax{"ptKaPidTofMax", 9999.9, "Upper bound of track pT for TOF PID for kaon selection"}; + Configurable nSigmaTofKaMax{"nSigmaTofKaMax", 3., "Nsigma cut on TOF only for kaon selection"}; + Configurable nSigmaTofCombinedKaMax{"nSigmaTofCombinedKaMax", 0., "Nsigma cut on TOF combined with TOF for kaon selection"}; + + // detector clusters selections + Configurable nClustersTpcMin{"nClustersTpcMin", 70, "Minimum number of TPC clusters requirement"}; + Configurable nTpcCrossedRowsMin{"nTpcCrossedRowsMin", 70, "Minimum number of TPC crossed rows requirement"}; + Configurable tpcCrossedRowsOverFindableClustersRatioMin{"tpcCrossedRowsOverFindableClustersRatioMin", 0.8, "Minimum ratio TPC crossed rows over findable clusters requirement"}; + Configurable tpcChi2PerClusterMax{"tpcChi2PerClusterMax", 4, "Maximum value of chi2 fit over TPC clusters"}; + Configurable nClustersItsMin{"nClustersItsMin", 3, "Minimum number of ITS clusters requirement for pi <- charm baryon"}; + 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"}; + + ConfigurableAxis thnConfigAxisMass{"thnConfigAxisMass", {120, 2.4, 3.1}, "Cand. inv-mass bins"}; + ConfigurableAxis thnConfigAxisPt{"thnConfigAxisPt", {100, 0, 20}, "Cand. pT bins"}; + ConfigurableAxis thnConfigAxisCent{"thnConfigAxisCent", {100, 0, 100}, "Centrality bins"}; + ConfigurableAxis thnConfigAxisPtKaon{"thnConfigAxisPtKaon", {100, 0, 10}, "PtPion from Omegac0 bins"}; + + struct : ConfigurableGroup { + //// KF selection + std::string prefix = "kfSel"; + Configurable applyCompetingCascRejection{"applyCompetingCascRejection", false, "Apply competing Xi(for OmegaKa) rejection"}; + Configurable cascadeRejMassWindow{"cascadeRejMassWindow", 0.01, "competing Xi(for OmegaKa) rejection mass window"}; + Configurable v0LdlMin{"v0LdlMin", 3., "Minimum value of l/dl of V0"}; // l/dl and Chi2 are to be determined + Configurable cascLdlMin{"cascLdlMin", 1., "Minimum value of l/dl of casc"}; + Configurable omegaKaLdlMax{"omegaKaLdlMax", 5., "Maximum value of l/dl of OmegaKa"}; + Configurable cTauOmegaKaMax{"cTauOmegaKaMax", 0.4, "lifetime τ of OmegaKa"}; + Configurable v0Chi2OverNdfMax{"v0Chi2OverNdfMax", 100., "Maximum chi2Geo/NDF of V0"}; + Configurable cascChi2OverNdfMax{"cascChi2OverNdfMax", 100., "Maximum chi2Geo/NDF of casc"}; + Configurable omegaKaChi2OverNdfMax{"omegaKaChi2OverNdfMax", 100., "Maximum chi2Geo/NDF of OmegaKa"}; + Configurable chi2TopoV0ToCascMax{"chi2TopoV0ToCascMax", 100., "Maximum chi2Topo/NDF of V0ToCasc"}; + Configurable chi2TopoKaToCascMax{"chi2TopoKaToCascMax", 100., "Maximum chi2Topo/NDF of KaToCasc"}; + Configurable chi2TopoOmegaKaToPvMax{"chi2TopoOmegaKaToPvMax", 100., "Maximum chi2Topo/NDF of OmegaKaToPv"}; + Configurable chi2TopoCascToOmegaKaMax{"chi2TopoCascToOmegaKaMax", 100., "Maximum chi2Topo/NDF of CascToOmegaKa"}; + Configurable chi2TopoKaToOmegaKaMax{"chi2TopoKaToOmegaKaMax", 100., "Maximum chi2Topo/NDF of KaToOmegaKa"}; + Configurable chi2TopoCascToPvMax{"chi2TopoCascToPvMax", 100., "Maximum chi2Topo/NDF of CascToPv"}; + Configurable chi2TopoKaFromOmegaKaToPvMax{"chi2TopoKaFromOmegaKaToPvMax", 100., "Maximum chi2Topo/NDF of CascToPv"}; + Configurable decayLenOmegaKaMax{"decayLenOmegaKaMax", 1.5, "Maximum decay lengthXY of OmegaKa"}; + Configurable decayLenCascMin{"decayLenCascMin", 1., "Minimum decay lengthXY of Cascade"}; + Configurable decayLenLambdaMin{"decayLenLambdaMin", 0., "Minimum decay lengthXY of V0"}; + Configurable cosPaCascToOmegaKaMin{"cosPaCascToOmegaKaMin", 0.995, "Minimum cosPA of cascade<-OmegaKa"}; + Configurable cosPaV0ToCascMin{"cosPaV0ToCascMin", 0.99, "Minimum cosPA of V0<-cascade"}; + } KfconfigurableGroup; + + // topological cuts + // Configurable> binsPt{"binsPt", std::vector{hf_cuts_omegaKa_to_omega_pi::vecBinsPt}, "pT bin limits"}; + // Configurable> cuts{"cuts", {hf_cuts_omegaKa_to_omega_pi::Cuts[0], hf_cuts_omegaKa_to_omega_pi::NBinsPt, hf_cuts_omegaKa_to_omega_pi::NCutVars, hf_cuts_omegaKa_to_omega_pi::labelsPt, hf_cuts_omegaKa_to_omega_pi::labelsCutVar}, "OmegaKa candidate selection per pT bin"}; + // ML inference + // Configurable applyMl{"applyMl", false, "Flag to apply ML selections"}; + // Configurable> binsPtMl{"binsPtMl", std::vector{hf_cuts_ml::vecBinsPt}, "pT bin limits for ML application"}; + // Configurable> cutDirMl{"cutDirMl", std::vector{hf_cuts_ml::vecCutDir}, "Whether to reject score values greater or smaller than the threshold"}; + // Configurable> cutsMl{"cutsMl", {hf_cuts_ml::Cuts[0], hf_cuts_ml::NBinsPt, hf_cuts_ml::NCutScores, hf_cuts_ml::labelsPt, hf_cuts_ml::labelsCutScore}, "ML selections per pT bin"}; + // Configurable nClassesMl{"nClassesMl", static_cast(hf_cuts_ml::NCutScores), "Number of classes in ML model"}; + // Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature1", "feature2"}, "Names of ML model input features"}; + // CCDB configuration + // Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + // Configurable> modelPathsCCDB{"modelPathsCCDB", std::vector{"EventFiltering/PWGHF/BDTOmegaKa"}, "Paths of models on CCDB"}; + // Configurable> onnxFileNames{"onnxFileNames", std::vector{"ModelHandler_onnx_OmegaKaToOmegaKa.onnx"}, "ONNX file names for each pT bin (if not from CCDB full path)"}; + // Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB"}; + // Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; + + // o2::analysis::HfMlResponseOmegaKaToOmegaKa hfMlResponse; + // std::vector outputMlOmegaKa = {}; + // o2::ccdb::CcdbApi ccdbApi; + + TrackSelectorPi selectorPion; + TrackSelectorPr selectorProton; + TrackSelectorKa selectorKaon; + + using TracksSel = soa::Join; + using TracksSelLf = soa::Join; + + HistogramRegistry registry{"registry"}; // for QA of selections + + OutputObj hInvMassCharmBaryon{TH1D("hInvMassCharmBaryon", "Charm baryon invariant mass;inv mass;entries", 500, 2.0, 3.1)}; + OutputObj hPtCharmBaryon{TH1D("hPtCharmBaryon", "Charm baryon transverse momentum before sel;Pt;entries", 3000, 0., 30)}; + OutputObj hPtKaFromCharmBaryon{TH1D("hPtKaFromCharmBaryon", "Ka from charm baryon transverse momentum before sel;Pt;entries", 2000, 0., 20)}; + + void init(InitContext const&) + { + const AxisSpec thnAxisMass{thnConfigAxisMass, "inv. mass (#Omega#Ka) (GeV/#it{c}^{2})"}; + const AxisSpec thnAxisPt{thnConfigAxisPt, "#it{p}_{T} (GeV/#it{c})"}; + const AxisSpec thnAxisPtKaon{thnConfigAxisPtKaon, "Pt of Kaon from Omegac0."}; + std::vector axes = {thnAxisMass, thnAxisPt, thnAxisPtKaon}; + registry.add("hMassVsPtVsPtKaon", "Thn for Omegac0 or Xic candidates with InvmassOmegaKa&pT&pTKa", HistType::kTHnSparseD, axes); + registry.get(HIST("hMassVsPtVsPtKaon"))->Sumw2(); + + selectorPion.setRangePtTpc(ptPiPidTpcMin, ptPiPidTpcMax); + selectorPion.setRangeNSigmaTpc(-nSigmaTpcPiMax, nSigmaTpcPiMax); + selectorPion.setRangeNSigmaTpcCondTof(-nSigmaTpcCombinedPiMax, nSigmaTpcCombinedPiMax); + selectorPion.setRangePtTof(ptPiPidTofMin, ptPiPidTofMax); + selectorPion.setRangeNSigmaTof(-nSigmaTofPiMax, nSigmaTofPiMax); + selectorPion.setRangeNSigmaTofCondTpc(-nSigmaTofCombinedPiMax, nSigmaTofCombinedPiMax); + + selectorProton.setRangePtTpc(ptPrPidTpcMin, ptPrPidTpcMax); + selectorProton.setRangeNSigmaTpc(-nSigmaTpcPrMax, nSigmaTpcPrMax); + selectorProton.setRangeNSigmaTpcCondTof(-nSigmaTpcCombinedPrMax, nSigmaTpcCombinedPrMax); + selectorProton.setRangePtTof(ptPrPidTofMin, ptPrPidTofMax); + selectorProton.setRangeNSigmaTof(-nSigmaTofPrMax, nSigmaTofPrMax); + selectorProton.setRangeNSigmaTofCondTpc(-nSigmaTofCombinedPrMax, nSigmaTofCombinedPrMax); + + selectorKaon.setRangePtTpc(ptKaPidTpcMin, ptKaPidTpcMax); + selectorKaon.setRangeNSigmaTpc(-nSigmaTpcKaMax, nSigmaTpcKaMax); + selectorKaon.setRangeNSigmaTpcCondTof(-nSigmaTpcCombinedKaMax, nSigmaTpcCombinedKaMax); + selectorKaon.setRangePtTof(ptKaPidTofMin, ptKaPidTofMax); + selectorKaon.setRangeNSigmaTof(-nSigmaTofKaMax, nSigmaTofKaMax); + selectorKaon.setRangeNSigmaTofCondTpc(-nSigmaTofCombinedKaMax, nSigmaTofCombinedKaMax); + + 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("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("hSelEtaKaFromCasc", "hSelEtaKaFromCasc;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelEtaKaFromCharm", "hSelEtaKaFromCharm;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("hSelKfPtOmega", "hSelKfPtOmega;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelPtKaFromCharm", "hSelPtKaFromCharm;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelTPCQualityKaFromCharm", "hSelTPCQualityKaFromCharm;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("hSelTPCQualityKaFromCasc", "hSelTPCQualityKaFromCasc;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelITSQualityKaFromCharm", "hSelITSQualityKaFromCharm;status;entries", {HistType::kTH1D, {axisSel}}); + 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("hSelDcaXYToPvKaFromCasc", "hSelDcaXYToPvKaFromCasc;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelPtOmegaKa", "hSelPtOmegaKa;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelCompetingCasc", "hSelCompetingCasc;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelV0_Casc_OmegaKaldl", "hSelV0_Casc_OmegaKaldl;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelctauOmegaKa", "hSelctauOmegaKa;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelChi2GeooverNDFV0_Casc_OmegaKa", "hSelChi2GeooverNDFV0_Casc_OmegaKa;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelChi2TopooverNDFV0_Casc_OmegaKa", "hSelChi2TopooverNDFV0_Casc_OmegaKa;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSeldecayLenOmegaKa_Casc_V0", "hSeldecayLenOmegaKa_Casc_V0;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelcosPaCascToOmegaKa_V0ToCasc", "hSelcosPaCascToOmegaKa_V0ToCasc;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hInvMassXiMinus_rej_cut", "hInvMassXiMinus_rej_cut", kTH1D, {{1000, 1.25f, 1.65f}}); + + // if (applyMl) { + // registry.add("hBDTScoreTest1", "hBDTScoreTest1", {HistType::kTH1D, {{100, 0.0f, 1.0f, "score"}}}); + // hfMlResponse.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl); + // if (loadModelsFromCCDB) { + // ccdbApi.init(ccdbUrl); + // hfMlResponse.setModelPathsCCDB(onnxFileNames, ccdbApi, modelPathsCCDB, timestampCCDB); + // } else { + // hfMlResponse.setModelPathsLocal(onnxFileNames); + // } + // hfMlResponse.cacheInputFeaturesIndices(namesInputFeatures); + // hfMlResponse.init(); + // } + } + // for pT-dependent cuts (other selections will move into this in futrue) + // \param hfCandOmegaKa is candidate + // return true if candidate passes all cuts + // template + // bool selectionTopol(const T1& hfCandOmegaKa) + //{ + // auto candpT = hfCandOmegaKa.ptCharmBaryon(); + // auto KaPtFromOmegaKa = hfCandOmegaKa.ptKaFromCharmBaryon(); + // int pTBin = findBin(binsPt, candpT); + // if (pTBin == -1) { + // return false; + // } + + // check that the candidate pT is within the analysis range + // if (candpT <= ptCandMin || candpT >= ptCandMax) { + // return false; + // } + + // check that the candidate pT is within the analysis range + // if (pionPtFromOmegaKa < cuts->get(pTBin, "pT pi from OmegaKa")) { + // registry.fill(HIST("hSelPtKaFromCharm"), 0); + // return false; + // } else { + // registry.fill(HIST("hSelPtKaFromCharm"), 1); + // } + + // return true; + //} // end template + + void process(aod::HfCandToOmegaKaKf const& candidates, + TracksSel const& tracks, + TracksSelLf const& lfTracks) + { + // looping over charm baryon candidates + for (const auto& candidate : candidates) { + // initializing selection flags + bool statusPidLambda = false; + bool statusPidCascade = false; + bool statusPidCharmBaryon = false; + + bool statusInvMassLambda = false; + bool statusInvMassCascade = false; + bool statusInvMassCharmBaryon = false; + + bool resultSelections = true; // True if the candidate passes all the selections, False otherwise + + int infoTpcStored = 0; + int infoTofStored = 0; + + auto trackV0PosDauId = candidate.posTrackId(); // positive V0 daughter + auto trackV0NegDauId = candidate.negTrackId(); // negative V0 daughter + auto trackKaFromCascId = candidate.bachelorId(); // kaon <- cascade + auto trackKaFromCharmId = candidate.bachelorFromCharmBaryonId(); // pion <- charm baryon + auto trackV0PosDau = lfTracks.rawIteratorAt(trackV0PosDauId); + auto trackV0NegDau = lfTracks.rawIteratorAt(trackV0NegDauId); + auto trackKaFromCasc = lfTracks.rawIteratorAt(trackKaFromCascId); + auto trackKaFromCharm = tracks.rawIteratorAt(trackKaFromCharmId); + + auto trackPiFromLam = trackV0NegDau; + auto trackPrFromLam = trackV0PosDau; + + int8_t signDecay = candidate.signDecay(); // sign of pi <- cascade + + if (signDecay > 0) { + trackPiFromLam = trackV0PosDau; + trackPrFromLam = trackV0NegDau; + registry.fill(HIST("hSelSignDec"), 1); // anti-particle decay + } else if (signDecay < 0) { + registry.fill(HIST("hSelSignDec"), 0); // particle decay + } + + // pt-dependent selection + // if (!selectionTopol(candidate)) { + // resultSelections = false; + // hfSelToOmegaKa(statusPidLambda, statusPidCascade, statusPidCharmBaryon, statusInvMassLambda, statusInvMassCascade, statusInvMassCharmBaryon, resultSelections, infoTpcStored, infoTofStored, + // trackKaFromCharm.tpcNSigmaPi(), trackKaFromCasc.tpcNSigmaKa(), trackPiFromLam.tpcNSigmaPi(), trackPrFromLam.tpcNSigmaPr(), + // trackKaFromCharm.tofNSigmaPi(), trackKaFromCasc.tofNSigmaKa(), trackPiFromLam.tofNSigmaPi(), trackPrFromLam.tofNSigmaPr()); + // if constexpr (ConstructMethod == hf_cand_casc_lf::ConstructMethod::KfParticle) { + // if (applyMl) { + // hfMlSelToOmegaKa(outputMlOmegaKa); + // } + // } + // continue; + //} + + // eta selection + double etaV0DauPr = candidate.etaV0DauPr(); + double etaV0DauPi = candidate.etaV0DauPi(); + double etaKaFromCasc = candidate.etaBachFromCasc(); + double etaKaFromCharmBaryon = candidate.etaBachFromCharmBaryon(); + if (std::abs(etaV0DauPr) > etaTrackLFDauMax) { + resultSelections = false; + registry.fill(HIST("hSelEtaPosV0Dau"), 0); + } else { + registry.fill(HIST("hSelEtaPosV0Dau"), 1); + } + if (std::abs(etaV0DauPi) > etaTrackLFDauMax) { + resultSelections = false; + registry.fill(HIST("hSelEtaNegV0Dau"), 0); + } else { + registry.fill(HIST("hSelEtaNegV0Dau"), 1); + } + if (std::abs(etaKaFromCasc) > etaTrackLFDauMax) { + resultSelections = false; + registry.fill(HIST("hSelEtaKaFromCasc"), 0); + } else { + registry.fill(HIST("hSelEtaKaFromCasc"), 1); + } + if (std::abs(etaKaFromCharmBaryon) > etaTrackCharmBachMax) { + resultSelections = false; + registry.fill(HIST("hSelEtaKaFromCharm"), 0); + } else { + registry.fill(HIST("hSelEtaKaFromCharm"), 1); + } + + // minimum radius cut (LFcut) + if (RecoDecay::sqrtSumOfSquares(candidate.xDecayVtxCascadeKf(), candidate.yDecayVtxCascadeKf()) < radiusCascMin) { + resultSelections = false; + registry.fill(HIST("hSelRadCasc"), 0); + } else { + registry.fill(HIST("hSelRadCasc"), 1); + } + if (RecoDecay::sqrtSumOfSquares(candidate.xDecayVtxV0Kf(), candidate.yDecayVtxV0Kf()) < radiusV0Min) { + resultSelections = false; + registry.fill(HIST("hSelRadV0"), 0); + } else { + 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); + } + + // cut on charm bachelor Kaon dcaXY + if ((std::abs(candidate.impactParBachFromCharmBaryonXY()) < impactParameterXYKaFromCharmBaryonMin) || (std::abs(candidate.impactParBachFromCharmBaryonXY()) > impactParameterXYKaFromCharmBaryonMax)) { + resultSelections = false; + registry.fill(HIST("hSelDCAXYPrimPi"), 0); + } else { + registry.fill(HIST("hSelDCAXYPrimPi"), 1); + } + + // cut on cascade dcaXY + if ((std::abs(candidate.impactParCascXY()) < impactParameterXYCascMin) || (std::abs(candidate.impactParCascXY()) > impactParameterXYCascMax)) { + resultSelections = false; + registry.fill(HIST("hSelDCAXYCasc"), 0); + } else { + registry.fill(HIST("hSelDCAXYCasc"), 1); + } + + // Charm daughter pT selections + if (std::abs(candidate.kfPtOmega()) < ptCascMin) { + resultSelections = false; + registry.fill(HIST("hSelKfPtOmega"), 0); + } else { + registry.fill(HIST("hSelKfPtOmega"), 1); + } + if (std::abs(candidate.kfPtKaFromOmegaKa()) < ptKaFromCharmBaryonMin) { + resultSelections = false; + registry.fill(HIST("hSelPtKaFromCharm"), 0); + } else { + registry.fill(HIST("hSelPtKaFromCharm"), 1); + } + + // Competing Ξ rejection(KF) Try to reject cases in which the candidate has a an inv. mass compatibler to Xi (bachelor pion) instead of Omega (bachelor kaon) + if (KfconfigurableGroup.applyCompetingCascRejection) { + if (std::abs(candidate.invMassCascadeRej() - o2::constants::physics::MassXiMinus) < KfconfigurableGroup.cascadeRejMassWindow) { + resultSelections = false; + registry.fill(HIST("hSelCompetingCasc"), 0); + } else { + registry.fill(HIST("hSelCompetingCasc"), 1); + registry.fill(HIST("hInvMassXiMinus_rej_cut"), candidate.invMassCascadeRej()); + } + } + + // OmegaKa Pt selection + if (std::abs(candidate.kfPtOmegaKa()) < ptCandMin || std::abs(candidate.kfPtOmegaKa()) > ptCandMax) { + resultSelections = false; + registry.fill(HIST("hSelPtOmegaKa"), 0); + } else { + registry.fill(HIST("hSelPtOmegaKa"), 1); + } + + // v0&Casc&OmegaKa ldl selection + if ((candidate.v0ldl() < KfconfigurableGroup.v0LdlMin) || (candidate.cascldl() < KfconfigurableGroup.cascLdlMin) || (candidate.omegaKaldl() > KfconfigurableGroup.omegaKaLdlMax)) { + resultSelections = false; + registry.fill(HIST("hSelV0_Casc_OmegaKaldl"), 0); + } else { + registry.fill(HIST("hSelV0_Casc_OmegaKaldl"), 1); + } + + // OmegaKa ctau selsection + if (candidate.cTauOmegaKa() > KfconfigurableGroup.cTauOmegaKaMax) { + resultSelections = false; + registry.fill(HIST("hSelctauOmegaKa"), 0); + } else { + registry.fill(HIST("hSelctauOmegaKa"), 1); + } + + // Chi2Geo/NDF V0&Casc&OmegaKa selection + if ((candidate.chi2GeoV0() > KfconfigurableGroup.v0Chi2OverNdfMax) || (candidate.chi2GeoV0() < 0) || (candidate.chi2GeoCasc() > KfconfigurableGroup.cascChi2OverNdfMax) || (candidate.chi2GeoCasc() < 0) || (candidate.chi2GeoOmegaKa() > KfconfigurableGroup.omegaKaChi2OverNdfMax) || (candidate.chi2GeoOmegaKa() < 0)) { + resultSelections = false; + registry.fill(HIST("hSelChi2GeooverNDFV0_Casc_OmegaKa"), 0); + } else { + registry.fill(HIST("hSelChi2GeooverNDFV0_Casc_OmegaKa"), 1); + } + + // Chi2Topo/NDF selection + if ((candidate.chi2TopoV0ToCasc() > KfconfigurableGroup.chi2TopoV0ToCascMax) || (candidate.chi2TopoV0ToCasc() < 0) || (candidate.chi2TopoKaToCasc() > KfconfigurableGroup.chi2TopoKaToCascMax) || (candidate.chi2TopoKaToCasc() < 0) || (candidate.chi2TopoCascToOmegaKa() > KfconfigurableGroup.chi2TopoCascToOmegaKaMax) || (candidate.chi2TopoCascToOmegaKa() < 0) || (candidate.chi2TopoKaToOmegaKa() > KfconfigurableGroup.chi2TopoKaToOmegaKaMax) || (candidate.chi2TopoKaToOmegaKa() < 0) || + (candidate.chi2TopoOmegaKaToPv() > KfconfigurableGroup.chi2TopoOmegaKaToPvMax) || (candidate.chi2TopoOmegaKaToPv() < 0) || (candidate.chi2TopoCascToPv() > KfconfigurableGroup.chi2TopoCascToPvMax) || (candidate.chi2TopoCascToPv() < 0) || (candidate.chi2TopoKaFromOmegaKaToPv() > KfconfigurableGroup.chi2TopoKaFromOmegaKaToPvMax) || (candidate.chi2TopoKaFromOmegaKaToPv() < 0)) { + resultSelections = false; + registry.fill(HIST("hSelChi2TopooverNDFV0_Casc_OmegaKa"), 0); + } else { + registry.fill(HIST("hSelChi2TopooverNDFV0_Casc_OmegaKa"), 1); + } + + // DecaylengthXY of OmegaKa&Casc&V0 selection + if ((std::abs(candidate.decLenCharmBaryon()) > KfconfigurableGroup.decayLenOmegaKaMax) || (std::abs(candidate.decLenCascade()) < KfconfigurableGroup.decayLenCascMin) || (std::abs(candidate.decLenV0()) < KfconfigurableGroup.decayLenLambdaMin)) { + resultSelections = false; + registry.fill(HIST("hSeldecayLenOmegaKa_Casc_V0"), 0); + } else { + registry.fill(HIST("hSeldecayLenOmegaKa_Casc_V0"), 1); + } + + // KFPA cut cosPaCascToOmegaKa cosPaV0ToCasc + if ((candidate.cosPaCascToOmegaKa() < KfconfigurableGroup.cosPaCascToOmegaKaMin) || (candidate.cosPaV0ToCasc() < KfconfigurableGroup.cosPaV0ToCascMin)) { + resultSelections = false; + registry.fill(HIST("hSelcosPaCascToOmegaKa_V0ToCasc"), 0); + } else { + registry.fill(HIST("hSelcosPaCascToOmegaKa_V0ToCasc"), 1); + } + + // TPC clusters selections + if (applyTrkSelLf) { + if (!isSelectedTrackTpcQuality(trackPiFromLam, nClustersTpcMin, nTpcCrossedRowsMin, tpcCrossedRowsOverFindableClustersRatioMin, tpcChi2PerClusterMax)) { + resultSelections = false; + registry.fill(HIST("hSelTPCQualityPiFromLam"), 0); + } else { + registry.fill(HIST("hSelTPCQualityPiFromLam"), 1); + } + if (!isSelectedTrackTpcQuality(trackPrFromLam, nClustersTpcMin, nTpcCrossedRowsMin, tpcCrossedRowsOverFindableClustersRatioMin, tpcChi2PerClusterMax)) { + resultSelections = false; + registry.fill(HIST("hSelTPCQualityPrFromLam"), 0); + } else { + registry.fill(HIST("hSelTPCQualityPrFromLam"), 1); + } + if (!isSelectedTrackTpcQuality(trackKaFromCasc, nClustersTpcMin, nTpcCrossedRowsMin, tpcCrossedRowsOverFindableClustersRatioMin, tpcChi2PerClusterMax)) { + resultSelections = false; + registry.fill(HIST("hSelTPCQualityKaFromCasc"), 0); + } else { + registry.fill(HIST("hSelTPCQualityKaFromCasc"), 1); + } + } + if (!isSelectedTrackTpcQuality(trackKaFromCharm, nClustersTpcMin, nTpcCrossedRowsMin, tpcCrossedRowsOverFindableClustersRatioMin, tpcChi2PerClusterMax)) { + resultSelections = false; + registry.fill(HIST("hSelTPCQualityKaFromCharm"), 0); + } else { + registry.fill(HIST("hSelTPCQualityKaFromCharm"), 1); + } + + // ITS clusters selection + if (!isSelectedTrackItsQuality(trackKaFromCharm, nClustersItsMin, itsChi2PerClusterMax) || trackKaFromCharm.itsNClsInnerBarrel() < nClustersItsInnBarrMin) { + resultSelections = false; + registry.fill(HIST("hSelITSQualityKaFromCharm"), 0); + } else { + registry.fill(HIST("hSelITSQualityKaFromCharm"), 1); + } + + // track-level PID selection + + // for TrackSelectorPID + int statusPidPrFromLam = -999; + int statusPidPiFromLam = -999; + int statusPidKaFromCasc = -999; + int statusPidKaFromCharmBaryon = -999; + + if (usePidTpcOnly && usePidTpcTofCombined) { + LOGF(fatal, "Check the PID configurables, usePidTpcOnly and usePidTpcTofCombined can't have the same value"); + } else if (!usePidTpcOnly && !usePidTpcTofCombined) { + LOGF(fatal, "At least one PID method must be enabled"); + } + + if (trackPiFromLam.hasTPC()) { + SETBIT(infoTpcStored, PiFromLam); + } + if (trackPrFromLam.hasTPC()) { + SETBIT(infoTpcStored, PrFromLam); + } + if (trackKaFromCasc.hasTPC()) { + SETBIT(infoTpcStored, KaFromCasc); + } + if (trackKaFromCharm.hasTPC()) { + SETBIT(infoTpcStored, KaFromCharm); + } + if (trackPiFromLam.hasTOF()) { + SETBIT(infoTofStored, PiFromLam); + } + if (trackPrFromLam.hasTOF()) { + SETBIT(infoTofStored, PrFromLam); + } + if (trackKaFromCasc.hasTOF()) { + SETBIT(infoTofStored, KaFromCasc); + } + if (trackKaFromCharm.hasTOF()) { + SETBIT(infoTofStored, KaFromCharm); + } + + if (usePidTpcOnly) { + statusPidPrFromLam = selectorProton.statusTpc(trackPrFromLam); + statusPidPiFromLam = selectorPion.statusTpc(trackPiFromLam); + statusPidKaFromCasc = selectorKaon.statusTpc(trackKaFromCasc); + statusPidKaFromCharmBaryon = selectorKaon.statusTpc(trackKaFromCharm); + } else if (usePidTpcTofCombined) { + statusPidPrFromLam = selectorProton.statusTpcOrTof(trackPrFromLam); + statusPidPiFromLam = selectorPion.statusTpcOrTof(trackPiFromLam); + statusPidKaFromCasc = selectorKaon.statusTpcOrTof(trackKaFromCasc); + statusPidKaFromCharmBaryon = selectorKaon.statusTpcOrTof(trackKaFromCharm); + } + + if (statusPidPrFromLam == TrackSelectorPID::Accepted && statusPidPiFromLam == TrackSelectorPID::Accepted) { + statusPidLambda = true; + if (resultSelections) { + registry.fill(HIST("hStatusCheck"), 0.5); + } + } else { + resultSelections = false; + } + + if (statusPidPrFromLam == TrackSelectorPID::Accepted && statusPidPiFromLam == TrackSelectorPID::Accepted && statusPidKaFromCasc == TrackSelectorPID::Accepted) { + statusPidCascade = true; + if (resultSelections) { + registry.fill(HIST("hStatusCheck"), 1.5); + } + } else { + resultSelections = false; + } + + if (statusPidPrFromLam == TrackSelectorPID::Accepted && statusPidPiFromLam == TrackSelectorPID::Accepted && statusPidKaFromCasc == TrackSelectorPID::Accepted && statusPidKaFromCharmBaryon == TrackSelectorPID::Accepted) { + statusPidCharmBaryon = true; + if (resultSelections) { + registry.fill(HIST("hStatusCheck"), 2.5); + } + } else { + resultSelections = false; + } + + // invariant mass cuts + double invMassLambda = candidate.invMassLambda(); + 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); + } + } else { + registry.fill(HIST("hSelMassLam"), 0); + resultSelections = false; + } + + if (std::abs(invMassCascade - o2::constants::physics::MassOmegaMinus) < cascadeMassWindow) { + statusInvMassCascade = true; + registry.fill(HIST("hSelMassCasc"), 1); + if (statusPidLambda && statusPidCascade && statusPidCharmBaryon && statusInvMassLambda && resultSelections) { + registry.fill(HIST("hStatusCheck"), 4.5); + } + } else { + registry.fill(HIST("hSelMassCasc"), 0); + resultSelections = false; + } + + 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); + } + } else { + registry.fill(HIST("hSelMassCharmBaryon"), 0); + resultSelections = false; + } + // ML selections + // if constexpr (ConstructMethod == hf_cand_casc_lf::ConstructMethod::KfParticle) { + // if (applyMl) { + // bool isSelectedMlOmegaKa = false; + // std::vector inputFeaturesOmegaKa = hfMlResponse.getInputFeatures(candidate, trackPiFromLam, trackKaFromCasc, trackKaFromCharm); + // isSelectedMlOmegaKa = hfMlResponse.isSelectedMl(inputFeaturesOmegaKa, ptCand, outputMlOmegaKa); + // if (isSelectedMlOmegaKa) { + // registry.fill(HIST("hBDTScoreTest1"), outputMlOmegaKa[0]); + // } + // hfMlSelToOmegaKa(outputMlOmegaKa); + // } + //} + + hfSelToOmegaKaKf(statusPidLambda, statusPidCascade, statusPidCharmBaryon, statusInvMassLambda, statusInvMassCascade, statusInvMassCharmBaryon, resultSelections, infoTpcStored, infoTofStored, + trackKaFromCharm.tpcNSigmaKa(), trackKaFromCasc.tpcNSigmaKa(), trackPiFromLam.tpcNSigmaPi(), trackPrFromLam.tpcNSigmaPr(), + trackKaFromCharm.tofNSigmaKa(), trackKaFromCasc.tofNSigmaKa(), trackPiFromLam.tofNSigmaPi(), trackPrFromLam.tofNSigmaPr()); + + if (resultSelections) { + if (!statusPidLambda) { + registry.fill(HIST("hSelPID"), 0.5); + } + if (statusPidLambda) { + registry.fill(HIST("hSelPID"), 1.5); + } + if (!statusPidCascade) { + registry.fill(HIST("hSelPID"), 2.5); + } + if (statusPidCascade) { + registry.fill(HIST("hSelPID"), 3.5); + } + if (!statusPidCharmBaryon) { + registry.fill(HIST("hSelPID"), 4.5); + } + if (statusPidCharmBaryon) { + registry.fill(HIST("hSelPID"), 5.5); + } + if (!statusInvMassLambda) { + registry.fill(HIST("hSelPID"), 6.5); + } + if (statusInvMassLambda) { + registry.fill(HIST("hSelPID"), 7.5); + } + if (!statusInvMassCascade) { + registry.fill(HIST("hSelPID"), 8.5); + } + if (statusInvMassCascade) { + registry.fill(HIST("hSelPID"), 9.5); + } + if (!statusInvMassCharmBaryon) { + registry.fill(HIST("hSelPID"), 10.5); + } + if (statusInvMassCharmBaryon) { + registry.fill(HIST("hSelPID"), 11.5); + } + } + + if (statusPidLambda && statusPidCascade && statusPidCharmBaryon && statusInvMassLambda && statusInvMassCascade && statusInvMassCharmBaryon && resultSelections) { + hInvMassCharmBaryon->Fill(invMassCharmBaryon); + hPtCharmBaryon->Fill(candidate.kfPtOmegaKa()); + hPtKaFromCharmBaryon->Fill(candidate.kfPtKaFromOmegaKa()); + registry.fill(HIST("hMassVsPtVsPtKaon"), + candidate.invMassCharmBaryon(), + candidate.kfPtOmegaKa(), + candidate.kfPtKaFromOmegaKa()); + } + } + } // end process +}; // end struct + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From 2ef76d75486b81c616bc5d3b35a7f0e1daffcf90 Mon Sep 17 00:00:00 2001 From: FDUEnrich <23210190047@m.fudan.edu.cn> Date: Wed, 25 Jun 2025 18:58:35 +0800 Subject: [PATCH 07/22] Update candidateSelectorOmegac0ToOmegaPi.cxx --- .../candidateSelectorOmegac0ToOmegaPi.cxx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPi.cxx b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPi.cxx index 71f8e47ae95..82c783f9c68 100644 --- a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPi.cxx @@ -551,21 +551,20 @@ struct HfCandidateSelectorToOmegaPi { registry.fill(HIST("hSelctauOmegac"), 1); } - // Chi2Geo/NDF V0&Casc&OmegaKa selection - if ((candidate.chi2GeoV0() > KfconfigurableGroup.v0Chi2OverNdfMax) || (candidate.chi2GeoV0() < 0) || (candidate.chi2GeoCasc() > KfconfigurableGroup.cascChi2OverNdfMax) || (candidate.chi2GeoCasc() < 0) || (candidate.chi2GeoOmegaKa() > KfconfigurableGroup.omegaKaChi2OverNdfMax) || (candidate.chi2GeoOmegaKa() < 0)) { + // Chi2Geo/NDF V0&Casc&Omegac selection + if ((candidate.v0Chi2OverNdf() > KfconfigurableGroup.v0Chi2OverNdfMax) || (candidate.v0Chi2OverNdf() < 0) || (candidate.cascChi2OverNdf() > KfconfigurableGroup.cascChi2OverNdfMax) || (candidate.cascChi2OverNdf() < 0) || (candidate.omegacChi2OverNdf() > KfconfigurableGroup.omegacChi2OverNdfMax) || (candidate.omegacChi2OverNdf() < 0)) { resultSelections = false; - registry.fill(HIST("hSelChi2GeooverNDFV0_Casc_OmegaKa"), 0); + registry.fill(HIST("hSelChi2GeooverNDFV0_Casc_Omegac"), 0); } else { - registry.fill(HIST("hSelChi2GeooverNDFV0_Casc_OmegaKa"), 1); + registry.fill(HIST("hSelChi2GeooverNDFV0_Casc_Omegac"), 1); } - - // Chi2Topo/NDF selection - if ((candidate.chi2TopoV0ToCasc() > KfconfigurableGroup.chi2TopoV0ToCascMax) || (candidate.chi2TopoV0ToCasc() < 0) || (candidate.chi2TopoKaToCasc() > KfconfigurableGroup.chi2TopoKaToCascMax) || (candidate.chi2TopoKaToCasc() < 0) || (candidate.chi2TopoCascToOmegaKa() > KfconfigurableGroup.chi2TopoCascToOmegaKaMax) || (candidate.chi2TopoCascToOmegaKa() < 0) || (candidate.chi2TopoKaToOmegaKa() > KfconfigurableGroup.chi2TopoKaToOmegaKaMax) || (candidate.chi2TopoKaToOmegaKa() < 0) || - (candidate.chi2TopoOmegaKaToPv() > KfconfigurableGroup.chi2TopoOmegaKaToPvMax) || (candidate.chi2TopoOmegaKaToPv() < 0) || (candidate.chi2TopoCascToPv() > KfconfigurableGroup.chi2TopoCascToPvMax) || (candidate.chi2TopoCascToPv() < 0) || (candidate.chi2TopoKaFromOmegaKaToPv() > KfconfigurableGroup.chi2TopoKaFromOmegaKaToPvMax) || (candidate.chi2TopoKaFromOmegaKaToPv() < 0)) { + + // Chi2Topo/NDF (chi2TopoV0ToCasc chi2TopoOmegacToPv chi2TopoCascToOmegac chi2TopoCascToPv) selection (???????????/NDF of which particle????????) + if ((candidate.chi2TopoV0ToCasc() > KfconfigurableGroup.chi2TopoV0ToCascMax) || (candidate.chi2TopoV0ToCasc() < 0) || (candidate.chi2TopoOmegacToPv() > KfconfigurableGroup.chi2TopoOmegacToPvMax) || (candidate.chi2TopoOmegacToPv() < 0) || (candidate.chi2TopoCascToOmegac() > KfconfigurableGroup.chi2TopoCascToOmegacMax) || (candidate.chi2TopoCascToOmegac() < 0) || (candidate.chi2TopoCascToPv() > KfconfigurableGroup.chi2TopoCascToPvMax) || (candidate.chi2TopoCascToPv() < 0)) { resultSelections = false; - registry.fill(HIST("hSelChi2TopooverNDFV0_Casc_OmegaKa"), 0); + registry.fill(HIST("hSelChi2TopooverNDFV0_Casc_Omegac"), 0); } else { - registry.fill(HIST("hSelChi2TopooverNDFV0_Casc_OmegaKa"), 1); + registry.fill(HIST("hSelChi2TopooverNDFV0_Casc_Omegac"), 1); } // DecaylengthXY of Omegac&Casc&V0 selection From 8e26799b04515eb5dab4557c29f3aeae9db98d12 Mon Sep 17 00:00:00 2001 From: FDUEnrich <23210190047@m.fudan.edu.cn> Date: Wed, 25 Jun 2025 19:12:04 +0800 Subject: [PATCH 08/22] Update candidateCreatorXic0Omegac0.cxx --- .../candidateCreatorXic0Omegac0.cxx | 181 +++++++++--------- 1 file changed, 92 insertions(+), 89 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx index 47fa2af3bc2..08d9e935693 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx @@ -27,41 +27,42 @@ #include /// includes KFParticle -#include "PWGHF/Core/CentralityEstimation.h" -#include "PWGHF/Core/SelectorCuts.h" -#include "PWGHF/DataModel/CandidateReconstructionTables.h" -#include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "PWGHF/Utils/utilsBfieldCCDB.h" -#include "PWGHF/Utils/utilsEvSelHf.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" -#include "PWGLF/DataModel/mcCentrality.h" - -#include "Common/Core/RecoDecay.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/CollisionAssociationTables.h" -#include "Common/DataModel/EventSelection.h" -#include "Tools/KFparticle/KFUtilities.h" +#include "KFParticle.h" +#include "KFParticleBase.h" +#include "KFPTrack.h" +#include "KFPVertex.h" +#include "KFVertex.h" #include "CCDB/BasicCCDBManager.h" #include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" #include "DataFormatsParameters/GRPMagField.h" #include "DataFormatsParameters/GRPObject.h" +#include "DCAFitter/DCAFitterN.h" #include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" -#include "Framework/RunningWorkflowInfo.h" +#include "Framework/ASoAHelpers.h" #include "Framework/runDataProcessing.h" +#include "Framework/RunningWorkflowInfo.h" #include "ReconstructionDataFormats/DCA.h" #include "ReconstructionDataFormats/Track.h" #include "ReconstructionDataFormats/V0.h" -#include "KFPTrack.h" -#include "KFPVertex.h" -#include "KFParticle.h" -#include "KFParticleBase.h" -#include "KFVertex.h" +#include "Common/Core/RecoDecay.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/CollisionAssociationTables.h" +#include "Common/DataModel/EventSelection.h" +#include "Tools/KFparticle/KFUtilities.h" + +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/DataModel/mcCentrality.h" + +#include "PWGHF/Core/CentralityEstimation.h" +#include "PWGHF/Core/SelectorCuts.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/Utils/utilsBfieldCCDB.h" +#include "PWGHF/Utils/utilsEvSelHf.h" using namespace o2; using namespace o2::track; @@ -1665,14 +1666,14 @@ struct HfCandidateCreatorXic0Omegac0 { template void runOmegac0Xic0ToOmegaKaCreatorWithKFParticle(Coll const&, - aod::BCsWithTimestamps const& /*bcWithTimeStamps*/, - MyKfTracks const&, - MyKfCascTable const&, KFCascadesLinked const&, - aod::HfCascLf2Prongs const& candidates, - Hist& hInvMassCharmBaryon, - Hist& hFitterStatus, - Hist& hCandidateCounter, - Hist& hCascadesCounter) + aod::BCsWithTimestamps const& /*bcWithTimeStamps*/, + MyKfTracks const&, + MyKfCascTable const&, KFCascadesLinked const&, + aod::HfCascLf2Prongs const& candidates, + Hist& hInvMassCharmBaryon, + Hist& hFitterStatus, + Hist& hCandidateCounter, + Hist& hCascadesCounter) { for (const auto& cand : candidates) { hCandidateCounter->Fill(1); @@ -1708,9 +1709,9 @@ struct HfCandidateCreatorXic0Omegac0 { // 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 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.signed1Pt() > 0 ? +1 : -1; int signOmega = casc.sign() > 0 ? +1 : -1; @@ -1730,11 +1731,11 @@ struct HfCandidateCreatorXic0Omegac0 { } // convert for Pos and Neg Particles if (signOmega > 0) { - kfPiFromV0 = KFParticle(kfpTrackV0DauPos, kPiPlus); - kfPrFromV0 = KFParticle(kfpTrackV0DauNeg, -kProton); - kfKaFromOmega = KFParticle(kfpTrackKaFromOmega, kKPlus); - kfPiFromXiRej = KFParticle(kfpTrackKaFromOmega, kPiPlus); // rej - kfKaFromCharm = KFParticle(kfpTrackKaFromCharm, kKMinus); + kfPiFromV0 = KFParticle(kfpTrackV0DauPos, kPiPlus); + kfPrFromV0 = KFParticle(kfpTrackV0DauNeg, -kProton); + kfKaFromOmega = KFParticle(kfpTrackKaFromOmega, kKPlus); + kfPiFromXiRej = KFParticle(kfpTrackKaFromOmega, kPiPlus); // rej + kfKaFromCharm = KFParticle(kfpTrackKaFromCharm, kKMinus); } if (doCascadePreselection) { @@ -1758,7 +1759,7 @@ struct HfCandidateCreatorXic0Omegac0 { std::array vertexCasc = {casc.x(), casc.y(), casc.z()}; std::array pVecCasc = {casc.px(), casc.py(), casc.pz()}; - // step 1 : construct V0 with KF + //step 1 : construct V0 with KF const KFParticle* v0Daughters[2] = {&kfPrFromV0, &kfPiFromV0}; // construct V0 KFParticle kfV0; @@ -1787,7 +1788,7 @@ struct HfCandidateCreatorXic0Omegac0 { } kfV0.TransportToDecayVertex(); - // step 2 : reconstruct cascade(Omega) with KF + //step 2 : reconstruct cascade(Omega) with KF const KFParticle* omegaDaugthers[2] = {&kfKaFromOmega, &kfV0}; const KFParticle* omegaDaugthersRej[2] = {&kfPiFromXiRej, &kfV0}; // rej // construct cascade @@ -1807,14 +1808,14 @@ struct HfCandidateCreatorXic0Omegac0 { kfOmega.GetMass(massCasc, sigCasc); kfOmegarej.GetMass(massCascrej, sigCascrej); // rej // err_massOmega and err_massXiRej > 0 - if (sigCasc <= 0 || sigCascrej <= 0) + if (sigCasc <= 0 || sigCascrej <=0) continue; // chi2>0 && NDF>0 if (kfOmega.GetNDF() <= 0 || kfOmega.GetChi2() <= 0) continue; if ((std::abs(massCasc - MassOmegaMinus) > massToleranceCascade) || (std::abs(massCascrej - MassXiMinus) < massToleranceCascadeRej)) continue; - registry.fill(HIST("hInvMassXiMinus_rej"), massCascrej); // rej: Add competing rejection to minimize misidentified Xi impact. Reject if kfBachPionRej is Pion and the constructed cascade has Xi's invariant mass. + registry.fill(HIST("hInvMassXiMinus_rej"), massCascrej); // rej: Add competing rejection to minimize misidentified Xi impact. Reject if kfBachPionRej is Pion and the constructed cascade has Xi's invariant mass. KFParticle kfOmegaMassConstrained = kfOmega; kfOmegaMassConstrained.SetNonlinearMassConstraint(o2::constants::physics::MassOmegaMinus); // set mass constrain to XiMinus if (kfUseCascadeMassConstraint) { @@ -1825,8 +1826,8 @@ struct HfCandidateCreatorXic0Omegac0 { kfOmega.TransportToDecayVertex(); // rej: Add competing rejection to minimize misidentified Xi impact. Reject if kfBachPionRej is Pion and the constructed cascade has Xi's invariant mass. - // step 3 : reconstruc OmegaKa with KF - // Create KF charm bach Pion from track + //step 3 : reconstruc OmegaKa with KF + // Create KF charm bach Pion from track const KFParticle* omegaKaDaugthers[2] = {&kfKaFromCharm, &kfOmega}; // construct Omegac0 or Xic0 KFParticle kfOmegaKa; @@ -1911,12 +1912,12 @@ struct HfCandidateCreatorXic0Omegac0 { float cosPaXYV0ToCasc = cpaXYFromKF(kfV0, kfOmega); float cosPaXYCascToOmegaKa = cpaXYFromKF(kfOmega, kfOmegaKa); - // Get Chi2Geo/NDF + //Get Chi2Geo/NDF float chi2GeoV0 = kfV0.GetChi2() / kfV0.GetNDF(); float chi2GeoCasc = kfOmega.GetChi2() / kfOmega.GetNDF(); float chi2GeoOmegaKa = kfOmegaKa.GetChi2() / kfOmegaKa.GetNDF(); - // Get Chi2Topo/NDF + //Get Chi2Topo/NDF float chi2NdfTopoV0ToCasc = kfV0ToOmega.GetChi2() / kfV0ToOmega.GetNDF(); float chi2NdfTopoKaToCasc = kfKaToOmega.GetChi2() / kfKaToOmega.GetNDF(); float chi2NdfTopoKaFromOmegaKaToOmegaKa = kfKaFromCharmToOmegaKa.GetChi2() / kfKaFromCharmToOmegaKa.GetNDF(); @@ -1926,7 +1927,7 @@ struct HfCandidateCreatorXic0Omegac0 { float chi2NdfTopoOmegaKaToPv = kfCharmToPv.GetChi2() / kfCharmToPv.GetNDF(); float chi2NdfTopoKaFromOmegaKaToPv = kfKaFromCharmToPv.GetChi2() / kfKaFromCharmToPv.GetNDF(); - // Get MassChi2/NDF + //Get MassChi2/NDF auto v0Chi2OverNdfm = kfV0MassConstrained.GetChi2() / kfV0MassConstrained.GetNDF(); auto cascChi2OverNdfm = kfOmegaMassConstrained.GetChi2() / kfOmegaMassConstrained.GetNDF(); @@ -1956,38 +1957,40 @@ struct HfCandidateCreatorXic0Omegac0 { float ctV0 = kfV0ToOmega.GetLifeTime(); float ctCasc = kfOmegaToOmegaKa.GetLifeTime(); float ctOmegaKa = kfCharmToPv.GetLifeTime(); - + hCandidateCounter->Fill(3); // fill full kf table kfCandidateOmegaKaData(collision.globalIndex(), - collision.posX(), collision.posY(), collision.posZ(), // PV Coord - kfPv.GetX(), kfPv.GetY(), kfPv.GetZ(), // PV KF - vertexV0[0], vertexV0[1], vertexV0[2], // V0 Vtx from LF-table - pVecV0[0], pVecV0[1], pVecV0[2], // V0 P from LF-table - vertexCasc[0], vertexCasc[1], vertexCasc[2], // Casc Vtx from LF-table - pVecCasc[0], pVecCasc[1], pVecCasc[2], // Casc P from LF-table - kfV0.GetX(), kfV0.GetY(), kfV0.GetZ(), // V0 Vtx KF - kfV0.GetPx(), kfV0.GetPy(), kfV0.GetPz(), // V0 P KF - kfOmega.GetX(), kfOmega.GetY(), kfOmega.GetZ(), // Omega Vtx KF - kfOmega.GetPx(), kfOmega.GetPx(), kfOmega.GetPx(), // Omega Vtx KF - kfOmegaKa.GetX(), kfOmegaKa.GetY(), kfOmegaKa.GetZ(), // OmegaKa Vtx KF (SecondaryVertex) - kfOmegaKa.GetPx(), kfOmegaKa.GetPx(), kfOmegaKa.GetPx(), // OmegaKa P KF - signOmega, // Check Omega sign - kfPrFromV0.GetEta(), kfPiFromV0.GetEta(), kfKaFromOmega.GetEta(), kfKaFromCharm.GetEta(), kfV0.GetEta(), kfOmega.GetEta(), kfOmegaKa.GetEta(), kfOmegaKa.GetRapidity(), // Eta of daughters and mothers. Rapidity of OmegaKa - impactParameterKaFromCharmXY, errImpactParameterKaFromCharmXY, impactParameterOmegaXY, errImpactParameterOmegaXY, // DCAXY of KaFromCharm and Omega - kfPrToV0.GetDistanceFromParticle(kfPiToV0), kfV0ToOmega.GetDistanceFromParticle(kfKaToOmega), kfOmegaToOmegaKa.GetDistanceFromParticle(kfKaFromCharmToOmegaKa), // DCA of daughters - cosPaV0ToPv, cosPaCascToPv, cosPaOmegaKaToPv, cosPaXYV0ToPv, cosPaXYCascToPv, cosPaXYOmegaKaToPv, cosPaV0ToCasc, cosPaCascToOmegaKa, cosPaXYV0ToCasc, cosPaXYCascToOmegaKa, // CosPA of PV and mothers - chi2GeoV0, chi2GeoCasc, chi2GeoOmegaKa, // Chi2Geo/NDF - v0Chi2OverNdfm, cascChi2OverNdfm, // Chi2Mass/NDF - chi2NdfTopoV0ToCasc, chi2NdfTopoKaToCasc, chi2NdfTopoKaFromOmegaKaToOmegaKa, chi2NdfTopoCascToOmegaKa, chi2NdfTopoV0ToPv, chi2NdfTopoCascToPv, chi2NdfTopoKaFromOmegaKaToPv, chi2NdfTopoOmegaKaToPv, // Chi2Topo/NDF - ldlV0, ldlCasc, ldlOmegaKa, // ldl - decayLxyLam, decayLxyCasc, decayLxyOmegaKa, // DecaylengthXY - massLam, sigLam, massCasc, sigCasc, massCascrej, sigCascrej, massOmegaKa, sigOmegaKa, // massKF and masserror - ptOmegaKa, ptKaFromCharm, ptOmega, // pT - cosThetaStarKaFromOmegac, cosThetaStarKaFromXic, ctV0, ctCasc, ctOmegaKa, // cosThetaStar & ct - cascAodElement.v0Id(), casc.posTrackId(), casc.negTrackId(), casc.cascadeId(), casc.bachelorId(), trackKaFromCharm.globalIndex()); + collision.posX(), collision.posY(), collision.posZ(),//PV Coord + kfPv.GetX(), kfPv.GetY(), kfPv.GetZ(),//PV KF + vertexV0[0], vertexV0[1], vertexV0[2], //V0 Vtx from LF-table + pVecV0[0], pVecV0[1], pVecV0[2], //V0 P from LF-table + vertexCasc[0], vertexCasc[1], vertexCasc[2], //Casc Vtx from LF-table + pVecCasc[0], pVecCasc[1], pVecCasc[2], //Casc P from LF-table + kfV0.GetX(), kfV0.GetY(), kfV0.GetZ(), //V0 Vtx KF + kfV0.GetPx(), kfV0.GetPy(), kfV0.GetPz(),//V0 P KF + kfOmega.GetX(), kfOmega.GetY(), kfOmega.GetZ(), //Omega Vtx KF + kfOmega.GetPx(), kfOmega.GetPx(), kfOmega.GetPx(), //Omega Vtx KF + kfOmegaKa.GetX(), kfOmegaKa.GetY(), kfOmegaKa.GetZ(), //OmegaKa Vtx KF (SecondaryVertex) + kfOmegaKa.GetPx(), kfOmegaKa.GetPx(), kfOmegaKa.GetPx(), //OmegaKa P KF + signOmega, //Check Omega sign + kfPrFromV0.GetEta(), kfPiFromV0.GetEta(), kfKaFromOmega.GetEta(), kfKaFromCharm.GetEta(), kfV0.GetEta(), kfOmega.GetEta(), kfOmegaKa.GetEta(), kfOmegaKa.GetRapidity(), //Eta of daughters and mothers. Rapidity of OmegaKa + impactParameterKaFromCharmXY, errImpactParameterKaFromCharmXY, impactParameterOmegaXY, errImpactParameterOmegaXY, //DCAXY of KaFromCharm and Omega + kfPrToV0.GetDistanceFromParticle(kfPiToV0), kfV0ToOmega.GetDistanceFromParticle(kfKaToOmega), kfOmegaToOmegaKa.GetDistanceFromParticle(kfKaFromCharmToOmegaKa), //DCA of daughters + cosPaV0ToPv, cosPaCascToPv, cosPaOmegaKaToPv, cosPaXYV0ToPv, cosPaXYCascToPv, cosPaXYOmegaKaToPv, cosPaV0ToCasc, cosPaCascToOmegaKa, cosPaXYV0ToCasc, cosPaXYCascToOmegaKa, //CosPA of PV and mothers + chi2GeoV0, chi2GeoCasc, chi2GeoOmegaKa, //Chi2Geo/NDF + v0Chi2OverNdfm, cascChi2OverNdfm, //Chi2Mass/NDF + chi2NdfTopoV0ToCasc, chi2NdfTopoKaToCasc, chi2NdfTopoKaFromOmegaKaToOmegaKa, chi2NdfTopoCascToOmegaKa, chi2NdfTopoV0ToPv, chi2NdfTopoCascToPv, chi2NdfTopoKaFromOmegaKaToPv, chi2NdfTopoOmegaKaToPv, //Chi2Topo/NDF + ldlV0, ldlCasc, ldlOmegaKa, //ldl + decayLxyLam, decayLxyCasc, decayLxyOmegaKa, //DecaylengthXY + massLam, sigLam, massCasc, sigCasc, massCascrej, sigCascrej, massOmegaKa, sigOmegaKa, //massKF and masserror + ptOmegaKa, ptKaFromCharm, ptOmega, //pT + cosThetaStarKaFromOmegac, cosThetaStarKaFromXic, ctV0, ctCasc, ctOmegaKa, //cosThetaStar & ct + cascAodElement.v0Id(), casc.posTrackId(), casc.negTrackId(), casc.cascadeId(), casc.bachelorId(), trackKaFromCharm.globalIndex() + ); } + } /// @brief process function w/o centrality selections @@ -2039,11 +2042,11 @@ struct HfCandidateCreatorXic0Omegac0 { 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, - MyKfTracks const& tracks, - MyKfCascTable const& cascades, - KFCascadesLinked const& cascadeLinks, - aod::HfCascLf2Prongs const& candidates) + aod::BCsWithTimestamps const& bcWithTimeStamps, + MyKfTracks const& tracks, + MyKfCascTable const& cascades, + KFCascadesLinked const& cascadeLinks, + aod::HfCascLf2Prongs const& candidates) { runOmegac0Xic0ToOmegaKaCreatorWithKFParticle(collisions, bcWithTimeStamps, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToOmegaK, hFitterStatusToOmegaK, hCandidateCounterToOmegaK, hCascadesCounterToOmegaK); } @@ -2109,11 +2112,11 @@ struct HfCandidateCreatorXic0Omegac0 { 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, - MyKfTracks const& tracks, - MyKfCascTable const& cascades, - KFCascadesLinked const& cascadeLinks, - aod::HfCascLf2Prongs const& candidates) + aod::BCsWithTimestamps const& bcWithTimeStamps, + MyKfTracks const& tracks, + MyKfCascTable const& cascades, + KFCascadesLinked const& cascadeLinks, + aod::HfCascLf2Prongs const& candidates) { runOmegac0Xic0ToOmegaKaCreatorWithKFParticle(collisions, bcWithTimeStamps, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToOmegaK, hFitterStatusToOmegaK, hCandidateCounterToOmegaK, hCascadesCounterToOmegaK); } @@ -2179,11 +2182,11 @@ struct HfCandidateCreatorXic0Omegac0 { 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, - MyKfTracks const& tracks, - MyKfCascTable const& cascades, - KFCascadesLinked const& cascadeLinks, - aod::HfCascLf2Prongs const& candidates) + aod::BCsWithTimestamps const& bcWithTimeStamps, + MyKfTracks const& tracks, + MyKfCascTable const& cascades, + KFCascadesLinked const& cascadeLinks, + aod::HfCascLf2Prongs const& candidates) { runOmegac0Xic0ToOmegaKaCreatorWithKFParticle(collisions, bcWithTimeStamps, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToOmegaK, hFitterStatusToOmegaK, hCandidateCounterToOmegaK, hCascadesCounterToOmegaK); } From d20f74c8ac5d6c7c2ad637844c0d704810ba5a8c Mon Sep 17 00:00:00 2001 From: FDUEnrich <23210190047@m.fudan.edu.cn> Date: Wed, 25 Jun 2025 19:30:30 +0800 Subject: [PATCH 09/22] Update candidateCreatorXic0Omegac0.cxx From 265696acf2d93ae643de179b2ac0e297a0b05cc6 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 25 Jun 2025 11:33:32 +0000 Subject: [PATCH 10/22] Please consider the following formatting changes --- .../candidateCreatorXic0Omegac0.cxx | 136 +++++++++--------- 1 file changed, 67 insertions(+), 69 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx index 08d9e935693..6e4c9317a65 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx @@ -1666,14 +1666,14 @@ struct HfCandidateCreatorXic0Omegac0 { template void runOmegac0Xic0ToOmegaKaCreatorWithKFParticle(Coll const&, - aod::BCsWithTimestamps const& /*bcWithTimeStamps*/, - MyKfTracks const&, - MyKfCascTable const&, KFCascadesLinked const&, - aod::HfCascLf2Prongs const& candidates, - Hist& hInvMassCharmBaryon, - Hist& hFitterStatus, - Hist& hCandidateCounter, - Hist& hCascadesCounter) + aod::BCsWithTimestamps const& /*bcWithTimeStamps*/, + MyKfTracks const&, + MyKfCascTable const&, KFCascadesLinked const&, + aod::HfCascLf2Prongs const& candidates, + Hist& hInvMassCharmBaryon, + Hist& hFitterStatus, + Hist& hCandidateCounter, + Hist& hCascadesCounter) { for (const auto& cand : candidates) { hCandidateCounter->Fill(1); @@ -1709,9 +1709,9 @@ struct HfCandidateCreatorXic0Omegac0 { // 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 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.signed1Pt() > 0 ? +1 : -1; int signOmega = casc.sign() > 0 ? +1 : -1; @@ -1731,11 +1731,11 @@ struct HfCandidateCreatorXic0Omegac0 { } // convert for Pos and Neg Particles if (signOmega > 0) { - kfPiFromV0 = KFParticle(kfpTrackV0DauPos, kPiPlus); - kfPrFromV0 = KFParticle(kfpTrackV0DauNeg, -kProton); - kfKaFromOmega = KFParticle(kfpTrackKaFromOmega, kKPlus); - kfPiFromXiRej = KFParticle(kfpTrackKaFromOmega, kPiPlus); // rej - kfKaFromCharm = KFParticle(kfpTrackKaFromCharm, kKMinus); + kfPiFromV0 = KFParticle(kfpTrackV0DauPos, kPiPlus); + kfPrFromV0 = KFParticle(kfpTrackV0DauNeg, -kProton); + kfKaFromOmega = KFParticle(kfpTrackKaFromOmega, kKPlus); + kfPiFromXiRej = KFParticle(kfpTrackKaFromOmega, kPiPlus); // rej + kfKaFromCharm = KFParticle(kfpTrackKaFromCharm, kKMinus); } if (doCascadePreselection) { @@ -1759,7 +1759,7 @@ struct HfCandidateCreatorXic0Omegac0 { std::array vertexCasc = {casc.x(), casc.y(), casc.z()}; std::array pVecCasc = {casc.px(), casc.py(), casc.pz()}; - //step 1 : construct V0 with KF + // step 1 : construct V0 with KF const KFParticle* v0Daughters[2] = {&kfPrFromV0, &kfPiFromV0}; // construct V0 KFParticle kfV0; @@ -1788,7 +1788,7 @@ struct HfCandidateCreatorXic0Omegac0 { } kfV0.TransportToDecayVertex(); - //step 2 : reconstruct cascade(Omega) with KF + // step 2 : reconstruct cascade(Omega) with KF const KFParticle* omegaDaugthers[2] = {&kfKaFromOmega, &kfV0}; const KFParticle* omegaDaugthersRej[2] = {&kfPiFromXiRej, &kfV0}; // rej // construct cascade @@ -1808,14 +1808,14 @@ struct HfCandidateCreatorXic0Omegac0 { kfOmega.GetMass(massCasc, sigCasc); kfOmegarej.GetMass(massCascrej, sigCascrej); // rej // err_massOmega and err_massXiRej > 0 - if (sigCasc <= 0 || sigCascrej <=0) + if (sigCasc <= 0 || sigCascrej <= 0) continue; // chi2>0 && NDF>0 if (kfOmega.GetNDF() <= 0 || kfOmega.GetChi2() <= 0) continue; if ((std::abs(massCasc - MassOmegaMinus) > massToleranceCascade) || (std::abs(massCascrej - MassXiMinus) < massToleranceCascadeRej)) continue; - registry.fill(HIST("hInvMassXiMinus_rej"), massCascrej); // rej: Add competing rejection to minimize misidentified Xi impact. Reject if kfBachPionRej is Pion and the constructed cascade has Xi's invariant mass. + registry.fill(HIST("hInvMassXiMinus_rej"), massCascrej); // rej: Add competing rejection to minimize misidentified Xi impact. Reject if kfBachPionRej is Pion and the constructed cascade has Xi's invariant mass. KFParticle kfOmegaMassConstrained = kfOmega; kfOmegaMassConstrained.SetNonlinearMassConstraint(o2::constants::physics::MassOmegaMinus); // set mass constrain to XiMinus if (kfUseCascadeMassConstraint) { @@ -1826,8 +1826,8 @@ struct HfCandidateCreatorXic0Omegac0 { kfOmega.TransportToDecayVertex(); // rej: Add competing rejection to minimize misidentified Xi impact. Reject if kfBachPionRej is Pion and the constructed cascade has Xi's invariant mass. - //step 3 : reconstruc OmegaKa with KF - // Create KF charm bach Pion from track + // step 3 : reconstruc OmegaKa with KF + // Create KF charm bach Pion from track const KFParticle* omegaKaDaugthers[2] = {&kfKaFromCharm, &kfOmega}; // construct Omegac0 or Xic0 KFParticle kfOmegaKa; @@ -1912,12 +1912,12 @@ struct HfCandidateCreatorXic0Omegac0 { float cosPaXYV0ToCasc = cpaXYFromKF(kfV0, kfOmega); float cosPaXYCascToOmegaKa = cpaXYFromKF(kfOmega, kfOmegaKa); - //Get Chi2Geo/NDF + // Get Chi2Geo/NDF float chi2GeoV0 = kfV0.GetChi2() / kfV0.GetNDF(); float chi2GeoCasc = kfOmega.GetChi2() / kfOmega.GetNDF(); float chi2GeoOmegaKa = kfOmegaKa.GetChi2() / kfOmegaKa.GetNDF(); - //Get Chi2Topo/NDF + // Get Chi2Topo/NDF float chi2NdfTopoV0ToCasc = kfV0ToOmega.GetChi2() / kfV0ToOmega.GetNDF(); float chi2NdfTopoKaToCasc = kfKaToOmega.GetChi2() / kfKaToOmega.GetNDF(); float chi2NdfTopoKaFromOmegaKaToOmegaKa = kfKaFromCharmToOmegaKa.GetChi2() / kfKaFromCharmToOmegaKa.GetNDF(); @@ -1927,7 +1927,7 @@ struct HfCandidateCreatorXic0Omegac0 { float chi2NdfTopoOmegaKaToPv = kfCharmToPv.GetChi2() / kfCharmToPv.GetNDF(); float chi2NdfTopoKaFromOmegaKaToPv = kfKaFromCharmToPv.GetChi2() / kfKaFromCharmToPv.GetNDF(); - //Get MassChi2/NDF + // Get MassChi2/NDF auto v0Chi2OverNdfm = kfV0MassConstrained.GetChi2() / kfV0MassConstrained.GetNDF(); auto cascChi2OverNdfm = kfOmegaMassConstrained.GetChi2() / kfOmegaMassConstrained.GetNDF(); @@ -1957,40 +1957,38 @@ struct HfCandidateCreatorXic0Omegac0 { float ctV0 = kfV0ToOmega.GetLifeTime(); float ctCasc = kfOmegaToOmegaKa.GetLifeTime(); float ctOmegaKa = kfCharmToPv.GetLifeTime(); - + hCandidateCounter->Fill(3); // fill full kf table kfCandidateOmegaKaData(collision.globalIndex(), - collision.posX(), collision.posY(), collision.posZ(),//PV Coord - kfPv.GetX(), kfPv.GetY(), kfPv.GetZ(),//PV KF - vertexV0[0], vertexV0[1], vertexV0[2], //V0 Vtx from LF-table - pVecV0[0], pVecV0[1], pVecV0[2], //V0 P from LF-table - vertexCasc[0], vertexCasc[1], vertexCasc[2], //Casc Vtx from LF-table - pVecCasc[0], pVecCasc[1], pVecCasc[2], //Casc P from LF-table - kfV0.GetX(), kfV0.GetY(), kfV0.GetZ(), //V0 Vtx KF - kfV0.GetPx(), kfV0.GetPy(), kfV0.GetPz(),//V0 P KF - kfOmega.GetX(), kfOmega.GetY(), kfOmega.GetZ(), //Omega Vtx KF - kfOmega.GetPx(), kfOmega.GetPx(), kfOmega.GetPx(), //Omega Vtx KF - kfOmegaKa.GetX(), kfOmegaKa.GetY(), kfOmegaKa.GetZ(), //OmegaKa Vtx KF (SecondaryVertex) - kfOmegaKa.GetPx(), kfOmegaKa.GetPx(), kfOmegaKa.GetPx(), //OmegaKa P KF - signOmega, //Check Omega sign - kfPrFromV0.GetEta(), kfPiFromV0.GetEta(), kfKaFromOmega.GetEta(), kfKaFromCharm.GetEta(), kfV0.GetEta(), kfOmega.GetEta(), kfOmegaKa.GetEta(), kfOmegaKa.GetRapidity(), //Eta of daughters and mothers. Rapidity of OmegaKa - impactParameterKaFromCharmXY, errImpactParameterKaFromCharmXY, impactParameterOmegaXY, errImpactParameterOmegaXY, //DCAXY of KaFromCharm and Omega - kfPrToV0.GetDistanceFromParticle(kfPiToV0), kfV0ToOmega.GetDistanceFromParticle(kfKaToOmega), kfOmegaToOmegaKa.GetDistanceFromParticle(kfKaFromCharmToOmegaKa), //DCA of daughters - cosPaV0ToPv, cosPaCascToPv, cosPaOmegaKaToPv, cosPaXYV0ToPv, cosPaXYCascToPv, cosPaXYOmegaKaToPv, cosPaV0ToCasc, cosPaCascToOmegaKa, cosPaXYV0ToCasc, cosPaXYCascToOmegaKa, //CosPA of PV and mothers - chi2GeoV0, chi2GeoCasc, chi2GeoOmegaKa, //Chi2Geo/NDF - v0Chi2OverNdfm, cascChi2OverNdfm, //Chi2Mass/NDF - chi2NdfTopoV0ToCasc, chi2NdfTopoKaToCasc, chi2NdfTopoKaFromOmegaKaToOmegaKa, chi2NdfTopoCascToOmegaKa, chi2NdfTopoV0ToPv, chi2NdfTopoCascToPv, chi2NdfTopoKaFromOmegaKaToPv, chi2NdfTopoOmegaKaToPv, //Chi2Topo/NDF - ldlV0, ldlCasc, ldlOmegaKa, //ldl - decayLxyLam, decayLxyCasc, decayLxyOmegaKa, //DecaylengthXY - massLam, sigLam, massCasc, sigCasc, massCascrej, sigCascrej, massOmegaKa, sigOmegaKa, //massKF and masserror - ptOmegaKa, ptKaFromCharm, ptOmega, //pT - cosThetaStarKaFromOmegac, cosThetaStarKaFromXic, ctV0, ctCasc, ctOmegaKa, //cosThetaStar & ct - cascAodElement.v0Id(), casc.posTrackId(), casc.negTrackId(), casc.cascadeId(), casc.bachelorId(), trackKaFromCharm.globalIndex() - ); + collision.posX(), collision.posY(), collision.posZ(), // PV Coord + kfPv.GetX(), kfPv.GetY(), kfPv.GetZ(), // PV KF + vertexV0[0], vertexV0[1], vertexV0[2], // V0 Vtx from LF-table + pVecV0[0], pVecV0[1], pVecV0[2], // V0 P from LF-table + vertexCasc[0], vertexCasc[1], vertexCasc[2], // Casc Vtx from LF-table + pVecCasc[0], pVecCasc[1], pVecCasc[2], // Casc P from LF-table + kfV0.GetX(), kfV0.GetY(), kfV0.GetZ(), // V0 Vtx KF + kfV0.GetPx(), kfV0.GetPy(), kfV0.GetPz(), // V0 P KF + kfOmega.GetX(), kfOmega.GetY(), kfOmega.GetZ(), // Omega Vtx KF + kfOmega.GetPx(), kfOmega.GetPx(), kfOmega.GetPx(), // Omega Vtx KF + kfOmegaKa.GetX(), kfOmegaKa.GetY(), kfOmegaKa.GetZ(), // OmegaKa Vtx KF (SecondaryVertex) + kfOmegaKa.GetPx(), kfOmegaKa.GetPx(), kfOmegaKa.GetPx(), // OmegaKa P KF + signOmega, // Check Omega sign + kfPrFromV0.GetEta(), kfPiFromV0.GetEta(), kfKaFromOmega.GetEta(), kfKaFromCharm.GetEta(), kfV0.GetEta(), kfOmega.GetEta(), kfOmegaKa.GetEta(), kfOmegaKa.GetRapidity(), // Eta of daughters and mothers. Rapidity of OmegaKa + impactParameterKaFromCharmXY, errImpactParameterKaFromCharmXY, impactParameterOmegaXY, errImpactParameterOmegaXY, // DCAXY of KaFromCharm and Omega + kfPrToV0.GetDistanceFromParticle(kfPiToV0), kfV0ToOmega.GetDistanceFromParticle(kfKaToOmega), kfOmegaToOmegaKa.GetDistanceFromParticle(kfKaFromCharmToOmegaKa), // DCA of daughters + cosPaV0ToPv, cosPaCascToPv, cosPaOmegaKaToPv, cosPaXYV0ToPv, cosPaXYCascToPv, cosPaXYOmegaKaToPv, cosPaV0ToCasc, cosPaCascToOmegaKa, cosPaXYV0ToCasc, cosPaXYCascToOmegaKa, // CosPA of PV and mothers + chi2GeoV0, chi2GeoCasc, chi2GeoOmegaKa, // Chi2Geo/NDF + v0Chi2OverNdfm, cascChi2OverNdfm, // Chi2Mass/NDF + chi2NdfTopoV0ToCasc, chi2NdfTopoKaToCasc, chi2NdfTopoKaFromOmegaKaToOmegaKa, chi2NdfTopoCascToOmegaKa, chi2NdfTopoV0ToPv, chi2NdfTopoCascToPv, chi2NdfTopoKaFromOmegaKaToPv, chi2NdfTopoOmegaKaToPv, // Chi2Topo/NDF + ldlV0, ldlCasc, ldlOmegaKa, // ldl + decayLxyLam, decayLxyCasc, decayLxyOmegaKa, // DecaylengthXY + massLam, sigLam, massCasc, sigCasc, massCascrej, sigCascrej, massOmegaKa, sigOmegaKa, // massKF and masserror + ptOmegaKa, ptKaFromCharm, ptOmega, // pT + cosThetaStarKaFromOmegac, cosThetaStarKaFromXic, ctV0, ctCasc, ctOmegaKa, // cosThetaStar & ct + cascAodElement.v0Id(), casc.posTrackId(), casc.negTrackId(), casc.cascadeId(), casc.bachelorId(), trackKaFromCharm.globalIndex()); } - } /// @brief process function w/o centrality selections @@ -2042,11 +2040,11 @@ struct HfCandidateCreatorXic0Omegac0 { 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, - MyKfTracks const& tracks, - MyKfCascTable const& cascades, - KFCascadesLinked const& cascadeLinks, - aod::HfCascLf2Prongs const& candidates) + aod::BCsWithTimestamps const& bcWithTimeStamps, + MyKfTracks const& tracks, + MyKfCascTable const& cascades, + KFCascadesLinked const& cascadeLinks, + aod::HfCascLf2Prongs const& candidates) { runOmegac0Xic0ToOmegaKaCreatorWithKFParticle(collisions, bcWithTimeStamps, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToOmegaK, hFitterStatusToOmegaK, hCandidateCounterToOmegaK, hCascadesCounterToOmegaK); } @@ -2112,11 +2110,11 @@ struct HfCandidateCreatorXic0Omegac0 { 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, - MyKfTracks const& tracks, - MyKfCascTable const& cascades, - KFCascadesLinked const& cascadeLinks, - aod::HfCascLf2Prongs const& candidates) + aod::BCsWithTimestamps const& bcWithTimeStamps, + MyKfTracks const& tracks, + MyKfCascTable const& cascades, + KFCascadesLinked const& cascadeLinks, + aod::HfCascLf2Prongs const& candidates) { runOmegac0Xic0ToOmegaKaCreatorWithKFParticle(collisions, bcWithTimeStamps, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToOmegaK, hFitterStatusToOmegaK, hCandidateCounterToOmegaK, hCascadesCounterToOmegaK); } @@ -2182,11 +2180,11 @@ struct HfCandidateCreatorXic0Omegac0 { 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, - MyKfTracks const& tracks, - MyKfCascTable const& cascades, - KFCascadesLinked const& cascadeLinks, - aod::HfCascLf2Prongs const& candidates) + aod::BCsWithTimestamps const& bcWithTimeStamps, + MyKfTracks const& tracks, + MyKfCascTable const& cascades, + KFCascadesLinked const& cascadeLinks, + aod::HfCascLf2Prongs const& candidates) { runOmegac0Xic0ToOmegaKaCreatorWithKFParticle(collisions, bcWithTimeStamps, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToOmegaK, hFitterStatusToOmegaK, hCandidateCounterToOmegaK, hCascadesCounterToOmegaK); } From cb2a9b29b268e8521f2f2bc68e583a8df8e2bb20 Mon Sep 17 00:00:00 2001 From: FDUEnrich <23210190047@m.fudan.edu.cn> Date: Mon, 30 Jun 2025 09:56:14 +0800 Subject: [PATCH 11/22] Delete useless config --- PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx index f3d0f892a6d..08df8ce9c5a 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx @@ -135,8 +135,6 @@ struct HfCandidateCreatorXic0Omegac0 { Configurable kfConstructMethod{"kfConstructMethod", 2, "KF Construct Method"}; Configurable kfUseV0MassConstraint{"kfUseV0MassConstraint", false, "KF: use Lambda mass constraint"}; Configurable kfUseCascadeMassConstraint{"kfUseCascadeMassConstraint", false, "KF: use Cascade mass constraint"}; - Configurable constrainToPv{"constrainToPv", false, "Constrain particles to PV"}; - Configurable constrainToMother{"constrainToMother", false, "Constrain daughter particles to mother particles"}; Configurable kfResolutionQA{"kfResolutionQA", false, "KF: KFParticle Quality Assurance"}; HfEventSelection hfEvSel; // event selection and monitoring From 64fee4420b1ae5bd0a29f729b1493883d017275f Mon Sep 17 00:00:00 2001 From: FDUEnrich <23210190047@m.fudan.edu.cn> Date: Mon, 30 Jun 2025 20:41:38 +0800 Subject: [PATCH 12/22] Update taskOmegac0ToOmegapi.cxx --- PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx | 42 +++++++++++++++++++----- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx b/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx index 4e9c3ccc412..e8ace2afdbd 100644 --- a/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx +++ b/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx @@ -47,12 +47,30 @@ using namespace o2::analysis; using namespace o2::framework; using namespace o2::framework::expressions; +namespace o2::aod +{ +namespace ml +{ +// collision info +DECLARE_SOA_COLUMN(KfptPiFromOmegac, kfptPiFromOmegac, float); +DECLARE_SOA_COLUMN(KfptOmegac, kfptOmegac, float); +DECLARE_SOA_COLUMN(InvMassCharmBaryon, invMassCharmBaryon, float); +DECLARE_SOA_COLUMN(MlProbOmegac, mlProbOmegac, float); +DECLARE_SOA_COLUMN(Cent, cent, float); +}// namespace ml +DECLARE_SOA_TABLE(HfKfOmegacML, "AOD", "HFKFOMEGACML", + ml::InvMassCharmBaryon, ml::KfptOmegac, ml::KfptPiFromOmegac, ml::MlProbOmegac, ml::Cent); +} + /// Omegac0 analysis task struct HfTaskOmegac0ToOmegapi { + + Produces kfCandMl; // ML inference Configurable applyMl{"applyMl", false, "Flag to apply ML selections"}; Configurable fillCent{"fillCent", false, "Flag to fill centrality information"}; + Configurable fillTree{"fillTree", false, "Fill TTree for local analysis.(Enabled only with ML)"}; Configurable selectionFlagOmegac0{"selectionFlagOmegac0", true, "Select Omegac0 candidates"}; Configurable yCandGenMax{"yCandGenMax", 0.5, "max. gen particle rapidity"}; Configurable yCandRecoMax{"yCandRecoMax", 0.8, "max. cand. rapidity"}; @@ -200,22 +218,30 @@ struct HfTaskOmegac0ToOmegapi { } float cent = evaluateCentralityColl(collision); if constexpr (applyMl) { - registry.fill(HIST("hBdtScoreVsMassVsPtVsYVsCentVsPtPion"), - candidate.mlProbOmegac()[0], + if (fillTree) { + kfCandMl(candidate.invMassCharmBaryon(), + candidate.ptCharmBaryon(), + candidate.kfptPiFromOmegac(), + candidate.mlProbOmegac()[0], + cent); + } else { + registry.fill(HIST("hBdtScoreVsMassVsPtVsYVsCentVsPtPion"), + candidate.mlProbOmegac()[0], candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfRapOmegac(), cent, candidate.kfptPiFromOmegac(), numPvContributors); + } } else { registry.fill(HIST("hMassVsPtVsYVsCentVsPtPion"), - candidate.invMassCharmBaryon(), - candidate.ptCharmBaryon(), - candidate.kfRapOmegac(), - cent, - candidate.kfptPiFromOmegac(), - numPvContributors); + candidate.invMassCharmBaryon(), + candidate.ptCharmBaryon(), + candidate.kfRapOmegac(), + cent, + candidate.kfptPiFromOmegac(), + numPvContributors); } } } From ed9164a662b31687e7ad078b8c728c60d6e6700c Mon Sep 17 00:00:00 2001 From: FDUEnrich <23210190047@m.fudan.edu.cn> Date: Mon, 30 Jun 2025 20:43:08 +0800 Subject: [PATCH 13/22] Update SelectorCuts.h --- PWGHF/Core/SelectorCuts.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/PWGHF/Core/SelectorCuts.h b/PWGHF/Core/SelectorCuts.h index 18aab0bad6f..f0a9ad9034e 100644 --- a/PWGHF/Core/SelectorCuts.h +++ b/PWGHF/Core/SelectorCuts.h @@ -702,6 +702,40 @@ static const std::vector labelsPt = { static const std::vector labelsCutVar = {"pT pi from Omegac"}; } // namespace hf_cuts_omegac_to_omega_pi +namespace hf_cuts_omegacxic_to_omega_ka +{ +static constexpr int NBinsPt = 4; +static constexpr int NCutVars = 1; +// 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] = { + + 1.0, + 2.0, + 4.0, + 6.0, + 12.0}; + +auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; + +// default values for the cuts +// pi_pT +constexpr double Cuts[NBinsPt][NCutVars] = {{0.2}, /* 1 < pt < 2 */ + {0.2}, /* 2 < pt < 4 */ + {0.6}, /* 4 < pt < 6 */ + {0.8}}; /* 6 < pt < 12 */ + +// row labels +static const std::vector labelsPt = { + "pT bin 0", + "pT bin 1", + "pT bin 2", + "pT bin 3"}; + +// column labels +static const std::vector labelsCutVar = {"pT Ka from Omegac"}; +} // namespace hf_cuts_omegacxic_to_omega_ka + namespace hf_cuts_xic_to_p_k_pi { static constexpr int NBinsPt = 10; From a45fe7292c74fdece74235f215f8ca4e98e6a14b Mon Sep 17 00:00:00 2001 From: FDUEnrich <23210190047@m.fudan.edu.cn> Date: Mon, 30 Jun 2025 20:47:14 +0800 Subject: [PATCH 14/22] Update candidateCreatorXic0Omegac0.cxx --- PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx index 08df8ce9c5a..9a2fd13decb 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx @@ -1717,7 +1717,7 @@ struct HfCandidateCreatorXic0Omegac0 { 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.signed1Pt() > 0 ? +1 : -1; + int KaFromOmegaCharge = trackKaFromOmega.sign() > 0 ? +1 : -1; int signOmega = casc.sign() > 0 ? +1 : -1; KFPTrack kfpTrackKaFromCharm = createKFPTrackFromTrack(trackKaFromCharm); From 7f91527adc9b8db4c677e9ccfe24e7f10ff33684 Mon Sep 17 00:00:00 2001 From: FDUEnrich <23210190047@m.fudan.edu.cn> Date: Mon, 30 Jun 2025 20:49:00 +0800 Subject: [PATCH 15/22] Update candidateSelectorOmegac0Xic0ToOmegaKa.cxx --- .../candidateSelectorOmegac0Xic0ToOmegaKa.cxx | 129 +++++------------- 1 file changed, 35 insertions(+), 94 deletions(-) diff --git a/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx b/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx index f6c7c4fdb05..7a6a3dc9dbc 100644 --- a/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx +++ b/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx @@ -60,6 +60,10 @@ struct HfCandidateSelectorToOmegaKa { Configurable cascadeMassWindow{"cascadeMassWindow", 0.01, "Cascade mass window"}; Configurable applyTrkSelLf{"applyTrkSelLf", true, "Apply track selection for LF daughters"}; + // topological cuts + Configurable> binsPt{"binsPt", std::vector{hf_cuts_omegacxic_to_omega_ka::vecBinsPt}, "pT bin limits"}; + Configurable> cuts{"cuts", {hf_cuts_omegacxic_to_omega_ka::Cuts[0], hf_cuts_omegacxic_to_omega_ka::NBinsPt, hf_cuts_omegacxic_to_omega_ka::NCutVars, hf_cuts_omegacxic_to_omega_ka::labelsPt, hf_cuts_omegacxic_to_omega_ka::labelsCutVar}, "OmegaC0 candidate selection per pT bin"}; + // limit charm baryon invariant mass spectrum Configurable invMassCharmBaryonMin{"invMassCharmBaryonMin", 2.0, "Lower limit invariant mass spectrum charm baryon"}; // Xic0:2.470 Omegac0:2.695 Configurable invMassCharmBaryonMax{"invMassCharmBaryonMax", 3.1, "Upper limit invariant mass spectrum charm baryon"}; @@ -156,27 +160,6 @@ struct HfCandidateSelectorToOmegaKa { Configurable cosPaV0ToCascMin{"cosPaV0ToCascMin", 0.99, "Minimum cosPA of V0<-cascade"}; } KfconfigurableGroup; - // topological cuts - // Configurable> binsPt{"binsPt", std::vector{hf_cuts_omegaKa_to_omega_pi::vecBinsPt}, "pT bin limits"}; - // Configurable> cuts{"cuts", {hf_cuts_omegaKa_to_omega_pi::Cuts[0], hf_cuts_omegaKa_to_omega_pi::NBinsPt, hf_cuts_omegaKa_to_omega_pi::NCutVars, hf_cuts_omegaKa_to_omega_pi::labelsPt, hf_cuts_omegaKa_to_omega_pi::labelsCutVar}, "OmegaKa candidate selection per pT bin"}; - // ML inference - // Configurable applyMl{"applyMl", false, "Flag to apply ML selections"}; - // Configurable> binsPtMl{"binsPtMl", std::vector{hf_cuts_ml::vecBinsPt}, "pT bin limits for ML application"}; - // Configurable> cutDirMl{"cutDirMl", std::vector{hf_cuts_ml::vecCutDir}, "Whether to reject score values greater or smaller than the threshold"}; - // Configurable> cutsMl{"cutsMl", {hf_cuts_ml::Cuts[0], hf_cuts_ml::NBinsPt, hf_cuts_ml::NCutScores, hf_cuts_ml::labelsPt, hf_cuts_ml::labelsCutScore}, "ML selections per pT bin"}; - // Configurable nClassesMl{"nClassesMl", static_cast(hf_cuts_ml::NCutScores), "Number of classes in ML model"}; - // Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature1", "feature2"}, "Names of ML model input features"}; - // CCDB configuration - // Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - // Configurable> modelPathsCCDB{"modelPathsCCDB", std::vector{"EventFiltering/PWGHF/BDTOmegaKa"}, "Paths of models on CCDB"}; - // Configurable> onnxFileNames{"onnxFileNames", std::vector{"ModelHandler_onnx_OmegaKaToOmegaKa.onnx"}, "ONNX file names for each pT bin (if not from CCDB full path)"}; - // Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB"}; - // Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; - - // o2::analysis::HfMlResponseOmegaKaToOmegaKa hfMlResponse; - // std::vector outputMlOmegaKa = {}; - // o2::ccdb::CcdbApi ccdbApi; - TrackSelectorPi selectorPion; TrackSelectorPr selectorProton; TrackSelectorKa selectorKaon; @@ -261,48 +244,38 @@ struct HfCandidateSelectorToOmegaKa { registry.add("hSeldecayLenOmegaKa_Casc_V0", "hSeldecayLenOmegaKa_Casc_V0;status;entries", {HistType::kTH1D, {axisSel}}); registry.add("hSelcosPaCascToOmegaKa_V0ToCasc", "hSelcosPaCascToOmegaKa_V0ToCasc;status;entries", {HistType::kTH1D, {axisSel}}); registry.add("hInvMassXiMinus_rej_cut", "hInvMassXiMinus_rej_cut", kTH1D, {{1000, 1.25f, 1.65f}}); - - // if (applyMl) { - // registry.add("hBDTScoreTest1", "hBDTScoreTest1", {HistType::kTH1D, {{100, 0.0f, 1.0f, "score"}}}); - // hfMlResponse.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl); - // if (loadModelsFromCCDB) { - // ccdbApi.init(ccdbUrl); - // hfMlResponse.setModelPathsCCDB(onnxFileNames, ccdbApi, modelPathsCCDB, timestampCCDB); - // } else { - // hfMlResponse.setModelPathsLocal(onnxFileNames); - // } - // hfMlResponse.cacheInputFeaturesIndices(namesInputFeatures); - // hfMlResponse.init(); - // } } // for pT-dependent cuts (other selections will move into this in futrue) // \param hfCandOmegaKa is candidate // return true if candidate passes all cuts - // template - // bool selectionTopol(const T1& hfCandOmegaKa) - //{ - // auto candpT = hfCandOmegaKa.ptCharmBaryon(); - // auto KaPtFromOmegaKa = hfCandOmegaKa.ptKaFromCharmBaryon(); - // int pTBin = findBin(binsPt, candpT); - // if (pTBin == -1) { - // return false; - // } - - // check that the candidate pT is within the analysis range - // if (candpT <= ptCandMin || candpT >= ptCandMax) { - // return false; - // } - - // check that the candidate pT is within the analysis range - // if (pionPtFromOmegaKa < cuts->get(pTBin, "pT pi from OmegaKa")) { - // registry.fill(HIST("hSelPtKaFromCharm"), 0); - // return false; - // } else { - // registry.fill(HIST("hSelPtKaFromCharm"), 1); - // } - - // return true; - //} // end template + template + bool selectionTopol(const T1& hfCandOmegaKa) + { + auto candpT = hfCandOmegaKa.kfPtOmegaKa(); + auto KaPtFromOmegaKa = hfCandOmegaKa.kfPtKaFromOmegaKa(); + int pTBin = findBin(binsPt, candpT); + if (pTBin == -1) { + return false; + } + + // check that the candidate pT is within the analysis range + if (candpT <= ptCandMin || candpT >= ptCandMax) { + registry.fill(HIST("hSelPtOmegaKa"), 0); + return false; + } else { + registry.fill(HIST("hSelPtOmegaKa"), 1); + } + + // check that the candidate pT is within the analysis range + if (KaPtFromOmegaKa < cuts->get(pTBin, "pT ka from OmegaKa")) { + registry.fill(HIST("hSelPtKaFromCharm"), 0); + return false; + } else { + registry.fill(HIST("hSelPtKaFromCharm"), 1); + } + + return true; + } // end template void process(aod::HfCandToOmegaKaKf const& candidates, TracksSel const& tracks, @@ -347,18 +320,9 @@ struct HfCandidateSelectorToOmegaKa { } // pt-dependent selection - // if (!selectionTopol(candidate)) { - // resultSelections = false; - // hfSelToOmegaKa(statusPidLambda, statusPidCascade, statusPidCharmBaryon, statusInvMassLambda, statusInvMassCascade, statusInvMassCharmBaryon, resultSelections, infoTpcStored, infoTofStored, - // trackKaFromCharm.tpcNSigmaPi(), trackKaFromCasc.tpcNSigmaKa(), trackPiFromLam.tpcNSigmaPi(), trackPrFromLam.tpcNSigmaPr(), - // trackKaFromCharm.tofNSigmaPi(), trackKaFromCasc.tofNSigmaKa(), trackPiFromLam.tofNSigmaPi(), trackPrFromLam.tofNSigmaPr()); - // if constexpr (ConstructMethod == hf_cand_casc_lf::ConstructMethod::KfParticle) { - // if (applyMl) { - // hfMlSelToOmegaKa(outputMlOmegaKa); - // } - // } - // continue; - //} + if (!selectionTopol(candidate)) { + resultSelections = false; + } // eta selection double etaV0DauPr = candidate.etaV0DauPr(); @@ -466,9 +430,6 @@ struct HfCandidateSelectorToOmegaKa { } if (std::abs(candidate.kfPtKaFromOmegaKa()) < ptKaFromCharmBaryonMin) { resultSelections = false; - registry.fill(HIST("hSelPtKaFromCharm"), 0); - } else { - registry.fill(HIST("hSelPtKaFromCharm"), 1); } // Competing Ξ rejection(KF) Try to reject cases in which the candidate has a an inv. mass compatibler to Xi (bachelor pion) instead of Omega (bachelor kaon) @@ -482,14 +443,6 @@ struct HfCandidateSelectorToOmegaKa { } } - // OmegaKa Pt selection - if (std::abs(candidate.kfPtOmegaKa()) < ptCandMin || std::abs(candidate.kfPtOmegaKa()) > ptCandMax) { - resultSelections = false; - registry.fill(HIST("hSelPtOmegaKa"), 0); - } else { - registry.fill(HIST("hSelPtOmegaKa"), 1); - } - // v0&Casc&OmegaKa ldl selection if ((candidate.v0ldl() < KfconfigurableGroup.v0LdlMin) || (candidate.cascldl() < KfconfigurableGroup.cascLdlMin) || (candidate.omegaKaldl() > KfconfigurableGroup.omegaKaLdlMax)) { resultSelections = false; @@ -690,18 +643,6 @@ struct HfCandidateSelectorToOmegaKa { registry.fill(HIST("hSelMassCharmBaryon"), 0); resultSelections = false; } - // ML selections - // if constexpr (ConstructMethod == hf_cand_casc_lf::ConstructMethod::KfParticle) { - // if (applyMl) { - // bool isSelectedMlOmegaKa = false; - // std::vector inputFeaturesOmegaKa = hfMlResponse.getInputFeatures(candidate, trackPiFromLam, trackKaFromCasc, trackKaFromCharm); - // isSelectedMlOmegaKa = hfMlResponse.isSelectedMl(inputFeaturesOmegaKa, ptCand, outputMlOmegaKa); - // if (isSelectedMlOmegaKa) { - // registry.fill(HIST("hBDTScoreTest1"), outputMlOmegaKa[0]); - // } - // hfMlSelToOmegaKa(outputMlOmegaKa); - // } - //} hfSelToOmegaKaKf(statusPidLambda, statusPidCascade, statusPidCharmBaryon, statusInvMassLambda, statusInvMassCascade, statusInvMassCharmBaryon, resultSelections, infoTpcStored, infoTofStored, trackKaFromCharm.tpcNSigmaKa(), trackKaFromCasc.tpcNSigmaKa(), trackPiFromLam.tpcNSigmaPi(), trackPrFromLam.tpcNSigmaPr(), From 062a1366398eb1f252ccace5408a502d4c0a342c Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 30 Jun 2025 12:49:30 +0000 Subject: [PATCH 16/22] Please consider the following formatting changes --- PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx | 34 ++++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx b/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx index e8ace2afdbd..a39836c406e 100644 --- a/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx +++ b/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx @@ -57,10 +57,10 @@ DECLARE_SOA_COLUMN(KfptOmegac, kfptOmegac, float); DECLARE_SOA_COLUMN(InvMassCharmBaryon, invMassCharmBaryon, float); DECLARE_SOA_COLUMN(MlProbOmegac, mlProbOmegac, float); DECLARE_SOA_COLUMN(Cent, cent, float); -}// namespace ml +} // namespace ml DECLARE_SOA_TABLE(HfKfOmegacML, "AOD", "HFKFOMEGACML", ml::InvMassCharmBaryon, ml::KfptOmegac, ml::KfptPiFromOmegac, ml::MlProbOmegac, ml::Cent); -} +} // namespace o2::aod /// Omegac0 analysis task @@ -219,29 +219,29 @@ struct HfTaskOmegac0ToOmegapi { float cent = evaluateCentralityColl(collision); if constexpr (applyMl) { if (fillTree) { - kfCandMl(candidate.invMassCharmBaryon(), - candidate.ptCharmBaryon(), - candidate.kfptPiFromOmegac(), - candidate.mlProbOmegac()[0], - cent); + kfCandMl(candidate.invMassCharmBaryon(), + candidate.ptCharmBaryon(), + candidate.kfptPiFromOmegac(), + candidate.mlProbOmegac()[0], + cent); } else { registry.fill(HIST("hBdtScoreVsMassVsPtVsYVsCentVsPtPion"), - candidate.mlProbOmegac()[0], + candidate.mlProbOmegac()[0], + candidate.invMassCharmBaryon(), + candidate.ptCharmBaryon(), + candidate.kfRapOmegac(), + cent, + candidate.kfptPiFromOmegac(), + numPvContributors); + } + } else { + registry.fill(HIST("hMassVsPtVsYVsCentVsPtPion"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfRapOmegac(), cent, candidate.kfptPiFromOmegac(), numPvContributors); - } - } else { - registry.fill(HIST("hMassVsPtVsYVsCentVsPtPion"), - candidate.invMassCharmBaryon(), - candidate.ptCharmBaryon(), - candidate.kfRapOmegac(), - cent, - candidate.kfptPiFromOmegac(), - numPvContributors); } } } From 447d8e4719f3905237f5a46fb8ad25a13aec653d Mon Sep 17 00:00:00 2001 From: FDUEnrich <23210190047@m.fudan.edu.cn> Date: Tue, 1 Jul 2025 19:58:18 +0800 Subject: [PATCH 17/22] Update PWGHF/DataModel/CandidateReconstructionTables.h Co-authored-by: Fabrizio --- PWGHF/DataModel/CandidateReconstructionTables.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index d9ca2b173ba..e924140bdf2 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -1445,7 +1445,7 @@ DECLARE_SOA_COLUMN(KfRapOmegaKa, kfRapOmegaKa, float); DECLARE_SOA_COLUMN(KfPtKaFromOmegaKa, kfPtKaFromOmegaKa, float); DECLARE_SOA_COLUMN(KfPtOmega, kfPtOmega, float); DECLARE_SOA_COLUMN(KfPtOmegaKa, kfPtOmegaKa, float); -DECLARE_SOA_COLUMN(CosThetaStarKaFromOemgac, cosThetaStarKaFromOemgac, float); +DECLARE_SOA_COLUMN(CosThetaStarKaFromOmegac, cosThetaStarKaFromOmegac, float); DECLARE_SOA_COLUMN(CosThetaStarKaFromXic, cosThetaStarKaFromXic, float); DECLARE_SOA_COLUMN(KfDcaXYPiFromOmegac, kfDcaXYPiFromOmegac, float); DECLARE_SOA_COLUMN(KfDcaXYPiFromXic, kfDcaXYPiFromXic, float); From 96cb1b0a4b6f0adc348774fe68554b9a92dd8404 Mon Sep 17 00:00:00 2001 From: FDUEnrich <23210190047@m.fudan.edu.cn> Date: Wed, 2 Jul 2025 09:52:47 +0800 Subject: [PATCH 18/22] Update candidateCreatorXic0Omegac0.cxx --- PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx index 9a2fd13decb..b287e2a42fe 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx @@ -1717,8 +1717,8 @@ struct HfCandidateCreatorXic0Omegac0 { 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 - int KaFromOmegaCharge = trackKaFromOmega.sign() > 0 ? +1 : -1; - int signOmega = casc.sign() > 0 ? +1 : -1; + auto KaFromOmegaCharge = trackKaFromOmega.sign(); + auto signOmega = casc.sign(); KFPTrack kfpTrackKaFromCharm = createKFPTrackFromTrack(trackKaFromCharm); KFPTrack kfpTrackKaFromOmega = createKFPTrackFromTrack(trackKaFromOmega); From a5f0d71da39947c5d00dbca3cfebc11f1cbfaf4f Mon Sep 17 00:00:00 2001 From: FDUEnrich <23210190047@m.fudan.edu.cn> Date: Wed, 2 Jul 2025 09:55:56 +0800 Subject: [PATCH 19/22] Update candidateSelectorOmegac0Xic0ToOmegaKa.cxx --- PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx b/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx index 7a6a3dc9dbc..5dd6d356990 100644 --- a/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx +++ b/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx @@ -179,7 +179,7 @@ struct HfCandidateSelectorToOmegaKa { const AxisSpec thnAxisPt{thnConfigAxisPt, "#it{p}_{T} (GeV/#it{c})"}; const AxisSpec thnAxisPtKaon{thnConfigAxisPtKaon, "Pt of Kaon from Omegac0."}; std::vector axes = {thnAxisMass, thnAxisPt, thnAxisPtKaon}; - registry.add("hMassVsPtVsPtKaon", "Thn for Omegac0 or Xic candidates with InvmassOmegaKa&pT&pTKa", HistType::kTHnSparseD, axes); + registry.add("hMassVsPtVsPtKaon", "Thn for Omegac0 or Xic candidates with InvmassOmegaKa&pT&pTKa", HistType::kTHnSparseF, axes); registry.get(HIST("hMassVsPtVsPtKaon"))->Sumw2(); selectorPion.setRangePtTpc(ptPiPidTpcMin, ptPiPidTpcMax); From 7babec9cda5d5dab415aaf51647814fec695ef34 Mon Sep 17 00:00:00 2001 From: FDUEnrich <23210190047@m.fudan.edu.cn> Date: Wed, 2 Jul 2025 10:14:14 +0800 Subject: [PATCH 20/22] Update candidateCreatorXic0Omegac0.cxx --- PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx index b287e2a42fe..f2c02466d1d 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx @@ -152,7 +152,7 @@ struct HfCandidateCreatorXic0Omegac0 { using MyV0Table = soa::Join; using MyLFTracksWCov = soa::Join; - using MyKfTracks = soa::Join; + using MyKfTracks = soa::Join; using MyKfCascTable = soa::Join; using KFCascadesLinked = soa::Join; From dd1e5cedc6ba5461f4800aad566438a5c0bb8fe0 Mon Sep 17 00:00:00 2001 From: FDUEnrich <23210190047@m.fudan.edu.cn> Date: Wed, 2 Jul 2025 11:27:25 +0800 Subject: [PATCH 21/22] Update candidateCreatorXic0Omegac0.cxx --- PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx index f2c02466d1d..2042399c372 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx @@ -152,7 +152,7 @@ struct HfCandidateCreatorXic0Omegac0 { using MyV0Table = soa::Join; using MyLFTracksWCov = soa::Join; - using MyKfTracks = soa::Join; + using MyKfTracks = soa::Join; using MyKfCascTable = soa::Join; using KFCascadesLinked = soa::Join; From 2c35a1b413975390ea5a290889524bc3fb2869de Mon Sep 17 00:00:00 2001 From: FDUEnrich <23210190047@m.fudan.edu.cn> Date: Wed, 2 Jul 2025 11:41:16 +0800 Subject: [PATCH 22/22] Update CandidateReconstructionTables.h --- PWGHF/DataModel/CandidateReconstructionTables.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index e924140bdf2..b1051842f1a 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -1732,7 +1732,7 @@ DECLARE_SOA_TABLE(HfCandToOmegaKaKf, "AOD", "HFCANDTOOMEGAKAKF", hf_cand_xic0_omegac0::DecLenV0, hf_cand_xic0_omegac0::DecLenCascade, hf_cand_xic0_omegac0::DecLenCharmBaryon, hf_cand_xic0_omegac0::InvMassLambda, hf_cand_xic0_omegac0::InvMassLambdaErr, hf_cand_xic0_omegac0::InvMassCascade, hf_cand_xic0_omegac0::InvMassCascadeErr, hf_cand_xic0_omegac0::InvMassCascadeRej, hf_cand_xic0_omegac0::InvMassCascadeRejErr, hf_cand_xic0_omegac0::InvMassCharmBaryon, hf_cand_xic0_omegac0::InvMassCharmBaryonErr, hf_cand_xic0_omegac0::KfPtOmegaKa, hf_cand_xic0_omegac0::KfPtKaFromOmegaKa, hf_cand_xic0_omegac0::KfPtOmega, - hf_cand_xic0_omegac0::CosThetaStarKaFromOemgac, hf_cand_xic0_omegac0::CosThetaStarKaFromXic, hf_cand_xic0_omegac0::CTauV0, hf_cand_xic0_omegac0::CTauCascade, hf_cand_xic0_omegac0::CTauOmegaKa, + hf_cand_xic0_omegac0::CosThetaStarKaFromOmegac, hf_cand_xic0_omegac0::CosThetaStarKaFromXic, hf_cand_xic0_omegac0::CTauV0, hf_cand_xic0_omegac0::CTauCascade, hf_cand_xic0_omegac0::CTauOmegaKa, hf_cand_xic0_omegac0::V0Id, v0data::PosTrackId, v0data::NegTrackId, hf_cand_xic0_omegac0::CascadeId, cascdata::BachelorId, hf_cand_xic0_omegac0::BachelorFromCharmBaryonId); DECLARE_SOA_TABLE(HfCandToXiPiKf, "AOD", "HFCANDTOXIPIKF", //!