From 2e047f79d73d99c5a2f513d61b5447164c45df38 Mon Sep 17 00:00:00 2001 From: "mingze.li" Date: Wed, 17 Jun 2026 17:13:36 +0200 Subject: [PATCH 1/4] Adding new task for local mix candidate analysis in Dstar spin alignment measurement. --- PWGHF/D2H/Tasks/CMakeLists.txt | 5 + .../Tasks/taskMixingDstarCandTreeCreator.cxx | 247 ++++++++++++++++++ 2 files changed, 252 insertions(+) create mode 100644 PWGHF/D2H/Tasks/taskMixingDstarCandTreeCreator.cxx diff --git a/PWGHF/D2H/Tasks/CMakeLists.txt b/PWGHF/D2H/Tasks/CMakeLists.txt index 19a61637c19..288d9e4cdb1 100644 --- a/PWGHF/D2H/Tasks/CMakeLists.txt +++ b/PWGHF/D2H/Tasks/CMakeLists.txt @@ -178,3 +178,8 @@ o2physics_add_dpl_workflow(task-deuteron-from-lb SOURCES taskDeuteronFromLb.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(task-mixing-dstar-cand-tree-creator + SOURCES taskMixingDstarCandTreeCreator.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGHF/D2H/Tasks/taskMixingDstarCandTreeCreator.cxx b/PWGHF/D2H/Tasks/taskMixingDstarCandTreeCreator.cxx new file mode 100644 index 00000000000..4d11564b356 --- /dev/null +++ b/PWGHF/D2H/Tasks/taskMixingDstarCandTreeCreator.cxx @@ -0,0 +1,247 @@ +// 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 taskMixingDstarCandTreeCreator.cxx +/// \brief Writer of D*+ → D0 ( → π+ K-) π+ candidates in the form of flat tables to be stored in TTrees. +/// Intended for Mix-candidate analysis in spin alignment measurement. +/// Serving as a correction for detector acceptance and reconstruction efficiency. +/// +/// \author Mingze li , CCNU/UniTo + +#include "PWGHF/Core/DecayChannels.h" +#include "PWGHF/D2H/Utils/utilsFlow.h" +#include "PWGHF/Core/CentralityEstimation.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" + +#include "Common/Core/RecoDecay.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::hf_centrality; +using namespace o2::hf_occupancy; +using namespace o2::analysis::hf_flow_utils; + +namespace o2::aod +{ +namespace mixing_dstar +{ +DECLARE_SOA_INDEX_COLUMN(Collision, collision); +// D0 related variables +DECLARE_SOA_COLUMN(MD0, mD0, float); +DECLARE_SOA_COLUMN(PtD0, ptD0, float); +DECLARE_SOA_COLUMN(PD0, pD0, float); +DECLARE_SOA_COLUMN(EtaD0, etaD0, float); +DECLARE_SOA_COLUMN(PhiD0, phiD0, float); +DECLARE_SOA_COLUMN(YD0, yD0, float); +// soft pion related variables +DECLARE_SOA_COLUMN(PtSoftPi, ptSoftPi, float); +DECLARE_SOA_COLUMN(PSoftPi, pSoftPi, float); +DECLARE_SOA_COLUMN(EtaSoftPi, etaSoftPi, float); +DECLARE_SOA_COLUMN(PhiSoftPi, phiSoftPi, float); +DECLARE_SOA_COLUMN(YSoftPi, ySoftPi, float); +// Dstar related variables +DECLARE_SOA_COLUMN(M, m, float); +DECLARE_SOA_COLUMN(Pt, pt, float); +DECLARE_SOA_COLUMN(P, p, float); +DECLARE_SOA_COLUMN(Eta, eta, float); +DECLARE_SOA_COLUMN(Phi, phi, float); +DECLARE_SOA_COLUMN(Y, y, float); +DECLARE_SOA_COLUMN(MlProbDstarToD0PiBkg, mlProbDstarToD0PiBkg, float); +DECLARE_SOA_COLUMN(MlProbDstarToD0PiPrompt, mlProbDstarToD0PiPrompt, float); +DECLARE_SOA_COLUMN(MlProbDstarToD0PiNonPrompt, mlProbDstarToD0PiNonPrompt, float); +// Events +DECLARE_SOA_COLUMN(ZVec, zVec, float); +DECLARE_SOA_COLUMN(Centrality, centrality, float); +DECLARE_SOA_COLUMN(Multiplicity, multiplicity, int); +DECLARE_SOA_COLUMN(Occupancy, occupancy, int); +DECLARE_SOA_COLUMN(XQvec, xqVec, float); +DECLARE_SOA_COLUMN(YQvec, yqVec, float); +DECLARE_SOA_COLUMN(GIndexCol, gIndexCol, int); +DECLARE_SOA_COLUMN(TimeStamp, timeStamp, int64_t); +// Tracks +DECLARE_SOA_COLUMN(MinAbsEtaTrack, MinabsEtaTrack, float); +DECLARE_SOA_COLUMN(MinNumItsCls, minNumItsCls, int); +DECLARE_SOA_COLUMN(MinNumTpcCls, minNumTpcCls, int); +} // namespace mixing_dstar + +DECLARE_SOA_TABLE(HfCandDstMix, "AOD", "HFCANDDSTMIX", + mixing_dstar::MD0, + // mixing_dstar::PtD0, + // mixing_dstar::EtaD0, + // mixing_dstar::PhiD0, + // mixing_dstar::YD0, + mixing_dstar::PtSoftPi, + mixing_dstar::EtaSoftPi, + mixing_dstar::PhiSoftPi, + // mixing_dstar::YSoftPi, + mixing_dstar::M, + mixing_dstar::Pt, + mixing_dstar::Eta, + mixing_dstar::Phi, + mixing_dstar::Y, + mixing_dstar::MlProbDstarToD0PiBkg, + mixing_dstar::MlProbDstarToD0PiPrompt, + mixing_dstar::MlProbDstarToD0PiNonPrompt, + mixing_dstar::ZVec, + mixing_dstar::Centrality, + // mixing_dstar::Multiplicity, + mixing_dstar::Occupancy, + mixing_dstar::XQvec, + mixing_dstar::YQvec, + mixing_dstar::MinAbsEtaTrack, + mixing_dstar::MinNumItsCls, + mixing_dstar::MinNumTpcCls, + mixing_dstar::GIndexCol, + mixing_dstar::TimeStamp); +} // namespace o2::aod + +/// Writes the full information in an output TTree +struct HfTaskMixingDstarCandTreeCreator { + Produces rowCandidateMix; + + Configurable selectionFlagDstarToD0Pi{"selectionFlagDstarToD0Pi", true, "Selection Flag for D* decay to D0 & Pi"}; + Configurable fillMixingCandidateTable{"fillMixingCandidateTable", false, "Switch to fill lite table with candidate properties"}; + + Configurable qVecDetector{"qVecDetector", 2, "Detector for Q vector estimation (FV0A: 0, FT0M: 1, FT0C: 2)"}; + Configurable centEstimator{"centEstimator", 2, "Centrality estimator ((None: 0, FT0C: 2, FT0M: 3))"}; + Configurable occEstimator{"occEstimator", 2, "If enabled, replace number of PV contributors with occupancy estimation (0: don't use, 1: ITS, 2: FT0C)"}; + + + using CollsWithQVecs = soa::Join; + using TracksWithExtra = soa::Join; + using CandDstarWSelFlag = soa::Join; + using FilteredCandDstarWSelFlagAndMl = soa::Filtered>; + + Filter filterSelectDstarCandidates = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstarToD0Pi; + + Preslice dstarWithMlPerCollision = aod::hf_cand::collisionId; + + void init(InitContext const&) + { + } + + /// prongTracks is the vector of daughter tracks + /// etaMin is the minimum eta + /// nItsClsMin is the minumum number of clusters in ITS + /// nTpcClsMin is the minumum number of clusters in TPC + template + void getTrackingInfos(std::vector const& prongTracks, float& etaMin, int& nItsClsMin, int& nTpcClsMin) + { + etaMin = 10.f; + nItsClsMin = 10; + nTpcClsMin = 1000; + + for (const auto& track : prongTracks) { + if (std::abs(track.eta()) < etaMin) { + etaMin = std::abs(track.eta()); + } + if (track.itsNCls() < nItsClsMin) { + nItsClsMin = track.itsNCls(); + } + if (track.tpcNClsCrossedRows() < nTpcClsMin) { + nTpcClsMin = track.tpcNClsCrossedRows(); + } + } + } + + template + void fillCandidateTable(CollType const& collision, const T& candidate, Trk const& /*tracks*/, BcType const& /*bcs*/) + { + const auto bc = collision.template bc_as(); + const int64_t timeStamp = bc.timestamp(); + + float massD0{-1.f}; + float massDStar{-1.f}; + float etaSoftPi{-1.f}; + float phiSoftPi{-1.f}; + if (candidate.signSoftPi() > 0) { + massD0 = candidate.invMassD0(); + massDStar = candidate.invMassDstar(); + } else { + massD0 = candidate.invMassD0Bar(); + massDStar = candidate.invMassAntiDstar(); + } + etaSoftPi = RecoDecay::eta(std::array{candidate.pxSoftPi(), candidate.pySoftPi(), candidate.pzSoftPi()}); + phiSoftPi = RecoDecay::phi(std::array{candidate.pxSoftPi(), candidate.pySoftPi(), candidate.pzSoftPi()}); + + float absEtaTrackMin{-1.f}; + int numItsClsMin{-1}, numTpcClsMin{-1}; + + auto trackProng0 = candidate.template prong0_as(); + auto trackProng1 = candidate.template prong1_as(); + auto trackProng2 = candidate.template prongPi_as(); + getTrackingInfos(std::vector{trackProng0, trackProng1, trackProng2}, absEtaTrackMin, numItsClsMin, numTpcClsMin); + std::array const Qvector = getQvec(collision, qVecDetector.value); + + if (fillMixingCandidateTable) { + rowCandidateMix( + massD0, + // candidate.ptD0(), + // candidate.etaD0(), + // candidate.phiD0(), + // candidate.yD0(), + candidate.ptSoftPi(), + etaSoftPi, + phiSoftPi, + massDStar, + candidate.pt(), + candidate.eta(), + candidate.phi(), + candidate.y(constants::physics::MassDStar), + candidate.mlProbDstarToD0Pi()[0], + candidate.mlProbDstarToD0Pi()[1], + candidate.mlProbDstarToD0Pi()[2], + collision.posZ(), + getCentralityColl(collision, centEstimator), + getOccupancyColl(collision, occEstimator), + Qvector[0], + Qvector[1], + absEtaTrackMin, + numItsClsMin, + numTpcClsMin, + collision.globalIndex(), + timeStamp); + } + } + + void processData(CollsWithQVecs const& collisions, + FilteredCandDstarWSelFlagAndMl const& dstarCandidates, + TracksWithExtra const& tracks, + aod::BCsWithTimestamps const& bcWithTimeStamps) + { + for (const auto& collision : collisions) { + auto thisCollId = collision.globalIndex(); + auto groupedDstarCandidates = dstarCandidates.sliceBy(dstarWithMlPerCollision, thisCollId); + for (const auto& dstarCandidate : groupedDstarCandidates) { + fillCandidateTable(collision, dstarCandidate, tracks, bcWithTimeStamps); + } + } + } + PROCESS_SWITCH(HfTaskMixingDstarCandTreeCreator, processData, "Process data", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} From b03fd1d5de9718e8706ba204bf7d5a632e0f26f0 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 17 Jun 2026 15:24:10 +0000 Subject: [PATCH 2/4] Please consider the following formatting changes --- PWGHF/D2H/Tasks/taskMixingDstarCandTreeCreator.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskMixingDstarCandTreeCreator.cxx b/PWGHF/D2H/Tasks/taskMixingDstarCandTreeCreator.cxx index 4d11564b356..6421fd0869c 100644 --- a/PWGHF/D2H/Tasks/taskMixingDstarCandTreeCreator.cxx +++ b/PWGHF/D2H/Tasks/taskMixingDstarCandTreeCreator.cxx @@ -16,9 +16,9 @@ /// /// \author Mingze li , CCNU/UniTo +#include "PWGHF/Core/CentralityEstimation.h" #include "PWGHF/Core/DecayChannels.h" #include "PWGHF/D2H/Utils/utilsFlow.h" -#include "PWGHF/Core/CentralityEstimation.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" @@ -82,7 +82,7 @@ DECLARE_SOA_COLUMN(TimeStamp, timeStamp, int64_t); // Tracks DECLARE_SOA_COLUMN(MinAbsEtaTrack, MinabsEtaTrack, float); DECLARE_SOA_COLUMN(MinNumItsCls, minNumItsCls, int); -DECLARE_SOA_COLUMN(MinNumTpcCls, minNumTpcCls, int); +DECLARE_SOA_COLUMN(MinNumTpcCls, minNumTpcCls, int); } // namespace mixing_dstar DECLARE_SOA_TABLE(HfCandDstMix, "AOD", "HFCANDDSTMIX", @@ -127,7 +127,6 @@ struct HfTaskMixingDstarCandTreeCreator { Configurable centEstimator{"centEstimator", 2, "Centrality estimator ((None: 0, FT0C: 2, FT0M: 3))"}; Configurable occEstimator{"occEstimator", 2, "If enabled, replace number of PV contributors with occupancy estimation (0: don't use, 1: ITS, 2: FT0C)"}; - using CollsWithQVecs = soa::Join; using TracksWithExtra = soa::Join; using CandDstarWSelFlag = soa::Join; @@ -235,7 +234,7 @@ struct HfTaskMixingDstarCandTreeCreator { auto groupedDstarCandidates = dstarCandidates.sliceBy(dstarWithMlPerCollision, thisCollId); for (const auto& dstarCandidate : groupedDstarCandidates) { fillCandidateTable(collision, dstarCandidate, tracks, bcWithTimeStamps); - } + } } } PROCESS_SWITCH(HfTaskMixingDstarCandTreeCreator, processData, "Process data", true); From 958da4ace13a9a6743cc6ea528e4e2158739de19 Mon Sep 17 00:00:00 2001 From: "mingze.li" Date: Wed, 17 Jun 2026 17:33:35 +0200 Subject: [PATCH 3/4] Use UpperCamelCase for names of O2 columns --- PWGHF/D2H/Tasks/taskMixingDstarCandTreeCreator.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskMixingDstarCandTreeCreator.cxx b/PWGHF/D2H/Tasks/taskMixingDstarCandTreeCreator.cxx index 6421fd0869c..c84990f791f 100644 --- a/PWGHF/D2H/Tasks/taskMixingDstarCandTreeCreator.cxx +++ b/PWGHF/D2H/Tasks/taskMixingDstarCandTreeCreator.cxx @@ -75,12 +75,12 @@ DECLARE_SOA_COLUMN(ZVec, zVec, float); DECLARE_SOA_COLUMN(Centrality, centrality, float); DECLARE_SOA_COLUMN(Multiplicity, multiplicity, int); DECLARE_SOA_COLUMN(Occupancy, occupancy, int); -DECLARE_SOA_COLUMN(XQvec, xqVec, float); -DECLARE_SOA_COLUMN(YQvec, yqVec, float); +DECLARE_SOA_COLUMN(XQVec, xQVec, float); +DECLARE_SOA_COLUMN(YQVec, yQVec, float); DECLARE_SOA_COLUMN(GIndexCol, gIndexCol, int); DECLARE_SOA_COLUMN(TimeStamp, timeStamp, int64_t); // Tracks -DECLARE_SOA_COLUMN(MinAbsEtaTrack, MinabsEtaTrack, float); +DECLARE_SOA_COLUMN(MinAbsEtaTrack, minAbsEtaTrack, float); DECLARE_SOA_COLUMN(MinNumItsCls, minNumItsCls, int); DECLARE_SOA_COLUMN(MinNumTpcCls, minNumTpcCls, int); } // namespace mixing_dstar @@ -107,8 +107,8 @@ DECLARE_SOA_TABLE(HfCandDstMix, "AOD", "HFCANDDSTMIX", mixing_dstar::Centrality, // mixing_dstar::Multiplicity, mixing_dstar::Occupancy, - mixing_dstar::XQvec, - mixing_dstar::YQvec, + mixing_dstar::XQVec, + mixing_dstar::YQVec, mixing_dstar::MinAbsEtaTrack, mixing_dstar::MinNumItsCls, mixing_dstar::MinNumTpcCls, From be2d40807ad4740e2ec11ac4bdc1e17230e7afa5 Mon Sep 17 00:00:00 2001 From: "mingze.li" Date: Thu, 18 Jun 2026 17:09:17 +0200 Subject: [PATCH 4/4] update --- PWGHF/D2H/TableProducer/CMakeLists.txt | 7 ++ .../treeCreatorDstarSpinAlignMixing.cxx} | 99 ++++++++----------- PWGHF/D2H/Tasks/CMakeLists.txt | 5 - 3 files changed, 50 insertions(+), 61 deletions(-) rename PWGHF/D2H/{Tasks/taskMixingDstarCandTreeCreator.cxx => TableProducer/treeCreatorDstarSpinAlignMixing.cxx} (77%) diff --git a/PWGHF/D2H/TableProducer/CMakeLists.txt b/PWGHF/D2H/TableProducer/CMakeLists.txt index 674bbeeb25c..5a725c4623b 100644 --- a/PWGHF/D2H/TableProducer/CMakeLists.txt +++ b/PWGHF/D2H/TableProducer/CMakeLists.txt @@ -106,3 +106,10 @@ o2physics_add_dpl_workflow(converter-reduced-3-prongs-ml SOURCES converterReducedHadronDausPid.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +# Tree creator + +o2physics_add_dpl_workflow(tree-creator-dstar-spin-align-mixing + SOURCES treeCreatorDstarSpinAlignMixing.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGHF/D2H/Tasks/taskMixingDstarCandTreeCreator.cxx b/PWGHF/D2H/TableProducer/treeCreatorDstarSpinAlignMixing.cxx similarity index 77% rename from PWGHF/D2H/Tasks/taskMixingDstarCandTreeCreator.cxx rename to PWGHF/D2H/TableProducer/treeCreatorDstarSpinAlignMixing.cxx index c84990f791f..04ef2564bd0 100644 --- a/PWGHF/D2H/Tasks/taskMixingDstarCandTreeCreator.cxx +++ b/PWGHF/D2H/TableProducer/treeCreatorDstarSpinAlignMixing.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file taskMixingDstarCandTreeCreator.cxx +/// \file treeCreatorDstarSpinAlignMixing.cxx /// \brief Writer of D*+ → D0 ( → π+ K-) π+ candidates in the form of flat tables to be stored in TTrees. /// Intended for Mix-candidate analysis in spin alignment measurement. /// Serving as a correction for detector acceptance and reconstruction efficiency. @@ -49,21 +49,21 @@ namespace mixing_dstar DECLARE_SOA_INDEX_COLUMN(Collision, collision); // D0 related variables DECLARE_SOA_COLUMN(MD0, mD0, float); -DECLARE_SOA_COLUMN(PtD0, ptD0, float); -DECLARE_SOA_COLUMN(PD0, pD0, float); -DECLARE_SOA_COLUMN(EtaD0, etaD0, float); -DECLARE_SOA_COLUMN(PhiD0, phiD0, float); -DECLARE_SOA_COLUMN(YD0, yD0, float); +// DECLARE_SOA_COLUMN(PtD0, ptD0, float); +// DECLARE_SOA_COLUMN(PD0, pD0, float); +// DECLARE_SOA_COLUMN(EtaD0, etaD0, float); +// DECLARE_SOA_COLUMN(PhiD0, phiD0, float); +// DECLARE_SOA_COLUMN(YD0, yD0, float); // soft pion related variables DECLARE_SOA_COLUMN(PtSoftPi, ptSoftPi, float); -DECLARE_SOA_COLUMN(PSoftPi, pSoftPi, float); +// DECLARE_SOA_COLUMN(PSoftPi, pSoftPi, float); DECLARE_SOA_COLUMN(EtaSoftPi, etaSoftPi, float); DECLARE_SOA_COLUMN(PhiSoftPi, phiSoftPi, float); -DECLARE_SOA_COLUMN(YSoftPi, ySoftPi, float); +// DECLARE_SOA_COLUMN(YSoftPi, ySoftPi, float); // Dstar related variables DECLARE_SOA_COLUMN(M, m, float); DECLARE_SOA_COLUMN(Pt, pt, float); -DECLARE_SOA_COLUMN(P, p, float); +// DECLARE_SOA_COLUMN(P, p, float); DECLARE_SOA_COLUMN(Eta, eta, float); DECLARE_SOA_COLUMN(Phi, phi, float); DECLARE_SOA_COLUMN(Y, y, float); @@ -71,9 +71,9 @@ DECLARE_SOA_COLUMN(MlProbDstarToD0PiBkg, mlProbDstarToD0PiBkg, float); DECLARE_SOA_COLUMN(MlProbDstarToD0PiPrompt, mlProbDstarToD0PiPrompt, float); DECLARE_SOA_COLUMN(MlProbDstarToD0PiNonPrompt, mlProbDstarToD0PiNonPrompt, float); // Events -DECLARE_SOA_COLUMN(ZVec, zVec, float); +DECLARE_SOA_COLUMN(ZVtx, zVtx, float); DECLARE_SOA_COLUMN(Centrality, centrality, float); -DECLARE_SOA_COLUMN(Multiplicity, multiplicity, int); +DECLARE_SOA_COLUMN(NPvContrib, nPvContrib, uint16_t); DECLARE_SOA_COLUMN(Occupancy, occupancy, int); DECLARE_SOA_COLUMN(XQVec, xQVec, float); DECLARE_SOA_COLUMN(YQVec, yQVec, float); @@ -81,20 +81,15 @@ DECLARE_SOA_COLUMN(GIndexCol, gIndexCol, int); DECLARE_SOA_COLUMN(TimeStamp, timeStamp, int64_t); // Tracks DECLARE_SOA_COLUMN(MinAbsEtaTrack, minAbsEtaTrack, float); -DECLARE_SOA_COLUMN(MinNumItsCls, minNumItsCls, int); -DECLARE_SOA_COLUMN(MinNumTpcCls, minNumTpcCls, int); +DECLARE_SOA_COLUMN(MinNumItsCls, minNumItsCls, uint8_t); +DECLARE_SOA_COLUMN(MinNumTpcCls, minNumTpcCls, uint8_t); } // namespace mixing_dstar DECLARE_SOA_TABLE(HfCandDstMix, "AOD", "HFCANDDSTMIX", mixing_dstar::MD0, - // mixing_dstar::PtD0, - // mixing_dstar::EtaD0, - // mixing_dstar::PhiD0, - // mixing_dstar::YD0, mixing_dstar::PtSoftPi, mixing_dstar::EtaSoftPi, mixing_dstar::PhiSoftPi, - // mixing_dstar::YSoftPi, mixing_dstar::M, mixing_dstar::Pt, mixing_dstar::Eta, @@ -103,9 +98,9 @@ DECLARE_SOA_TABLE(HfCandDstMix, "AOD", "HFCANDDSTMIX", mixing_dstar::MlProbDstarToD0PiBkg, mixing_dstar::MlProbDstarToD0PiPrompt, mixing_dstar::MlProbDstarToD0PiNonPrompt, - mixing_dstar::ZVec, + mixing_dstar::ZVtx, mixing_dstar::Centrality, - // mixing_dstar::Multiplicity, + mixing_dstar::NPvContrib, mixing_dstar::Occupancy, mixing_dstar::XQVec, mixing_dstar::YQVec, @@ -117,12 +112,9 @@ DECLARE_SOA_TABLE(HfCandDstMix, "AOD", "HFCANDDSTMIX", } // namespace o2::aod /// Writes the full information in an output TTree -struct HfTaskMixingDstarCandTreeCreator { +struct HfTreeCreatorDstarSpinAlignMixing { Produces rowCandidateMix; - Configurable selectionFlagDstarToD0Pi{"selectionFlagDstarToD0Pi", true, "Selection Flag for D* decay to D0 & Pi"}; - Configurable fillMixingCandidateTable{"fillMixingCandidateTable", false, "Switch to fill lite table with candidate properties"}; - Configurable qVecDetector{"qVecDetector", 2, "Detector for Q vector estimation (FV0A: 0, FT0M: 1, FT0C: 2)"}; Configurable centEstimator{"centEstimator", 2, "Centrality estimator ((None: 0, FT0C: 2, FT0M: 3))"}; Configurable occEstimator{"occEstimator", 2, "If enabled, replace number of PV contributors with occupancy estimation (0: don't use, 1: ITS, 2: FT0C)"}; @@ -132,7 +124,7 @@ struct HfTaskMixingDstarCandTreeCreator { using CandDstarWSelFlag = soa::Join; using FilteredCandDstarWSelFlagAndMl = soa::Filtered>; - Filter filterSelectDstarCandidates = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstarToD0Pi; + Filter filterSelectDstarCandidates = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == true; Preslice dstarWithMlPerCollision = aod::hf_cand::collisionId; @@ -193,35 +185,30 @@ struct HfTaskMixingDstarCandTreeCreator { getTrackingInfos(std::vector{trackProng0, trackProng1, trackProng2}, absEtaTrackMin, numItsClsMin, numTpcClsMin); std::array const Qvector = getQvec(collision, qVecDetector.value); - if (fillMixingCandidateTable) { - rowCandidateMix( - massD0, - // candidate.ptD0(), - // candidate.etaD0(), - // candidate.phiD0(), - // candidate.yD0(), - candidate.ptSoftPi(), - etaSoftPi, - phiSoftPi, - massDStar, - candidate.pt(), - candidate.eta(), - candidate.phi(), - candidate.y(constants::physics::MassDStar), - candidate.mlProbDstarToD0Pi()[0], - candidate.mlProbDstarToD0Pi()[1], - candidate.mlProbDstarToD0Pi()[2], - collision.posZ(), - getCentralityColl(collision, centEstimator), - getOccupancyColl(collision, occEstimator), - Qvector[0], - Qvector[1], - absEtaTrackMin, - numItsClsMin, - numTpcClsMin, - collision.globalIndex(), - timeStamp); - } + rowCandidateMix( + massD0, + candidate.ptSoftPi(), + etaSoftPi, + phiSoftPi, + massDStar, + candidate.pt(), + candidate.eta(), + candidate.phi(), + candidate.y(constants::physics::MassDStar), + candidate.mlProbDstarToD0Pi()[0], + candidate.mlProbDstarToD0Pi()[1], + candidate.mlProbDstarToD0Pi()[2], + collision.posZ(), + getCentralityColl(collision, centEstimator), + collision.numContrib(), + getOccupancyColl(collision, occEstimator), + Qvector[0], + Qvector[1], + absEtaTrackMin, + numItsClsMin, + numTpcClsMin, + collision.globalIndex(), + timeStamp); } void processData(CollsWithQVecs const& collisions, @@ -237,10 +224,10 @@ struct HfTaskMixingDstarCandTreeCreator { } } } - PROCESS_SWITCH(HfTaskMixingDstarCandTreeCreator, processData, "Process data", true); + PROCESS_SWITCH(HfTreeCreatorDstarSpinAlignMixing, processData, "Process data", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } diff --git a/PWGHF/D2H/Tasks/CMakeLists.txt b/PWGHF/D2H/Tasks/CMakeLists.txt index 288d9e4cdb1..19a61637c19 100644 --- a/PWGHF/D2H/Tasks/CMakeLists.txt +++ b/PWGHF/D2H/Tasks/CMakeLists.txt @@ -178,8 +178,3 @@ o2physics_add_dpl_workflow(task-deuteron-from-lb SOURCES taskDeuteronFromLb.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(task-mixing-dstar-cand-tree-creator - SOURCES taskMixingDstarCandTreeCreator.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis)