From 04ddea4911bd4496b3248d3483dd6c19a17f8ced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Mon, 14 Jul 2025 14:40:48 +0200 Subject: [PATCH 01/13] Copy derivedDataCreatorBplusToD0Pi --- PWGHF/TableProducer/CMakeLists.txt | 16 +- .../derivedDataCreatorXicToXiPiPi.cxx | 453 ++++++++++++++++++ 2 files changed, 464 insertions(+), 5 deletions(-) create mode 100644 PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx diff --git a/PWGHF/TableProducer/CMakeLists.txt b/PWGHF/TableProducer/CMakeLists.txt index 1ffd2a67ab0..b831d2f9532 100644 --- a/PWGHF/TableProducer/CMakeLists.txt +++ b/PWGHF/TableProducer/CMakeLists.txt @@ -320,18 +320,24 @@ o2physics_add_dpl_workflow(derived-data-creator-dplus-to-pi-k-pi PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(derived-data-creator-dstar-to-d0-pi + SOURCES derivedDataCreatorDstarToD0Pi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(derived-data-creator-lc-to-p-k-pi SOURCES derivedDataCreatorLcToPKPi.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(derived-data-creator-dstar-to-d0-pi - SOURCES derivedDataCreatorDstarToD0Pi.cxx +o2physics_add_dpl_workflow(derived-data-creator-xic-to-xi-pi-pi + SOURCES derivedDataCreatorXicToXiPiPi.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + # Converters o2physics_add_dpl_workflow(converter-dstar-indices - SOURCES converterDstarIndices.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + SOURCES converterDstarIndices.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx new file mode 100644 index 00000000000..7842444e3f4 --- /dev/null +++ b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx @@ -0,0 +1,453 @@ +// 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 derivedDataCreatorXicToXiPiPi.cxx +/// \brief Producer of derived tables of Ξc± → (Ξ∓ → (Λ → p π∓) π∓) π± π± candidates, collisions and MC particles +/// \note Based on derivedDataCreatorBplusToD0Pi.cxx +/// +/// \author Vít Kučera , Inha University + +#include "PWGHF/Core/DecayChannels.h" +#include "PWGHF/Core/HfHelper.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/DataModel/DerivedTables.h" +#include "PWGHF/Utils/utilsDerivedData.h" +#include "PWGHF/Utils/utilsPid.h" +#include "PWGLF/DataModel/mcCentrality.h" + +#include "Common/Core/RecoDecay.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/Multiplicity.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::aod::pid_tpc_tof_utils; +using namespace o2::analysis::hf_derived; +using namespace o2::hf_decay::hf_cand_beauty; + +/// Writes the full information in an output TTree +struct HfDerivedDataCreatorBplusToD0Pi { + HfProducesDerivedData< + o2::aod::HfBplusBases, + o2::aod::HfBplusCollBases, + o2::aod::HfBplusCollIds, + o2::aod::HfBplusMcCollBases, + o2::aod::HfBplusMcCollIds, + o2::aod::HfBplusMcRCollIds, + o2::aod::HfBplusPBases, + o2::aod::HfBplusPIds> + rowsCommon; + // Candidates + Produces rowCandidatePar; + Produces rowCandidateParD0; + Produces rowCandidateParE; + Produces rowCandidateSel; + Produces rowCandidateMl; + Produces rowCandidateMlD0; + Produces rowCandidateId; + Produces rowCandidateMc; + + // Switches for filling tables + HfConfigurableDerivedData confDerData; + Configurable fillCandidatePar{"fillCandidatePar", true, "Fill candidate parameters"}; + Configurable fillCandidateParD0{"fillCandidateParD0", true, "Fill D0 candidate parameters"}; + Configurable fillCandidateParE{"fillCandidateParE", true, "Fill candidate extended parameters"}; + Configurable fillCandidateSel{"fillCandidateSel", true, "Fill candidate selection flags"}; + Configurable fillCandidateMl{"fillCandidateMl", true, "Fill candidate selection ML scores"}; + Configurable fillCandidateMlD0{"fillCandidateMlD0", true, "Fill D0 candidate selection ML scores"}; + Configurable fillCandidateId{"fillCandidateId", true, "Fill original indices from the candidate table"}; + Configurable fillCandidateMc{"fillCandidateMc", true, "Fill candidate MC info"}; + // Parameters for production of training samples + Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"}; + Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; + + HfHelper hfHelper; + SliceCache cache; + static constexpr double mass{o2::constants::physics::MassBPlus}; + + using CollisionsWCentMult = soa::Join; + using CollisionsWMcCentMult = soa::Join; + using TracksWPid = soa::Join; + using SelectedCandidates = soa::Filtered>; + using SelectedCandidatesMc = soa::Filtered>; + using SelectedCandidatesMl = soa::Filtered>; + using SelectedCandidatesMcMl = soa::Filtered>; + using MatchedGenCandidatesMc = soa::Filtered>; + using TypeMcCollisions = soa::Join; + using THfCandDaughtersMl = soa::Join; + + Filter filterSelectCandidates = (aod::hf_sel_candidate_bplus::isSelBplusToD0Pi & static_cast(BIT(aod::SelectionStep::RecoMl - 1))) != 0; + Filter filterMcGenMatching = nabs(aod::hf_cand_bplus::flagMcMatchGen) == static_cast(DecayChannelMain::BplusToD0Pi); + + Preslice candidatesPerCollision = aod::hf_cand::collisionId; + Preslice candidatesMcPerCollision = aod::hf_cand::collisionId; + Preslice candidatesMlPerCollision = aod::hf_cand::collisionId; + Preslice candidatesMcMlPerCollision = aod::hf_cand::collisionId; + Preslice mcParticlesPerMcCollision = aod::mcparticle::mcCollisionId; + + // trivial partitions for all candidates to allow "->sliceByCached" inside processCandidates + Partition candidatesAll = aod::hf_sel_candidate_bplus::isSelBplusToD0Pi >= 0; + Partition candidatesMcAll = aod::hf_sel_candidate_bplus::isSelBplusToD0Pi >= 0; + Partition candidatesMlAll = aod::hf_sel_candidate_bplus::isSelBplusToD0Pi >= 0; + Partition candidatesMcMlAll = aod::hf_sel_candidate_bplus::isSelBplusToD0Pi >= 0; + // partitions for signal and background + Partition candidatesMcSig = nabs(aod::hf_cand_bplus::flagMcMatchRec) == static_cast(DecayChannelMain::BplusToD0Pi); + Partition candidatesMcBkg = nabs(aod::hf_cand_bplus::flagMcMatchRec) != static_cast(DecayChannelMain::BplusToD0Pi); + Partition candidatesMcMlSig = nabs(aod::hf_cand_bplus::flagMcMatchRec) == static_cast(DecayChannelMain::BplusToD0Pi); + Partition candidatesMcMlBkg = nabs(aod::hf_cand_bplus::flagMcMatchRec) != static_cast(DecayChannelMain::BplusToD0Pi); + + void init(InitContext const&) + { + std::array doprocess{doprocessData, doprocessMcSig, doprocessMcBkg, doprocessMcAll, doprocessDataMl, doprocessMcMlSig, doprocessMcMlBkg, doprocessMcMlAll, doprocessMcGenOnly}; + if (std::accumulate(doprocess.begin(), doprocess.end(), 0) != 1) { + LOGP(fatal, "Only one process function can be enabled at a time."); + } + rowsCommon.init(confDerData); + } + + template + void fillTablesCandidate(const T& candidate, const U& prongCharm, const V& prongBachelor, int candFlag, double invMass, + double ct, double y, int8_t flagMc, int8_t origin, float mlScore, const std::vector& mlScoresCharm) + { + rowsCommon.fillTablesCandidate(candidate, invMass, y); + if (fillCandidatePar) { + rowCandidatePar( + candidate.chi2PCA(), + candidate.cpa(), + candidate.cpaXY(), + candidate.decayLength(), + candidate.decayLengthXY(), + candidate.decayLengthNormalised(), + candidate.decayLengthXYNormalised(), + candidate.ptProng0(), + candidate.ptProng1(), + candidate.impactParameter0(), + candidate.impactParameter1(), + candidate.impactParameterNormalised0(), + candidate.impactParameterNormalised1(), + prongBachelor.tpcNSigmaPi(), + prongBachelor.tofNSigmaPi(), + prongBachelor.tpcTofNSigmaPi(), + prongBachelor.tpcNSigmaKa(), + prongBachelor.tofNSigmaKa(), + prongBachelor.tpcTofNSigmaKa(), + candidate.maxNormalisedDeltaIP(), + candidate.impactParameterProduct()); + } + if (fillCandidateParD0) { + std::array, 2>, 2> sigmas{}; // PID nSigma [Expected][Hypothesis][TPC/TOF/TPC+TOF] + if (candFlag == 0) { + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion], prongCharm, 0, Pi) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon], prongCharm, 0, Ka) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion], prongCharm, 1, Pi) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon], prongCharm, 1, Ka) + } else if (candFlag == 1) { + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion], prongCharm, 1, Pi) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon], prongCharm, 1, Ka) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion], prongCharm, 0, Pi) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon], prongCharm, 0, Ka) + } + rowCandidateParD0( + prongCharm.cpa(), + prongCharm.decayLength(), + prongCharm.impactParameter0(), + prongCharm.impactParameter1(), + prongCharm.impactParameterProduct(), + sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion][0], + sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion][1], + sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion][2], + sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon][0], + sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon][1], + sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon][2], + sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion][0], + sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion][1], + sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion][2], + sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon][0], + sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon][1], + sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon][2]); + } + if (fillCandidateParE) { + rowCandidateParE( + candidate.xSecondaryVertex(), + candidate.ySecondaryVertex(), + candidate.zSecondaryVertex(), + candidate.errorDecayLength(), + candidate.errorDecayLengthXY(), + candidate.rSecondaryVertex(), + RecoDecay::p(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()), + candidate.pxProng1(), + candidate.pyProng1(), + candidate.pzProng1(), + candidate.errorImpactParameter1(), + hfHelper.cosThetaStarBplus(candidate), + ct); + } + if (fillCandidateSel) { + rowCandidateSel( + BIT(candFlag)); + } + if (fillCandidateMl) { + rowCandidateMl( + mlScore); + } + if (fillCandidateMlD0) { + rowCandidateMlD0( + mlScoresCharm); + } + if (fillCandidateId) { + rowCandidateId( + candidate.collisionId(), + prongCharm.prong0Id(), + prongCharm.prong1Id(), + candidate.prong1Id()); + } + if (fillCandidateMc) { + rowCandidateMc( + flagMc, + origin); + } + } + + template + void processCandidates(CollType const& collisions, + Partition& candidates, + CandCharmType const&, + TracksWPid const&, + aod::BCs const&) + { + // Fill collision properties + if constexpr (isMc) { + if (confDerData.fillMcRCollId) { + rowsCommon.matchedCollisions.clear(); + } + } + auto sizeTableColl = collisions.size(); + rowsCommon.reserveTablesColl(sizeTableColl); + for (const auto& collision : collisions) { + auto thisCollId = collision.globalIndex(); + auto candidatesThisColl = candidates->sliceByCached(aod::hf_cand::collisionId, thisCollId, cache); // FIXME + auto sizeTableCand = candidatesThisColl.size(); + LOGF(debug, "Rec. collision %d has %d candidates", thisCollId, sizeTableCand); + // Skip collisions without HF candidates (and without HF particles in matched MC collisions if saving indices of reconstructed collisions matched to MC collisions) + bool mcCollisionHasMcParticles{false}; + if constexpr (isMc) { + mcCollisionHasMcParticles = confDerData.fillMcRCollId && collision.has_mcCollision() && rowsCommon.hasMcParticles[collision.mcCollisionId()]; + LOGF(debug, "Rec. collision %d has MC collision %d with MC particles? %s", thisCollId, collision.mcCollisionId(), mcCollisionHasMcParticles ? "yes" : "no"); + } + if (sizeTableCand == 0 && (!confDerData.fillMcRCollId || !mcCollisionHasMcParticles)) { + LOGF(debug, "Skipping rec. collision %d", thisCollId); + continue; + } + LOGF(debug, "Filling rec. collision %d at derived index %d", thisCollId, rowsCommon.rowCollBase.lastIndex() + 1); + rowsCommon.fillTablesCollision(collision); + + // Fill candidate properties + rowsCommon.reserveTablesCandidates(sizeTableCand); + reserveTable(rowCandidatePar, fillCandidatePar, sizeTableCand); + reserveTable(rowCandidateParD0, fillCandidateParD0, sizeTableCand); + reserveTable(rowCandidateParE, fillCandidateParE, sizeTableCand); + reserveTable(rowCandidateSel, fillCandidateSel, sizeTableCand); + reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand); + reserveTable(rowCandidateMlD0, fillCandidateMlD0, sizeTableCand); + reserveTable(rowCandidateId, fillCandidateId, sizeTableCand); + if constexpr (isMc) { + reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand); + } + int8_t flagMcRec = 0, origin = 0; + for (const auto& candidate : candidatesThisColl) { + if constexpr (isMl) { + if (!TESTBIT(candidate.isSelBplusToD0Pi(), aod::SelectionStep::RecoMl)) { + continue; + } + } + if constexpr (isMc) { + flagMcRec = candidate.flagMcMatchRec(); + origin = candidate.originMcRec(); + if constexpr (onlyBkg) { + if (std::abs(flagMcRec) == DecayChannelMain::BplusToD0Pi) { + continue; + } + if (downSampleBkgFactor < 1.) { + float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { + continue; + } + } + } + if constexpr (onlySig) { + if (std::abs(flagMcRec) != DecayChannelMain::BplusToD0Pi) { + continue; + } + } + } + auto prongCharm = candidate.template prong0_as(); + auto prongBachelor = candidate.template prong1_as(); + double ct = hfHelper.ctBplus(candidate); + double y = hfHelper.yBplus(candidate); + float massBplusToD0Pi = hfHelper.invMassBplusToD0Pi(candidate); + float mlScoreBplusToD0Pi{-1.f}; + std::vector mlScoresD0; + bool isD0 = prongBachelor.sign() < 0; + if (isD0) { // is D0 + std::copy(prongCharm.mlProbD0().begin(), prongCharm.mlProbD0().end(), std::back_inserter(mlScoresD0)); + } else { // is D0bar + std::copy(prongCharm.mlProbD0bar().begin(), prongCharm.mlProbD0bar().end(), std::back_inserter(mlScoresD0)); + } + if constexpr (isMl) { + mlScoreBplusToD0Pi = candidate.mlProbBplusToD0Pi(); + } + // flag = 0 for D0 pi-, flag = 1 for D0bar pi+ + fillTablesCandidate(candidate, prongCharm, prongBachelor, isD0 ? 0 : 1, massBplusToD0Pi, ct, y, flagMcRec, origin, mlScoreBplusToD0Pi, mlScoresD0); + } + } + } + + void processData(CollisionsWCentMult const& collisions, + SelectedCandidates const&, + THfCandDaughtersMl const& candidatesDaughters, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + processCandidates(collisions, candidatesAll, candidatesDaughters, tracks, bcs); + } + PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processData, "Process data", true); + + void processMcSig(CollisionsWMcCentMult const& collisions, + SelectedCandidatesMc const&, + TypeMcCollisions const& mcCollisions, + MatchedGenCandidatesMc const& mcParticles, + THfCandDaughtersMl const& candidatesDaughters, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); + processCandidates(collisions, candidatesMcSig, candidatesDaughters, tracks, bcs); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); + } + PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcSig, "Process MC only for signals", false); + + void processMcBkg(CollisionsWMcCentMult const& collisions, + SelectedCandidatesMc const&, + TypeMcCollisions const& mcCollisions, + MatchedGenCandidatesMc const& mcParticles, + THfCandDaughtersMl const& candidatesDaughters, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); + processCandidates(collisions, candidatesMcBkg, candidatesDaughters, tracks, bcs); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); + } + PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcBkg, "Process MC only for background", false); + + void processMcAll(CollisionsWMcCentMult const& collisions, + SelectedCandidatesMc const&, + TypeMcCollisions const& mcCollisions, + MatchedGenCandidatesMc const& mcParticles, + THfCandDaughtersMl const& candidatesDaughters, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); + processCandidates(collisions, candidatesMcAll, candidatesDaughters, tracks, bcs); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); + } + PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcAll, "Process MC", false); + + // ML versions + + void processDataMl(CollisionsWCentMult const& collisions, + SelectedCandidatesMl const&, + THfCandDaughtersMl const& candidatesDaughters, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + processCandidates(collisions, candidatesMlAll, candidatesDaughters, tracks, bcs); + } + PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processDataMl, "Process data with ML", false); + + void processMcMlSig(CollisionsWMcCentMult const& collisions, + SelectedCandidatesMcMl const&, + TypeMcCollisions const& mcCollisions, + MatchedGenCandidatesMc const& mcParticles, + THfCandDaughtersMl const& candidatesDaughters, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); + processCandidates(collisions, candidatesMcMlSig, candidatesDaughters, tracks, bcs); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); + } + PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcMlSig, "Process MC with ML only for signals", false); + + void processMcMlBkg(CollisionsWMcCentMult const& collisions, + SelectedCandidatesMcMl const&, + TypeMcCollisions const& mcCollisions, + MatchedGenCandidatesMc const& mcParticles, + THfCandDaughtersMl const& candidatesDaughters, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); + processCandidates(collisions, candidatesMcMlBkg, candidatesDaughters, tracks, bcs); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); + } + PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcMlBkg, "Process MC with ML only for background", false); + + void processMcMlAll(CollisionsWMcCentMult const& collisions, + SelectedCandidatesMcMl const&, + TypeMcCollisions const& mcCollisions, + MatchedGenCandidatesMc const& mcParticles, + THfCandDaughtersMl const& candidatesDaughters, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); + processCandidates(collisions, candidatesMcMlAll, candidatesDaughters, tracks, bcs); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); + } + PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcMlAll, "Process MC with ML", false); + + void processMcGenOnly(TypeMcCollisions const& mcCollisions, + MatchedGenCandidatesMc const& mcParticles) + { + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); + } + PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcGenOnly, "Process MC gen. only", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} From 58524c43c245ca3910a9ff1ad21cb8aeea9669c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Mon, 14 Jul 2025 16:49:53 +0200 Subject: [PATCH 02/13] Define 5-prong tables --- .../DataModel/CandidateReconstructionTables.h | 1 + PWGHF/DataModel/DerivedTables.h | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index d411369fa3e..4c5ca4da709 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -245,6 +245,7 @@ DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, Tracks, "_0"); //! Index to f DECLARE_SOA_INDEX_COLUMN_FULL(Prong1, prong1, int, Tracks, "_1"); //! Index to second prong DECLARE_SOA_INDEX_COLUMN_FULL(Prong2, prong2, int, Tracks, "_2"); //! Index to third prong DECLARE_SOA_INDEX_COLUMN_FULL(Prong3, prong3, int, Tracks, "_3"); //! Index to fourth prong +DECLARE_SOA_INDEX_COLUMN_FULL(Prong4, prong4, int, Tracks, "_4"); //! Index to fifth prong DECLARE_SOA_INDEX_COLUMN(V0, v0); //! Index to V0 prong DECLARE_SOA_INDEX_COLUMN(Cascade, cascade); //! Index to cascade prong DECLARE_SOA_COLUMN(HFflag, hfflag, uint8_t); //! Bitmap to store selection results, o2-linter: disable=name/o2-column (written to disk) diff --git a/PWGHF/DataModel/DerivedTables.h b/PWGHF/DataModel/DerivedTables.h index 49632f85a95..fabe5ba5a9c 100644 --- a/PWGHF/DataModel/DerivedTables.h +++ b/PWGHF/DataModel/DerivedTables.h @@ -41,6 +41,7 @@ namespace o2::aod // B0 → D− π+ // B+ → D0 π+ // D*+ → D0 π+ +// Ξc± → (Ξ∓ → (Λ → p π∓) π∓) π± π± // ================ // Collision tables @@ -214,6 +215,17 @@ DECLARE_SOA_COLUMN(FlagMcDecayChanGen, flagMcDecayChanGen, int8_t); //! resonant hf_track_index::Prong3Id, \ o2::soa::Marker); +// Declares the table with global indices for 4-prong candidates (Ids). +#define DECLARE_TABLE_CAND_ID_5P(_hf_type_, _hf_description_) \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##Ids, "HF" _hf_description_ "ID", \ + hf_cand::CollisionId, \ + hf_track_index::Prong0Id, \ + hf_track_index::Prong1Id, \ + hf_track_index::Prong2Id, \ + hf_track_index::Prong3Id, \ + hf_track_index::Prong4Id, \ + o2::soa::Marker); + // Declares the table with candidate selection flags (Sels). #define DECLARE_TABLE_CAND_SEL(_hf_type_, _hf_description_) \ DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##Sels, "HF" _hf_description_ "SEL", \ @@ -282,6 +294,11 @@ DECLARE_SOA_COLUMN(FlagMcDecayChanGen, flagMcDecayChanGen, int8_t); //! resonant DECLARE_TABLES_COMMON(_hf_type_, _hf_description_, _hf_namespace_) \ DECLARE_TABLE_CAND_ID_4P(_hf_type_, _hf_description_) +#define DECLARE_TABLES_5P(_hf_type_, _hf_description_, _hf_namespace_, _marker_number_) \ + constexpr uint Marker##_hf_type_ = _marker_number_; \ + DECLARE_TABLES_COMMON(_hf_type_, _hf_description_, _hf_namespace_) \ + DECLARE_TABLE_CAND_ID_5P(_hf_type_, _hf_description_) + // ================ // Declarations of common tables for individual species // ================ @@ -296,6 +313,7 @@ DECLARE_TABLES_3P(Dstar, "DST", dstar, 6); #undef B0 DECLARE_TABLES_4P(B0, "B0", b0, 7); #pragma pop_macro("B0") +DECLARE_TABLES_5P(XicToXiPiPi, "XICTOXIPIPI", xic_to_xi_pi_pi, 6); // ================ // Additional species-specific candidate tables From f63a073da0fa8c1121e73510c5acd11ca47a0632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Mon, 14 Jul 2025 17:54:02 +0200 Subject: [PATCH 03/13] Add other tables. First round of replacement --- PWGHF/DataModel/DerivedTables.h | 76 +++++++ .../derivedDataCreatorXicToXiPiPi.cxx | 206 +++++++++--------- 2 files changed, 176 insertions(+), 106 deletions(-) diff --git a/PWGHF/DataModel/DerivedTables.h b/PWGHF/DataModel/DerivedTables.h index fabe5ba5a9c..8711f3af97a 100644 --- a/PWGHF/DataModel/DerivedTables.h +++ b/PWGHF/DataModel/DerivedTables.h @@ -919,6 +919,82 @@ DECLARE_SOA_TABLE_STAGED(HfDstarMcs, "HFDSTMC", //! Table with MC candidate info hf_cand_mc::FlagMcMatchRec, hf_cand_mc::OriginMcRec, o2::soa::Marker); + +// ---------------- +// Xic+ +// ---------------- + +DECLARE_SOA_TABLE_STAGED(HfXicToXiPiPiPars, "HFXICTOXIPIPIPAR", //! Table with candidate properties used for selection + hf_cand::Chi2PCA, + hf_cand_par::Cpa, + hf_cand_par::CpaXY, + hf_cand_par::DecayLength, + hf_cand_par::DecayLengthXY, + hf_cand_par::DecayLengthNormalised, + hf_cand_par::DecayLengthXYNormalised, + hf_cand_par::PtProng0, + hf_cand_par::PtProng1, + hf_cand::ImpactParameter0, + hf_cand::ImpactParameter1, + hf_cand_par::ImpactParameterNormalised0, + hf_cand_par::ImpactParameterNormalised1, + hf_cand_par::NSigTpcPiExpPi, + hf_cand_par::NSigTofPiExpPi, + hf_cand_par::NSigTpcTofPiExpPi, + hf_cand_par::NSigTpcKaExpPi, + hf_cand_par::NSigTofKaExpPi, + hf_cand_par::NSigTpcTofKaExpPi, + hf_cand_par::MaxNormalisedDeltaIP, + hf_cand_par::ImpactParameterProduct, + o2::soa::Marker); + +DECLARE_SOA_TABLE_STAGED(HfXicToXiPiPiParXis, "HFXICTOXIPIPIPARXI", //! Table with Xi candidate properties used for selection of Xic+ + hf_cand_par_charm::CpaCharm, + hf_cand_par_charm::DecayLengthCharm, + hf_cand_par_charm::ImpactParameter0Charm, + hf_cand_par_charm::ImpactParameter1Charm, + hf_cand_par_charm::ImpactParameterProductCharm, + hf_cand_par_charm::NSigTpcPiExpPiCharm, + hf_cand_par_charm::NSigTofPiExpPiCharm, + hf_cand_par_charm::NSigTpcTofPiExpPiCharm, + hf_cand_par_charm::NSigTpcKaExpPiCharm, + hf_cand_par_charm::NSigTofKaExpPiCharm, + hf_cand_par_charm::NSigTpcTofKaExpPiCharm, + hf_cand_par_charm::NSigTpcPiExpKaCharm, + hf_cand_par_charm::NSigTofPiExpKaCharm, + hf_cand_par_charm::NSigTpcTofPiExpKaCharm, + hf_cand_par_charm::NSigTpcKaExpKaCharm, + hf_cand_par_charm::NSigTofKaExpKaCharm, + hf_cand_par_charm::NSigTpcTofKaExpKaCharm); + +DECLARE_SOA_TABLE_STAGED(HfXicToXiPiPiParEs, "HFXICTOXIPIPIPARE", //! Table with additional candidate properties used for selection + hf_cand::XSecondaryVertex, + hf_cand::YSecondaryVertex, + hf_cand::ZSecondaryVertex, + hf_cand::ErrorDecayLength, + hf_cand::ErrorDecayLengthXY, + hf_cand_par::RSecondaryVertex, + hf_cand_par::PProng1, + hf_cand::PxProng1, + hf_cand::PyProng1, + hf_cand::PzProng1, + hf_cand::ErrorImpactParameter1, + hf_cand_par::CosThetaStar, + hf_cand_par::Ct, + o2::soa::Marker); + +DECLARE_SOA_TABLE_STAGED(HfXicToXiPiPiMls, "HFXICTOXIPIPIML", //! Table with candidate selection ML scores + hf_cand_mc::MlScoreSig, + o2::soa::Marker); + +DECLARE_SOA_TABLE_STAGED(HfXicToXiPiPiMlXis, "HFXICTOXIPIPIMLXI", //! Table with Xi candidate selection ML scores + hf_cand_mc_charm::MlScoresCharm, + o2::soa::Marker); + +DECLARE_SOA_TABLE_STAGED(HfXicToXiPiPiMcs, "HFXICTOXIPIPIMC", //! Table with MC candidate info + hf_cand_mc::FlagMcMatchRec, + hf_cand_mc::OriginMcRec, + o2::soa::Marker); } // namespace o2::aod #endif // PWGHF_DATAMODEL_DERIVEDTABLES_H_ diff --git a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx index 7842444e3f4..cdd6e5c9922 100644 --- a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx @@ -15,7 +15,7 @@ /// /// \author Vít Kučera , Inha University -#include "PWGHF/Core/DecayChannels.h" +// #include "PWGHF/Core/DecayChannels.h" #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" @@ -54,38 +54,39 @@ using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::aod::pid_tpc_tof_utils; using namespace o2::analysis::hf_derived; -using namespace o2::hf_decay::hf_cand_beauty; +using namespace o2::aod::hf_cand_xic_to_xi_pi_pi; +// using namespace o2::hf_decay::hf_cand_beauty; /// Writes the full information in an output TTree -struct HfDerivedDataCreatorBplusToD0Pi { +struct HfDerivedDataCreatorXicToXiPiPi { HfProducesDerivedData< - o2::aod::HfBplusBases, - o2::aod::HfBplusCollBases, - o2::aod::HfBplusCollIds, - o2::aod::HfBplusMcCollBases, - o2::aod::HfBplusMcCollIds, - o2::aod::HfBplusMcRCollIds, - o2::aod::HfBplusPBases, - o2::aod::HfBplusPIds> + o2::aod::HfXicToXiPiPiBases, + o2::aod::HfXicToXiPiPiCollBases, + o2::aod::HfXicToXiPiPiCollIds, + o2::aod::HfXicToXiPiPiMcCollBases, + o2::aod::HfXicToXiPiPiMcCollIds, + o2::aod::HfXicToXiPiPiMcRCollIds, + o2::aod::HfXicToXiPiPiPBases, + o2::aod::HfXicToXiPiPiPIds> rowsCommon; // Candidates - Produces rowCandidatePar; - Produces rowCandidateParD0; - Produces rowCandidateParE; - Produces rowCandidateSel; - Produces rowCandidateMl; - Produces rowCandidateMlD0; - Produces rowCandidateId; - Produces rowCandidateMc; + Produces rowCandidatePar; + Produces rowCandidateParXi; + Produces rowCandidateParE; + Produces rowCandidateSel; + Produces rowCandidateMl; + Produces rowCandidateMlXi; + Produces rowCandidateId; + Produces rowCandidateMc; // Switches for filling tables HfConfigurableDerivedData confDerData; Configurable fillCandidatePar{"fillCandidatePar", true, "Fill candidate parameters"}; - Configurable fillCandidateParD0{"fillCandidateParD0", true, "Fill D0 candidate parameters"}; + Configurable fillCandidateParXi{"fillCandidateParXi", true, "Fill Xi candidate parameters"}; Configurable fillCandidateParE{"fillCandidateParE", true, "Fill candidate extended parameters"}; Configurable fillCandidateSel{"fillCandidateSel", true, "Fill candidate selection flags"}; Configurable fillCandidateMl{"fillCandidateMl", true, "Fill candidate selection ML scores"}; - Configurable fillCandidateMlD0{"fillCandidateMlD0", true, "Fill D0 candidate selection ML scores"}; + Configurable fillCandidateMlXi{"fillCandidateMlXi", true, "Fill Xi candidate selection ML scores"}; Configurable fillCandidateId{"fillCandidateId", true, "Fill original indices from the candidate table"}; Configurable fillCandidateMc{"fillCandidateMc", true, "Fill candidate MC info"}; // Parameters for production of training samples @@ -99,16 +100,16 @@ struct HfDerivedDataCreatorBplusToD0Pi { using CollisionsWCentMult = soa::Join; using CollisionsWMcCentMult = soa::Join; using TracksWPid = soa::Join; - using SelectedCandidates = soa::Filtered>; - using SelectedCandidatesMc = soa::Filtered>; - using SelectedCandidatesMl = soa::Filtered>; - using SelectedCandidatesMcMl = soa::Filtered>; - using MatchedGenCandidatesMc = soa::Filtered>; + using SelectedCandidates = soa::Filtered>; + using SelectedCandidatesMc = soa::Filtered>; + using SelectedCandidatesMl = soa::Filtered>; + using SelectedCandidatesMcMl = soa::Filtered>; + using MatchedGenCandidatesMc = soa::Filtered>; using TypeMcCollisions = soa::Join; - using THfCandDaughtersMl = soa::Join; + using THfCandDaughtersMl = soa::Join; - Filter filterSelectCandidates = (aod::hf_sel_candidate_bplus::isSelBplusToD0Pi & static_cast(BIT(aod::SelectionStep::RecoMl - 1))) != 0; - Filter filterMcGenMatching = nabs(aod::hf_cand_bplus::flagMcMatchGen) == static_cast(DecayChannelMain::BplusToD0Pi); + Filter filterSelectCandidates = (aod::hf_sel_candidate_xic::isSelXicToXiPiPi & static_cast(BIT(aod::SelectionStep::RecoMl - 1))) != 0; + Filter filterMcGenMatching = nabs(aod::hf_cand_bplus::flagMcMatchGen) == static_cast(DecayType::XicToXiPiPi); Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesMcPerCollision = aod::hf_cand::collisionId; @@ -117,15 +118,15 @@ struct HfDerivedDataCreatorBplusToD0Pi { Preslice mcParticlesPerMcCollision = aod::mcparticle::mcCollisionId; // trivial partitions for all candidates to allow "->sliceByCached" inside processCandidates - Partition candidatesAll = aod::hf_sel_candidate_bplus::isSelBplusToD0Pi >= 0; - Partition candidatesMcAll = aod::hf_sel_candidate_bplus::isSelBplusToD0Pi >= 0; - Partition candidatesMlAll = aod::hf_sel_candidate_bplus::isSelBplusToD0Pi >= 0; - Partition candidatesMcMlAll = aod::hf_sel_candidate_bplus::isSelBplusToD0Pi >= 0; + Partition candidatesAll = aod::hf_sel_candidate_xic::isSelXicToXiPiPi >= 0; + Partition candidatesMcAll = aod::hf_sel_candidate_xic::isSelXicToXiPiPi >= 0; + Partition candidatesMlAll = aod::hf_sel_candidate_xic::isSelXicToXiPiPi >= 0; + Partition candidatesMcMlAll = aod::hf_sel_candidate_xic::isSelXicToXiPiPi >= 0; // partitions for signal and background - Partition candidatesMcSig = nabs(aod::hf_cand_bplus::flagMcMatchRec) == static_cast(DecayChannelMain::BplusToD0Pi); - Partition candidatesMcBkg = nabs(aod::hf_cand_bplus::flagMcMatchRec) != static_cast(DecayChannelMain::BplusToD0Pi); - Partition candidatesMcMlSig = nabs(aod::hf_cand_bplus::flagMcMatchRec) == static_cast(DecayChannelMain::BplusToD0Pi); - Partition candidatesMcMlBkg = nabs(aod::hf_cand_bplus::flagMcMatchRec) != static_cast(DecayChannelMain::BplusToD0Pi); + Partition candidatesMcSig = nabs(aod::hf_cand_bplus::flagMcMatchRec) == static_cast(DecayType::XicToXiPiPi); + Partition candidatesMcBkg = nabs(aod::hf_cand_bplus::flagMcMatchRec) != static_cast(DecayType::XicToXiPiPi); + Partition candidatesMcMlSig = nabs(aod::hf_cand_bplus::flagMcMatchRec) == static_cast(DecayType::XicToXiPiPi); + Partition candidatesMcMlBkg = nabs(aod::hf_cand_bplus::flagMcMatchRec) != static_cast(DecayType::XicToXiPiPi); void init(InitContext const&) { @@ -137,8 +138,8 @@ struct HfDerivedDataCreatorBplusToD0Pi { } template - void fillTablesCandidate(const T& candidate, const U& prongCharm, const V& prongBachelor, int candFlag, double invMass, - double ct, double y, int8_t flagMc, int8_t origin, float mlScore, const std::vector& mlScoresCharm) + void fillTablesCandidate(const T& candidate, const U& prongCascade, const V& prongBachelor0, int candFlag, double invMass, + double ct, double y, int8_t flagMc, int8_t origin, float mlScore, const std::vector& mlScoresCascade) { rowsCommon.fillTablesCandidate(candidate, invMass, y); if (fillCandidatePar) { @@ -151,39 +152,27 @@ struct HfDerivedDataCreatorBplusToD0Pi { candidate.decayLengthNormalised(), candidate.decayLengthXYNormalised(), candidate.ptProng0(), - candidate.ptProng1(), - candidate.impactParameter0(), - candidate.impactParameter1(), - candidate.impactParameterNormalised0(), - candidate.impactParameterNormalised1(), - prongBachelor.tpcNSigmaPi(), - prongBachelor.tofNSigmaPi(), - prongBachelor.tpcTofNSigmaPi(), - prongBachelor.tpcNSigmaKa(), - prongBachelor.tofNSigmaKa(), - prongBachelor.tpcTofNSigmaKa(), - candidate.maxNormalisedDeltaIP(), - candidate.impactParameterProduct()); + candidate.ptProng1()); } - if (fillCandidateParD0) { + if (fillCandidateParXi) { std::array, 2>, 2> sigmas{}; // PID nSigma [Expected][Hypothesis][TPC/TOF/TPC+TOF] if (candFlag == 0) { - GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion], prongCharm, 0, Pi) - GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon], prongCharm, 0, Ka) - GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion], prongCharm, 1, Pi) - GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon], prongCharm, 1, Ka) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion], prongCascade, 0, Pi) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon], prongCascade, 0, Ka) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion], prongCascade, 1, Pi) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon], prongCascade, 1, Ka) } else if (candFlag == 1) { - GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion], prongCharm, 1, Pi) - GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon], prongCharm, 1, Ka) - GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion], prongCharm, 0, Pi) - GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon], prongCharm, 0, Ka) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion], prongCascade, 1, Pi) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon], prongCascade, 1, Ka) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion], prongCascade, 0, Pi) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon], prongCascade, 0, Ka) } - rowCandidateParD0( - prongCharm.cpa(), - prongCharm.decayLength(), - prongCharm.impactParameter0(), - prongCharm.impactParameter1(), - prongCharm.impactParameterProduct(), + rowCandidateParXi( + prongCascade.cpa(), + prongCascade.decayLength(), + prongCascade.impactParameter0(), + prongCascade.impactParameter1(), + prongCascade.impactParameterProduct(), sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion][0], sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion][1], sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion][2], @@ -210,7 +199,6 @@ struct HfDerivedDataCreatorBplusToD0Pi { candidate.pyProng1(), candidate.pzProng1(), candidate.errorImpactParameter1(), - hfHelper.cosThetaStarBplus(candidate), ct); } if (fillCandidateSel) { @@ -221,15 +209,15 @@ struct HfDerivedDataCreatorBplusToD0Pi { rowCandidateMl( mlScore); } - if (fillCandidateMlD0) { - rowCandidateMlD0( - mlScoresCharm); + if (fillCandidateMlXi) { + rowCandidateMlXi( + mlScoresCascade); } if (fillCandidateId) { rowCandidateId( candidate.collisionId(), - prongCharm.prong0Id(), - prongCharm.prong1Id(), + prongCascade.prong0Id(), + prongCascade.prong1Id(), candidate.prong1Id()); } if (fillCandidateMc) { @@ -239,10 +227,10 @@ struct HfDerivedDataCreatorBplusToD0Pi { } } - template + template void processCandidates(CollType const& collisions, Partition& candidates, - CandCharmType const&, + CandCascadeType const&, TracksWPid const&, aod::BCs const&) { @@ -275,11 +263,11 @@ struct HfDerivedDataCreatorBplusToD0Pi { // Fill candidate properties rowsCommon.reserveTablesCandidates(sizeTableCand); reserveTable(rowCandidatePar, fillCandidatePar, sizeTableCand); - reserveTable(rowCandidateParD0, fillCandidateParD0, sizeTableCand); + reserveTable(rowCandidateParXi, fillCandidateParXi, sizeTableCand); reserveTable(rowCandidateParE, fillCandidateParE, sizeTableCand); reserveTable(rowCandidateSel, fillCandidateSel, sizeTableCand); reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand); - reserveTable(rowCandidateMlD0, fillCandidateMlD0, sizeTableCand); + reserveTable(rowCandidateMlXi, fillCandidateMlXi, sizeTableCand); reserveTable(rowCandidateId, fillCandidateId, sizeTableCand); if constexpr (isMc) { reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand); @@ -287,15 +275,15 @@ struct HfDerivedDataCreatorBplusToD0Pi { int8_t flagMcRec = 0, origin = 0; for (const auto& candidate : candidatesThisColl) { if constexpr (isMl) { - if (!TESTBIT(candidate.isSelBplusToD0Pi(), aod::SelectionStep::RecoMl)) { + if (!TESTBIT(candidate.isSelXicToXiPiPi(), aod::SelectionStep::RecoMl)) { continue; } } if constexpr (isMc) { flagMcRec = candidate.flagMcMatchRec(); - origin = candidate.originMcRec(); + origin = candidate.originRec(); if constexpr (onlyBkg) { - if (std::abs(flagMcRec) == DecayChannelMain::BplusToD0Pi) { + if (std::abs(flagMcRec) == DecayType::XicToXiPiPi) { continue; } if (downSampleBkgFactor < 1.) { @@ -306,29 +294,35 @@ struct HfDerivedDataCreatorBplusToD0Pi { } } if constexpr (onlySig) { - if (std::abs(flagMcRec) != DecayChannelMain::BplusToD0Pi) { + if (std::abs(flagMcRec) != DecayType::XicToXiPiPi) { continue; } } } - auto prongCharm = candidate.template prong0_as(); - auto prongBachelor = candidate.template prong1_as(); - double ct = hfHelper.ctBplus(candidate); - double y = hfHelper.yBplus(candidate); - float massBplusToD0Pi = hfHelper.invMassBplusToD0Pi(candidate); - float mlScoreBplusToD0Pi{-1.f}; - std::vector mlScoresD0; - bool isD0 = prongBachelor.sign() < 0; - if (isD0) { // is D0 - std::copy(prongCharm.mlProbD0().begin(), prongCharm.mlProbD0().end(), std::back_inserter(mlScoresD0)); - } else { // is D0bar - std::copy(prongCharm.mlProbD0bar().begin(), prongCharm.mlProbD0bar().end(), std::back_inserter(mlScoresD0)); + // FIXME + auto prongCascade = candidate.template cascade_as(); + auto prongBachelor0 = candidate.template pi0_as(); + auto prongBachelor1 = candidate.template pi1_as(); + auto prongBachelorWhat = candidate.template bachelor_as(); + auto prongPosTrack = candidate.template posTrack_as(); + auto prongNegTrack = candidate.template negTrack_as(); + + double ct = hfHelper.ctXic(candidate); + double y = hfHelper.yXic(candidate); + float massXicToXiPiPi = candidate.invMassXicPlus(); + float mlScoreXicToXiPiPi{-1.f}; + std::vector mlScoresXi; + bool isXi = prongBachelor0.sign() < 0; + if (isXi) { // is Xi + std::copy(prongCascade.mlProbXi().begin(), prongCascade.mlProbXi().end(), std::back_inserter(mlScoresXi)); + } else { // is Xibar + std::copy(prongCascade.mlProbXibar().begin(), prongCascade.mlProbXibar().end(), std::back_inserter(mlScoresXi)); } if constexpr (isMl) { - mlScoreBplusToD0Pi = candidate.mlProbBplusToD0Pi(); + mlScoreXicToXiPiPi = candidate.mlProbXicToXiPiPi(); } - // flag = 0 for D0 pi-, flag = 1 for D0bar pi+ - fillTablesCandidate(candidate, prongCharm, prongBachelor, isD0 ? 0 : 1, massBplusToD0Pi, ct, y, flagMcRec, origin, mlScoreBplusToD0Pi, mlScoresD0); + // flag = 0 for Xi pi-, flag = 1 for Xibar pi+ + fillTablesCandidate(candidate, prongCascade, prongBachelor0, isXi ? 0 : 1, massXicToXiPiPi, ct, y, flagMcRec, origin, mlScoreXicToXiPiPi, mlScoresXi); } } } @@ -341,7 +335,7 @@ struct HfDerivedDataCreatorBplusToD0Pi { { processCandidates(collisions, candidatesAll, candidatesDaughters, tracks, bcs); } - PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processData, "Process data", true); + PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processData, "Process data", true); void processMcSig(CollisionsWMcCentMult const& collisions, SelectedCandidatesMc const&, @@ -355,7 +349,7 @@ struct HfDerivedDataCreatorBplusToD0Pi { processCandidates(collisions, candidatesMcSig, candidatesDaughters, tracks, bcs); rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } - PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcSig, "Process MC only for signals", false); + PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processMcSig, "Process MC only for signals", false); void processMcBkg(CollisionsWMcCentMult const& collisions, SelectedCandidatesMc const&, @@ -369,7 +363,7 @@ struct HfDerivedDataCreatorBplusToD0Pi { processCandidates(collisions, candidatesMcBkg, candidatesDaughters, tracks, bcs); rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } - PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcBkg, "Process MC only for background", false); + PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processMcBkg, "Process MC only for background", false); void processMcAll(CollisionsWMcCentMult const& collisions, SelectedCandidatesMc const&, @@ -383,7 +377,7 @@ struct HfDerivedDataCreatorBplusToD0Pi { processCandidates(collisions, candidatesMcAll, candidatesDaughters, tracks, bcs); rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } - PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcAll, "Process MC", false); + PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processMcAll, "Process MC", false); // ML versions @@ -395,7 +389,7 @@ struct HfDerivedDataCreatorBplusToD0Pi { { processCandidates(collisions, candidatesMlAll, candidatesDaughters, tracks, bcs); } - PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processDataMl, "Process data with ML", false); + PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processDataMl, "Process data with ML", false); void processMcMlSig(CollisionsWMcCentMult const& collisions, SelectedCandidatesMcMl const&, @@ -409,7 +403,7 @@ struct HfDerivedDataCreatorBplusToD0Pi { processCandidates(collisions, candidatesMcMlSig, candidatesDaughters, tracks, bcs); rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } - PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcMlSig, "Process MC with ML only for signals", false); + PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processMcMlSig, "Process MC with ML only for signals", false); void processMcMlBkg(CollisionsWMcCentMult const& collisions, SelectedCandidatesMcMl const&, @@ -423,7 +417,7 @@ struct HfDerivedDataCreatorBplusToD0Pi { processCandidates(collisions, candidatesMcMlBkg, candidatesDaughters, tracks, bcs); rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } - PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcMlBkg, "Process MC with ML only for background", false); + PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processMcMlBkg, "Process MC with ML only for background", false); void processMcMlAll(CollisionsWMcCentMult const& collisions, SelectedCandidatesMcMl const&, @@ -437,17 +431,17 @@ struct HfDerivedDataCreatorBplusToD0Pi { processCandidates(collisions, candidatesMcMlAll, candidatesDaughters, tracks, bcs); rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } - PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcMlAll, "Process MC with ML", false); + PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processMcMlAll, "Process MC with ML", false); void processMcGenOnly(TypeMcCollisions const& mcCollisions, MatchedGenCandidatesMc const& mcParticles) { rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } - PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcGenOnly, "Process MC gen. only", false); + PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processMcGenOnly, "Process MC gen. only", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From ac7fcfa11376040b3f230a1e993e6091d26a215e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Mon, 14 Jul 2025 18:03:00 +0200 Subject: [PATCH 04/13] Fix mass --- PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx index cdd6e5c9922..5f32da72f9e 100644 --- a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx @@ -95,7 +95,7 @@ struct HfDerivedDataCreatorXicToXiPiPi { HfHelper hfHelper; SliceCache cache; - static constexpr double mass{o2::constants::physics::MassBPlus}; + static constexpr double mass{o2::constants::physics::MassXiCPlus}; using CollisionsWCentMult = soa::Join; using CollisionsWMcCentMult = soa::Join; From e8a4a3fef4a79b975f8d6579df311de1bc9d27e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Mon, 14 Jul 2025 18:04:37 +0200 Subject: [PATCH 05/13] Fix MC namespace --- PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx index 5f32da72f9e..9b6d413cb50 100644 --- a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx @@ -109,7 +109,7 @@ struct HfDerivedDataCreatorXicToXiPiPi { using THfCandDaughtersMl = soa::Join; Filter filterSelectCandidates = (aod::hf_sel_candidate_xic::isSelXicToXiPiPi & static_cast(BIT(aod::SelectionStep::RecoMl - 1))) != 0; - Filter filterMcGenMatching = nabs(aod::hf_cand_bplus::flagMcMatchGen) == static_cast(DecayType::XicToXiPiPi); + Filter filterMcGenMatching = nabs(aod::hf_cand_xic_to_xi_pi_pi::flagMcMatchGen) == static_cast(DecayType::XicToXiPiPi); Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesMcPerCollision = aod::hf_cand::collisionId; @@ -123,10 +123,10 @@ struct HfDerivedDataCreatorXicToXiPiPi { Partition candidatesMlAll = aod::hf_sel_candidate_xic::isSelXicToXiPiPi >= 0; Partition candidatesMcMlAll = aod::hf_sel_candidate_xic::isSelXicToXiPiPi >= 0; // partitions for signal and background - Partition candidatesMcSig = nabs(aod::hf_cand_bplus::flagMcMatchRec) == static_cast(DecayType::XicToXiPiPi); - Partition candidatesMcBkg = nabs(aod::hf_cand_bplus::flagMcMatchRec) != static_cast(DecayType::XicToXiPiPi); - Partition candidatesMcMlSig = nabs(aod::hf_cand_bplus::flagMcMatchRec) == static_cast(DecayType::XicToXiPiPi); - Partition candidatesMcMlBkg = nabs(aod::hf_cand_bplus::flagMcMatchRec) != static_cast(DecayType::XicToXiPiPi); + Partition candidatesMcSig = nabs(aod::hf_cand_xic_to_xi_pi_pi::flagMcMatchRec) == static_cast(DecayType::XicToXiPiPi); + Partition candidatesMcBkg = nabs(aod::hf_cand_xic_to_xi_pi_pi::flagMcMatchRec) != static_cast(DecayType::XicToXiPiPi); + Partition candidatesMcMlSig = nabs(aod::hf_cand_xic_to_xi_pi_pi::flagMcMatchRec) == static_cast(DecayType::XicToXiPiPi); + Partition candidatesMcMlBkg = nabs(aod::hf_cand_xic_to_xi_pi_pi::flagMcMatchRec) != static_cast(DecayType::XicToXiPiPi); void init(InitContext const&) { From b5d698331ad41a20d027193559ef0e2a812ee182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Tue, 15 Jul 2025 22:30:38 +0200 Subject: [PATCH 06/13] Compiles --- PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx | 6 +- PWGHF/D2H/Tasks/taskXic0ToXiPi.cxx | 6 +- .../DataModel/CandidateReconstructionTables.h | 30 ++-- PWGHF/DataModel/DerivedTables.h | 162 +++++++++--------- .../derivedDataCreatorXicToXiPiPi.cxx | 160 ++++++++--------- .../treeCreatorOmegac0ToOmegaKa.cxx | 6 +- .../treeCreatorOmegac0ToOmegaPi.cxx | 22 +-- PWGHF/TableProducer/treeCreatorOmegacSt.cxx | 8 +- PWGHF/TableProducer/treeCreatorToXiPi.cxx | 20 +-- .../TableProducer/treeCreatorXic0ToXiPiKf.cxx | 12 +- .../TableProducer/treeCreatorXicToXiPiPi.cxx | 16 +- PWGHF/Tasks/taskMcEfficiencyToXiPi.cxx | 20 +-- 12 files changed, 225 insertions(+), 243 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx b/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx index ca784ce606c..a611d7e166a 100644 --- a/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx +++ b/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx @@ -276,10 +276,10 @@ struct HfTaskOmegac0ToOmegapi { auto numPvContributors = candidate.template collision_as().numContrib(); if constexpr (applyMl) { - registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsOmegac0Type"), candidate.mlProbOmegac()[0], candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfRapOmegac(), candidate.ptBhadMotherPart(), candidate.originRec(), candidate.flagMcMatchRec(), numPvContributors); + registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsOmegac0Type"), candidate.mlProbOmegac()[0], candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfRapOmegac(), candidate.ptBhadMotherPart(), candidate.originMcRec(), candidate.flagMcMatchRec(), numPvContributors); } else { - registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsOmegac0Type"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfRapOmegac(), candidate.ptBhadMotherPart(), candidate.originRec(), candidate.flagMcMatchRec(), numPvContributors); + registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsOmegac0Type"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfRapOmegac(), candidate.ptBhadMotherPart(), candidate.originMcRec(), candidate.flagMcMatchRec(), numPvContributors); } } @@ -298,7 +298,7 @@ struct HfTaskOmegac0ToOmegapi { maxNumContrib = recCol.numContrib() > maxNumContrib ? recCol.numContrib() : maxNumContrib; } - if (particle.originGen() == RecoDecay::OriginType::Prompt) { + if (particle.originMcGen() == RecoDecay::OriginType::Prompt) { registry.fill(HIST("hSparseAcc"), ptGen, -1., yGen, RecoDecay::OriginType::Prompt, maxNumContrib); } else { float ptGenB = mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); diff --git a/PWGHF/D2H/Tasks/taskXic0ToXiPi.cxx b/PWGHF/D2H/Tasks/taskXic0ToXiPi.cxx index d82dada99f9..40efcbbcc31 100644 --- a/PWGHF/D2H/Tasks/taskXic0ToXiPi.cxx +++ b/PWGHF/D2H/Tasks/taskXic0ToXiPi.cxx @@ -243,7 +243,7 @@ struct HfTaskXic0ToXiPi { kfptXic, candidate.kfRapXic(), candidate.ptBhadMotherPart(), - candidate.originRec(), + candidate.originMcRec(), candidate.flagMcMatchRec(), numPvContributors); } else { @@ -252,7 +252,7 @@ struct HfTaskXic0ToXiPi { kfptXic, candidate.kfRapXic(), candidate.ptBhadMotherPart(), - candidate.originRec(), + candidate.originMcRec(), candidate.flagMcMatchRec(), numPvContributors); } @@ -273,7 +273,7 @@ struct HfTaskXic0ToXiPi { maxNumContrib = recCol.numContrib() > maxNumContrib ? recCol.numContrib() : maxNumContrib; } - if (particle.originGen() == RecoDecay::OriginType::Prompt) { + if (particle.originMcGen() == RecoDecay::OriginType::Prompt) { registry.fill(HIST("hSparseAcc"), ptGen, -1., diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 4c5ca4da709..71f5bd2f27d 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -1567,8 +1567,8 @@ DECLARE_SOA_COLUMN(CollisionMatched, collisionMatched, bool); DECLARE_SOA_COLUMN(DebugGenCharmBar, debugGenCharmBar, int8_t); DECLARE_SOA_COLUMN(DebugGenCasc, debugGenCasc, int8_t); DECLARE_SOA_COLUMN(DebugGenLambda, debugGenLambda, int8_t); -DECLARE_SOA_COLUMN(OriginRec, originRec, int8_t); -DECLARE_SOA_COLUMN(OriginGen, originGen, int8_t); +DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t); +DECLARE_SOA_COLUMN(OriginMcGen, originMcGen, int8_t); DECLARE_SOA_COLUMN(PtCharmBaryonGen, ptCharmBaryonGen, float); DECLARE_SOA_COLUMN(RapidityCharmBaryonGen, rapidityCharmBaryonGen, float); @@ -1791,7 +1791,7 @@ DECLARE_SOA_TABLE(HfCandToXiPiKfQa, "AOD", "HFCANDTOXIPIKFQA", DECLARE_SOA_TABLE(HfXicToXiPiMCRec, "AOD", "HFXICXIPIMCREC", //! hf_cand_xic0_omegac0::FlagMcMatchRec, hf_cand_xic0_omegac0::DebugMcRec, - hf_cand_xic0_omegac0::OriginRec, + hf_cand_xic0_omegac0::OriginMcRec, hf_cand_xic0_omegac0::CollisionMatched, hf_cand::PtBhadMotherPart, hf_cand::PdgBhadMotherPart, @@ -1799,7 +1799,7 @@ DECLARE_SOA_TABLE(HfXicToXiPiMCRec, "AOD", "HFXICXIPIMCREC", //! DECLARE_SOA_TABLE(HfOmegacToXiPiMCRec, "AOD", "HFOMCXIPIMCREC", //! hf_cand_xic0_omegac0::FlagMcMatchRec, hf_cand_xic0_omegac0::DebugMcRec, - hf_cand_xic0_omegac0::OriginRec, + hf_cand_xic0_omegac0::OriginMcRec, hf_cand_xic0_omegac0::CollisionMatched, hf_cand::PtBhadMotherPart, hf_cand::PdgBhadMotherPart, @@ -1807,7 +1807,7 @@ DECLARE_SOA_TABLE(HfOmegacToXiPiMCRec, "AOD", "HFOMCXIPIMCREC", //! DECLARE_SOA_TABLE(HfToOmegaPiMCRec, "AOD", "HFTOOMEPIMCREC", //! hf_cand_xic0_omegac0::FlagMcMatchRec, hf_cand_xic0_omegac0::DebugMcRec, - hf_cand_xic0_omegac0::OriginRec, + hf_cand_xic0_omegac0::OriginMcRec, hf_cand_xic0_omegac0::CollisionMatched, hf_cand::PtBhadMotherPart, hf_cand::PdgBhadMotherPart, @@ -1815,7 +1815,7 @@ DECLARE_SOA_TABLE(HfToOmegaPiMCRec, "AOD", "HFTOOMEPIMCREC", //! DECLARE_SOA_TABLE(HfToOmegaKMCRec, "AOD", "HFTOOMEKMCREC", //! hf_cand_xic0_omegac0::FlagMcMatchRec, hf_cand_xic0_omegac0::DebugMcRec, - hf_cand_xic0_omegac0::OriginRec, + hf_cand_xic0_omegac0::OriginMcRec, hf_cand_xic0_omegac0::CollisionMatched, hf_cand::PtBhadMotherPart, hf_cand::PdgBhadMotherPart, @@ -1824,16 +1824,16 @@ DECLARE_SOA_TABLE(HfToOmegaKMCRec, "AOD", "HFTOOMEKMCREC", //! // table with results of generator level MC matching DECLARE_SOA_TABLE(HfXicToXiPiMCGen, "AOD", "HFXICXIPIMCGEN", //! hf_cand_xic0_omegac0::FlagMcMatchGen, hf_cand_xic0_omegac0::DebugGenCharmBar, hf_cand_xic0_omegac0::DebugGenCasc, hf_cand_xic0_omegac0::DebugGenLambda, - hf_cand_xic0_omegac0::PtCharmBaryonGen, hf_cand_xic0_omegac0::RapidityCharmBaryonGen, hf_cand_xic0_omegac0::OriginGen, hf_cand::IdxBhadMotherPart, o2::soa::Marker<1>); + hf_cand_xic0_omegac0::PtCharmBaryonGen, hf_cand_xic0_omegac0::RapidityCharmBaryonGen, hf_cand_xic0_omegac0::OriginMcGen, hf_cand::IdxBhadMotherPart, o2::soa::Marker<1>); DECLARE_SOA_TABLE(HfOmegacToXiPiMCGen, "AOD", "HFOMECXIPIMCGEN", //! hf_cand_xic0_omegac0::FlagMcMatchGen, hf_cand_xic0_omegac0::DebugGenCharmBar, hf_cand_xic0_omegac0::DebugGenCasc, hf_cand_xic0_omegac0::DebugGenLambda, - hf_cand_xic0_omegac0::PtCharmBaryonGen, hf_cand_xic0_omegac0::RapidityCharmBaryonGen, hf_cand_xic0_omegac0::OriginGen, hf_cand::IdxBhadMotherPart, o2::soa::Marker<2>); + hf_cand_xic0_omegac0::PtCharmBaryonGen, hf_cand_xic0_omegac0::RapidityCharmBaryonGen, hf_cand_xic0_omegac0::OriginMcGen, hf_cand::IdxBhadMotherPart, o2::soa::Marker<2>); DECLARE_SOA_TABLE(HfToOmegaPiMCGen, "AOD", "HFTOOMEPIMCGEN", //! hf_cand_xic0_omegac0::FlagMcMatchGen, hf_cand_xic0_omegac0::DebugGenCharmBar, hf_cand_xic0_omegac0::DebugGenCasc, hf_cand_xic0_omegac0::DebugGenLambda, - hf_cand_xic0_omegac0::PtCharmBaryonGen, hf_cand_xic0_omegac0::RapidityCharmBaryonGen, hf_cand_xic0_omegac0::OriginGen, hf_cand::IdxBhadMotherPart, o2::soa::Marker<3>); + hf_cand_xic0_omegac0::PtCharmBaryonGen, hf_cand_xic0_omegac0::RapidityCharmBaryonGen, hf_cand_xic0_omegac0::OriginMcGen, hf_cand::IdxBhadMotherPart, o2::soa::Marker<3>); DECLARE_SOA_TABLE(HfToOmegaKMCGen, "AOD", "HFTOOMEKMCGEN", //! hf_cand_xic0_omegac0::FlagMcMatchGen, hf_cand_xic0_omegac0::DebugGenCharmBar, hf_cand_xic0_omegac0::DebugGenCasc, hf_cand_xic0_omegac0::DebugGenLambda, - hf_cand_xic0_omegac0::PtCharmBaryonGen, hf_cand_xic0_omegac0::RapidityCharmBaryonGen, hf_cand_xic0_omegac0::OriginGen, hf_cand::IdxBhadMotherPart, o2::soa::Marker<4>); + hf_cand_xic0_omegac0::PtCharmBaryonGen, hf_cand_xic0_omegac0::RapidityCharmBaryonGen, hf_cand_xic0_omegac0::OriginMcGen, hf_cand::IdxBhadMotherPart, o2::soa::Marker<4>); // specific Xic to Xi Pi Pi candidate properties namespace hf_cand_xic_to_xi_pi_pi @@ -1901,8 +1901,8 @@ DECLARE_SOA_COLUMN(NSigTofPrFromLambda, nSigTofPrFromLambda, float); // MC matching result: DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); // reconstruction level DECLARE_SOA_COLUMN(FlagMcMatchGen, flagMcMatchGen, int8_t); // generator level -DECLARE_SOA_COLUMN(OriginRec, originRec, int8_t); -DECLARE_SOA_COLUMN(OriginGen, originGen, int8_t); +DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t); +DECLARE_SOA_COLUMN(OriginMcGen, originMcGen, int8_t); // Residuals and pulls DECLARE_SOA_COLUMN(PtResidual, ptResidual, float); DECLARE_SOA_COLUMN(PResidual, pResidual, float); @@ -2004,17 +2004,17 @@ DECLARE_SOA_TABLE(HfCandXicKF, "AOD", "HFCANDXICKF", // table with results of reconstruction level MC matching DECLARE_SOA_TABLE(HfCandXicMcRec, "AOD", "HFCANDXICMCREC", hf_cand_xic_to_xi_pi_pi::FlagMcMatchRec, - hf_cand_xic_to_xi_pi_pi::OriginRec); + hf_cand_xic_to_xi_pi_pi::OriginMcRec); // table with results of generator level MC matching DECLARE_SOA_TABLE(HfCandXicMcGen, "AOD", "HFCANDXICMCGEN", hf_cand_xic_to_xi_pi_pi::FlagMcMatchGen, - hf_cand_xic_to_xi_pi_pi::OriginGen, + hf_cand_xic_to_xi_pi_pi::OriginMcGen, hf_cand::PdgBhadMotherPart); // table with residuals and pulls of PV DECLARE_SOA_TABLE(HfCandXicResid, "AOD", "HFCANDXICRESID", - hf_cand_xic_to_xi_pi_pi::OriginGen, + hf_cand_xic_to_xi_pi_pi::OriginMcGen, hf_cand_xic_to_xi_pi_pi::PResidual, hf_cand_xic_to_xi_pi_pi::PtResidual, hf_cand_xic_to_xi_pi_pi::XPvResidual, diff --git a/PWGHF/DataModel/DerivedTables.h b/PWGHF/DataModel/DerivedTables.h index 8711f3af97a..9a5b5ef7531 100644 --- a/PWGHF/DataModel/DerivedTables.h +++ b/PWGHF/DataModel/DerivedTables.h @@ -313,7 +313,7 @@ DECLARE_TABLES_3P(Dstar, "DST", dstar, 6); #undef B0 DECLARE_TABLES_4P(B0, "B0", b0, 7); #pragma pop_macro("B0") -DECLARE_TABLES_5P(XicToXiPiPi, "XICTOXIPIPI", xic_to_xi_pi_pi, 6); +DECLARE_TABLES_5P(XicToXiPiPi, "XICXPP", xic_to_xi_pi_pi, 8); // ================ // Additional species-specific candidate tables @@ -322,26 +322,37 @@ DECLARE_TABLES_5P(XicToXiPiPi, "XICTOXIPIPI", xic_to_xi_pi_pi, 6); // Candidate properties used for selection namespace hf_cand_par { -DECLARE_SOA_COLUMN(CosThetaStar, cosThetaStar, float); //! cosine of theta star -DECLARE_SOA_COLUMN(Cpa, cpa, float); //! cosine of pointing angle -DECLARE_SOA_COLUMN(CpaXY, cpaXY, float); //! cosine of pointing angle in the transverse plane -DECLARE_SOA_COLUMN(Ct, ct, float); //! proper lifetime times c -DECLARE_SOA_COLUMN(DecayLength, decayLength, float); //! decay length -DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); //! decay length divided by its uncertainty -DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); //! decay length in the transverse plane -DECLARE_SOA_COLUMN(DecayLengthXYNormalised, decayLengthXYNormalised, float); //! decay length in the transverse plane divided by its uncertainty -DECLARE_SOA_COLUMN(ImpactParameterNormalised0, impactParameterNormalised0, float); //! impact parameter of prong 0 divided by its uncertainty -DECLARE_SOA_COLUMN(ImpactParameterNormalised1, impactParameterNormalised1, float); //! impact parameter of prong 1 divided by its uncertainty -DECLARE_SOA_COLUMN(ImpactParameterNormalised2, impactParameterNormalised2, float); //! impact parameter of prong 2 divided by its uncertainty -DECLARE_SOA_COLUMN(ImpactParameterProduct, impactParameterProduct, float); //! product of impact parameters of prong 0 and prong 1 -DECLARE_SOA_COLUMN(MaxNormalisedDeltaIP, maxNormalisedDeltaIP, float); //! see RecoDecay::maxNormalisedDeltaIP -DECLARE_SOA_COLUMN(PProng0, pProng0, float); //! momentum magnitude of prong 0 -DECLARE_SOA_COLUMN(PProng1, pProng1, float); //! momentum magnitude of prong 1 -DECLARE_SOA_COLUMN(PProng2, pProng2, float); //! momentum magnitude of prong 2 -DECLARE_SOA_COLUMN(PtProng0, ptProng0, float); //! transverse momentum of prong 0 -DECLARE_SOA_COLUMN(PtProng1, ptProng1, float); //! transverse momentum of prong 1 -DECLARE_SOA_COLUMN(PtProng2, ptProng2, float); //! transverse momentum of prong 2 -DECLARE_SOA_COLUMN(RSecondaryVertex, rSecondaryVertex, float); //! distance of the secondary vertex from the z axis +DECLARE_SOA_COLUMN(CosThetaStar, cosThetaStar, float); //! cosine of theta star +DECLARE_SOA_COLUMN(Cpa, cpa, float); //! cosine of pointing angle +DECLARE_SOA_COLUMN(CpaXY, cpaXY, float); //! cosine of pointing angle in the transverse plane +DECLARE_SOA_COLUMN(Ct, ct, float); //! proper lifetime times c +DECLARE_SOA_COLUMN(DecayLength, decayLength, float); //! decay length +DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); //! decay length divided by its uncertainty +DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); //! decay length in the transverse plane +DECLARE_SOA_COLUMN(DecayLengthXYNormalised, decayLengthXYNormalised, float); //! decay length in the transverse plane divided by its uncertainty +DECLARE_SOA_COLUMN(ImpactParameterNormalised0, impactParameterNormalised0, float); //! impact parameter of prong 0 divided by its uncertainty +DECLARE_SOA_COLUMN(ImpactParameterNormalised1, impactParameterNormalised1, float); //! impact parameter of prong 1 divided by its uncertainty +DECLARE_SOA_COLUMN(ImpactParameterNormalised2, impactParameterNormalised2, float); //! impact parameter of prong 2 divided by its uncertainty +DECLARE_SOA_COLUMN(ImpactParameterProduct, impactParameterProduct, float); //! product of impact parameters of prong 0 and prong 1 +DECLARE_SOA_COLUMN(ImpactParameterXi, impactParameterXi, float); //! product of impact parameters of prong 0 and prong 1 +DECLARE_SOA_COLUMN(ImpactParameterNormalisedXi, impactParameterNormalisedXi, float); //! product of impact parameters of prong 0 and prong 1 +DECLARE_SOA_COLUMN(ImpactParameterPi0, impactParameterPi0, float); //! product of impact parameters of prong 0 and prong 1 +DECLARE_SOA_COLUMN(ImpactParameterNormalisedPi0, impactParameterNormalisedPi0, float); //! product of impact parameters of prong 0 and prong 1 +DECLARE_SOA_COLUMN(ImpactParameterPi1, impactParameterPi1, float); //! product of impact parameters of prong 0 and prong 1 +DECLARE_SOA_COLUMN(ImpactParameterNormalisedPi1, impactParameterNormalisedPi1, float); //! product of impact parameters of prong 0 and prong 1 +DECLARE_SOA_COLUMN(MaxNormalisedDeltaIP, maxNormalisedDeltaIP, float); //! see RecoDecay::maxNormalisedDeltaIP +DECLARE_SOA_COLUMN(PProng0, pProng0, float); //! momentum magnitude of prong 0 +DECLARE_SOA_COLUMN(PProng1, pProng1, float); //! momentum magnitude of prong 1 +DECLARE_SOA_COLUMN(PProng2, pProng2, float); //! momentum magnitude of prong 2 +DECLARE_SOA_COLUMN(PPi0, pPi0, float); //! momentum of pion prong 0 +DECLARE_SOA_COLUMN(PPi1, pPi1, float); //! momentum of pion prong 1 +DECLARE_SOA_COLUMN(PtProng0, ptProng0, float); //! transverse momentum of prong 0 +DECLARE_SOA_COLUMN(PtProng1, ptProng1, float); //! transverse momentum of prong 1 +DECLARE_SOA_COLUMN(PtProng2, ptProng2, float); //! transverse momentum of prong 2 +DECLARE_SOA_COLUMN(PtPi0, ptPi0, float); //! transverse momentum of pion prong 0 +DECLARE_SOA_COLUMN(PtPi1, ptPi1, float); //! transverse momentum of pion prong 1 +DECLARE_SOA_COLUMN(PtXi, ptXi, float); //! transverse momentum of Xi prong +DECLARE_SOA_COLUMN(RSecondaryVertex, rSecondaryVertex, float); //! distance of the secondary vertex from the z axis // D*± → D0(bar) π± DECLARE_SOA_COLUMN(SignProng1, signProng1, int8_t); // TOF @@ -921,77 +932,70 @@ DECLARE_SOA_TABLE_STAGED(HfDstarMcs, "HFDSTMC", //! Table with MC candidate info o2::soa::Marker); // ---------------- -// Xic+ +// Ξc± → (Ξ∓ → (Λ → p π∓) π∓) π± π± // ---------------- -DECLARE_SOA_TABLE_STAGED(HfXicToXiPiPiPars, "HFXICTOXIPIPIPAR", //! Table with candidate properties used for selection +DECLARE_SOA_TABLE_STAGED(HfXicToXiPiPiPars, "HFXICXPPPAR", //! Table with candidate properties used for selection + hf_cand_par::PtXi, + hf_cand_par::PtPi0, + hf_cand_par::PtPi1, + hf_cand_xic_to_xi_pi_pi::InvMassXi, + hf_cand_xic_to_xi_pi_pi::InvMassLambda, + hf_cand_xic_to_xi_pi_pi::InvMassXiPi0, + hf_cand_xic_to_xi_pi_pi::InvMassXiPi1, hf_cand::Chi2PCA, - hf_cand_par::Cpa, - hf_cand_par::CpaXY, + hf_cand_par::Ct, hf_cand_par::DecayLength, - hf_cand_par::DecayLengthXY, hf_cand_par::DecayLengthNormalised, + hf_cand_par::DecayLengthXY, hf_cand_par::DecayLengthXYNormalised, - hf_cand_par::PtProng0, - hf_cand_par::PtProng1, - hf_cand::ImpactParameter0, - hf_cand::ImpactParameter1, - hf_cand_par::ImpactParameterNormalised0, - hf_cand_par::ImpactParameterNormalised1, - hf_cand_par::NSigTpcPiExpPi, - hf_cand_par::NSigTofPiExpPi, - hf_cand_par::NSigTpcTofPiExpPi, - hf_cand_par::NSigTpcKaExpPi, - hf_cand_par::NSigTofKaExpPi, - hf_cand_par::NSigTpcTofKaExpPi, + hf_cand_par::Cpa, + hf_cand_par::CpaXY, + hf_cand_xic_to_xi_pi_pi::CpaXi, + hf_cand_xic_to_xi_pi_pi::CpaXYXi, + hf_cand_xic_to_xi_pi_pi::CpaLambda, + hf_cand_xic_to_xi_pi_pi::CpaXYLambda, + hf_cand_par::ImpactParameterXi, + hf_cand_par::ImpactParameterNormalisedXi, + hf_cand_par::ImpactParameterPi0, + hf_cand_par::ImpactParameterNormalisedPi0, + hf_cand_par::ImpactParameterPi1, + hf_cand_par::ImpactParameterNormalisedPi1, hf_cand_par::MaxNormalisedDeltaIP, - hf_cand_par::ImpactParameterProduct, o2::soa::Marker); -DECLARE_SOA_TABLE_STAGED(HfXicToXiPiPiParXis, "HFXICTOXIPIPIPARXI", //! Table with Xi candidate properties used for selection of Xic+ - hf_cand_par_charm::CpaCharm, - hf_cand_par_charm::DecayLengthCharm, - hf_cand_par_charm::ImpactParameter0Charm, - hf_cand_par_charm::ImpactParameter1Charm, - hf_cand_par_charm::ImpactParameterProductCharm, - hf_cand_par_charm::NSigTpcPiExpPiCharm, - hf_cand_par_charm::NSigTofPiExpPiCharm, - hf_cand_par_charm::NSigTpcTofPiExpPiCharm, - hf_cand_par_charm::NSigTpcKaExpPiCharm, - hf_cand_par_charm::NSigTofKaExpPiCharm, - hf_cand_par_charm::NSigTpcTofKaExpPiCharm, - hf_cand_par_charm::NSigTpcPiExpKaCharm, - hf_cand_par_charm::NSigTofPiExpKaCharm, - hf_cand_par_charm::NSigTpcTofPiExpKaCharm, - hf_cand_par_charm::NSigTpcKaExpKaCharm, - hf_cand_par_charm::NSigTofKaExpKaCharm, - hf_cand_par_charm::NSigTpcTofKaExpKaCharm); - -DECLARE_SOA_TABLE_STAGED(HfXicToXiPiPiParEs, "HFXICTOXIPIPIPARE", //! Table with additional candidate properties used for selection - hf_cand::XSecondaryVertex, - hf_cand::YSecondaryVertex, - hf_cand::ZSecondaryVertex, - hf_cand::ErrorDecayLength, - hf_cand::ErrorDecayLengthXY, - hf_cand_par::RSecondaryVertex, - hf_cand_par::PProng1, - hf_cand::PxProng1, - hf_cand::PyProng1, - hf_cand::PzProng1, - hf_cand::ErrorImpactParameter1, - hf_cand_par::CosThetaStar, - hf_cand_par::Ct, +DECLARE_SOA_TABLE_STAGED(HfXicToXiPiPiParEs, "HFXICXPPPARE", //! Table with additional candidate properties used for selection + hf_cand_xic_to_xi_pi_pi::CpaLambdaToXi, + hf_cand_xic_to_xi_pi_pi::CpaXYLambdaToXi, + hf_cand_par::PPi0, + hf_cand_par::PPi1, + hf_cand_xic_to_xi_pi_pi::PBachelorPi, + hf_cand_xic_to_xi_pi_pi::PPiFromLambda, + hf_cand_xic_to_xi_pi_pi::PPrFromLambda, + hf_cand_xic_to_xi_pi_pi::DcaXiDaughters, + hf_cand_xic_to_xi_pi_pi::DcaV0Daughters, + hf_cand_xic_to_xi_pi_pi::DcaPosToPV, + hf_cand_xic_to_xi_pi_pi::DcaNegToPV, + hf_cand_xic_to_xi_pi_pi::DcaBachelorToPV, + hf_cand_xic_to_xi_pi_pi::DcaXYCascToPV, + hf_cand_xic_to_xi_pi_pi::DcaZCascToPV, + hf_cand_xic_to_xi_pi_pi::NSigTpcPiFromXicPlus0, + hf_cand_xic_to_xi_pi_pi::NSigTpcPiFromXicPlus1, + hf_cand_xic_to_xi_pi_pi::NSigTpcBachelorPi, + hf_cand_xic_to_xi_pi_pi::NSigTpcPiFromLambda, + hf_cand_xic_to_xi_pi_pi::NSigTpcPrFromLambda, + hf_cand_xic_to_xi_pi_pi::NSigTofPiFromXicPlus0, + hf_cand_xic_to_xi_pi_pi::NSigTofPiFromXicPlus1, + hf_cand_xic_to_xi_pi_pi::NSigTofBachelorPi, + hf_cand_xic_to_xi_pi_pi::NSigTofPiFromLambda, + hf_cand_xic_to_xi_pi_pi::NSigTofPrFromLambda, o2::soa::Marker); -DECLARE_SOA_TABLE_STAGED(HfXicToXiPiPiMls, "HFXICTOXIPIPIML", //! Table with candidate selection ML scores - hf_cand_mc::MlScoreSig, - o2::soa::Marker); - -DECLARE_SOA_TABLE_STAGED(HfXicToXiPiPiMlXis, "HFXICTOXIPIPIMLXI", //! Table with Xi candidate selection ML scores - hf_cand_mc_charm::MlScoresCharm, +DECLARE_SOA_TABLE_STAGED(HfXicToXiPiPiMls, "HFXICXPPML", //! Table with candidate selection ML scores + hf_cand_mc::MlScores, o2::soa::Marker); -DECLARE_SOA_TABLE_STAGED(HfXicToXiPiPiMcs, "HFXICTOXIPIPIMC", //! Table with MC candidate info +DECLARE_SOA_TABLE_STAGED(HfXicToXiPiPiMcs, "HFXICXPPMC", //! Table with MC candidate info hf_cand_mc::FlagMcMatchRec, hf_cand_mc::OriginMcRec, o2::soa::Marker); diff --git a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx index 9b6d413cb50..8c4b976e7e4 100644 --- a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx @@ -21,10 +21,10 @@ #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/DataModel/DerivedTables.h" #include "PWGHF/Utils/utilsDerivedData.h" -#include "PWGHF/Utils/utilsPid.h" +// #include "PWGHF/Utils/utilsPid.h" #include "PWGLF/DataModel/mcCentrality.h" -#include "Common/Core/RecoDecay.h" +// #include "Common/Core/RecoDecay.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/Multiplicity.h" @@ -71,22 +71,18 @@ struct HfDerivedDataCreatorXicToXiPiPi { rowsCommon; // Candidates Produces rowCandidatePar; - Produces rowCandidateParXi; Produces rowCandidateParE; Produces rowCandidateSel; Produces rowCandidateMl; - Produces rowCandidateMlXi; Produces rowCandidateId; Produces rowCandidateMc; // Switches for filling tables HfConfigurableDerivedData confDerData; Configurable fillCandidatePar{"fillCandidatePar", true, "Fill candidate parameters"}; - Configurable fillCandidateParXi{"fillCandidateParXi", true, "Fill Xi candidate parameters"}; Configurable fillCandidateParE{"fillCandidateParE", true, "Fill candidate extended parameters"}; Configurable fillCandidateSel{"fillCandidateSel", true, "Fill candidate selection flags"}; Configurable fillCandidateMl{"fillCandidateMl", true, "Fill candidate selection ML scores"}; - Configurable fillCandidateMlXi{"fillCandidateMlXi", true, "Fill Xi candidate selection ML scores"}; Configurable fillCandidateId{"fillCandidateId", true, "Fill original indices from the candidate table"}; Configurable fillCandidateMc{"fillCandidateMc", true, "Fill candidate MC info"}; // Parameters for production of training samples @@ -106,9 +102,9 @@ struct HfDerivedDataCreatorXicToXiPiPi { using SelectedCandidatesMcMl = soa::Filtered>; using MatchedGenCandidatesMc = soa::Filtered>; using TypeMcCollisions = soa::Join; - using THfCandDaughtersMl = soa::Join; + using THfCandDaughtersMl = aod::Cascades; - Filter filterSelectCandidates = (aod::hf_sel_candidate_xic::isSelXicToXiPiPi & static_cast(BIT(aod::SelectionStep::RecoMl - 1))) != 0; + Filter filterSelectCandidates = (aod::hf_sel_candidate_xic::isSelXicToXiPiPi & static_cast(BIT(o2::aod::hf_sel_candidate_xic::XicToXiPiPiSelectionStep::RecoMl - 1))) != 0; Filter filterMcGenMatching = nabs(aod::hf_cand_xic_to_xi_pi_pi::flagMcMatchGen) == static_cast(DecayType::XicToXiPiPi); Preslice candidatesPerCollision = aod::hf_cand::collisionId; @@ -137,69 +133,66 @@ struct HfDerivedDataCreatorXicToXiPiPi { rowsCommon.init(confDerData); } - template - void fillTablesCandidate(const T& candidate, const U& prongCascade, const V& prongBachelor0, int candFlag, double invMass, - double ct, double y, int8_t flagMc, int8_t origin, float mlScore, const std::vector& mlScoresCascade) + template + void fillTablesCandidate(const T& candidate, int candFlag, double invMass, + double ct, double y, int8_t flagMc, int8_t origin, const std::vector& mlScores) { rowsCommon.fillTablesCandidate(candidate, invMass, y); if (fillCandidatePar) { rowCandidatePar( + candidate.ptProng0(), + candidate.ptProng1(), + candidate.ptProng2(), + candidate.invMassXi(), + candidate.invMassLambda(), + candidate.invMassXiPi0(), + candidate.invMassXiPi1(), candidate.chi2PCA(), - candidate.cpa(), - candidate.cpaXY(), + ct, candidate.decayLength(), - candidate.decayLengthXY(), candidate.decayLengthNormalised(), + candidate.decayLengthXY(), candidate.decayLengthXYNormalised(), - candidate.ptProng0(), - candidate.ptProng1()); - } - if (fillCandidateParXi) { - std::array, 2>, 2> sigmas{}; // PID nSigma [Expected][Hypothesis][TPC/TOF/TPC+TOF] - if (candFlag == 0) { - GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion], prongCascade, 0, Pi) - GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon], prongCascade, 0, Ka) - GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion], prongCascade, 1, Pi) - GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon], prongCascade, 1, Ka) - } else if (candFlag == 1) { - GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion], prongCascade, 1, Pi) - GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon], prongCascade, 1, Ka) - GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion], prongCascade, 0, Pi) - GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon], prongCascade, 0, Ka) - } - rowCandidateParXi( - prongCascade.cpa(), - prongCascade.decayLength(), - prongCascade.impactParameter0(), - prongCascade.impactParameter1(), - prongCascade.impactParameterProduct(), - sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion][0], - sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion][1], - sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion][2], - sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon][0], - sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon][1], - sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon][2], - sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion][0], - sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion][1], - sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion][2], - sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon][0], - sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon][1], - sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon][2]); + candidate.cpa(), + candidate.cpaXY(), + candidate.cpaXi(), + candidate.cpaXYXi(), + candidate.cpaLambda(), + candidate.cpaXYLambda(), + candidate.impactParameter0(), + candidate.impactParameterNormalised0(), + candidate.impactParameter1(), + candidate.impactParameterNormalised1(), + candidate.impactParameter2(), + candidate.impactParameterNormalised2(), + candidate.maxNormalisedDeltaIP()); } if (fillCandidateParE) { rowCandidateParE( - candidate.xSecondaryVertex(), - candidate.ySecondaryVertex(), - candidate.zSecondaryVertex(), - candidate.errorDecayLength(), - candidate.errorDecayLengthXY(), - candidate.rSecondaryVertex(), - RecoDecay::p(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()), - candidate.pxProng1(), - candidate.pyProng1(), - candidate.pzProng1(), - candidate.errorImpactParameter1(), - ct); + candidate.cpaLambdaToXi(), + candidate.cpaXYLambdaToXi(), + candidate.pProng1(), + candidate.pProng2(), + candidate.pBachelorPi(), + candidate.pPiFromLambda(), + candidate.pPrFromLambda(), + candidate.dcaXiDaughters(), + candidate.dcaV0Daughters(), + candidate.dcaPosToPV(), + candidate.dcaNegToPV(), + candidate.dcaBachelorToPV(), + candidate.dcaXYCascToPV(), + candidate.dcaZCascToPV(), + candidate.nSigTpcPiFromXicPlus0(), + candidate.nSigTpcPiFromXicPlus1(), + candidate.nSigTpcBachelorPi(), + candidate.nSigTpcPiFromLambda(), + candidate.nSigTpcPrFromLambda(), + candidate.nSigTofPiFromXicPlus0(), + candidate.nSigTofPiFromXicPlus1(), + candidate.nSigTofBachelorPi(), + candidate.nSigTofPiFromLambda(), + candidate.nSigTofPrFromLambda()); } if (fillCandidateSel) { rowCandidateSel( @@ -207,18 +200,16 @@ struct HfDerivedDataCreatorXicToXiPiPi { } if (fillCandidateMl) { rowCandidateMl( - mlScore); - } - if (fillCandidateMlXi) { - rowCandidateMlXi( - mlScoresCascade); + mlScores); } if (fillCandidateId) { rowCandidateId( candidate.collisionId(), - prongCascade.prong0Id(), - prongCascade.prong1Id(), - candidate.prong1Id()); + candidate.pi0Id(), + candidate.pi1Id(), + candidate.bachelorId(), + candidate.posTrackId(), + candidate.negTrackId()); } if (fillCandidateMc) { rowCandidateMc( @@ -263,11 +254,9 @@ struct HfDerivedDataCreatorXicToXiPiPi { // Fill candidate properties rowsCommon.reserveTablesCandidates(sizeTableCand); reserveTable(rowCandidatePar, fillCandidatePar, sizeTableCand); - reserveTable(rowCandidateParXi, fillCandidateParXi, sizeTableCand); reserveTable(rowCandidateParE, fillCandidateParE, sizeTableCand); reserveTable(rowCandidateSel, fillCandidateSel, sizeTableCand); reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand); - reserveTable(rowCandidateMlXi, fillCandidateMlXi, sizeTableCand); reserveTable(rowCandidateId, fillCandidateId, sizeTableCand); if constexpr (isMc) { reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand); @@ -275,13 +264,13 @@ struct HfDerivedDataCreatorXicToXiPiPi { int8_t flagMcRec = 0, origin = 0; for (const auto& candidate : candidatesThisColl) { if constexpr (isMl) { - if (!TESTBIT(candidate.isSelXicToXiPiPi(), aod::SelectionStep::RecoMl)) { + if (!TESTBIT(candidate.isSelXicToXiPiPi(), o2::aod::hf_sel_candidate_xic::XicToXiPiPiSelectionStep::RecoMl)) { continue; } } if constexpr (isMc) { flagMcRec = candidate.flagMcMatchRec(); - origin = candidate.originRec(); + origin = candidate.originMcRec(); if constexpr (onlyBkg) { if (std::abs(flagMcRec) == DecayType::XicToXiPiPi) { continue; @@ -299,30 +288,19 @@ struct HfDerivedDataCreatorXicToXiPiPi { } } } - // FIXME - auto prongCascade = candidate.template cascade_as(); - auto prongBachelor0 = candidate.template pi0_as(); - auto prongBachelor1 = candidate.template pi1_as(); - auto prongBachelorWhat = candidate.template bachelor_as(); - auto prongPosTrack = candidate.template posTrack_as(); - auto prongNegTrack = candidate.template negTrack_as(); - - double ct = hfHelper.ctXic(candidate); + // auto prongPi0FromXic = candidate.template pi0_as(); double y = hfHelper.yXic(candidate); float massXicToXiPiPi = candidate.invMassXicPlus(); - float mlScoreXicToXiPiPi{-1.f}; - std::vector mlScoresXi; - bool isXi = prongBachelor0.sign() < 0; - if (isXi) { // is Xi - std::copy(prongCascade.mlProbXi().begin(), prongCascade.mlProbXi().end(), std::back_inserter(mlScoresXi)); - } else { // is Xibar - std::copy(prongCascade.mlProbXibar().begin(), prongCascade.mlProbXibar().end(), std::back_inserter(mlScoresXi)); - } + double ct = hfHelper.ctXic(candidate); + std::vector mlScoreXicToXiPiPi; + // float mlScoreXicToXiPiPi{-1.f}; + // std::vector mlScoresXi; + // bool isXi = prongPi0FromXic.sign() < 0; if constexpr (isMl) { - mlScoreXicToXiPiPi = candidate.mlProbXicToXiPiPi(); + std::copy(candidate.mlProbXicToXiPiPi().begin(), candidate.mlProbXicToXiPiPi().end(), std::back_inserter(mlScoreXicToXiPiPi)); } // flag = 0 for Xi pi-, flag = 1 for Xibar pi+ - fillTablesCandidate(candidate, prongCascade, prongBachelor0, isXi ? 0 : 1, massXicToXiPiPi, ct, y, flagMcRec, origin, mlScoreXicToXiPiPi, mlScoresXi); + fillTablesCandidate(candidate, 1, massXicToXiPiPi, ct, y, flagMcRec, origin, mlScoreXicToXiPiPi); } } } diff --git a/PWGHF/TableProducer/treeCreatorOmegac0ToOmegaKa.cxx b/PWGHF/TableProducer/treeCreatorOmegac0ToOmegaKa.cxx index a16685f7b04..aaa3ee36337 100644 --- a/PWGHF/TableProducer/treeCreatorOmegac0ToOmegaKa.cxx +++ b/PWGHF/TableProducer/treeCreatorOmegac0ToOmegaKa.cxx @@ -95,7 +95,7 @@ DECLARE_SOA_COLUMN(IsKaonGlbTrkWoDca, isKaonGlbTrkWoDca, bool); DECLARE_SOA_COLUMN(KaonItsNCls, kaonItsNCls, uint8_t); // from creator - MC DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); // reconstruction level -DECLARE_SOA_COLUMN(OriginRec, originRec, int8_t); +DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t); DECLARE_SOA_COLUMN(CollisionMatched, collisionMatched, bool); // from selector DECLARE_SOA_COLUMN(PidTpcInfoStored, pidTpcInfoStored, int); @@ -136,7 +136,7 @@ DECLARE_SOA_TABLE(HfOmegac0ToOmegaKaLites, "AOD", "HFTOOMEKALITE", full::PidTpcInfoStored, full::PidTofInfoStored, full::TpcNSigmaKaFromCharmBaryon, full::TpcNSigmaKaFromCasc, full::TpcNSigmaPiFromLambda, full::TpcNSigmaPrFromLambda, full::TofNSigmaKaFromCharmBaryon, full::TofNSigmaKaFromCasc, full::TofNSigmaPiFromLambda, full::TofNSigmaPrFromLambda, - full::FlagMcMatchRec, full::OriginRec, full::CollisionMatched); + full::FlagMcMatchRec, full::OriginMcRec, full::CollisionMatched); } // namespace o2::aod @@ -264,7 +264,7 @@ struct HfTreeCreatorOmegac0ToOmegaKa { // Filling candidate properties rowCandidateLite.reserve(candidates.size()); for (const auto& candidate : candidates) { - fillCandidateLite(candidate, candidate.flagMcMatchRec(), candidate.originRec(), candidate.collisionMatched()); + fillCandidateLite(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched()); } } PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaKa, processMcLite, "Process MC", false); diff --git a/PWGHF/TableProducer/treeCreatorOmegac0ToOmegaPi.cxx b/PWGHF/TableProducer/treeCreatorOmegac0ToOmegaPi.cxx index ad25a583f45..4fb9c92235c 100644 --- a/PWGHF/TableProducer/treeCreatorOmegac0ToOmegaPi.cxx +++ b/PWGHF/TableProducer/treeCreatorOmegac0ToOmegaPi.cxx @@ -101,7 +101,7 @@ DECLARE_SOA_COLUMN(IsPionGlbTrkWoDca, isPionGlbTrkWoDca, bool); DECLARE_SOA_COLUMN(PionItsNCls, pionItsNCls, uint8_t); // from creator - MC DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); // reconstruction level -DECLARE_SOA_COLUMN(OriginRec, originRec, int8_t); +DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t); DECLARE_SOA_COLUMN(CollisionMatched, collisionMatched, bool); // from selector DECLARE_SOA_COLUMN(PidTpcInfoStored, pidTpcInfoStored, int); @@ -190,7 +190,7 @@ DECLARE_SOA_TABLE(HfOmegac0ToOmegaPiLites, "AOD", "HFTOOMEPILITE", full::PidTpcInfoStored, full::PidTofInfoStored, full::TpcNSigmaPiFromCharmBaryon, full::TpcNSigmaKaFromCasc, full::TpcNSigmaPiFromLambda, full::TpcNSigmaPrFromLambda, full::TofNSigmaPiFromCharmBaryon, full::TofNSigmaKaFromCasc, full::TofNSigmaPiFromLambda, full::TofNSigmaPrFromLambda, - full::FlagMcMatchRec, full::OriginRec, full::CollisionMatched, hf_track_index::HFflag); + full::FlagMcMatchRec, full::OriginMcRec, full::CollisionMatched, hf_track_index::HFflag); DECLARE_SOA_TABLE(HfKfOmegacFulls, "AOD", "HFKFOMEGACFULL", full::NSigmaTPCPiFromOmegac, full::NSigmaTOFPiFromOmegac, full::NSigmaTPCKaFromCasc, full::NSigmaTOFKaFromCasc, @@ -211,7 +211,7 @@ DECLARE_SOA_TABLE(HfKfOmegacFulls, "AOD", "HFKFOMEGACFULL", full::MassV0Ndf, full::MassCascNdf, full::V0Chi2OverNdf, full::CascChi2OverNdf, full::OmegacChi2OverNdf, full::MassV0Chi2OverNdf, full::MassCascChi2OverNdf, full::CascRejectInvmass, - full::FlagMcMatchRec, full::OriginRec, full::CollisionMatched, hf_track_index::HFflag); + full::FlagMcMatchRec, full::OriginMcRec, full::CollisionMatched, hf_track_index::HFflag); DECLARE_SOA_TABLE(HfKfOmegacLites, "AOD", "HFKFOMEGACLITE", full::NSigmaTPCPiFromOmegac, full::NSigmaTOFPiFromOmegac, full::NSigmaTPCKaFromCasc, full::NSigmaTOFKaFromCasc, @@ -225,7 +225,7 @@ DECLARE_SOA_TABLE(HfKfOmegacLites, "AOD", "HFKFOMEGACLITE", full::CosThetaStarPiFromOmegac, full::CtOmegac, full::EtaOmegac, full::V0Chi2OverNdf, full::CascChi2OverNdf, full::OmegacChi2OverNdf, full::CascRejectInvmass, - full::FlagMcMatchRec, full::OriginRec, full::CollisionMatched, hf_track_index::HFflag); + full::FlagMcMatchRec, full::OriginMcRec, full::CollisionMatched, hf_track_index::HFflag); } // namespace o2::aod /// Writes the full information in an output TTree @@ -504,7 +504,7 @@ struct HfTreeCreatorOmegac0ToOmegaPi { // Filling candidate properties rowCandidateLite.reserve(candidates.size()); for (const auto& candidate : candidates) { - fillCandidateLite(candidate, candidate.flagMcMatchRec(), candidate.originRec(), candidate.collisionMatched()); + fillCandidateLite(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched()); } } PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processMcLite, "Process MC", false); @@ -521,11 +521,11 @@ struct HfTreeCreatorOmegac0ToOmegaPi { rowCandidateLite.reserve(candidates.size()); for (const auto& candidate : candidates) { if (keepOnlyMcSignal) { - if (candidate.originRec() != 0) { - fillKfCandidate(candidate, candidate.flagMcMatchRec(), candidate.originRec(), candidate.collisionMatched()); + if (candidate.originMcRec() != 0) { + fillKfCandidate(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched()); } } else { - fillKfCandidate(candidate, candidate.flagMcMatchRec(), candidate.originRec(), candidate.collisionMatched()); + fillKfCandidate(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched()); } } } @@ -543,11 +543,11 @@ struct HfTreeCreatorOmegac0ToOmegaPi { rowCandidateLite.reserve(candidates.size()); for (const auto& candidate : candidates) { if (keepOnlyMcSignal) { - if (candidate.originRec() != 0) { - fillKfCandidateLite(candidate, candidate.flagMcMatchRec(), candidate.originRec(), candidate.collisionMatched()); + if (candidate.originMcRec() != 0) { + fillKfCandidateLite(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched()); } } else { - fillKfCandidateLite(candidate, candidate.flagMcMatchRec(), candidate.originRec(), candidate.collisionMatched()); + fillKfCandidateLite(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched()); } } } diff --git a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx index b74dafe4c5e..c291852c448 100644 --- a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx +++ b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx @@ -87,7 +87,7 @@ DECLARE_SOA_COLUMN(DecayLengthCharmedBaryon, decayLengthCharmedBaryon, float); DECLARE_SOA_COLUMN(DecayLengthXYCharmedBaryon, decayLengthXYCharmedBaryon, float); DECLARE_SOA_COLUMN(DecayLengthCasc, decayLengthCasc, float); DECLARE_SOA_COLUMN(DecayLengthXYCasc, decayLengthXYCasc, float); -DECLARE_SOA_COLUMN(OriginGen, originGen, int); +DECLARE_SOA_COLUMN(OriginMcGen, originMcGen, int); DECLARE_SOA_COLUMN(DecayChannel, decayChannel, int); } // namespace hf_st_charmed_baryon_gen @@ -104,7 +104,7 @@ DECLARE_SOA_TABLE(HfStChBarGens, "AOD", "HFSTCHBARGEN", hf_st_charmed_baryon_gen::DecayLengthXYCharmedBaryon, hf_st_charmed_baryon_gen::DecayLengthCasc, hf_st_charmed_baryon_gen::DecayLengthXYCasc, - hf_st_charmed_baryon_gen::OriginGen, + hf_st_charmed_baryon_gen::OriginMcGen, hf_st_charmed_baryon_gen::DecayChannel); // CharmedBaryon -> Casc + Pion/Kaon @@ -164,7 +164,7 @@ DECLARE_SOA_COLUMN(DecayLengthCasc, decayLengthCasc, float); DECLARE_SOA_COLUMN(DecayLengthXYCasc, decayLengthXYCasc, float); DECLARE_SOA_INDEX_COLUMN_FULL(MotherCasc, motherCasc, int, HfStChBarGens, "_Casc"); DECLARE_SOA_INDEX_COLUMN_FULL(MotherPionOrKaon, motherPionOrKaon, int, HfStChBarGens, "_PionOrKaon"); -DECLARE_SOA_COLUMN(OriginRec, originRec, int); +DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int); } // namespace hf_st_charmed_baryon DECLARE_SOA_TABLE(HfStChBars, "AOD", "HFSTCHBAR", @@ -220,7 +220,7 @@ DECLARE_SOA_TABLE(HfStChBars, "AOD", "HFSTCHBAR", hf_st_charmed_baryon::DecayLengthXYCasc, hf_st_charmed_baryon::MotherCascId, hf_st_charmed_baryon::MotherPionOrKaonId, - hf_st_charmed_baryon::OriginRec); + hf_st_charmed_baryon::OriginMcRec); } // namespace o2::aod struct HfTreeCreatorOmegacSt { diff --git a/PWGHF/TableProducer/treeCreatorToXiPi.cxx b/PWGHF/TableProducer/treeCreatorToXiPi.cxx index 88ca022029a..01e40cfb2c8 100644 --- a/PWGHF/TableProducer/treeCreatorToXiPi.cxx +++ b/PWGHF/TableProducer/treeCreatorToXiPi.cxx @@ -136,7 +136,7 @@ DECLARE_SOA_COLUMN(NTpcRowsNegV0Dau, nTpcRowsNegV0Dau, int16_t); // from creator - MC DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); // reconstruction level DECLARE_SOA_COLUMN(DebugMcRec, debugMcRec, int8_t); // debug flag for mis-association reconstruction level -DECLARE_SOA_COLUMN(OriginRec, originRec, int8_t); +DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t); DECLARE_SOA_COLUMN(CollisionMatched, collisionMatched, bool); // from selector DECLARE_SOA_COLUMN(StatusPidLambda, statusPidLambda, bool); @@ -194,7 +194,7 @@ DECLARE_SOA_TABLE(HfToXiPiFulls, "AOD", "HFTOXIPIFULL", full::StatusInvMassLambda, full::StatusInvMassCascade, full::StatusInvMassCharmBaryon, full::ResultSelections, full::PidTpcInfoStored, full::PidTofInfoStored, full::TpcNSigmaPiFromCharmBaryon, full::TpcNSigmaPiFromCasc, full::TpcNSigmaPiFromLambda, full::TpcNSigmaPrFromLambda, full::TofNSigmaPiFromCharmBaryon, full::TofNSigmaPiFromCasc, full::TofNSigmaPiFromLambda, full::TofNSigmaPrFromLambda, - full::FlagMcMatchRec, full::DebugMcRec, full::OriginRec, full::CollisionMatched); + full::FlagMcMatchRec, full::DebugMcRec, full::OriginMcRec, full::CollisionMatched); DECLARE_SOA_TABLE(HfToXiPiLites, "AOD", "HFTOXIPILITE", full::XPv, full::YPv, full::ZPv, full::Centrality, collision::NumContrib, collision::Chi2, @@ -219,7 +219,7 @@ DECLARE_SOA_TABLE(HfToXiPiLites, "AOD", "HFTOXIPILITE", full::PidTpcInfoStored, full::PidTofInfoStored, full::TpcNSigmaPiFromCharmBaryon, full::TpcNSigmaPiFromCasc, full::TpcNSigmaPiFromLambda, full::TpcNSigmaPrFromLambda, full::TofNSigmaPiFromCharmBaryon, full::TofNSigmaPiFromCasc, full::TofNSigmaPiFromLambda, full::TofNSigmaPrFromLambda, - full::FlagMcMatchRec, full::OriginRec, full::CollisionMatched); + full::FlagMcMatchRec, full::OriginMcRec, full::CollisionMatched); } // namespace o2::aod @@ -490,7 +490,7 @@ struct HfTreeCreatorToXiPi { // Filling candidate properties rowCandidateFull.reserve(candidates.size()); for (const auto& candidate : candidates) { - fillCandidate(candidate, candidate.flagMcMatchRec(), candidate.debugMcRec(), candidate.originRec(), candidate.collisionMatched()); + fillCandidate(candidate, candidate.flagMcMatchRec(), candidate.debugMcRec(), candidate.originMcRec(), candidate.collisionMatched()); } } PROCESS_SWITCH(HfTreeCreatorToXiPi, processMcFullXic0, "Process MC with full information for xic0 w/o centrality", false); @@ -507,7 +507,7 @@ struct HfTreeCreatorToXiPi { // Filling candidate properties rowCandidateFull.reserve(candidates.size()); for (const auto& candidate : candidates) { - fillCandidate(candidate, candidate.flagMcMatchRec(), candidate.debugMcRec(), candidate.originRec(), candidate.collisionMatched()); + fillCandidate(candidate, candidate.flagMcMatchRec(), candidate.debugMcRec(), candidate.originMcRec(), candidate.collisionMatched()); } } PROCESS_SWITCH(HfTreeCreatorToXiPi, processMcFullOmegac0, "Process MC with full information for omegac0", false); @@ -592,7 +592,7 @@ struct HfTreeCreatorToXiPi { // Filling candidate properties rowCandidateLite.reserve(candidates.size()); for (const auto& candidate : candidates) { - fillCandidateLite(candidate, candidate.flagMcMatchRec(), candidate.originRec(), candidate.collisionMatched()); + fillCandidateLite(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched()); } } PROCESS_SWITCH(HfTreeCreatorToXiPi, processMcLiteXic0, "Process MC and produce lite table version for xic0", false); @@ -609,7 +609,7 @@ struct HfTreeCreatorToXiPi { // Filling candidate properties rowCandidateLite.reserve(candidates.size()); for (const auto& candidate : candidates) { - fillCandidateLite(candidate, candidate.flagMcMatchRec(), candidate.originRec(), candidate.collisionMatched()); + fillCandidateLite(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched()); } } PROCESS_SWITCH(HfTreeCreatorToXiPi, processMcLiteXic0WithFT0C, "Process MC and produce lite table version for Xic0 with FT0C", false); @@ -626,7 +626,7 @@ struct HfTreeCreatorToXiPi { // Filling candidate properties rowCandidateLite.reserve(candidates.size()); for (const auto& candidate : candidates) { - fillCandidateLite(candidate, candidate.flagMcMatchRec(), candidate.originRec(), candidate.collisionMatched()); + fillCandidateLite(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched()); } } PROCESS_SWITCH(HfTreeCreatorToXiPi, processMcLiteXic0WithFT0M, "Process MC and produce lite table version for Xic0 with FT0M", false); @@ -643,7 +643,7 @@ struct HfTreeCreatorToXiPi { // Filling candidate properties rowCandidateLite.reserve(candidates.size()); for (const auto& candidate : candidates) { - fillCandidateLite(candidate, candidate.flagMcMatchRec(), candidate.originRec(), candidate.collisionMatched()); + fillCandidateLite(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched()); } } PROCESS_SWITCH(HfTreeCreatorToXiPi, processMcLiteXic0WithNTracksPV, "Process MC and produce lite table version for Xic0 with NTracksPV", false); @@ -660,7 +660,7 @@ struct HfTreeCreatorToXiPi { // Filling candidate properties rowCandidateLite.reserve(candidates.size()); for (const auto& candidate : candidates) { - fillCandidateLite(candidate, candidate.flagMcMatchRec(), candidate.originRec(), candidate.collisionMatched()); + fillCandidateLite(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched()); } } PROCESS_SWITCH(HfTreeCreatorToXiPi, processMcLiteOmegac0, "Process MC and produce lite table version for omegac0", false); diff --git a/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx b/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx index ae861a337c7..0e1c06d5965 100644 --- a/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx +++ b/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx @@ -56,7 +56,7 @@ DECLARE_SOA_COLUMN(DcaCharmBaryonDau, dcaCharmBaryonDau, float); // from creator - MC DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); // reconstruction level DECLARE_SOA_COLUMN(DebugMcRec, debugMcRec, int8_t); // debug flag for mis-association reconstruction level -DECLARE_SOA_COLUMN(OriginRec, originRec, int8_t); +DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t); DECLARE_SOA_COLUMN(CollisionMatched, collisionMatched, bool); // from selector DECLARE_SOA_COLUMN(TpcNSigmaPiFromCharmBaryon, tpcNSigmaPiFromCharmBaryon, float); @@ -129,7 +129,7 @@ DECLARE_SOA_TABLE(HfKfXicFulls, "AOD", "HFKFXICFULL", full::MassV0Ndf, full::MassCascNdf, full::V0Chi2OverNdf, full::CascChi2OverNdf, full::XicChi2OverNdf, full::MassV0Chi2OverNdf, full::MassCascChi2OverNdf, - full::FlagMcMatchRec, full::DebugMcRec, full::OriginRec, full::CollisionMatched); + full::FlagMcMatchRec, full::DebugMcRec, full::OriginMcRec, full::CollisionMatched); } // namespace o2::aod @@ -280,7 +280,7 @@ struct HfTreeCreatorXic0ToXiPiKf { { rowKfCandidate.reserve(candidates.size()); for (const auto& candidate : candidates) { - fillKfCandidate(candidate, candidate.flagMcMatchRec(), candidate.debugMcRec(), candidate.originRec(), candidate.collisionMatched()); + fillKfCandidate(candidate, candidate.flagMcMatchRec(), candidate.debugMcRec(), candidate.originMcRec(), candidate.collisionMatched()); } } PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfMcXic0, "Process MC with information for xic0", false); @@ -290,7 +290,7 @@ struct HfTreeCreatorXic0ToXiPiKf { { rowKfCandidate.reserve(candidates.size()); for (const auto& candidate : candidates) { - fillKfCandidate(candidate, candidate.flagMcMatchRec(), candidate.debugMcRec(), candidate.originRec(), candidate.collisionMatched()); + fillKfCandidate(candidate, candidate.flagMcMatchRec(), candidate.debugMcRec(), candidate.originMcRec(), candidate.collisionMatched()); } } PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfMCWithFT0C, "Process MC with information for xic0 at FT0C", false); @@ -300,7 +300,7 @@ struct HfTreeCreatorXic0ToXiPiKf { { rowKfCandidate.reserve(candidates.size()); for (const auto& candidate : candidates) { - fillKfCandidate(candidate, candidate.flagMcMatchRec(), candidate.debugMcRec(), candidate.originRec(), candidate.collisionMatched()); + fillKfCandidate(candidate, candidate.flagMcMatchRec(), candidate.debugMcRec(), candidate.originMcRec(), candidate.collisionMatched()); } } PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfMCWithFT0M, "Process MC with information for xic0 at FT0M", false); @@ -310,7 +310,7 @@ struct HfTreeCreatorXic0ToXiPiKf { { rowKfCandidate.reserve(candidates.size()); for (const auto& candidate : candidates) { - fillKfCandidate(candidate, candidate.flagMcMatchRec(), candidate.debugMcRec(), candidate.originRec(), candidate.collisionMatched()); + fillKfCandidate(candidate, candidate.flagMcMatchRec(), candidate.debugMcRec(), candidate.originMcRec(), candidate.collisionMatched()); } } PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processMCLiteWithNTracksPV, "Process MC with information for xic0 at Ntrack", false); diff --git a/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx index 4a90516eaa2..52a12a02b91 100644 --- a/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx @@ -81,7 +81,7 @@ DECLARE_SOA_COLUMN(MaxNormalisedDeltaIP, maxNormalisedDeltaIP, float); DECLARE_SOA_TABLE(HfCandXicToXiPiPiLites, "AOD", "HFXICXI2PILITE", full::ParticleFlag, - hf_cand_xic_to_xi_pi_pi::OriginRec, + hf_cand_xic_to_xi_pi_pi::OriginMcRec, full::CandidateSelFlag, full::Y, full::Eta, @@ -118,7 +118,7 @@ DECLARE_SOA_TABLE(HfCandXicToXiPiPiLites, "AOD", "HFXICXI2PILITE", DECLARE_SOA_TABLE(HfCandXicToXiPiPiLiteKfs, "AOD", "HFXICXI2PILITKF", full::ParticleFlag, - hf_cand_xic_to_xi_pi_pi::OriginRec, + hf_cand_xic_to_xi_pi_pi::OriginMcRec, full::CandidateSelFlag, full::Y, full::Eta, @@ -187,7 +187,7 @@ DECLARE_SOA_TABLE(HfCandXicToXiPiPiLiteKfs, "AOD", "HFXICXI2PILITKF", DECLARE_SOA_TABLE(HfCandXicToXiPiPiFulls, "AOD", "HFXICXI2PIFULL", full::ParticleFlag, - hf_cand_xic_to_xi_pi_pi::OriginRec, + hf_cand_xic_to_xi_pi_pi::OriginMcRec, full::CandidateSelFlag, full::Y, full::Eta, @@ -249,7 +249,7 @@ DECLARE_SOA_TABLE(HfCandXicToXiPiPiFulls, "AOD", "HFXICXI2PIFULL", DECLARE_SOA_TABLE(HfCandXicToXiPiPiFullKfs, "AOD", "HFXICXI2PIFULKF", full::ParticleFlag, - hf_cand_xic_to_xi_pi_pi::OriginRec, + hf_cand_xic_to_xi_pi_pi::OriginMcRec, full::CandidateSelFlag, full::Y, full::Eta, @@ -329,7 +329,7 @@ DECLARE_SOA_TABLE(HfCandXicToXiPiPiFullKfs, "AOD", "HFXICXI2PIFULKF", DECLARE_SOA_TABLE(HfCandXicToXiPiPiFullPs, "AOD", "HFXICXI2PIFULLP", hf_cand_xic_to_xi_pi_pi::FlagMcMatchGen, - hf_cand_xic_to_xi_pi_pi::OriginGen, + hf_cand_xic_to_xi_pi_pi::OriginMcGen, hf_cand::PdgBhadMotherPart, full::Pt, full::Eta, @@ -379,7 +379,7 @@ struct HfTreeCreatorXicToXiPiPi { int8_t originMc = 0; if constexpr (doMc) { particleFlag = candidate.flagMcMatchRec(); - originMc = candidate.originRec(); + originMc = candidate.originMcRec(); } if constexpr (!doKf) { if (fillCandidateLiteTable) { @@ -718,7 +718,7 @@ struct HfTreeCreatorXicToXiPiPi { for (const auto& particle : particles) { rowCandidateFullParticles( particle.flagMcMatchGen(), - particle.originGen(), + particle.originMcGen(), particle.pdgBhadMotherPart(), particle.pt(), particle.eta(), @@ -771,7 +771,7 @@ struct HfTreeCreatorXicToXiPiPi { for (const auto& particle : particles) { rowCandidateFullParticles( particle.flagMcMatchGen(), - particle.originGen(), + particle.originMcGen(), particle.pdgBhadMotherPart(), particle.pt(), particle.eta(), diff --git a/PWGHF/Tasks/taskMcEfficiencyToXiPi.cxx b/PWGHF/Tasks/taskMcEfficiencyToXiPi.cxx index fb70dda36d2..5841c8c3091 100644 --- a/PWGHF/Tasks/taskMcEfficiencyToXiPi.cxx +++ b/PWGHF/Tasks/taskMcEfficiencyToXiPi.cxx @@ -149,11 +149,11 @@ struct HfTaskMcEfficiencyToXiPi { pt = RecoDecay::sqrtSumOfSquares(candidate.pxCharmBaryon(), candidate.pyCharmBaryon()); // all candidates (candidateCreator) - hCandidates->Fill(kHFStepTracked, pt, mass, candidate.collisionMatched(), candidate.originRec()); + hCandidates->Fill(kHFStepTracked, pt, mass, candidate.collisionMatched(), candidate.originMcRec()); // check xi-pi candidate passed candidate selector cuts (except PID) if (candidate.resultSelections() && candidate.statusInvMassLambda() && candidate.statusInvMassCascade() && candidate.statusInvMassCharmBaryon()) { - hCandidates->Fill(kHFStepTrackedCuts, pt, mass, candidate.collisionMatched(), candidate.originRec()); + hCandidates->Fill(kHFStepTrackedCuts, pt, mass, candidate.collisionMatched(), candidate.originMcRec()); selectedKine = true; } if (!selectedKine) { @@ -162,7 +162,7 @@ struct HfTaskMcEfficiencyToXiPi { // check xi-pi candidate passed candidate selector cuts (PID included) if (candidate.statusPidCharmBaryon()) { - hCandidates->Fill(kHFStepTrackedSelected, pt, mass, candidate.collisionMatched(), candidate.originRec()); + hCandidates->Fill(kHFStepTrackedSelected, pt, mass, candidate.collisionMatched(), candidate.originMcRec()); selectedPid = true; } if (!selectedPid) { @@ -231,11 +231,11 @@ struct HfTaskMcEfficiencyToXiPi { } // all candidates - hCandidates->Fill(kHFStepMC, mcParticle.pt(), mass, true, mcParticle.originGen()); // set matchedCollision to true by default at gen level + hCandidates->Fill(kHFStepMC, mcParticle.pt(), mass, true, mcParticle.originMcGen()); // set matchedCollision to true by default at gen level // candidates with charm baryon within eta range if (std::abs(mcParticle.y()) < rapidityCharmBaryonMax) { - hCandidates->Fill(kHFStepMcInRapidity, mcParticle.pt(), mass, true, mcParticle.originGen()); + hCandidates->Fill(kHFStepMcInRapidity, mcParticle.pt(), mass, true, mcParticle.originMcGen()); } // exclude cases with undesired decays @@ -302,14 +302,14 @@ struct HfTaskMcEfficiencyToXiPi { } // final state candidates pass eta and pt selection if (inAcceptance) { - hCandidates->Fill(kHFStepAcceptance, mcParticle.pt(), mass, true, mcParticle.originGen()); + hCandidates->Fill(kHFStepAcceptance, mcParticle.pt(), mass, true, mcParticle.originMcGen()); } if (tracked[pionId] && tracked[pionFromCascadeId] && tracked[pionFromLambdaId] && tracked[protonId]) { // final state candidates have a mc particleID != 0 - hCandidates->Fill(kHFStepTrackable, mcParticle.pt(), mass, true, mcParticle.originGen()); + hCandidates->Fill(kHFStepTrackable, mcParticle.pt(), mass, true, mcParticle.originMcGen()); if (inAcceptance) { - hCandidates->Fill(kHFStepAcceptanceTrackable, mcParticle.pt(), mass, true, mcParticle.originGen()); + hCandidates->Fill(kHFStepAcceptanceTrackable, mcParticle.pt(), mass, true, mcParticle.originMcGen()); } else { LOGP(debug, "Candidate {} not in acceptance but tracked.", mcParticle.globalIndex()); LOGP(debug, "MC cascade: pt={} eta={}", cascade.pt(), cascade.eta()); @@ -365,13 +365,13 @@ struct HfTaskMcEfficiencyToXiPi { // with pion track cuts (see checkTrackGlbTrk and checkTrkItsTrk) if (selectedIts[pionId]) { - hCandidates->Fill(kHFStepItsTrackableCuts, mcParticle.pt(), mass, true, mcParticle.originGen()); + hCandidates->Fill(kHFStepItsTrackableCuts, mcParticle.pt(), mass, true, mcParticle.originMcGen()); if (!inAcceptance) { LOGP(debug, "Candidate {} has daughters not in acceptance but pion <-- charm tracked and selected (its only)", mcParticle.globalIndex()); } } if (selectedItsTpc[pionId]) { - hCandidates->Fill(kHFStepItsTpcTrackableCuts, mcParticle.pt(), mass, true, mcParticle.originGen()); + hCandidates->Fill(kHFStepItsTpcTrackableCuts, mcParticle.pt(), mass, true, mcParticle.originMcGen()); if (!inAcceptance) { LOGP(debug, "Candidate {} has daughters not in acceptance but pion <-- charm tracked and selected (its & tpc)", mcParticle.globalIndex()); } From 287207fd6f0b4f23a1c70635cb2bcc659f712e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 16 Jul 2025 08:37:50 +0200 Subject: [PATCH 07/13] Organise columns --- PWGHF/DataModel/DerivedTables.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/PWGHF/DataModel/DerivedTables.h b/PWGHF/DataModel/DerivedTables.h index 9a5b5ef7531..5789673ba07 100644 --- a/PWGHF/DataModel/DerivedTables.h +++ b/PWGHF/DataModel/DerivedTables.h @@ -330,28 +330,28 @@ DECLARE_SOA_COLUMN(DecayLength, decayLength, float); DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); //! decay length divided by its uncertainty DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); //! decay length in the transverse plane DECLARE_SOA_COLUMN(DecayLengthXYNormalised, decayLengthXYNormalised, float); //! decay length in the transverse plane divided by its uncertainty +DECLARE_SOA_COLUMN(ImpactParameterXi, impactParameterXi, float); //! impact parameter of the Xi prong +DECLARE_SOA_COLUMN(ImpactParameterPi0, impactParameterPi0, float); //! impact parameter of the first pion prong +DECLARE_SOA_COLUMN(ImpactParameterPi1, impactParameterPi1, float); //! impact parameter of the second pion prong DECLARE_SOA_COLUMN(ImpactParameterNormalised0, impactParameterNormalised0, float); //! impact parameter of prong 0 divided by its uncertainty DECLARE_SOA_COLUMN(ImpactParameterNormalised1, impactParameterNormalised1, float); //! impact parameter of prong 1 divided by its uncertainty DECLARE_SOA_COLUMN(ImpactParameterNormalised2, impactParameterNormalised2, float); //! impact parameter of prong 2 divided by its uncertainty +DECLARE_SOA_COLUMN(ImpactParameterNormalisedXi, impactParameterNormalisedXi, float); //! impact parameter of the Xi prong divided by its uncertainty +DECLARE_SOA_COLUMN(ImpactParameterNormalisedPi0, impactParameterNormalisedPi0, float); //! impact parameter of the first pion prong divided by its uncertainty +DECLARE_SOA_COLUMN(ImpactParameterNormalisedPi1, impactParameterNormalisedPi1, float); //! impact parameter of the second pion prong divided by its uncertainty DECLARE_SOA_COLUMN(ImpactParameterProduct, impactParameterProduct, float); //! product of impact parameters of prong 0 and prong 1 -DECLARE_SOA_COLUMN(ImpactParameterXi, impactParameterXi, float); //! product of impact parameters of prong 0 and prong 1 -DECLARE_SOA_COLUMN(ImpactParameterNormalisedXi, impactParameterNormalisedXi, float); //! product of impact parameters of prong 0 and prong 1 -DECLARE_SOA_COLUMN(ImpactParameterPi0, impactParameterPi0, float); //! product of impact parameters of prong 0 and prong 1 -DECLARE_SOA_COLUMN(ImpactParameterNormalisedPi0, impactParameterNormalisedPi0, float); //! product of impact parameters of prong 0 and prong 1 -DECLARE_SOA_COLUMN(ImpactParameterPi1, impactParameterPi1, float); //! product of impact parameters of prong 0 and prong 1 -DECLARE_SOA_COLUMN(ImpactParameterNormalisedPi1, impactParameterNormalisedPi1, float); //! product of impact parameters of prong 0 and prong 1 DECLARE_SOA_COLUMN(MaxNormalisedDeltaIP, maxNormalisedDeltaIP, float); //! see RecoDecay::maxNormalisedDeltaIP DECLARE_SOA_COLUMN(PProng0, pProng0, float); //! momentum magnitude of prong 0 DECLARE_SOA_COLUMN(PProng1, pProng1, float); //! momentum magnitude of prong 1 DECLARE_SOA_COLUMN(PProng2, pProng2, float); //! momentum magnitude of prong 2 -DECLARE_SOA_COLUMN(PPi0, pPi0, float); //! momentum of pion prong 0 -DECLARE_SOA_COLUMN(PPi1, pPi1, float); //! momentum of pion prong 1 +DECLARE_SOA_COLUMN(PProngPi0, pProngPi0, float); //! momentum magnitude of the first pion prong +DECLARE_SOA_COLUMN(PProngPi1, pProngPi1, float); //! momentum magnitude of the second pion prong DECLARE_SOA_COLUMN(PtProng0, ptProng0, float); //! transverse momentum of prong 0 DECLARE_SOA_COLUMN(PtProng1, ptProng1, float); //! transverse momentum of prong 1 DECLARE_SOA_COLUMN(PtProng2, ptProng2, float); //! transverse momentum of prong 2 -DECLARE_SOA_COLUMN(PtPi0, ptPi0, float); //! transverse momentum of pion prong 0 -DECLARE_SOA_COLUMN(PtPi1, ptPi1, float); //! transverse momentum of pion prong 1 -DECLARE_SOA_COLUMN(PtXi, ptXi, float); //! transverse momentum of Xi prong +DECLARE_SOA_COLUMN(PtProngXi, ptProngXi, float); //! transverse momentum of the Xi prong +DECLARE_SOA_COLUMN(PtProngPi0, ptProngPi0, float); //! transverse momentum of the first pion prong +DECLARE_SOA_COLUMN(PtProngPi1, ptProngPi1, float); //! transverse momentum of the second pion prong DECLARE_SOA_COLUMN(RSecondaryVertex, rSecondaryVertex, float); //! distance of the secondary vertex from the z axis // D*± → D0(bar) π± DECLARE_SOA_COLUMN(SignProng1, signProng1, int8_t); @@ -936,9 +936,9 @@ DECLARE_SOA_TABLE_STAGED(HfDstarMcs, "HFDSTMC", //! Table with MC candidate info // ---------------- DECLARE_SOA_TABLE_STAGED(HfXicToXiPiPiPars, "HFXICXPPPAR", //! Table with candidate properties used for selection - hf_cand_par::PtXi, - hf_cand_par::PtPi0, - hf_cand_par::PtPi1, + hf_cand_par::PtProngXi, + hf_cand_par::PtProngPi0, + hf_cand_par::PtProngPi1, hf_cand_xic_to_xi_pi_pi::InvMassXi, hf_cand_xic_to_xi_pi_pi::InvMassLambda, hf_cand_xic_to_xi_pi_pi::InvMassXiPi0, @@ -967,8 +967,8 @@ DECLARE_SOA_TABLE_STAGED(HfXicToXiPiPiPars, "HFXICXPPPAR", //! Table with candid DECLARE_SOA_TABLE_STAGED(HfXicToXiPiPiParEs, "HFXICXPPPARE", //! Table with additional candidate properties used for selection hf_cand_xic_to_xi_pi_pi::CpaLambdaToXi, hf_cand_xic_to_xi_pi_pi::CpaXYLambdaToXi, - hf_cand_par::PPi0, - hf_cand_par::PPi1, + hf_cand_par::PProngPi0, + hf_cand_par::PProngPi1, hf_cand_xic_to_xi_pi_pi::PBachelorPi, hf_cand_xic_to_xi_pi_pi::PPiFromLambda, hf_cand_xic_to_xi_pi_pi::PPrFromLambda, From cf4fe29440ef2b7e17fa6c0996b32f01baf4a445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 16 Jul 2025 08:43:34 +0200 Subject: [PATCH 08/13] Fix typo --- PWGHF/DataModel/DerivedTables.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/DataModel/DerivedTables.h b/PWGHF/DataModel/DerivedTables.h index 5789673ba07..8efba75d902 100644 --- a/PWGHF/DataModel/DerivedTables.h +++ b/PWGHF/DataModel/DerivedTables.h @@ -215,7 +215,7 @@ DECLARE_SOA_COLUMN(FlagMcDecayChanGen, flagMcDecayChanGen, int8_t); //! resonant hf_track_index::Prong3Id, \ o2::soa::Marker); -// Declares the table with global indices for 4-prong candidates (Ids). +// Declares the table with global indices for 5-prong candidates (Ids). #define DECLARE_TABLE_CAND_ID_5P(_hf_type_, _hf_description_) \ DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##Ids, "HF" _hf_description_ "ID", \ hf_cand::CollisionId, \ From 0eaac50d4d6575e39819a6627ca1b9035bfa2c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 16 Jul 2025 11:24:30 +0200 Subject: [PATCH 09/13] Fix linter errors --- PWGHF/DataModel/DerivedTables.h | 132 +++++++++--------- .../derivedDataCreatorXicToXiPiPi.cxx | 20 ++- PWGHF/Tasks/taskMcEfficiencyToXiPi.cxx | 12 +- 3 files changed, 80 insertions(+), 84 deletions(-) diff --git a/PWGHF/DataModel/DerivedTables.h b/PWGHF/DataModel/DerivedTables.h index 8efba75d902..684fc5ef94c 100644 --- a/PWGHF/DataModel/DerivedTables.h +++ b/PWGHF/DataModel/DerivedTables.h @@ -88,30 +88,30 @@ DECLARE_SOA_INDEX_COLUMN(McCollision, mcCollision); //! original global index of o2::soa::Marker); // Declares the base table with MC collisions (McCollBases) and joinable tables (McCollIds, McRCollIds). -#define DECLARE_TABLES_MCCOLL(_hf_type_, _hf_description_, _hf_namespace_) \ - namespace hf_mc_coll \ - { \ - namespace der_##_hf_namespace_ \ - { \ - DECLARE_SOA_ARRAY_INDEX_COLUMN_CUSTOM(Hf##_hf_type_##CollBase, hfCollBases, "HF" _hf_description_ "COLLBASES"); \ - } \ - } \ - DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##McCollBases, "HF" _hf_description_ "MCCOLLBASE", \ - o2::soa::Index<>, \ - mccollision::PosX, \ - mccollision::PosY, \ - mccollision::PosZ, \ - cent::CentFT0M, \ - o2::soa::Marker); \ - \ - using Hf##_hf_type_##McCollBase = Hf##_hf_type_##McCollBases::iterator; \ - using StoredHf##_hf_type_##McCollBase = StoredHf##_hf_type_##McCollBases::iterator; \ - \ - DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##McCollIds, "HF" _hf_description_ "MCCOLLID", \ - hf_mc_coll::McCollisionId, \ - o2::soa::Marker); \ - \ - DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##McRCollIds, "HF" _hf_description_ "MCRCOLLID", \ +#define DECLARE_TABLES_MCCOLL(_hf_type_, _hf_description_, _hf_namespace_) \ + namespace hf_mc_coll \ + { \ + namespace der_##_hf_namespace_ \ + { \ + DECLARE_SOA_ARRAY_INDEX_COLUMN_CUSTOM(Hf##_hf_type_##CollBase, hfCollBases, "HF" _hf_description_ "COLLBASES"); /* o2-linter: disable=name/o2-column (unified getter) */ \ + } \ + } \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##McCollBases, "HF" _hf_description_ "MCCOLLBASE", \ + o2::soa::Index<>, \ + mccollision::PosX, \ + mccollision::PosY, \ + mccollision::PosZ, \ + cent::CentFT0M, \ + o2::soa::Marker); \ + \ + using Hf##_hf_type_##McCollBase = Hf##_hf_type_##McCollBases::iterator; \ + using StoredHf##_hf_type_##McCollBase = StoredHf##_hf_type_##McCollBases::iterator; \ + \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##McCollIds, "HF" _hf_description_ "MCCOLLID", \ + hf_mc_coll::McCollisionId, \ + o2::soa::Marker); \ + \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##McRCollIds, "HF" _hf_description_ "MCRCOLLID", \ hf_mc_coll::der_##_hf_namespace_::Hf##_hf_type_##CollBaseIds); // ================ @@ -165,27 +165,27 @@ DECLARE_SOA_COLUMN(FlagMcDecayChanGen, flagMcDecayChanGen, int8_t); //! resonant } // namespace hf_mc_particle // Declares the base table with candidates (Bases). -#define DECLARE_TABLE_CAND_BASE(_hf_type_, _hf_description_, _hf_namespace_) \ - namespace hf_cand_base \ - { \ - namespace der_##_hf_namespace_ \ - { \ - DECLARE_SOA_INDEX_COLUMN_CUSTOM(Hf##_hf_type_##CollBase, hfCollBase, "HF" _hf_description_ "COLLBASES"); \ - } \ - } \ - \ - DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##Bases, "HF" _hf_description_ "BASE", \ - o2::soa::Index<>, \ - hf_cand_base::der_##_hf_namespace_::Hf##_hf_type_##CollBaseId, \ - hf_cand_base::Pt, \ - hf_cand_base::Eta, \ - hf_cand_base::Phi, \ - hf_cand_base::M, \ - hf_cand_base::Y, \ - hf_cand_base::Px, \ - hf_cand_base::Py, \ - hf_cand_base::Pz, \ - hf_cand_base::P, \ +#define DECLARE_TABLE_CAND_BASE(_hf_type_, _hf_description_, _hf_namespace_) \ + namespace hf_cand_base \ + { \ + namespace der_##_hf_namespace_ \ + { \ + DECLARE_SOA_INDEX_COLUMN_CUSTOM(Hf##_hf_type_##CollBase, hfCollBase, "HF" _hf_description_ "COLLBASES"); /* o2-linter: disable=name/o2-column (unified getter) */ \ + } \ + } \ + \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##Bases, "HF" _hf_description_ "BASE", \ + o2::soa::Index<>, \ + hf_cand_base::der_##_hf_namespace_::Hf##_hf_type_##CollBaseId, \ + hf_cand_base::Pt, \ + hf_cand_base::Eta, \ + hf_cand_base::Phi, \ + hf_cand_base::M, \ + hf_cand_base::Y, \ + hf_cand_base::Px, \ + hf_cand_base::Py, \ + hf_cand_base::Pz, \ + hf_cand_base::P, \ o2::soa::Marker); // Declares the table with global indices for 2-prong candidates (Ids). @@ -237,27 +237,27 @@ DECLARE_SOA_COLUMN(FlagMcDecayChanGen, flagMcDecayChanGen, int8_t); //! resonant // ================ // Declares the base table with MC particles (PBases). -#define DECLARE_TABLE_MCPARTICLE_BASE(_hf_type_, _hf_description_, _hf_namespace_) \ - namespace hf_mc_particle \ - { \ - namespace der_##_hf_namespace_ \ - { \ - DECLARE_SOA_INDEX_COLUMN_CUSTOM(Hf##_hf_type_##McCollBase, hfMcCollBase, "HF" _hf_description_ "MCCOLLBASES"); \ - } \ - } \ - DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##PBases, "HF" _hf_description_ "PBASE", \ - o2::soa::Index<>, \ - hf_mc_particle::der_##_hf_namespace_::Hf##_hf_type_##McCollBaseId, \ - hf_cand_base::Pt, \ - hf_cand_base::Eta, \ - hf_cand_base::Phi, \ - hf_cand_base::Y, \ - hf_mc_particle::FlagMcMatchGen, \ - hf_mc_particle::OriginMcGen, \ - hf_cand_base::Px, \ - hf_cand_base::Py, \ - hf_cand_base::Pz, \ - hf_cand_base::P, \ +#define DECLARE_TABLE_MCPARTICLE_BASE(_hf_type_, _hf_description_, _hf_namespace_) \ + namespace hf_mc_particle \ + { \ + namespace der_##_hf_namespace_ \ + { \ + DECLARE_SOA_INDEX_COLUMN_CUSTOM(Hf##_hf_type_##McCollBase, hfMcCollBase, "HF" _hf_description_ "MCCOLLBASES"); /* o2-linter: disable=name/o2-column (unified getter) */ \ + } \ + } \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##PBases, "HF" _hf_description_ "PBASE", \ + o2::soa::Index<>, \ + hf_mc_particle::der_##_hf_namespace_::Hf##_hf_type_##McCollBaseId, \ + hf_cand_base::Pt, \ + hf_cand_base::Eta, \ + hf_cand_base::Phi, \ + hf_cand_base::Y, \ + hf_mc_particle::FlagMcMatchGen, \ + hf_mc_particle::OriginMcGen, \ + hf_cand_base::Px, \ + hf_cand_base::Py, \ + hf_cand_base::Pz, \ + hf_cand_base::P, \ o2::soa::Marker); // Declares the table with global indices for MC particles (PIds). diff --git a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx index 8c4b976e7e4..b4a0fe11180 100644 --- a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx @@ -15,16 +15,13 @@ /// /// \author Vít Kučera , Inha University -// #include "PWGHF/Core/DecayChannels.h" #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/DataModel/DerivedTables.h" #include "PWGHF/Utils/utilsDerivedData.h" -// #include "PWGHF/Utils/utilsPid.h" #include "PWGLF/DataModel/mcCentrality.h" -// #include "Common/Core/RecoDecay.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/Multiplicity.h" @@ -55,7 +52,6 @@ using namespace o2::framework::expressions; using namespace o2::aod::pid_tpc_tof_utils; using namespace o2::analysis::hf_derived; using namespace o2::aod::hf_cand_xic_to_xi_pi_pi; -// using namespace o2::hf_decay::hf_cand_beauty; /// Writes the full information in an output TTree struct HfDerivedDataCreatorXicToXiPiPi { @@ -91,7 +87,7 @@ struct HfDerivedDataCreatorXicToXiPiPi { HfHelper hfHelper; SliceCache cache; - static constexpr double mass{o2::constants::physics::MassXiCPlus}; + static constexpr double Mass{o2::constants::physics::MassXiCPlus}; using CollisionsWCentMult = soa::Join; using CollisionsWMcCentMult = soa::Join; @@ -325,7 +321,7 @@ struct HfDerivedDataCreatorXicToXiPiPi { { rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcSig, candidatesDaughters, tracks, bcs); - rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, Mass); } PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processMcSig, "Process MC only for signals", false); @@ -339,7 +335,7 @@ struct HfDerivedDataCreatorXicToXiPiPi { { rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcBkg, candidatesDaughters, tracks, bcs); - rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, Mass); } PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processMcBkg, "Process MC only for background", false); @@ -353,7 +349,7 @@ struct HfDerivedDataCreatorXicToXiPiPi { { rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcAll, candidatesDaughters, tracks, bcs); - rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, Mass); } PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processMcAll, "Process MC", false); @@ -379,7 +375,7 @@ struct HfDerivedDataCreatorXicToXiPiPi { { rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcMlSig, candidatesDaughters, tracks, bcs); - rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, Mass); } PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processMcMlSig, "Process MC with ML only for signals", false); @@ -393,7 +389,7 @@ struct HfDerivedDataCreatorXicToXiPiPi { { rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcMlBkg, candidatesDaughters, tracks, bcs); - rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, Mass); } PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processMcMlBkg, "Process MC with ML only for background", false); @@ -407,14 +403,14 @@ struct HfDerivedDataCreatorXicToXiPiPi { { rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); processCandidates(collisions, candidatesMcMlAll, candidatesDaughters, tracks, bcs); - rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, Mass); } PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processMcMlAll, "Process MC with ML", false); void processMcGenOnly(TypeMcCollisions const& mcCollisions, MatchedGenCandidatesMc const& mcParticles) { - rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, Mass); } PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processMcGenOnly, "Process MC gen. only", false); }; diff --git a/PWGHF/Tasks/taskMcEfficiencyToXiPi.cxx b/PWGHF/Tasks/taskMcEfficiencyToXiPi.cxx index 5841c8c3091..0550bd5e726 100644 --- a/PWGHF/Tasks/taskMcEfficiencyToXiPi.cxx +++ b/PWGHF/Tasks/taskMcEfficiencyToXiPi.cxx @@ -54,9 +54,6 @@ struct HfTaskMcEfficiencyToXiPi { Configurable nClustersTpcMin{"nClustersTpcMin", 70, "Minimum number of TPC clusters requirement for pion <-- charm baryon"}; Configurable nClustersItsMin{"nClustersItsMin", 3, "Minimum number of ITS clusters requirement for pion <- charm baryon"}; - ConfigurableAxis axisPt{"axisPt", {200, 0, 20}, "pT axis"}; - ConfigurableAxis axisMass{"axisMass", {900, 2.1, 3}, "m_inv axis"}; - enum HFStep { kHFStepMC = 0, // all generated mothers kHFStepMcInRapidity, // MC mother in rapidity |y| < rapidityCharmBaryonMax=0.5 kHFStepAcceptance, // MC mother where all final state candidates pass eta and pt selection @@ -82,6 +79,9 @@ struct HfTaskMcEfficiencyToXiPi { using ParticleInfoOmegac0 = soa::Join; using BCsInfo = soa::Join; + ConfigurableAxis axisPt{"axisPt", {200, 0, 20}, "pT axis"}; + ConfigurableAxis axisMass{"axisMass", {900, 2.1, 3}, "m_inv axis"}; + HistogramRegistry registry{"registry"}; void init(InitContext&) @@ -241,7 +241,7 @@ struct HfTaskMcEfficiencyToXiPi { // exclude cases with undesired decays int cascId = -999; int pionId = -999; - for (auto& dauCharm : mcParticle.template daughters_as()) { + for (auto const& dauCharm : mcParticle.template daughters_as()) { if (std::abs(dauCharm.pdgCode()) == kXiMinus && (dauCharm.getProcess() == TMCProcess::kPDecay || dauCharm.getProcess() == TMCProcess::kPPrimary)) { cascId = dauCharm.globalIndex(); } else if (std::abs(dauCharm.pdgCode()) == kPiPlus && (dauCharm.getProcess() == TMCProcess::kPDecay || dauCharm.getProcess() == TMCProcess::kPPrimary)) { @@ -264,7 +264,7 @@ struct HfTaskMcEfficiencyToXiPi { // first create cascade daughters objects int lambdaId = -999; int pionFromCascadeId = -999; - for (auto& dauCasc : cascade.template daughters_as()) { + for (auto const& dauCasc : cascade.template daughters_as()) { if (std::abs(dauCasc.pdgCode()) == kLambda0 && dauCasc.getProcess() == TMCProcess::kPDecay) { lambdaId = dauCasc.globalIndex(); } else if (std::abs(dauCasc.pdgCode()) == kPiPlus && dauCasc.getProcess() == TMCProcess::kPDecay) { @@ -280,7 +280,7 @@ struct HfTaskMcEfficiencyToXiPi { // then create lambda daughters objects int protonId = -999; int pionFromLambdaId = -999; - for (auto& dauV0 : lambda.template daughters_as()) { + for (auto const& dauV0 : lambda.template daughters_as()) { if (std::abs(dauV0.pdgCode()) == kProton && dauV0.getProcess() == TMCProcess::kPDecay) { protonId = dauV0.globalIndex(); } else if (std::abs(dauV0.pdgCode()) == kPiPlus && dauV0.getProcess() == TMCProcess::kPDecay) { From 2ae303de17cbb2e3ef53b681376a19229aca6b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 16 Jul 2025 15:25:25 +0200 Subject: [PATCH 10/13] Fix MC selections --- .../derivedDataCreatorXicToXiPiPi.cxx | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx index b4a0fe11180..7713085f3b1 100644 --- a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx @@ -101,7 +101,7 @@ struct HfDerivedDataCreatorXicToXiPiPi { using THfCandDaughtersMl = aod::Cascades; Filter filterSelectCandidates = (aod::hf_sel_candidate_xic::isSelXicToXiPiPi & static_cast(BIT(o2::aod::hf_sel_candidate_xic::XicToXiPiPiSelectionStep::RecoMl - 1))) != 0; - Filter filterMcGenMatching = nabs(aod::hf_cand_xic_to_xi_pi_pi::flagMcMatchGen) == static_cast(DecayType::XicToXiPiPi); + Filter filterMcGenMatching = aod::hf_cand_xic_to_xi_pi_pi::flagMcMatchGen != 0; Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesMcPerCollision = aod::hf_cand::collisionId; @@ -115,10 +115,10 @@ struct HfDerivedDataCreatorXicToXiPiPi { Partition candidatesMlAll = aod::hf_sel_candidate_xic::isSelXicToXiPiPi >= 0; Partition candidatesMcMlAll = aod::hf_sel_candidate_xic::isSelXicToXiPiPi >= 0; // partitions for signal and background - Partition candidatesMcSig = nabs(aod::hf_cand_xic_to_xi_pi_pi::flagMcMatchRec) == static_cast(DecayType::XicToXiPiPi); - Partition candidatesMcBkg = nabs(aod::hf_cand_xic_to_xi_pi_pi::flagMcMatchRec) != static_cast(DecayType::XicToXiPiPi); - Partition candidatesMcMlSig = nabs(aod::hf_cand_xic_to_xi_pi_pi::flagMcMatchRec) == static_cast(DecayType::XicToXiPiPi); - Partition candidatesMcMlBkg = nabs(aod::hf_cand_xic_to_xi_pi_pi::flagMcMatchRec) != static_cast(DecayType::XicToXiPiPi); + Partition candidatesMcSig = aod::hf_cand_xic_to_xi_pi_pi::flagMcMatchRec != 0; + Partition candidatesMcBkg = aod::hf_cand_xic_to_xi_pi_pi::flagMcMatchRec == 0; + Partition candidatesMcMlSig = aod::hf_cand_xic_to_xi_pi_pi::flagMcMatchRec != 0; + Partition candidatesMcMlBkg = aod::hf_cand_xic_to_xi_pi_pi::flagMcMatchRec == 0; void init(InitContext const&) { @@ -268,7 +268,7 @@ struct HfDerivedDataCreatorXicToXiPiPi { flagMcRec = candidate.flagMcMatchRec(); origin = candidate.originMcRec(); if constexpr (onlyBkg) { - if (std::abs(flagMcRec) == DecayType::XicToXiPiPi) { + if (TESTBIT(std::abs(flagMcRec), DecayType::XicToXiPiPi)) { continue; } if (downSampleBkgFactor < 1.) { @@ -279,23 +279,19 @@ struct HfDerivedDataCreatorXicToXiPiPi { } } if constexpr (onlySig) { - if (std::abs(flagMcRec) != DecayType::XicToXiPiPi) { + if (!TESTBIT(std::abs(flagMcRec), DecayType::XicToXiPiPi)) { continue; } } } - // auto prongPi0FromXic = candidate.template pi0_as(); - double y = hfHelper.yXic(candidate); float massXicToXiPiPi = candidate.invMassXicPlus(); double ct = hfHelper.ctXic(candidate); + double y = hfHelper.yXic(candidate); std::vector mlScoreXicToXiPiPi; - // float mlScoreXicToXiPiPi{-1.f}; - // std::vector mlScoresXi; - // bool isXi = prongPi0FromXic.sign() < 0; if constexpr (isMl) { std::copy(candidate.mlProbXicToXiPiPi().begin(), candidate.mlProbXicToXiPiPi().end(), std::back_inserter(mlScoreXicToXiPiPi)); } - // flag = 0 for Xi pi-, flag = 1 for Xibar pi+ + // FIXME: Remove candFlag? fillTablesCandidate(candidate, 1, massXicToXiPiPi, ct, y, flagMcRec, origin, mlScoreXicToXiPiPi); } } From 24b06f55ecddc5c5b0d13302ad8c5b861309614a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Thu, 17 Jul 2025 15:10:28 +0200 Subject: [PATCH 11/13] Fix naming typo --- PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx index 7713085f3b1..01df95e9a10 100644 --- a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx @@ -287,12 +287,12 @@ struct HfDerivedDataCreatorXicToXiPiPi { float massXicToXiPiPi = candidate.invMassXicPlus(); double ct = hfHelper.ctXic(candidate); double y = hfHelper.yXic(candidate); - std::vector mlScoreXicToXiPiPi; + std::vector mlScoresXicToXiPiPi; if constexpr (isMl) { - std::copy(candidate.mlProbXicToXiPiPi().begin(), candidate.mlProbXicToXiPiPi().end(), std::back_inserter(mlScoreXicToXiPiPi)); + std::copy(candidate.mlProbXicToXiPiPi().begin(), candidate.mlProbXicToXiPiPi().end(), std::back_inserter(mlScoresXicToXiPiPi)); } // FIXME: Remove candFlag? - fillTablesCandidate(candidate, 1, massXicToXiPiPi, ct, y, flagMcRec, origin, mlScoreXicToXiPiPi); + fillTablesCandidate(candidate, 1, massXicToXiPiPi, ct, y, flagMcRec, origin, mlScoresXicToXiPiPi); } } } From 504113aec1853040bd8910ec2af7bfc3e3555ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Thu, 17 Jul 2025 15:43:56 +0200 Subject: [PATCH 12/13] Remove daughter table stuff --- .../derivedDataCreatorXicToXiPiPi.cxx | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx index 01df95e9a10..83f78496b5e 100644 --- a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx @@ -214,10 +214,9 @@ struct HfDerivedDataCreatorXicToXiPiPi { } } - template + template void processCandidates(CollType const& collisions, Partition& candidates, - CandCascadeType const&, TracksWPid const&, aod::BCs const&) { @@ -299,11 +298,10 @@ struct HfDerivedDataCreatorXicToXiPiPi { void processData(CollisionsWCentMult const& collisions, SelectedCandidates const&, - THfCandDaughtersMl const& candidatesDaughters, TracksWPid const& tracks, aod::BCs const& bcs) { - processCandidates(collisions, candidatesAll, candidatesDaughters, tracks, bcs); + processCandidates(collisions, candidatesAll, tracks, bcs); } PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processData, "Process data", true); @@ -311,12 +309,11 @@ struct HfDerivedDataCreatorXicToXiPiPi { SelectedCandidatesMc const&, TypeMcCollisions const& mcCollisions, MatchedGenCandidatesMc const& mcParticles, - THfCandDaughtersMl const& candidatesDaughters, TracksWPid const& tracks, aod::BCs const& bcs) { rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); - processCandidates(collisions, candidatesMcSig, candidatesDaughters, tracks, bcs); + processCandidates(collisions, candidatesMcSig, tracks, bcs); rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, Mass); } PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processMcSig, "Process MC only for signals", false); @@ -325,12 +322,11 @@ struct HfDerivedDataCreatorXicToXiPiPi { SelectedCandidatesMc const&, TypeMcCollisions const& mcCollisions, MatchedGenCandidatesMc const& mcParticles, - THfCandDaughtersMl const& candidatesDaughters, TracksWPid const& tracks, aod::BCs const& bcs) { rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); - processCandidates(collisions, candidatesMcBkg, candidatesDaughters, tracks, bcs); + processCandidates(collisions, candidatesMcBkg, tracks, bcs); rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, Mass); } PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processMcBkg, "Process MC only for background", false); @@ -339,12 +335,11 @@ struct HfDerivedDataCreatorXicToXiPiPi { SelectedCandidatesMc const&, TypeMcCollisions const& mcCollisions, MatchedGenCandidatesMc const& mcParticles, - THfCandDaughtersMl const& candidatesDaughters, TracksWPid const& tracks, aod::BCs const& bcs) { rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); - processCandidates(collisions, candidatesMcAll, candidatesDaughters, tracks, bcs); + processCandidates(collisions, candidatesMcAll, tracks, bcs); rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, Mass); } PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processMcAll, "Process MC", false); @@ -353,11 +348,10 @@ struct HfDerivedDataCreatorXicToXiPiPi { void processDataMl(CollisionsWCentMult const& collisions, SelectedCandidatesMl const&, - THfCandDaughtersMl const& candidatesDaughters, TracksWPid const& tracks, aod::BCs const& bcs) { - processCandidates(collisions, candidatesMlAll, candidatesDaughters, tracks, bcs); + processCandidates(collisions, candidatesMlAll, tracks, bcs); } PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processDataMl, "Process data with ML", false); @@ -365,12 +359,11 @@ struct HfDerivedDataCreatorXicToXiPiPi { SelectedCandidatesMcMl const&, TypeMcCollisions const& mcCollisions, MatchedGenCandidatesMc const& mcParticles, - THfCandDaughtersMl const& candidatesDaughters, TracksWPid const& tracks, aod::BCs const& bcs) { rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); - processCandidates(collisions, candidatesMcMlSig, candidatesDaughters, tracks, bcs); + processCandidates(collisions, candidatesMcMlSig, tracks, bcs); rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, Mass); } PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processMcMlSig, "Process MC with ML only for signals", false); @@ -379,12 +372,11 @@ struct HfDerivedDataCreatorXicToXiPiPi { SelectedCandidatesMcMl const&, TypeMcCollisions const& mcCollisions, MatchedGenCandidatesMc const& mcParticles, - THfCandDaughtersMl const& candidatesDaughters, TracksWPid const& tracks, aod::BCs const& bcs) { rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); - processCandidates(collisions, candidatesMcMlBkg, candidatesDaughters, tracks, bcs); + processCandidates(collisions, candidatesMcMlBkg, tracks, bcs); rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, Mass); } PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processMcMlBkg, "Process MC with ML only for background", false); @@ -393,12 +385,11 @@ struct HfDerivedDataCreatorXicToXiPiPi { SelectedCandidatesMcMl const&, TypeMcCollisions const& mcCollisions, MatchedGenCandidatesMc const& mcParticles, - THfCandDaughtersMl const& candidatesDaughters, TracksWPid const& tracks, aod::BCs const& bcs) { rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); - processCandidates(collisions, candidatesMcMlAll, candidatesDaughters, tracks, bcs); + processCandidates(collisions, candidatesMcMlAll, tracks, bcs); rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, Mass); } PROCESS_SWITCH(HfDerivedDataCreatorXicToXiPiPi, processMcMlAll, "Process MC with ML", false); From 4551274ce0f65bcc37e8c98b2a358084dfb4e598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Thu, 17 Jul 2025 16:54:03 +0200 Subject: [PATCH 13/13] Add sign --- PWGHF/DataModel/DerivedTables.h | 1 + PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx | 1 + 2 files changed, 2 insertions(+) diff --git a/PWGHF/DataModel/DerivedTables.h b/PWGHF/DataModel/DerivedTables.h index 684fc5ef94c..21c535595e4 100644 --- a/PWGHF/DataModel/DerivedTables.h +++ b/PWGHF/DataModel/DerivedTables.h @@ -936,6 +936,7 @@ DECLARE_SOA_TABLE_STAGED(HfDstarMcs, "HFDSTMC", //! Table with MC candidate info // ---------------- DECLARE_SOA_TABLE_STAGED(HfXicToXiPiPiPars, "HFXICXPPPAR", //! Table with candidate properties used for selection + hf_cand_xic_to_xi_pi_pi::Sign, hf_cand_par::PtProngXi, hf_cand_par::PtProngPi0, hf_cand_par::PtProngPi1, diff --git a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx index 83f78496b5e..a59636bc500 100644 --- a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx @@ -136,6 +136,7 @@ struct HfDerivedDataCreatorXicToXiPiPi { rowsCommon.fillTablesCandidate(candidate, invMass, y); if (fillCandidatePar) { rowCandidatePar( + candidate.sign(), candidate.ptProng0(), candidate.ptProng1(), candidate.ptProng2(),