From d9fc6bc7e6e5cccf7c54eb2f0a48461042860f67 Mon Sep 17 00:00:00 2001 From: mariafernandatorrescabrera Date: Tue, 5 May 2026 12:00:17 -0500 Subject: [PATCH 01/12] Update QA candidate selector for Omegac0 --- .../candidateSelectorOmegac0ToOmegaPiQa.cxx | 1232 +++++++++++++++++ 1 file changed, 1232 insertions(+) create mode 100755 PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx diff --git a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx new file mode 100755 index 00000000000..24b97d17db1 --- /dev/null +++ b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx @@ -0,0 +1,1232 @@ +// 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 candidateSelectorOmegac0ToOmegaPiQa.cxx +/// \brief Omegac0 → Omega Pi selection task + +/// \author Fabio Catalano , University of Houston +/// \author Maria Fernanda Torres Cabrera , University of Houston + +#include "PWGHF/Core/HfMlResponseOmegacToOmegaPi.h" +#include "PWGHF/Core/SelectorCuts.h" +#include "PWGHF/DataModel/AliasTables.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/Utils/utilsAnalysis.h" + +#include "Common/Core/RecoDecay.h" +#include "Common/Core/TrackSelectorPID.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include + +using namespace o2; +using namespace o2::aod; +using namespace o2::framework; +using namespace o2::analysis; + +enum PidInfoStored { + PiFromLam = 0, + PrFromLam, + KaFromCasc, + PiFromCharm +}; + +enum { + doDcaFitter = 0, + doKfParticle +}; + +/// Struct for applying Omegac0 -> Omega pi selection cuts +struct HfCandidateSelectorToOmegaPiQa { + // DCAFitter and KFParticle + Produces hfSelToOmegaPi; + // ML selection - Filled with both DCAFitter and KFParticle + Produces hfMlSelToOmegaPi; + + // cuts from SelectorCuts.h - pT dependent cuts + Configurable> binsPt{"binsPt", std::vector{hf_cuts_omegac_to_omega_pi::vecBinsPt}, "pT bin limits"}; + Configurable> cuts{"cuts", {hf_cuts_omegac_to_omega_pi::Cuts[0], hf_cuts_omegac_to_omega_pi::NBinsPt, hf_cuts_omegac_to_omega_pi::NCutVars, hf_cuts_omegac_to_omega_pi::labelsPt, hf_cuts_omegac_to_omega_pi::labelsCutVar}, "OmegaC0 candidate selection per pT bin"}; + + // ML inference + Configurable applyMl{"applyMl", false, "Flag to apply ML selections"}; + Configurable> binsPtMl{"binsPtMl", std::vector{hf_cuts_ml::vecBinsPt}, "pT bin limits for ML application"}; + Configurable> cutDirMl{"cutDirMl", std::vector{hf_cuts_ml::vecCutDir}, "Whether to reject score values greater or smaller than the threshold"}; + Configurable> cutsMl{"cutsMl", {hf_cuts_ml::Cuts[0], hf_cuts_ml::NBinsPt, hf_cuts_ml::NCutScores, hf_cuts_ml::labelsPt, hf_cuts_ml::labelsCutScore}, "ML selections per pT bin"}; + Configurable nClassesMl{"nClassesMl", static_cast(hf_cuts_ml::NCutScores), "Number of classes in ML model"}; + Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature1", "feature2"}, "Names of ML model input features"}; + + // CCDB configuration + Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable> modelPathsCCDB{"modelPathsCCDB", std::vector{"EventFiltering/PWGHF/BDTOmegac0"}, "Paths of models on CCDB"}; + Configurable> onnxFileNames{"onnxFileNames", std::vector{"ModelHandler_onnx_Omegac0ToOmegaPi.onnx"}, "ONNX file names for each pT bin (if not from CCDB full path)"}; + Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB"}; + Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; + + // LF analysis selections + Configurable etaTrackCharmBachMax{"etaTrackCharmBachMax", 0.8, "Max absolute value of eta for charm baryon bachelor"}; + Configurable etaTrackLFDauMax{"etaTrackLFDauMax", 1.0, "Max absolute value of eta for V0 and cascade daughters"}; + Configurable ptKaFromCascMin{"ptKaFromCascMin", 0.15, "Min pT kaon <- casc"}; + Configurable radiusCascMin{"radiusCascMin", 0.5, "Min cascade radius"}; + Configurable radiusV0Min{"radiusV0Min", 1.1, "Min V0 radius"}; + Configurable impactParameterXYPiFromCharmBaryonMin{"impactParameterXYPiFromCharmBaryonMin", 0., "Min dcaxy pi from charm baryon track to PV"}; + Configurable impactParameterXYPiFromCharmBaryonMax{"impactParameterXYPiFromCharmBaryonMax", 10., "Max dcaxy pi from charm baryon track to PV"}; + Configurable impactParameterXYCascMin{"impactParameterXYCascMin", 0., "Min dcaxy cascade track to PV"}; + Configurable impactParameterXYCascMax{"impactParameterXYCascMax", 10., "Max dcaxy cascade track to PV"}; + Configurable impactParameterZPiFromCharmBaryonMin{"impactParameterZPiFromCharmBaryonMin", 0., "Min dcaz pi from charm baryon track to PV"}; + Configurable impactParameterZPiFromCharmBaryonMax{"impactParameterZPiFromCharmBaryonMax", 10., "Max dcaz pi from charm baryon track to PV"}; + Configurable impactParameterZCascMin{"impactParameterZCascMin", 0., "Min dcaz cascade track to PV"}; + Configurable impactParameterZCascMax{"impactParameterZCascMax", 10., "Max dcaz cascade track to PV"}; + Configurable applyTrkSelLf{"applyTrkSelLf", true, "Apply track selection for LF daughters"}; + + // Mass window + Configurable v0MassWindow{"v0MassWindow", 0.01, "V0 mass window"}; + Configurable cascadeMassWindow{"cascadeMassWindow", 0.01, "Cascade mass window"}; + Configurable invMassCharmBaryonMin{"invMassCharmBaryonMin", 2.3, "Lower limit invariant mass spectrum charm baryon"}; // 2.4 Omegac0 only + Configurable invMassCharmBaryonMax{"invMassCharmBaryonMax", 3.1, "Upper limit invariant mass spectrum charm baryon"}; + + // Configurable cosPAV0Min{"cosPAV0Min", 0.97, "Min valueCosPA V0"}; + // Configurable cosPACascMin{"cosPACascMin", 0.97, "Min value CosPA cascade"}; + // Configurable dcaCascDauMax{"dcaCascDauMax", 1.0, "Max DCA cascade daughters"}; + // Configurable dcaV0DauMax{"dcaV0DauMax", 1.0, "Max DCA V0 daughters"}; + // Configurable dcaBachToPvMin{"dcaBachToPvMin", 0.04, "DCA Bach To PV"}; + // Configurable dcaNegToPvMin{"dcaNegToPvMin", 0.06, "DCA Neg To PV"}; + // Configurable dcaPosToPvMin{"dcaPosToPvMin", 0.06, "DCA Pos To PV"}; + + // PID options + Configurable usePidTpcOnly{"usePidTpcOnly", false, "Perform PID using only TPC"}; + Configurable usePidTpcTofCombined{"usePidTpcTofCombined", true, "Perform PID using TPC & TOF"}; + + // PID - TPC selections + Configurable ptPiPidTpcMin{"ptPiPidTpcMin", -1, "Lower bound of track pT for TPC PID for pion selection"}; + Configurable ptPiPidTpcMax{"ptPiPidTpcMax", 9999.9, "Upper bound of track pT for TPC PID for pion selection"}; + Configurable nSigmaTpcPiMax{"nSigmaTpcPiMax", 3., "Nsigma cut on TPC only for pion selection"}; + Configurable nSigmaTpcCombinedPiMax{"nSigmaTpcCombinedPiMax", 0., "Nsigma cut on TPC combined with TOF for pion selection"}; + + Configurable ptPrPidTpcMin{"ptPrPidTpcMin", -1, "Lower bound of track pT for TPC PID for proton selection"}; + Configurable ptPrPidTpcMax{"ptPrPidTpcMax", 9999.9, "Upper bound of track pT for TPC PID for proton selection"}; + Configurable nSigmaTpcPrMax{"nSigmaTpcPrMax", 3., "Nsigma cut on TPC only for proton selection"}; + Configurable nSigmaTpcCombinedPrMax{"nSigmaTpcCombinedPrMax", 0., "Nsigma cut on TPC combined with TOF for proton selection"}; + + Configurable ptKaPidTpcMin{"ptKaPidTpcMin", -1, "Lower bound of track pT for TPC PID for kaon selection"}; + Configurable ptKaPidTpcMax{"ptKaPidTpcMax", 9999.9, "Upper bound of track pT for TPC PID for kaon selection"}; + Configurable nSigmaTpcKaMax{"nSigmaTpcKaMax", 3., "Nsigma cut on TPC only for kaon selection"}; + Configurable nSigmaTpcCombinedKaMax{"nSigmaTpcCombinedKaMax", 0., "Nsigma cut on TPC combined with TOF for kaon selection"}; + + // PID - TOF selections + Configurable ptPiPidTofMin{"ptPiPidTofMin", -1, "Lower bound of track pT for TOF PID for pion selection"}; + Configurable ptPiPidTofMax{"ptPiPidTofMax", 9999.9, "Upper bound of track pT for TOF PID for pion selection"}; + Configurable nSigmaTofPiMax{"nSigmaTofPiMax", 3., "Nsigma cut on TOF only for pion selection"}; + Configurable nSigmaTofCombinedPiMax{"nSigmaTofCombinedPiMax", 0., "Nsigma cut on TOF combined with TPC for pion selection"}; + + Configurable ptPrPidTofMin{"ptPrPidTofMin", -1, "Lower bound of track pT for TOF PID for proton selection"}; + Configurable ptPrPidTofMax{"ptPrPidTofMax", 9999.9, "Upper bound of track pT for TOF PID for proton selection"}; + Configurable nSigmaTofPrMax{"nSigmaTofPrMax", 3., "Nsigma cut on TOF only for proton selection"}; + Configurable nSigmaTofCombinedPrMax{"nSigmaTofCombinedPrMax", 0., "Nsigma cut on TOF combined with TPC for proton selection"}; + + Configurable ptKaPidTofMin{"ptKaPidTofMin", -1, "Lower bound of track pT for TOF PID for kaon selection"}; + Configurable ptKaPidTofMax{"ptKaPidTofMax", 9999.9, "Upper bound of track pT for TOF PID for kaon selection"}; + Configurable nSigmaTofKaMax{"nSigmaTofKaMax", 3., "Nsigma cut on TOF only for kaon selection"}; + Configurable nSigmaTofCombinedKaMax{"nSigmaTofCombinedKaMax", 0., "Nsigma cut on TOF combined with TOF for kaon selection"}; + + // detector clusters selections + Configurable nClustersTpcMin{"nClustersTpcMin", 70, "Minimum number of TPC clusters requirement"}; + Configurable nTpcCrossedRowsMin{"nTpcCrossedRowsMin", 70, "Minimum number of TPC crossed rows requirement"}; + Configurable tpcCrossedRowsOverFindableClustersRatioMin{"tpcCrossedRowsOverFindableClustersRatioMin", 0.8, "Minimum ratio TPC crossed rows over findable clusters requirement"}; + Configurable tpcChi2PerClusterMax{"tpcChi2PerClusterMax", 4, "Maximum value of chi2 fit over TPC clusters"}; + Configurable nClustersItsMin{"nClustersItsMin", 3, "Minimum number of ITS clusters requirement for pi <- charm baryon"}; + Configurable nClustersItsInnBarrMin{"nClustersItsInnBarrMin", 1, "Minimum number of ITS clusters in inner barrel requirement for pi <- charm baryon"}; + Configurable itsChi2PerClusterMax{"itsChi2PerClusterMax", 36, "Maximum value of chi2 fit over ITS clusters for pi <- charm baryon"}; + + o2::analysis::HfMlResponseOmegacToOmegaPi hfMlResponse; + std::vector outputMlOmegac = {}; + o2::ccdb::CcdbApi ccdbApi; + + TrackSelectorPi selectorPion; + TrackSelectorPr selectorProton; + TrackSelectorKa selectorKaon; + + using TracksSel = soa::Join; + using TracksSelLf = soa::Join; + + HistogramRegistry registry{"registry"}; // for QA of selections + + // // kinematic selections + // Configurable ptPiFromCharmBaryonMin{"ptPiFromCharmBaryonMin", 0.2, "Min pT pi <- charm baryon"}; + // Configurable ptCandMin{"ptCandMin", 0., "Lower bound of candidate pT"}; + // Configurable ptCandMax{"ptCandMax", 50., "Upper bound of candidate pT"}; + + // Configurable dcaCharmBaryonDauMax{"dcaCharmBaryonDauMax", 2.0, "Max DCA charm baryon daughters"}; + + // struct : ConfigurableGroup { + // //// KF selection + // std::string prefix = "kfSel"; + // Configurable applyKFpreselections{"applyKFpreselections", false, "Apply KFParticle related rejection"}; + // Configurable applyCompetingCascRejection{"applyCompetingCascRejection", false, "Apply competing Xi(for Omegac0) rejection"}; + // Configurable cascadeRejMassWindow{"cascadeRejMassWindow", 0.01, "competing Xi(for Omegac0) rejection mass window"}; + // Configurable v0LdlMin{"v0LdlMin", 3., "Minimum value of l/dl of V0"}; // l/dl and Chi2 are to be determined + // Configurable cascLdlMin{"cascLdlMin", 1., "Minimum value of l/dl of casc"}; + // Configurable omegacLdlMax{"omegacLdlMax", 5., "Maximum value of l/dl of Omegac"}; + // Configurable cTauOmegacMax{"cTauOmegacMax", 0.4, "lifetime τ of Omegac"}; + // Configurable v0Chi2OverNdfMax{"v0Chi2OverNdfMax", 100., "Maximum chi2Geo/NDF of V0"}; + // Configurable cascChi2OverNdfMax{"cascChi2OverNdfMax", 100., "Maximum chi2Geo/NDF of casc"}; + // Configurable omegacChi2OverNdfMax{"omegacChi2OverNdfMax", 100., "Maximum chi2Geo/NDF of Omegac"}; + // Configurable chi2TopoV0ToCascMax{"chi2TopoV0ToCascMax", 100., "Maximum chi2Topo/NDF of V0ToCas"}; + // Configurable chi2TopoOmegacToPvMax{"chi2TopoOmegacToPvMax", 100., "Maximum chi2Topo/NDF of OmegacToPv"}; + // Configurable chi2TopoCascToOmegacMax{"chi2TopoCascToOmegacMax", 100., "Maximum chi2Topo/NDF of CascToOmegac"}; + // Configurable chi2TopoCascToPvMax{"chi2TopoCascToPvMax", 100., "Maximum chi2Topo/NDF of CascToPv"}; + // Configurable decayLenXYOmegacMax{"decayLenXYOmegacMax", 1.5, "Maximum decay lengthXY of Omegac"}; + // Configurable decayLenXYCascMin{"decayLenXYCascMin", 1., "Minimum decay lengthXY of Cascade"}; + // Configurable decayLenXYLambdaMin{"decayLenXYLambdaMin", 0., "Minimum decay lengthXY of V0"}; + // Configurable cosPaCascToOmegacMin{"cosPaCascToOmegacMin", 0.995, "Minimum cosPA of cascade<-Omegac"}; + // Configurable cosPaV0ToCascMin{"cosPaV0ToCascMin", 0.99, "Minimum cosPA of V0<-cascade"}; + // } kfConfigurableGroup; + + void init(InitContext const&) + // { + // std::array processesSelector = {doprocessOmegac0SelectorWithDCAFitter, doprocessOmegac0SelectorWithKFParticle}; + // const int nProcessesSelector = std::accumulate(processesSelector.begin(), processesSelector.end(), 0); + // if (nProcessesSelector != 1) { + // LOGP(fatal, "At most one process function for selector can be enabled at a time."); + // } + + selectorPion.setRangePtTpc(ptPiPidTpcMin, ptPiPidTpcMax); + selectorPion.setRangeNSigmaTpc(-nSigmaTpcPiMax, nSigmaTpcPiMax); + selectorPion.setRangeNSigmaTpcCondTof(-nSigmaTpcCombinedPiMax, nSigmaTpcCombinedPiMax); + selectorPion.setRangePtTof(ptPiPidTofMin, ptPiPidTofMax); + selectorPion.setRangeNSigmaTof(-nSigmaTofPiMax, nSigmaTofPiMax); + selectorPion.setRangeNSigmaTofCondTpc(-nSigmaTofCombinedPiMax, nSigmaTofCombinedPiMax); + + selectorProton.setRangePtTpc(ptPrPidTpcMin, ptPrPidTpcMax); + selectorProton.setRangeNSigmaTpc(-nSigmaTpcPrMax, nSigmaTpcPrMax); + selectorProton.setRangeNSigmaTpcCondTof(-nSigmaTpcCombinedPrMax, nSigmaTpcCombinedPrMax); + selectorProton.setRangePtTof(ptPrPidTofMin, ptPrPidTofMax); + selectorProton.setRangeNSigmaTof(-nSigmaTofPrMax, nSigmaTofPrMax); + selectorProton.setRangeNSigmaTofCondTpc(-nSigmaTofCombinedPrMax, nSigmaTofCombinedPrMax); + + selectorKaon.setRangePtTpc(ptKaPidTpcMin, ptKaPidTpcMax); + selectorKaon.setRangeNSigmaTpc(-nSigmaTpcKaMax, nSigmaTpcKaMax); + selectorKaon.setRangeNSigmaTpcCondTof(-nSigmaTpcCombinedKaMax, nSigmaTpcCombinedKaMax); + selectorKaon.setRangePtTof(ptKaPidTofMin, ptKaPidTofMax); + selectorKaon.setRangeNSigmaTof(-nSigmaTofKaMax, nSigmaTofKaMax); + selectorKaon.setRangeNSigmaTofCondTpc(-nSigmaTofCombinedKaMax, nSigmaTofCombinedKaMax); + + const AxisSpec axisSel{2, -0.5, 1.5, "status"}; + const AxisSpec axisSelOnLfDca{14, -0.5, 13.5, "status"}; + const AxisSpec axisSelOnLfKf{23, -0.5, 22.5, "status"}; + const AxisSpec axisSelOnHfDca{6, -0.5, 5.5, "status"}; + const AxisSpec axisSelOnHfKf{12, -0.5, 11.5, "status"}; + + // registry.add("hSelPID", "hSelPID;status;entries", {HistType::kTH1D, {{12, 0., 12.}}}); + // registry.add("hStatusCheck", "Check consecutive selections status;status;entries", {HistType::kTH1D, {{12, 0., 12.}}}); + + // for QA of the selections (bin 0 -> candidates that did not pass the selection, bin 1 -> candidates that passed the selection) + registry.add("hSelSignDec", "hSelSignDec;status;entries", {HistType::kTH1F, {axisSel}}); + registry.add("hSelStatusCluster", "hSelStatusCluster:# of events Passed;;", {HistType::kTH1F, {{6, -0.5, 5.5}}}); + registry.get(HIST("hSelStatusCluster"))->GetXaxis()->SetBinLabel(1, "All"); + registry.get(HIST("hSelStatusCluster"))->GetXaxis()->SetBinLabel(2, "TpcCluster PiFromV0"); + registry.get(HIST("hSelStatusCluster"))->GetXaxis()->SetBinLabel(3, "TpcCluster PrFromV0"); + registry.get(HIST("hSelStatusCluster"))->GetXaxis()->SetBinLabel(4, "TpcCluster KaFromCasc"); + registry.get(HIST("hSelStatusCluster"))->GetXaxis()->SetBinLabel(5, "TpcCluster PiFromCharm"); + registry.get(HIST("hSelStatusCluster"))->GetXaxis()->SetBinLabel(6, "ItsCluster PiFromCharm"); + + // registry.add("hSelEtaPosV0Dau", "hSelEtaPosV0Dau;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelEtaNegV0Dau", "hSelEtaNegV0Dau;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelEtaKaFromCasc", "hSelEtaKaFromCasc;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelEtaPiFromCharm", "hSelEtaPiFromCharm;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelRadCasc", "hSelRadCasc;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelRadV0", "hSelRadV0;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelCosPACasc", "hSelCosPACasc;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelCosPAV0", "hSelCosPAV0;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelDCACascDau", "hSelDCACascDau;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelDCAV0Dau", "hSelDCAV0Dau;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelDCACharmDau", "hSelDCACharmDau;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelDCAXYPrimPi", "hSelDCAXYPrimPi;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelDCAZPrimPi", "hSelDCAZPrimPi;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelDCAXYCasc", "hSelDCAXYCasc;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelDCAZCasc", "hSelDCAZCasc;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelPtKaFromCasc", "hSelPtKaFromCasc;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelPtPiFromCharm", "hSelPtPiFromCharm;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelTPCQualityPiFromCharm", "hSelTPCQualityPiFromCharm;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelTPCQualityPiFromLam", "hSelTPCQualityPiFromLam;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelTPCQualityPrFromLam", "hSelTPCQualityPrFromLam;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelTPCQualityKaFromCasc", "hSelTPCQualityKaFromCasc;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelITSQualityPiFromCharm", "hSelITSQualityPiFromCharm;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelMassLam", "hSelMassLam;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelMassCasc", "hSelMassCasc;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelMassCharmBaryon", "hSelMassCharmBaryon;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelDcaXYToPvV0Daughters", "hSelDcaXYToPvV0Daughters;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelDcaXYToPvKaFromCasc", "hSelDcaXYToPvKaFromCasc;status;entries", {HistType::kTH1D, {axisSel}}); + + registry.add("hSelStatusPID", "hSelStatusPID;# of events Passed;;", {HistType::kTH1F, {{4, -0.5, 3.5}}}); + registry.get(HIST("hSelStatusPID"))->GetXaxis()->SetBinLabel(1, "All"); + registry.get(HIST("hSelStatusPID"))->GetXaxis()->SetBinLabel(2, "Lambda"); + registry.get(HIST("hSelStatusPID"))->GetXaxis()->SetBinLabel(3, "Cascade"); + registry.get(HIST("hSelStatusPID"))->GetXaxis()->SetBinLabel(4, "CharmBaryon"); + + // For QA of LF & HF selection + if (doprocessSelectionDCAFitter) { + registry.add("hSelStatusLf", "hSelStatusLf;# of candidate passed;", {HistType::kTH1F, {axisSelOnLfDca}}); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(1, "All"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(2, "etaV0Dau"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(3, "radiusV0"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(4, "radiusCasc"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(5, "cosPAV0"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(6, "cosPACasc"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(7, "dcaV0Dau"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(8, "dcaCascDau"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(9, "dcaXYToPvV0Dau0"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(10, "dcaXYToPvV0Dau1"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(11, "dcaXYToPvCascDau"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(12, "ptKaFromCasc"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(13, "impactParCascXY"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(14, "impactParCascZ"); + + registry.add("hSelStatusHf", "hSelStatusHf;# of candidate passed;", {HistType::kTH1F, {axisSelOnHfDca}}); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(1, "All"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(2, "etaTrackCharmBach"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(3, "dcaCharmBaryonDau"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(4, "ptPiFromCharmBaryon"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(5, "impactParBachFromCharmXY"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(6, "impactParBachFromCharmZ"); + } + + if (doprocessSelectionKFParticle) { + registry.add("hSelStatusLf", "hSelStatusLf;# of candidate passed;", {HistType::kTH1F, {axisSelOnLfKf}}); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(1, "All"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(2, "etaV0Dau"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(3, "radiusV0"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(4, "radiusCasc"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(5, "cosPAV0"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(6, "cosPACasc"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(7, "dcaV0Dau"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(8, "dcaCascDau"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(9, "dcaXYToPvV0Dau0"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(10, "dcaXYToPvV0Dau1"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(11, "dcaXYToPvCascDau"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(12, "ptKaFromCasc"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(13, "cosPAV0ToCasc"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(14, "kfDcaXYCascToPv"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(15, "chi2GeoV0"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(16, "chi2GeoCasc"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(17, "chi2TopoV0ToPv"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(18, "chi2TopoCascToPv"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(19, "chi2TopoV0ToCasc"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(20, "v0ldl"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(21, "cascldl"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(22, "decayLenXYLambda"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(23, "decayLenXYCasc"); + + registry.add("hSelStatusHf", "hSelStatusHf;# of candidate passed;", {HistType::kTH1F, {axisSelOnHfKf}}); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(1, "All"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(2, "etaTrackCharmBach"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(3, "dcaCharmBaryonDau"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(4, "ptPiFromCharmBaryon"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(5, "cosPaCascToOmegac"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(6, "kfDcaXYPiFromOmegac"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(7, "chi2GeoOmegac"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(8, "chi2TopoOmegacToPv"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(9, "chi2TopoPiFromOmegacToPv"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(10, "chi2TopoCascToOmegac"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(11, "decayLenXYOmegac"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(12, "cTauOmegac"); + } + + // invariant mass histograms + registry.add("hInvMassCharmBaryonWoPidInvMassCut", "Charm baryon invariant mass; int mass; entries", {HistType::kTH1F, {{500, 2.3, 3.1}}}); + registry.add("hInvMassCharmBaryon", "Charm baryon invariant mass; int mass; entries", {HistType::kTH1F, {{500, 2.3, 3.1}}}); + registry.add("hInvMassCharmBaryonBkg", "Charm baryon invariant mass, rejected; int mass; entries", {HistType::kTH1F, {{500, 2.3, 3.1}}}); + // registry.add("hPtCharmBaryon", "Charm baryon transverse momentum; p_{T} (GeV/c); entries", {HistType::kTH1D, {{8000, 0., 80.}}}); + + // if (kfConfigurableGroup.applyKFpreselections) { + // registry.add("hSelPtOmegac", "hSelPtOmegac;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelCompetingCasc", "hSelCompetingCasc;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelKFstatus", "hSelKFstatus;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelV0_Casc_Omegacldl", "hSelV0_Casc_Omegacldl;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelctauOmegac", "hSelctauOmegac;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelChi2GeooverNDFV0_Casc_Omegac", "hSelChi2GeooverNDFV0_Casc_Omegac;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelChi2TopooverNDFV0_Casc_Omegac", "hSelChi2TopooverNDFV0_Casc_Omegac;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSeldecayLenXYOmegac_Casc_V0", "hSeldecayLenXYOmegac_Casc_V0;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hSelcosPaCascToOmegac_V0ToCasc", "hSelcosPaCascToOmegac_V0ToCasc;status;entries", {HistType::kTH1D, {axisSel}}); + // registry.add("hInvMassXiMinus_rej_cut", "hInvMassXiMinus_rej_cut", kTH1D, {{1000, 1.25f, 1.65f}}); + // } + // if (applyMl) { + // hfMlResponse.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl); + // if (loadModelsFromCCDB) { + // ccdbApi.init(ccdbUrl); + // hfMlResponse.setModelPathsCCDB(onnxFileNames, ccdbApi, modelPathsCCDB, timestampCCDB); + // } else { + // hfMlResponse.setModelPathsLocal(onnxFileNames); + // } + // hfMlResponse.cacheInputFeaturesIndices(namesInputFeatures); + // hfMlResponse.init(); + // } + + // HfMlResponse initialization + if (applyMl) { + if (doprocessSelectionDCAFitter) { + hfMlResponse.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl); + if (loadModelsFromCCDB) { + ccdbApi.init(ccdbUrl); + hfMlResponse.setModelPathsCCDB(onnxFileNames, ccdbApi, modelPathsCCDB, timestampCCDB); + } else { + hfMlResponse.setModelPathsLocal(onnxFileNames); + } + hfMlResponse.cacheInputFeaturesIndices(namesInputFeatures); + hfMlResponse.init(); + } else { + // KFParticle path: ML is not yet implemented + LOGP(warning, "ML selection is currently only supported for DCAFitter."); + } + } + } + + // LF cuts - Cuts on LF tracks reco + // Selection on LF related informations + // returns true if all cuts are passed + template + bool SelectOnLF(const T& candidate, const int& inputPtBin) + { + + registry.fill(HIST("hSelStatusLf"), 0.0); + + // Eta selection of V0, Cascade daughters + double etaV0PosDau = candidate.etaV0PosDau(); + double etaV0NegDau = candidate.etaV0NegDau(); + double etaKaFromCasc = candidate.etaBachFromCasc(); + + if (std::abs(etaV0PosDau) > etaTrackLFDauMax || std::abs(etaV0NegDau) > etaTrackLFDauMax || std::abs(etaKaFromCasc) > etaTrackLFDauMax) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 1.0); + + // Minimum radius cut + double radiusV0 = RecoDecay::sqrtSumOfSquares(candidate.xDecayVtxV0(), candidate.yDecayVtxV0()); + double radiusCasc = RecoDecay::sqrtSumOfSquares(candidate.xDecayVtxCascade(), candidate.yDecayVtxCascade()); + + if (radiusV0 < radiusV0Min) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 2.0); + if (radiusCasc < radiusCascMin) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 3.0); + + // Cosine of pointing angle + if (candidate.cosPAV0() < cuts->get(inputPtBin, "cosPAV0")) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 4.0); + if (candidate.cosPACasc() < cuts->get(inputPtBin, "cosPACasc")) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 5.0); + + // Distance of Closest Approach(DCA) + if (candidate.dcaV0Dau() > cuts->get(inputPtBin, "dcaV0Dau")) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 6.0); + + if (candidate.dcaCascDau() > cuts->get(inputPtBin, "dcaCascDau")) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 7.0); + + if (std::abs(candidate.dcaXYToPvV0Dau0()) < cuts->get(inputPtBin, "dcaXYToPvV0Dau0")) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 8.0); + + if (std::abs(candidate.dcaXYToPvV0Dau1()) < cuts->get(inputPtBin, "dcaXYToPvV0Dau1")) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 9.0); + + if (std::abs(candidate.dcaXYToPvCascDau()) < cuts->get(inputPtBin, "dcaXYToPvCascDau")) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 10.0); + + // pT: Bachelor + double ptKaFromCasc = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCasc(), candidate.pyBachFromCasc()); + if (std::abs(ptKaFromCasc) < ptKaFromCascMin) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 11.0); + + // Extra cuts for KFParticle + if constexpr (svReco == doKfParticle) { + // Cosine of Pointing angle + if (candidate.cosPaV0ToCasc() < cuts->get(inputPtBin, "cosPaV0ToCasc")) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 12.0); + + // DCA + if (std::abs(candidate.kfDcaXYCascToPv()) > cuts->get(inputPtBin, "kfDcaXYCascToPv")) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 13.0); + + // Chi2 + if (candidate.chi2GeoV0() < 0 || candidate.chi2GeoV0() > cuts->get(inputPtBin, "chi2GeoV0")) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 14.0); + if (candidate.chi2GeoCasc() < 0 || candidate.chi2GeoCasc() > cuts->get(inputPtBin, "chi2GeoCasc")) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 15.0); + if (candidate.chi2TopoV0ToPv() > 0 && candidate.chi2TopoV0ToPv() < cuts->get(inputPtBin, "chi2TopoV0ToPv")) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 16.0); + if (candidate.chi2TopoCascToPv() < 0 || candidate.chi2TopoCascToPv() > cuts->get(inputPtBin, "chi2TopoCascToPv")) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 17.0); + if (candidate.chi2TopoV0ToCasc() < 0 || candidate.chi2TopoV0ToCasc() > cuts->get(inputPtBin, "chi2TopoV0ToCasc")) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 18.0); + + // ldl + if (candidate.v0ldl() < cuts->get(inputPtBin, "v0ldl")) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 19.0); + if (candidate.cascldl() < cuts->get(inputPtBin, "cascldl")) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 20.0); + + // Decay length + if (std::abs(candidate.decayLenXYLambda()) < cuts->get(inputPtBin, "decayLenXYLambda")) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 21.0); + if (std::abs(candidate.decayLenXYCasc()) < cuts->get(inputPtBin, "decayLenXYCasc")) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 22.0); + + } else { + // Impact parameter(DCA?) + if (std::abs(candidate.impactParCascXY()) < impactParXYCascMin || std::abs(candidate.impactParCascXY()) > impactParXYCascMax) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 12.0); + if (std::abs(candidate.impactParCascZ()) < impactParZCascMin || std::abs(candidate.impactParCascZ()) > impactParZCascMax) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 13.0); + } + + // If passes all cuts, return true + return true; + } + + // HF cuts - Cuts on Charm baryon reco + // Apply cuts with charm baryon & charm bachelor related informations + // returns true if all cuts are passed + template + bool SelectOnHF(const T& candidate, const int& inputPtBin) + { + + registry.fill(HIST("hSelStatusHf"), 0.0); + + // eta selection on charm bayron bachelor + if (std::abs(candidate.etaBachFromCharmBaryon()) > etaTrackCharmBachMax) { + return false; + } + registry.fill(HIST("hSelStatusHf"), 1.0); + // Distance of Closest Approach(DCA) + if (candidate.dcaCharmBaryonDau() > cuts->get(inputPtBin, "dcaCharmBaryonDau")) { + return false; + } + registry.fill(HIST("hSelStatusHf"), 2.0); + + // pT: Charm Bachelor + double ptPiFromCharmBaryon = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()); + if (ptPiFromCharmBaryon < cuts->get(inputPtBin, "ptPiFromCharmBaryon")) { + return false; + } + registry.fill(HIST("hSelStatusHf"), 3.0); + + // specific selections with KFParticle output + if constexpr (svReco == doKfParticle) { + // Cosine of pointing angle + if (candidate.cosPaCascToOmegac() < cuts->get(inputPtBin, "cosPaCascToOmegac")) { + return false; + } + registry.fill(HIST("hSelStatusHf"), 4.0); + + // DCA + if (std::abs(candidate.kfDcaXYPiFromOmegac()) > cuts->get(inputPtBin, "kfDcaXYPiFromOmegac")) { + return false; + } + registry.fill(HIST("hSelStatusHf"), 5.0); + + // Chi2 + if (candidate.chi2GeoOmegac() < 0 || candidate.chi2GeoOmegac() > cuts->get(inputPtBin, "chi2GeoOmegac")) { + return false; + } + registry.fill(HIST("hSelStatusHf"), 6.0); + if (candidate.chi2TopoOmegacToPv() < 0 || candidate.chi2TopoOmegacToPv() > cuts->get(inputPtBin, "chi2TopoOmegacToPv")) { + return false; + } + registry.fill(HIST("hSelStatusHf"), 7.0); + if (candidate.chi2TopoPiFromOmegacToPv() < 0 || candidate.chi2TopoPiFromOmegacToPv() > cuts->get(inputPtBin, "chi2TopoPiFromOmegacToPv")) { + return false; + } + registry.fill(HIST("hSelStatusHf"), 8.0); + if (candidate.chi2TopoCascToOmegac() < 0 || candidate.chi2TopoCascToOmegac() > cuts->get(inputPtBin, "chi2TopoCascToOmegac")) { + return false; + } + registry.fill(HIST("hSelStatusHf"), 9.0); + + // Decay Length + if (std::abs(candidate.decayLenXYOmegac()) > cuts->get(inputPtBin, "decayLenXYOmegac")) { + return false; + } + registry.fill(HIST("hSelStatusHf"), 10.0); + + // ctau + if (std::abs(candidate.cTauOmegac()) > cuts->get(inputPtBin, "cTauOmegac")) { + return false; + } + registry.fill(HIST("hSelStatusHf"), 11.0); + } else { + // Impact parameter(DCA?) + if ((std::abs(candidate.impactParBachFromCharmBaryonXY()) < impactParXYPiFromCharmBaryonMin) || (std::abs(candidate.impactParBachFromCharmBaryonXY()) > impactParXYPiFromCharmBaryonMax)) { + return false; + } + registry.fill(HIST("hSelStatusHf"), 4.0); + if ((std::abs(candidate.impactParBachFromCharmBaryonZ()) < impactParZPiFromCharmBaryonMin) || (std::abs(candidate.impactParBachFromCharmBaryonZ()) > impactParZPiFromCharmBaryonMax)) { + return false; + } + registry.fill(HIST("hSelStatusHf"), 5.0); + } + + // If passes all cuts, return true + return true; + } + + // template + template + void runOmegac0Selector(TCandTable const& candidates, + TracksSel const& tracks, + TracksSelLf const& lfTracks) + { + // looping over charm baryon candidates + for (const auto& candidate : candidates) { + + bool resultSelections = true; // True if the candidate passes all the selections, False otherwise + outputMlOmegac.clear(); + + auto trackV0PosDau = lfTracks.rawIteratorAt(candidate.posTrackId()); + auto trackV0NegDau = lfTracks.rawIteratorAt(candidate.negTrackId()); + auto trackKaFromCasc = lfTracks.rawIteratorAt(candidate.bachelorId()); + auto trackPiFromCharm = tracks.rawIteratorAt(candidate.bachelorFromCharmBaryonId()); + + auto trackPiFromLam = trackV0NegDau; + auto trackPrFromLam = trackV0PosDau; + + int8_t const signDecay = candidate.signDecay(); // sign of pi <- cascade + + if (signDecay > 0) { + trackPiFromLam = trackV0PosDau; + trackPrFromLam = trackV0NegDau; + registry.fill(HIST("hSelSignDec"), 1); // anti-particle decay + } else { + registry.fill(HIST("hSelSignDec"), 0); // particle decay + } + + // pT selection + auto ptCandOmegac = RecoDecay::pt(candidate.pxCharmBaryon(), candidate.pyCharmBaryon()); + int pTBin = findBin(binsPt, ptCandOmegac); + if (pTBin == -1) { + resultSelections = false; + } + + // // check that the candidate pT is within the analysis range + // if (ptCandOmegac <= ptCandMin || ptCandOmegac >= ptCandMax) { + // resultSelections = false; + // continue; + // } + + // // check that the candidate pT is within the analysis range + // auto pionPtFromOmegac = candidate.ptPiFromCharmBaryon(); + // if (pionPtFromOmegac < cuts->get(pTBin, "pT pi from Omegac")) { + // resultSelections = false; + // registry.fill(HIST("hSelPtPiFromCharm"), 0); + // } else { + // registry.fill(HIST("hSelPtPiFromCharm"), 1); + // } + + // Topological selection + const bool selectionResOnLF = SelectOnLF(candidate, pTBin); + const bool selectionResOnHF = SelectOnHF(candidate, pTBin); + if (!selectionResOnLF || !selectionResOnHF) { + resultSelections = false; + } + + // if (std::abs(etaV0PosDau) > etaTrackLFDauMax) { + // resultSelections = false; + // registry.fill(HIST("hSelEtaPosV0Dau"), 0); + // } else { + // registry.fill(HIST("hSelEtaPosV0Dau"), 1); + // } + // if (std::abs(etaV0NegDau) > etaTrackLFDauMax) { + // resultSelections = false; + // registry.fill(HIST("hSelEtaNegV0Dau"), 0); + // } else { + // registry.fill(HIST("hSelEtaNegV0Dau"), 1); + // } + // if (std::abs(etaKaFromCasc) > etaTrackLFDauMax) { + // resultSelections = false; + // registry.fill(HIST("hSelEtaKaFromCasc"), 0); + // } else { + // registry.fill(HIST("hSelEtaKaFromCasc"), 1); + // } + // if (std::abs(etaPiFromCharmBaryon) > etaTrackCharmBachMax) { + // resultSelections = false; + // registry.fill(HIST("hSelEtaPiFromCharm"), 0); + // } else { + // registry.fill(HIST("hSelEtaPiFromCharm"), 1); + // } + + // // minimum radius cut (LFcut) + // if (RecoDecay::sqrtSumOfSquares(candidate.xDecayVtxCascade(), candidate.yDecayVtxCascade()) < radiusCascMin) { + // resultSelections = false; + // registry.fill(HIST("hSelRadCasc"), 0); + // } else { + // registry.fill(HIST("hSelRadCasc"), 1); + // } + // if (RecoDecay::sqrtSumOfSquares(candidate.xDecayVtxV0(), candidate.yDecayVtxV0()) < radiusV0Min) { + // resultSelections = false; + // registry.fill(HIST("hSelRadV0"), 0); + // } else { + // registry.fill(HIST("hSelRadV0"), 1); + // } + + // // cosPA (LFcut) + // if (candidate.cosPACasc() < cosPACascMin) { + // resultSelections = false; + // registry.fill(HIST("hSelCosPACasc"), 0); + // } else { + // registry.fill(HIST("hSelCosPACasc"), 1); + // } + // if (candidate.cosPAV0() < cosPAV0Min) { + // resultSelections = false; + // registry.fill(HIST("hSelCosPAV0"), 0); + // } else { + // registry.fill(HIST("hSelCosPAV0"), 1); + // } + + // // cascade and v0 daughters dca cut (LF cut) + // if (candidate.dcaCascDau() > dcaCascDauMax) { + // resultSelections = false; + // registry.fill(HIST("hSelDCACascDau"), 0); + // } else { + // registry.fill(HIST("hSelDCACascDau"), 1); + // } + + // if (candidate.dcaV0Dau() > dcaV0DauMax) { + // resultSelections = false; + // registry.fill(HIST("hSelDCAV0Dau"), 0); + // } else { + // registry.fill(HIST("hSelDCAV0Dau"), 1); + // } + + // // dca charm baryon daughters cut + // if (candidate.dcaCharmBaryonDau() > dcaCharmBaryonDauMax) { + // resultSelections = false; + // registry.fill(HIST("hSelDCACharmDau"), 0); + // } else { + // registry.fill(HIST("hSelDCACharmDau"), 1); + // } + + // // dcaXY v0 daughters to PV cut + // if (std::abs(candidate.dcaXYToPvV0Dau0()) < dcaPosToPvMin || std::abs(candidate.dcaXYToPvV0Dau1()) < dcaNegToPvMin) { + // resultSelections = false; + // registry.fill(HIST("hSelDcaXYToPvV0Daughters"), 0); + // } else { + // registry.fill(HIST("hSelDcaXYToPvV0Daughters"), 1); + // } + + // // dcaXY ka <-- cascade to PV cut + // if (std::abs(candidate.dcaXYToPvCascDau()) < dcaBachToPvMin) { + // resultSelections = false; + // registry.fill(HIST("hSelDcaXYToPvKaFromCasc"), 0); + // } else { + // registry.fill(HIST("hSelDcaXYToPvKaFromCasc"), 1); + // } + + // // cut on charm bachelor pion dcaXY and dcaZ + // if ((std::abs(candidate.impactParBachFromCharmBaryonXY()) < impactParameterXYPiFromCharmBaryonMin) || (std::abs(candidate.impactParBachFromCharmBaryonXY()) > impactParameterXYPiFromCharmBaryonMax)) { + // resultSelections = false; + // registry.fill(HIST("hSelDCAXYPrimPi"), 0); + // } else { + // registry.fill(HIST("hSelDCAXYPrimPi"), 1); + // } + // if ((std::abs(candidate.impactParBachFromCharmBaryonZ()) < impactParameterZPiFromCharmBaryonMin) || (std::abs(candidate.impactParBachFromCharmBaryonZ()) > impactParameterZPiFromCharmBaryonMax)) { + // resultSelections = false; + // registry.fill(HIST("hSelDCAZPrimPi"), 0); + // } else { + // registry.fill(HIST("hSelDCAZPrimPi"), 1); + // } + + // // cut on cascade dcaXY and dcaZ + // if ((std::abs(candidate.impactParCascXY()) < impactParameterXYCascMin) || (std::abs(candidate.impactParCascXY()) > impactParameterXYCascMax)) { + // resultSelections = false; + // registry.fill(HIST("hSelDCAXYCasc"), 0); + // } else { + // registry.fill(HIST("hSelDCAXYCasc"), 1); + // } + // if ((std::abs(candidate.impactParCascZ()) < impactParameterZCascMin) || (std::abs(candidate.impactParCascZ()) > impactParameterZCascMax)) { + // resultSelections = false; + // registry.fill(HIST("hSelDCAZCasc"), 0); + // } else { + // registry.fill(HIST("hSelDCAZCasc"), 1); + // } + + // // pT selections + // double const ptKaFromCasc = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCasc(), candidate.pyBachFromCasc()); + // double const ptPiFromCharmBaryon = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()); + // if (std::abs(ptKaFromCasc) < ptKaFromCascMin) { + // resultSelections = false; + // registry.fill(HIST("hSelPtKaFromCasc"), 0); + // } else { + // registry.fill(HIST("hSelPtKaFromCasc"), 1); + // } + // if (std::abs(ptPiFromCharmBaryon) < ptPiFromCharmBaryonMin) { + // resultSelections = false; + // registry.fill(HIST("hSelPtPiFromCharm"), 0); + // } else { + // registry.fill(HIST("hSelPtPiFromCharm"), 1); + // } + + // if constexpr (dokf) { + // // KFParticle Preselections(kfsel) + // if (kfConfigurableGroup.applyKFpreselections) { + + // bool inputKF = false; + // if (resultSelections) { + // inputKF = true; + // registry.fill(HIST("hSelKFstatus"), 0); + // } + + // // Competing Ξ rejection(KF) Try to reject cases in which the candidate has a an inv. mass compatibler to Xi (bachelor pion) instead of Omega (bachelor kaon) + // if (kfConfigurableGroup.applyCompetingCascRejection) { + // if (std::abs(candidate.cascRejectInvmass() - o2::constants::physics::MassXiMinus) < kfConfigurableGroup.cascadeRejMassWindow) { + // resultSelections = false; + // registry.fill(HIST("hSelCompetingCasc"), 0); + // } else { + // registry.fill(HIST("hSelCompetingCasc"), 1); + // registry.fill(HIST("hInvMassXiMinus_rej_cut"), candidate.cascRejectInvmass()); + // } + // } + + // // Omegac Pt selection + // if (std::abs(candidate.kfptOmegac()) < ptCandMin || std::abs(candidate.kfptOmegac()) > ptCandMax) { + // resultSelections = false; + // registry.fill(HIST("hSelPtOmegac"), 0); + // } else { + // registry.fill(HIST("hSelPtOmegac"), 1); + // } + + // // v0&Casc&Omegac ldl selection + // if ((candidate.v0ldl() < kfConfigurableGroup.v0LdlMin) || (candidate.cascldl() < kfConfigurableGroup.cascLdlMin) || (candidate.omegacldl() > kfConfigurableGroup.omegacLdlMax)) { + // resultSelections = false; + // registry.fill(HIST("hSelV0_Casc_Omegacldl"), 0); + // } else { + // registry.fill(HIST("hSelV0_Casc_Omegacldl"), 1); + // } + + // // Omegac ctau selsection + // if (candidate.cTauOmegac() > kfConfigurableGroup.cTauOmegacMax) { + // resultSelections = false; + // registry.fill(HIST("hSelctauOmegac"), 0); + // } else { + // registry.fill(HIST("hSelctauOmegac"), 1); + // } + + // // Chi2Geo/NDF V0&Casc&Omegac selection + // if ((candidate.v0Chi2OverNdf() > kfConfigurableGroup.v0Chi2OverNdfMax) || (candidate.v0Chi2OverNdf() < 0) || (candidate.cascChi2OverNdf() > kfConfigurableGroup.cascChi2OverNdfMax) || (candidate.cascChi2OverNdf() < 0) || (candidate.omegacChi2OverNdf() > kfConfigurableGroup.omegacChi2OverNdfMax) || (candidate.omegacChi2OverNdf() < 0)) { + // resultSelections = false; + // registry.fill(HIST("hSelChi2GeooverNDFV0_Casc_Omegac"), 0); + // } else { + // registry.fill(HIST("hSelChi2GeooverNDFV0_Casc_Omegac"), 1); + // } + + // // Chi2Topo/NDF (chi2TopoV0ToCasc chi2TopoOmegacToPv chi2TopoCascToOmegac chi2TopoCascToPv) selection (???????????/NDF of which particle????????) + // if ((candidate.chi2TopoV0ToCasc() > kfConfigurableGroup.chi2TopoV0ToCascMax) || (candidate.chi2TopoV0ToCasc() < 0) || (candidate.chi2TopoOmegacToPv() > kfConfigurableGroup.chi2TopoOmegacToPvMax) || (candidate.chi2TopoOmegacToPv() < 0) || (candidate.chi2TopoCascToOmegac() > kfConfigurableGroup.chi2TopoCascToOmegacMax) || (candidate.chi2TopoCascToOmegac() < 0) || (candidate.chi2TopoCascToPv() > kfConfigurableGroup.chi2TopoCascToPvMax) || (candidate.chi2TopoCascToPv() < 0)) { + // resultSelections = false; + // registry.fill(HIST("hSelChi2TopooverNDFV0_Casc_Omegac"), 0); + // } else { + // registry.fill(HIST("hSelChi2TopooverNDFV0_Casc_Omegac"), 1); + // } + + // // DecaylengthXY of Omegac&Casc&V0 selection + // if ((std::abs(candidate.decayLenXYOmegac()) > kfConfigurableGroup.decayLenXYOmegacMax) || (std::abs(candidate.decayLenXYCasc()) < kfConfigurableGroup.decayLenXYCascMin) || (std::abs(candidate.decayLenXYLambda()) < kfConfigurableGroup.decayLenXYLambdaMin)) { + // resultSelections = false; + // registry.fill(HIST("hSeldecayLenXYOmegac_Casc_V0"), 0); + // } else { + // registry.fill(HIST("hSeldecayLenXYOmegac_Casc_V0"), 1); + // } + + // // KFPA cut cosPaCascToOmegac cosPaV0ToCasc + // if ((candidate.cosPaCascToOmegac() < kfConfigurableGroup.cosPaCascToOmegacMin) || (candidate.cosPaV0ToCasc() < kfConfigurableGroup.cosPaV0ToCascMin)) { + // resultSelections = false; + // registry.fill(HIST("hSelcosPaCascToOmegac_V0ToCasc"), 0); + // } else { + // registry.fill(HIST("hSelcosPaCascToOmegac_V0ToCasc"), 1); + // } + + // if (resultSelections && inputKF) { + // registry.fill(HIST("hSelKFstatus"), 1); + // } + // } + // } + + // TPC clusters selections + if (resultSelections) { + registry.fill(HIST("hSelStatusCluster"), 0.0); + } + if (applyTrkSelLf) { + if (!isSelectedTrackTpcQuality(trackPiFromLam, nClustersTpcMin, nTpcCrossedRowsMin, tpcCrossedRowsOverFindableClustersRatioMin, tpcChi2PerClusterMax)) { + resultSelections = false; + } else { + if (resultSelections) { + registry.fill(HIST("hSelStatusCluster"), 1.0); + } + } + + if (!isSelectedTrackTpcQuality(trackPrFromLam, nClustersTpcMin, nTpcCrossedRowsMin, tpcCrossedRowsOverFindableClustersRatioMin, tpcChi2PerClusterMax)) { + resultSelections = false; + } else { + if (resultSelections) { + registry.fill(HIST("hSelStatusCluster"), 2.0); + } + } + + if (!isSelectedTrackTpcQuality(trackKaFromCasc, nClustersTpcMin, nTpcCrossedRowsMin, tpcCrossedRowsOverFindableClustersRatioMin, tpcChi2PerClusterMax)) { + resultSelections = false; + } else { + if (resultSelections) { + registry.fill(HIST("hSelStatusCluster"), 3.0); + } + } + } + + if (!isSelectedTrackTpcQuality(trackPiFromCharm, nClustersTpcMin, nTpcCrossedRowsMin, tpcCrossedRowsOverFindableClustersRatioMin, tpcChi2PerClusterMax)) { + resultSelections = false; + } else { + if (resultSelections) { + registry.fill(HIST("hSelStatusCluster"), 4.0); + } + } + + // ITS clusters selection + if (!isSelectedTrackItsQuality(trackPiFromCharm, nClustersItsMin, itsChi2PerClusterMax) || trackPiFromCharm.itsNClsInnerBarrel() < nClustersItsInnBarrMin) { + resultSelections = false; + } else { + if (resultSelections) { + registry.fill(HIST("hSelStatusCluster"), 5.0); + } + } + + // Track level PID selection + if (resultSelections) { + registry.fill(HIST("hSelStatusPID"), 0.0); + } + int statusPidPrFromLam = -999; + int statusPidPiFromLam = -999; + int statusPidKaFromCasc = -999; + int statusPidPiFromCharmBaryon = -999; + + // bool statusPidLambda = false; + // bool statusPidCascade = false; + // bool statusPidCharmBaryon = false; + + int infoTpcStored = 0; + int infoTofStored = 0; + + if (usePidTpcOnly == usePidTpcTofCombined) { + LOGF(fatal, "Check the PID configurables, usePidTpcOnly and usePidTpcTofCombined can't have the same value"); + } + + if (trackPiFromLam.hasTPC()) { + SETBIT(infoTpcStored, PiFromLam); + } + if (trackPrFromLam.hasTPC()) { + SETBIT(infoTpcStored, PrFromLam); + } + if (trackKaFromCasc.hasTPC()) { + SETBIT(infoTpcStored, KaFromCasc); + } + if (trackPiFromCharm.hasTPC()) { + SETBIT(infoTpcStored, PiFromCharm); + } + if (trackPiFromLam.hasTOF()) { + SETBIT(infoTofStored, PiFromLam); + } + if (trackPrFromLam.hasTOF()) { + SETBIT(infoTofStored, PrFromLam); + } + if (trackKaFromCasc.hasTOF()) { + SETBIT(infoTofStored, KaFromCasc); + } + if (trackPiFromCharm.hasTOF()) { + SETBIT(infoTofStored, PiFromCharm); + } + + if (usePidTpcOnly) { + statusPidPrFromLam = selectorProton.statusTpc(trackPrFromLam); + statusPidPiFromLam = selectorPion.statusTpc(trackPiFromLam); + statusPidKaFromCasc = selectorKaon.statusTpc(trackKaFromCasc); + statusPidPiFromCharmBaryon = selectorPion.statusTpc(trackPiFromCharm); + } else if (usePidTpcTofCombined) { + statusPidPrFromLam = selectorProton.statusTpcOrTof(trackPrFromLam); + statusPidPiFromLam = selectorPion.statusTpcOrTof(trackPiFromLam); + statusPidKaFromCasc = selectorKaon.statusTpcOrTof(trackKaFromCasc); + statusPidPiFromCharmBaryon = selectorPion.statusTpcOrTof(trackPiFromCharm); + } + + // if (statusPidPrFromLam == TrackSelectorPID::Accepted && statusPidPiFromLam == TrackSelectorPID::Accepted) { + // statusPidLambda = true; + // if (resultSelections) { + // registry.fill(HIST("hStatusCheck"), 0.5); + // } + // } + + // if (statusPidPrFromLam == TrackSelectorPID::Accepted && statusPidPiFromLam == TrackSelectorPID::Accepted && statusPidKaFromCasc == TrackSelectorPID::Accepted) { + // statusPidCascade = true; + // if (resultSelections) { + // registry.fill(HIST("hStatusCheck"), 1.5); + // } + // } + + // if (statusPidPrFromLam == TrackSelectorPID::Accepted && statusPidPiFromLam == TrackSelectorPID::Accepted && statusPidKaFromCasc == TrackSelectorPID::Accepted && statusPidPiFromCharmBaryon == TrackSelectorPID::Accepted) { + // statusPidCharmBaryon = true; + // if (resultSelections) { + // registry.fill(HIST("hStatusCheck"), 2.5); + // } + // } + + bool statusPidLambda = (statusPidPrFromLam == TrackSelectorPID::Accepted) && (statusPidPiFromLam == TrackSelectorPID::Accepted); + if (statusPidLambda && resultSelections) { + registry.fill(HIST("hSelStatusPID"), 1.0); + } + bool statusPidCascade = (statusPidLambda && statusPidKaFromCasc == TrackSelectorPID::Accepted); + if (statusPidCascade && resultSelections) { + registry.fill(HIST("hSelStatusPID"), 2.0); + } + bool statusPidCharmBaryon = (statusPidCascade && statusPidPiFromCharmBaryon == TrackSelectorPID::Accepted); + if (statusPidCharmBaryon && resultSelections) { + registry.fill(HIST("hSelStatusPID"), 3.0); + } + + // invariant mass cuts + bool statusInvMassLambda = false; + bool statusInvMassCascade = false; + bool statusInvMassCharmBaryon = false; + + double const invMassLambda = candidate.invMassLambda(); + double const invMassCascade = candidate.invMassCascade(); + double const invMassCharmBaryon = candidate.invMassCharmBaryon(); + + // if (std::abs(invMassLambda - massLambdaFromPDG) < v0MassWindow) { + // statusInvMassLambda = true; + // registry.fill(HIST("hSelMassLam"), 1); + // if (statusPidLambda && statusPidCascade && statusPidCharmBaryon && resultSelections) { + // registry.fill(HIST("hStatusCheck"), 3.5); + // } + // } else { + // registry.fill(HIST("hSelMassLam"), 0); + // } + + // if (std::abs(invMassCascade - massOmegaFromPDG) < cascadeMassWindow) { + // statusInvMassCascade = true; + // registry.fill(HIST("hSelMassCasc"), 1); + // if (statusPidLambda && statusPidCascade && statusPidCharmBaryon && statusInvMassLambda && resultSelections) { + // registry.fill(HIST("hStatusCheck"), 4.5); + // } + // } else { + // registry.fill(HIST("hSelMassCasc"), 0); + // } + + // if ((invMassCharmBaryon >= invMassCharmBaryonMin) && (invMassCharmBaryon <= invMassCharmBaryonMax)) { + // statusInvMassCharmBaryon = true; + // registry.fill(HIST("hSelMassCharmBaryon"), 1); + // if (statusPidLambda && statusPidCascade && statusPidCharmBaryon && statusInvMassLambda && statusInvMassCascade && resultSelections) { + // registry.fill(HIST("hStatusCheck"), 5.5); + // } + // } else { + // registry.fill(HIST("hSelMassCharmBaryon"), 0); + // } + + if (std::abs(invMassLambda - o2::constants::physics::MassLambda0) < v0MassWindow) { + statusInvMassLambda = true; + } + if (std::abs(invMassCascade - o2::constants::physics::MassOmegaMinus) < cascMassWindow) { + statusInvMassCascade = true; + } + if ((invMassCharmBaryon >= invMassCharmBaryonMin) && (invMassCharmBaryon <= invMassCharmBaryonMax)) { + statusInvMassCharmBaryon = true; + } + + // ML BDT selection + // if (applyMl) { + // bool isSelectedMlOmegac = false; + // std::vector inputFeaturesOmegaC = hfMlResponse.getInputFeatures(candidate, trackPiFromLam, trackKaFromCasc, trackPiFromCharm); + // isSelectedMlOmegac = hfMlResponse.isSelectedMl(inputFeaturesOmegaC, ptCandOmegac, outputMlOmegac); + // if (!isSelectedMlOmegac) { + // continue; + // } + // hfMlSelToOmegaPi(outputMlOmegac); + // } + if (applyMl) { + bool isSelectedMlOmegac = false; + std::vector inputFeaturesOmegaC = {}; + if constexpr (svReco == doDcaFitter) { + inputFeaturesOmegaC = hfMlResponse.getInputFeatures(candidate, trackPiFromLam, trackKaFromCasc, trackPiFromCharm); + isSelectedMlOmegac = hfMlResponse.isSelectedMl(inputFeaturesOmegaC, ptCandOmegac, outputMlOmegac); + + if (!isSelectedMlOmegac) { + continue; + } + hfMlSelToOmegaPi(outputMlOmegac); + } else { + // KFParticle path: skip ML application + } + } + + // hfSelToOmegaPi(statusPidLambda, statusPidCascade, statusPidCharmBaryon, statusInvMassLambda, statusInvMassCascade, statusInvMassCharmBaryon, resultSelections, infoTpcStored, infoTofStored, + // trackPiFromCharm.tpcNSigmaPi(), trackKaFromCasc.tpcNSigmaKa(), trackPiFromLam.tpcNSigmaPi(), trackPrFromLam.tpcNSigmaPr(), + // trackPiFromCharm.tofNSigmaPi(), trackKaFromCasc.tofNSigmaKa(), trackPiFromLam.tofNSigmaPi(), trackPrFromLam.tofNSigmaPr()); + + // Fill in selection result + if (!statusPidLambda || !statusPidCascade || !statusPidCharmBaryon || + !statusInvMassLambda || !statusInvMassCascade || !statusInvMassCharmBaryon) { + resultSelections = false; + } + hfSelToOmegaPi(statusPidLambda, statusPidCascade, statusPidCharmBaryon, statusInvMassLambda, statusInvMassCascade, statusInvMassCharmBaryon, resultSelections, + infoTpcStored, infoTofStored, + trackPiFromCharm.tpcNSigmaPi(), trackKaFromCasc.tpcNSigmaKa(), trackPiFromLam.tpcNSigmaPi(), trackPrFromLam.tpcNSigmaPr(), + trackPiFromCharm.tofNSigmaPi(), trackKaFromCasc.tofNSigmaKa(), trackPiFromLam.tofNSigmaPi(), trackPrFromLam.tofNSigmaPr()); + + // if (resultSelections) { + // if (!statusPidLambda) { + // registry.fill(HIST("hSelPID"), 0.5); + // } + // if (statusPidLambda) { + // registry.fill(HIST("hSelPID"), 1.5); + // } + // if (!statusPidCascade) { + // registry.fill(HIST("hSelPID"), 2.5); + // } + // if (statusPidCascade) { + // registry.fill(HIST("hSelPID"), 3.5); + // } + // if (!statusPidCharmBaryon) { + // registry.fill(HIST("hSelPID"), 4.5); + // } + // if (statusPidCharmBaryon) { + // registry.fill(HIST("hSelPID"), 5.5); + // } + // if (!statusInvMassLambda) { + // registry.fill(HIST("hSelPID"), 6.5); + // } + // if (statusInvMassLambda) { + // registry.fill(HIST("hSelPID"), 7.5); + // } + // if (!statusInvMassCascade) { + // registry.fill(HIST("hSelPID"), 8.5); + // } + // if (statusInvMassCascade) { + // registry.fill(HIST("hSelPID"), 9.5); + // } + // if (!statusInvMassCharmBaryon) { + // registry.fill(HIST("hSelPID"), 10.5); + // } + // if (statusInvMassCharmBaryon) { + // registry.fill(HIST("hSelPID"), 11.5); + // } + // } + + // Fill in invariant mass histogram + if (resultSelections) { + registry.fill(HIST("hInvMassCharmBaryonWoPidInvMassCut"), invMassCharmBaryon); + } + if (statusPidLambda && statusPidCascade && statusPidCharmBaryon && statusInvMassLambda && statusInvMassCascade && statusInvMassCharmBaryon && resultSelections) { + registry.fill(HIST("hInvMassCharmBaryon"), invMassCharmBaryon); + } else { + registry.fill(HIST("hInvMassCharmBaryonBkg"), invMassCharmBaryon); + } + + // if constexpr (dokf) { + // registry.fill(HIST("hPtCharmBaryon"), candidate.kfptOmegac()); + // } else { + // registry.fill(HIST("hPtCharmBaryon"), ptCandOmegac); + // } + + } // end of candidate loop + } // end run function + + /////////////////////////////////// + /// Process with DCAFitter // + /////////////////////////////////// + void processOmegac0SelectorWithDCAFitter(aod::HfCandToOmegaPi const& candidates, TracksSel const& tracks, TracksSelLf const& lfTracks) + { + runOmegac0Selector(candidates, tracks, lfTracks); + } + PROCESS_SWITCH(HfCandidateSelectorToOmegaPiQa, processOmegac0SelectorWithDCAFitter, "Omegac0 candidate selection with DCAFitter output", true); + + //////////////////////////////////// + /// Process with KFParticle // + //////////////////////////////////// + void processOmegac0SelectorWithKFParticle(soa::Join const& candidates, TracksSel const& tracks, TracksSelLf const& lfTracks) + { + runOmegac0Selector(candidates, tracks, lfTracks); + } + PROCESS_SWITCH(HfCandidateSelectorToOmegaPiQa, processOmegac0SelectorWithKFParticle, "Omegac0 candidate selection with KFParticle output", false); + +}; // end struct + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} \ No newline at end of file From 8434aa9f7d145d105e143fb313ab0e826ca63a9c Mon Sep 17 00:00:00 2001 From: mariafernandatorrescabrera Date: Wed, 6 May 2026 18:48:55 -0500 Subject: [PATCH 02/12] Update QA candidate selector for Omegac0 --- .../candidateSelectorOmegac0ToOmegaPiQa.cxx | 72 +++++++++++++------ 1 file changed, 51 insertions(+), 21 deletions(-) diff --git a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx index 24b97d17db1..0401fa098ac 100755 --- a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx +++ b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx @@ -110,8 +110,15 @@ struct HfCandidateSelectorToOmegaPiQa { // Mass window Configurable v0MassWindow{"v0MassWindow", 0.01, "V0 mass window"}; Configurable cascadeMassWindow{"cascadeMassWindow", 0.01, "Cascade mass window"}; + + // Competing cascade rejection for KFParticle candidates + Configurable applyCompetingCascRejection{"applyCompetingCascRejection", false, "Apply competing Xi rejection for Omegac0 KFParticle candidates"}; + Configurable cascadeRejMassWindow{"cascadeRejMassWindow", 0.01, "Competing Xi rejection mass window"}; + Configurable invMassCharmBaryonMin{"invMassCharmBaryonMin", 2.3, "Lower limit invariant mass spectrum charm baryon"}; // 2.4 Omegac0 only Configurable invMassCharmBaryonMax{"invMassCharmBaryonMax", 3.1, "Upper limit invariant mass spectrum charm baryon"}; + + Configurable omegacLdlMax{"omegacLdlMax", 5., "Maximum value of l/dl of Omegac"}; // Configurable cosPAV0Min{"cosPAV0Min", 0.97, "Min valueCosPA V0"}; // Configurable cosPACascMin{"cosPACascMin", 0.97, "Min value CosPA cascade"}; @@ -155,7 +162,7 @@ struct HfCandidateSelectorToOmegaPiQa { Configurable ptKaPidTofMin{"ptKaPidTofMin", -1, "Lower bound of track pT for TOF PID for kaon selection"}; Configurable ptKaPidTofMax{"ptKaPidTofMax", 9999.9, "Upper bound of track pT for TOF PID for kaon selection"}; Configurable nSigmaTofKaMax{"nSigmaTofKaMax", 3., "Nsigma cut on TOF only for kaon selection"}; - Configurable nSigmaTofCombinedKaMax{"nSigmaTofCombinedKaMax", 0., "Nsigma cut on TOF combined with TOF for kaon selection"}; + Configurable nSigmaTofCombinedKaMax{"nSigmaTofCombinedKaMax", 0., "Nsigma cut on TOF combined with TPC for kaon selection"}; // detector clusters selections Configurable nClustersTpcMin{"nClustersTpcMin", 70, "Minimum number of TPC clusters requirement"}; @@ -211,7 +218,7 @@ struct HfCandidateSelectorToOmegaPiQa { // } kfConfigurableGroup; void init(InitContext const&) - // { + { // std::array processesSelector = {doprocessOmegac0SelectorWithDCAFitter, doprocessOmegac0SelectorWithKFParticle}; // const int nProcessesSelector = std::accumulate(processesSelector.begin(), processesSelector.end(), 0); // if (nProcessesSelector != 1) { @@ -243,7 +250,7 @@ struct HfCandidateSelectorToOmegaPiQa { const AxisSpec axisSelOnLfDca{14, -0.5, 13.5, "status"}; const AxisSpec axisSelOnLfKf{23, -0.5, 22.5, "status"}; const AxisSpec axisSelOnHfDca{6, -0.5, 5.5, "status"}; - const AxisSpec axisSelOnHfKf{12, -0.5, 11.5, "status"}; + const AxisSpec axisSelOnHfKf{13, -0.5, 12.5, "status"}; // registry.add("hSelPID", "hSelPID;status;entries", {HistType::kTH1D, {{12, 0., 12.}}}); // registry.add("hStatusCheck", "Check consecutive selections status;status;entries", {HistType::kTH1D, {{12, 0., 12.}}}); @@ -293,7 +300,7 @@ struct HfCandidateSelectorToOmegaPiQa { registry.get(HIST("hSelStatusPID"))->GetXaxis()->SetBinLabel(4, "CharmBaryon"); // For QA of LF & HF selection - if (doprocessSelectionDCAFitter) { + if (doprocessOmegac0SelectorWithDCAFitter) { registry.add("hSelStatusLf", "hSelStatusLf;# of candidate passed;", {HistType::kTH1F, {axisSelOnLfDca}}); registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(1, "All"); registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(2, "etaV0Dau"); @@ -319,7 +326,7 @@ struct HfCandidateSelectorToOmegaPiQa { registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(6, "impactParBachFromCharmZ"); } - if (doprocessSelectionKFParticle) { + if (doprocessOmegac0SelectorWithKFParticle) { registry.add("hSelStatusLf", "hSelStatusLf;# of candidate passed;", {HistType::kTH1F, {axisSelOnLfKf}}); registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(1, "All"); registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(2, "etaV0Dau"); @@ -333,7 +340,7 @@ struct HfCandidateSelectorToOmegaPiQa { registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(10, "dcaXYToPvV0Dau1"); registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(11, "dcaXYToPvCascDau"); registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(12, "ptKaFromCasc"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(13, "cosPAV0ToCasc"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(13, "cosPaV0ToCasc"); registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(14, "kfDcaXYCascToPv"); registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(15, "chi2GeoV0"); registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(16, "chi2GeoCasc"); @@ -358,12 +365,19 @@ struct HfCandidateSelectorToOmegaPiQa { registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(10, "chi2TopoCascToOmegac"); registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(11, "decayLenXYOmegac"); registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(12, "cTauOmegac"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(13, "omegacldl"); } // invariant mass histograms - registry.add("hInvMassCharmBaryonWoPidInvMassCut", "Charm baryon invariant mass; int mass; entries", {HistType::kTH1F, {{500, 2.3, 3.1}}}); - registry.add("hInvMassCharmBaryon", "Charm baryon invariant mass; int mass; entries", {HistType::kTH1F, {{500, 2.3, 3.1}}}); - registry.add("hInvMassCharmBaryonBkg", "Charm baryon invariant mass, rejected; int mass; entries", {HistType::kTH1F, {{500, 2.3, 3.1}}}); + registry.add("hInvMassCharmBaryonWoPidInvMassCut", "Charm baryon invariant mass; inv. mass; entries", {HistType::kTH1F, {{500, 2.3, 3.1}}}); + registry.add("hInvMassCharmBaryon", "Charm baryon invariant mass; inv. mass; entries", {HistType::kTH1F, {{500, 2.3, 3.1}}}); + registry.add("hInvMassCharmBaryonBkg", "Charm baryon invariant mass, rejected; inv. mass; entries", {HistType::kTH1F, {{500, 2.3, 3.1}}}); + + if (doprocessOmegac0SelectorWithKFParticle) { + registry.add("hSelCompetingCasc", "hSelCompetingCasc;status;entries", {HistType::kTH1F, {axisSel}}); + registry.add("hInvMassXiMinus_rej_cut", "hInvMassXiMinus_rej_cut;m_{#Lambda#pi} under Xi hypothesis (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{1000, 1.25f, 1.65f}}}); + } + // registry.add("hPtCharmBaryon", "Charm baryon transverse momentum; p_{T} (GeV/c); entries", {HistType::kTH1D, {{8000, 0., 80.}}}); // if (kfConfigurableGroup.applyKFpreselections) { @@ -392,7 +406,7 @@ struct HfCandidateSelectorToOmegaPiQa { // HfMlResponse initialization if (applyMl) { - if (doprocessSelectionDCAFitter) { + if (doprocessOmegac0SelectorWithDCAFitter) { hfMlResponse.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl); if (loadModelsFromCCDB) { ccdbApi.init(ccdbUrl); @@ -542,11 +556,11 @@ struct HfCandidateSelectorToOmegaPiQa { } else { // Impact parameter(DCA?) - if (std::abs(candidate.impactParCascXY()) < impactParXYCascMin || std::abs(candidate.impactParCascXY()) > impactParXYCascMax) { + if (std::abs(candidate.impactParCascXY()) < impactParameterXYCascMin || std::abs(candidate.impactParCascXY()) > impactParameterXYCascMax) { return false; } registry.fill(HIST("hSelStatusLf"), 12.0); - if (std::abs(candidate.impactParCascZ()) < impactParZCascMin || std::abs(candidate.impactParCascZ()) > impactParZCascMax) { + if (std::abs(candidate.impactParCascZ()) < impactParameterZCascMin || std::abs(candidate.impactParCascZ()) > impactParameterZCascMax) { return false; } registry.fill(HIST("hSelStatusLf"), 13.0); @@ -626,13 +640,19 @@ struct HfCandidateSelectorToOmegaPiQa { return false; } registry.fill(HIST("hSelStatusHf"), 11.0); + + // Omegac l/dl + if (candidate.omegacldl() > omegacLdlMax) { + return false; + } + registry.fill(HIST("hSelStatusHf"), 12.0); } else { // Impact parameter(DCA?) - if ((std::abs(candidate.impactParBachFromCharmBaryonXY()) < impactParXYPiFromCharmBaryonMin) || (std::abs(candidate.impactParBachFromCharmBaryonXY()) > impactParXYPiFromCharmBaryonMax)) { + if ((std::abs(candidate.impactParBachFromCharmBaryonXY()) < impactParameterXYPiFromCharmBaryonMin) || (std::abs(candidate.impactParBachFromCharmBaryonXY()) > impactParameterXYPiFromCharmBaryonMax)) { return false; } registry.fill(HIST("hSelStatusHf"), 4.0); - if ((std::abs(candidate.impactParBachFromCharmBaryonZ()) < impactParZPiFromCharmBaryonMin) || (std::abs(candidate.impactParBachFromCharmBaryonZ()) > impactParZPiFromCharmBaryonMax)) { + if ((std::abs(candidate.impactParBachFromCharmBaryonZ()) < impactParameterZPiFromCharmBaryonMin) || (std::abs(candidate.impactParBachFromCharmBaryonZ()) > impactParameterZPiFromCharmBaryonMax)) { return false; } registry.fill(HIST("hSelStatusHf"), 5.0); @@ -701,6 +721,21 @@ struct HfCandidateSelectorToOmegaPiQa { resultSelections = false; } + // Competing Xi rejection (KF) Try to reject cases in which the candidate has a an inv. mass compatible with Xi (bachelor pion) instead of Omega (bachelor kaon) + if constexpr (svReco == doKfParticle) { + if (resultSelections && applyCompetingCascRejection) { + const auto invMassXiHypothesis = candidate.cascRejectInvmass(); + + if (std::abs(invMassXiHypothesis - o2::constants::physics::MassXiMinus) < cascadeRejMassWindow) { + resultSelections = false; + registry.fill(HIST("hSelCompetingCasc"), 0.0); + } else { + registry.fill(HIST("hSelCompetingCasc"), 1.0); + registry.fill(HIST("hInvMassXiMinus_rej_cut"), invMassXiHypothesis); + } + } + } + // if (std::abs(etaV0PosDau) > etaTrackLFDauMax) { // resultSelections = false; // registry.fill(HIST("hSelEtaPosV0Dau"), 0); @@ -1100,7 +1135,7 @@ struct HfCandidateSelectorToOmegaPiQa { if (std::abs(invMassLambda - o2::constants::physics::MassLambda0) < v0MassWindow) { statusInvMassLambda = true; } - if (std::abs(invMassCascade - o2::constants::physics::MassOmegaMinus) < cascMassWindow) { + if (std::abs(invMassCascade - o2::constants::physics::MassOmegaMinus) < cascadeMassWindow) { statusInvMassCascade = true; } if ((invMassCharmBaryon >= invMassCharmBaryonMin) && (invMassCharmBaryon <= invMassCharmBaryonMax)) { @@ -1133,17 +1168,12 @@ struct HfCandidateSelectorToOmegaPiQa { } } - // hfSelToOmegaPi(statusPidLambda, statusPidCascade, statusPidCharmBaryon, statusInvMassLambda, statusInvMassCascade, statusInvMassCharmBaryon, resultSelections, infoTpcStored, infoTofStored, - // trackPiFromCharm.tpcNSigmaPi(), trackKaFromCasc.tpcNSigmaKa(), trackPiFromLam.tpcNSigmaPi(), trackPrFromLam.tpcNSigmaPr(), - // trackPiFromCharm.tofNSigmaPi(), trackKaFromCasc.tofNSigmaKa(), trackPiFromLam.tofNSigmaPi(), trackPrFromLam.tofNSigmaPr()); - // Fill in selection result if (!statusPidLambda || !statusPidCascade || !statusPidCharmBaryon || !statusInvMassLambda || !statusInvMassCascade || !statusInvMassCharmBaryon) { resultSelections = false; } - hfSelToOmegaPi(statusPidLambda, statusPidCascade, statusPidCharmBaryon, statusInvMassLambda, statusInvMassCascade, statusInvMassCharmBaryon, resultSelections, - infoTpcStored, infoTofStored, + hfSelToOmegaPi(statusPidLambda, statusPidCascade, statusPidCharmBaryon, statusInvMassLambda, statusInvMassCascade, statusInvMassCharmBaryon, resultSelections, infoTpcStored, infoTofStored, trackPiFromCharm.tpcNSigmaPi(), trackKaFromCasc.tpcNSigmaKa(), trackPiFromLam.tpcNSigmaPi(), trackPrFromLam.tpcNSigmaPr(), trackPiFromCharm.tofNSigmaPi(), trackKaFromCasc.tofNSigmaKa(), trackPiFromLam.tofNSigmaPi(), trackPrFromLam.tofNSigmaPr()); From 4ab3779ebb5caada026c8e3d33c420edc2d5db26 Mon Sep 17 00:00:00 2001 From: mariafernandatorrescabrera Date: Wed, 13 May 2026 15:23:27 -0600 Subject: [PATCH 03/12] Fix bugs in QA candidate selector for Omegac0 --- .../candidateSelectorOmegac0ToOmegaPiQa.cxx | 504 ++++++++---------- 1 file changed, 237 insertions(+), 267 deletions(-) diff --git a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx index 0401fa098ac..015bec07feb 100755 --- a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx +++ b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx @@ -43,8 +43,10 @@ #include +#include #include #include +#include #include #include @@ -92,11 +94,29 @@ struct HfCandidateSelectorToOmegaPiQa { Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; // LF analysis selections + Configurable radiusCascMin{"radiusCascMin", 0.5, "Min cascade radius"}; + Configurable radiusV0Min{"radiusV0Min", 1.1, "Min V0 radius"}; + Configurable cosPAV0Min{"cosPAV0Min", 0.97, "Min value CosPA V0"}; + Configurable cosPACascMin{"cosPACascMin", 0.97, "Min value CosPA cascade"}; + Configurable dcaV0DauMax{"dcaV0DauMax", 1.0, "Max DCA V0 daughters"}; + Configurable dcaCascDauMax{"dcaCascDauMax", 1.0, "Max DCA cascade daughters"}; + Configurable dcaNegToPvMin{"dcaNegToPvMin", 0.06, "DCA Neg To PV"}; + Configurable dcaPosToPvMin{"dcaPosToPvMin", 0.06, "DCA Pos To PV"}; + Configurable dcaBachToPvMin{"dcaBachToPvMin", 0.04, "DCA Bach To PV"}; + Configurable applyTrkSelLf{"applyTrkSelLf", true, "Apply track selection for LF daughters"}; + + // Mass window + Configurable v0MassWindow{"v0MassWindow", 0.01, "V0 mass window"}; + Configurable cascadeMassWindow{"cascadeMassWindow", 0.01, "Cascade mass window"}; + Configurable invMassCharmBaryonMin{"invMassCharmBaryonMin", 2.3, "Lower limit invariant mass spectrum charm baryon"}; // 2.4 Omegac0 only + Configurable invMassCharmBaryonMax{"invMassCharmBaryonMax", 3.1, "Upper limit invariant mass spectrum charm baryon"}; + + // kinematic selections Configurable etaTrackCharmBachMax{"etaTrackCharmBachMax", 0.8, "Max absolute value of eta for charm baryon bachelor"}; Configurable etaTrackLFDauMax{"etaTrackLFDauMax", 1.0, "Max absolute value of eta for V0 and cascade daughters"}; Configurable ptKaFromCascMin{"ptKaFromCascMin", 0.15, "Min pT kaon <- casc"}; - Configurable radiusCascMin{"radiusCascMin", 0.5, "Min cascade radius"}; - Configurable radiusV0Min{"radiusV0Min", 1.1, "Min V0 radius"}; + Configurable ptPiFromCharmBaryonMin{"ptPiFromCharmBaryonMin", 0.2, "Min pT pi <- charm baryon"}; + Configurable impactParameterXYPiFromCharmBaryonMin{"impactParameterXYPiFromCharmBaryonMin", 0., "Min dcaxy pi from charm baryon track to PV"}; Configurable impactParameterXYPiFromCharmBaryonMax{"impactParameterXYPiFromCharmBaryonMax", 10., "Max dcaxy pi from charm baryon track to PV"}; Configurable impactParameterXYCascMin{"impactParameterXYCascMin", 0., "Min dcaxy cascade track to PV"}; @@ -105,28 +125,11 @@ struct HfCandidateSelectorToOmegaPiQa { Configurable impactParameterZPiFromCharmBaryonMax{"impactParameterZPiFromCharmBaryonMax", 10., "Max dcaz pi from charm baryon track to PV"}; Configurable impactParameterZCascMin{"impactParameterZCascMin", 0., "Min dcaz cascade track to PV"}; Configurable impactParameterZCascMax{"impactParameterZCascMax", 10., "Max dcaz cascade track to PV"}; - Configurable applyTrkSelLf{"applyTrkSelLf", true, "Apply track selection for LF daughters"}; - - // Mass window - Configurable v0MassWindow{"v0MassWindow", 0.01, "V0 mass window"}; - Configurable cascadeMassWindow{"cascadeMassWindow", 0.01, "Cascade mass window"}; - - // Competing cascade rejection for KFParticle candidates - Configurable applyCompetingCascRejection{"applyCompetingCascRejection", false, "Apply competing Xi rejection for Omegac0 KFParticle candidates"}; - Configurable cascadeRejMassWindow{"cascadeRejMassWindow", 0.01, "Competing Xi rejection mass window"}; - Configurable invMassCharmBaryonMin{"invMassCharmBaryonMin", 2.3, "Lower limit invariant mass spectrum charm baryon"}; // 2.4 Omegac0 only - Configurable invMassCharmBaryonMax{"invMassCharmBaryonMax", 3.1, "Upper limit invariant mass spectrum charm baryon"}; - - Configurable omegacLdlMax{"omegacLdlMax", 5., "Maximum value of l/dl of Omegac"}; + Configurable ptCandMin{"ptCandMin", 0., "Lower bound of candidate pT"}; + Configurable ptCandMax{"ptCandMax", 50., "Upper bound of candidate pT"}; - // Configurable cosPAV0Min{"cosPAV0Min", 0.97, "Min valueCosPA V0"}; - // Configurable cosPACascMin{"cosPACascMin", 0.97, "Min value CosPA cascade"}; - // Configurable dcaCascDauMax{"dcaCascDauMax", 1.0, "Max DCA cascade daughters"}; - // Configurable dcaV0DauMax{"dcaV0DauMax", 1.0, "Max DCA V0 daughters"}; - // Configurable dcaBachToPvMin{"dcaBachToPvMin", 0.04, "DCA Bach To PV"}; - // Configurable dcaNegToPvMin{"dcaNegToPvMin", 0.06, "DCA Neg To PV"}; - // Configurable dcaPosToPvMin{"dcaPosToPvMin", 0.06, "DCA Pos To PV"}; + Configurable dcaCharmBaryonDauMax{"dcaCharmBaryonDauMax", 2.0, "Max DCA charm baryon daughters"}; // PID options Configurable usePidTpcOnly{"usePidTpcOnly", false, "Perform PID using only TPC"}; @@ -186,44 +189,37 @@ struct HfCandidateSelectorToOmegaPiQa { HistogramRegistry registry{"registry"}; // for QA of selections - // // kinematic selections - // Configurable ptPiFromCharmBaryonMin{"ptPiFromCharmBaryonMin", 0.2, "Min pT pi <- charm baryon"}; - // Configurable ptCandMin{"ptCandMin", 0., "Lower bound of candidate pT"}; - // Configurable ptCandMax{"ptCandMax", 50., "Upper bound of candidate pT"}; - - // Configurable dcaCharmBaryonDauMax{"dcaCharmBaryonDauMax", 2.0, "Max DCA charm baryon daughters"}; - - // struct : ConfigurableGroup { - // //// KF selection - // std::string prefix = "kfSel"; - // Configurable applyKFpreselections{"applyKFpreselections", false, "Apply KFParticle related rejection"}; - // Configurable applyCompetingCascRejection{"applyCompetingCascRejection", false, "Apply competing Xi(for Omegac0) rejection"}; - // Configurable cascadeRejMassWindow{"cascadeRejMassWindow", 0.01, "competing Xi(for Omegac0) rejection mass window"}; - // Configurable v0LdlMin{"v0LdlMin", 3., "Minimum value of l/dl of V0"}; // l/dl and Chi2 are to be determined - // Configurable cascLdlMin{"cascLdlMin", 1., "Minimum value of l/dl of casc"}; - // Configurable omegacLdlMax{"omegacLdlMax", 5., "Maximum value of l/dl of Omegac"}; - // Configurable cTauOmegacMax{"cTauOmegacMax", 0.4, "lifetime τ of Omegac"}; - // Configurable v0Chi2OverNdfMax{"v0Chi2OverNdfMax", 100., "Maximum chi2Geo/NDF of V0"}; - // Configurable cascChi2OverNdfMax{"cascChi2OverNdfMax", 100., "Maximum chi2Geo/NDF of casc"}; - // Configurable omegacChi2OverNdfMax{"omegacChi2OverNdfMax", 100., "Maximum chi2Geo/NDF of Omegac"}; - // Configurable chi2TopoV0ToCascMax{"chi2TopoV0ToCascMax", 100., "Maximum chi2Topo/NDF of V0ToCas"}; - // Configurable chi2TopoOmegacToPvMax{"chi2TopoOmegacToPvMax", 100., "Maximum chi2Topo/NDF of OmegacToPv"}; - // Configurable chi2TopoCascToOmegacMax{"chi2TopoCascToOmegacMax", 100., "Maximum chi2Topo/NDF of CascToOmegac"}; - // Configurable chi2TopoCascToPvMax{"chi2TopoCascToPvMax", 100., "Maximum chi2Topo/NDF of CascToPv"}; - // Configurable decayLenXYOmegacMax{"decayLenXYOmegacMax", 1.5, "Maximum decay lengthXY of Omegac"}; - // Configurable decayLenXYCascMin{"decayLenXYCascMin", 1., "Minimum decay lengthXY of Cascade"}; - // Configurable decayLenXYLambdaMin{"decayLenXYLambdaMin", 0., "Minimum decay lengthXY of V0"}; - // Configurable cosPaCascToOmegacMin{"cosPaCascToOmegacMin", 0.995, "Minimum cosPA of cascade<-Omegac"}; - // Configurable cosPaV0ToCascMin{"cosPaV0ToCascMin", 0.99, "Minimum cosPA of V0<-cascade"}; - // } kfConfigurableGroup; + struct : ConfigurableGroup { + //// KF selection + std::string prefix = "kfSel"; + Configurable applyKFpreselections{"applyKFpreselections", false, "Apply KFParticle related rejection"}; + Configurable applyCompetingCascRejection{"applyCompetingCascRejection", false, "Apply competing Xi(for Omegac0) rejection"}; + Configurable cascadeRejMassWindow{"cascadeRejMassWindow", 0.01, "competing Xi(for Omegac0) rejection mass window"}; + Configurable v0LdlMin{"v0LdlMin", 3., "Minimum value of l/dl of V0"}; // l/dl and Chi2 are to be determined + Configurable cascLdlMin{"cascLdlMin", 1., "Minimum value of l/dl of casc"}; + Configurable omegacLdlMax{"omegacLdlMax", 5., "Maximum value of l/dl of Omegac"}; + Configurable cTauOmegacMax{"cTauOmegacMax", 0.4, "lifetime τ of Omegac"}; + Configurable v0Chi2OverNdfMax{"v0Chi2OverNdfMax", 100., "Maximum chi2Geo/NDF of V0"}; + Configurable cascChi2OverNdfMax{"cascChi2OverNdfMax", 100., "Maximum chi2Geo/NDF of casc"}; + Configurable omegacChi2OverNdfMax{"omegacChi2OverNdfMax", 100., "Maximum chi2Geo/NDF of Omegac"}; + Configurable chi2TopoV0ToCascMax{"chi2TopoV0ToCascMax", 100., "Maximum chi2Topo/NDF of V0ToCas"}; + Configurable chi2TopoOmegacToPvMax{"chi2TopoOmegacToPvMax", 100., "Maximum chi2Topo/NDF of OmegacToPv"}; + Configurable chi2TopoCascToOmegacMax{"chi2TopoCascToOmegacMax", 100., "Maximum chi2Topo/NDF of CascToOmegac"}; + Configurable chi2TopoCascToPvMax{"chi2TopoCascToPvMax", 100., "Maximum chi2Topo/NDF of CascToPv"}; + Configurable decayLenXYOmegacMax{"decayLenXYOmegacMax", 1.5, "Maximum decay lengthXY of Omegac"}; + Configurable decayLenXYCascMin{"decayLenXYCascMin", 1., "Minimum decay lengthXY of Cascade"}; + Configurable decayLenXYLambdaMin{"decayLenXYLambdaMin", 0., "Minimum decay lengthXY of V0"}; + Configurable cosPaCascToOmegacMin{"cosPaCascToOmegacMin", 0.995, "Minimum cosPA of cascade<-Omegac"}; + Configurable cosPaV0ToCascMin{"cosPaV0ToCascMin", 0.99, "Minimum cosPA of V0<-cascade"}; + } kfConfigurableGroup; void init(InitContext const&) { - // std::array processesSelector = {doprocessOmegac0SelectorWithDCAFitter, doprocessOmegac0SelectorWithKFParticle}; - // const int nProcessesSelector = std::accumulate(processesSelector.begin(), processesSelector.end(), 0); - // if (nProcessesSelector != 1) { - // LOGP(fatal, "At most one process function for selector can be enabled at a time."); - // } + std::array processesSelector = {doprocessOmegac0SelectorWithDCAFitter, doprocessOmegac0SelectorWithKFParticle}; + const int nProcessesSelector = std::accumulate(processesSelector.begin(), processesSelector.end(), 0); + if (nProcessesSelector != 1) { + LOGP(fatal, "Exactly one process function for selector can be enabled at a time."); + } selectorPion.setRangePtTpc(ptPiPidTpcMin, ptPiPidTpcMax); selectorPion.setRangeNSigmaTpc(-nSigmaTpcPiMax, nSigmaTpcPiMax); @@ -247,10 +243,10 @@ struct HfCandidateSelectorToOmegaPiQa { selectorKaon.setRangeNSigmaTofCondTpc(-nSigmaTofCombinedKaMax, nSigmaTofCombinedKaMax); const AxisSpec axisSel{2, -0.5, 1.5, "status"}; - const AxisSpec axisSelOnLfDca{14, -0.5, 13.5, "status"}; + const AxisSpec axisSelOnLfDca{16, -0.5, 15.5, "status"}; const AxisSpec axisSelOnLfKf{23, -0.5, 22.5, "status"}; const AxisSpec axisSelOnHfDca{6, -0.5, 5.5, "status"}; - const AxisSpec axisSelOnHfKf{13, -0.5, 12.5, "status"}; + const AxisSpec axisSelOnHfKf{12, -0.5, 11.5, "status"}; // registry.add("hSelPID", "hSelPID;status;entries", {HistType::kTH1D, {{12, 0., 12.}}}); // registry.add("hStatusCheck", "Check consecutive selections status;status;entries", {HistType::kTH1D, {{12, 0., 12.}}}); @@ -303,19 +299,21 @@ struct HfCandidateSelectorToOmegaPiQa { if (doprocessOmegac0SelectorWithDCAFitter) { registry.add("hSelStatusLf", "hSelStatusLf;# of candidate passed;", {HistType::kTH1F, {axisSelOnLfDca}}); registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(1, "All"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(2, "etaV0Dau"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(3, "radiusV0"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(4, "radiusCasc"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(5, "cosPAV0"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(6, "cosPACasc"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(7, "dcaV0Dau"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(8, "dcaCascDau"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(9, "dcaXYToPvV0Dau0"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(10, "dcaXYToPvV0Dau1"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(11, "dcaXYToPvCascDau"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(12, "ptKaFromCasc"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(13, "impactParCascXY"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(14, "impactParCascZ"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(2, "etaV0PosDau"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(3, "etaV0NegDau"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(4, "etaKaFromCasc"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(5, "radiusV0"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(6, "radiusCasc"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(7, "cosPAV0"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(8, "cosPACasc"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(9, "dcaV0Dau"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(10, "dcaCascDau"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(11, "dcaXYToPvV0Dau0"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(12, "dcaXYToPvV0Dau1"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(13, "dcaXYToPvCascDau"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(14, "ptKaFromCasc"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(15, "impactParCascXY"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(16, "impactParCascZ"); registry.add("hSelStatusHf", "hSelStatusHf;# of candidate passed;", {HistType::kTH1F, {axisSelOnHfDca}}); registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(1, "All"); @@ -329,22 +327,22 @@ struct HfCandidateSelectorToOmegaPiQa { if (doprocessOmegac0SelectorWithKFParticle) { registry.add("hSelStatusLf", "hSelStatusLf;# of candidate passed;", {HistType::kTH1F, {axisSelOnLfKf}}); registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(1, "All"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(2, "etaV0Dau"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(3, "radiusV0"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(4, "radiusCasc"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(5, "cosPAV0"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(6, "cosPACasc"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(7, "dcaV0Dau"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(8, "dcaCascDau"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(9, "dcaXYToPvV0Dau0"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(10, "dcaXYToPvV0Dau1"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(11, "dcaXYToPvCascDau"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(12, "ptKaFromCasc"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(13, "cosPaV0ToCasc"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(14, "kfDcaXYCascToPv"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(15, "chi2GeoV0"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(16, "chi2GeoCasc"); - registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(17, "chi2TopoV0ToPv"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(2, "etaV0PosDau"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(3, "etaV0NegDau"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(4, "etaKaFromCasc"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(5, "radiusV0"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(6, "radiusCasc"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(7, "cosPAV0"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(8, "cosPACasc"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(9, "dcaV0Dau"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(10, "dcaCascDau"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(11, "dcaXYToPvV0Dau0"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(12, "dcaXYToPvV0Dau1"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(13, "dcaXYToPvCascDau"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(14, "ptKaFromCasc"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(15, "cosPaV0ToCasc"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(16, "chi2GeoV0"); + registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(17, "chi2GeoCasc"); registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(18, "chi2TopoCascToPv"); registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(19, "chi2TopoV0ToCasc"); registry.get(HIST("hSelStatusLf"))->GetXaxis()->SetBinLabel(20, "v0ldl"); @@ -357,21 +355,18 @@ struct HfCandidateSelectorToOmegaPiQa { registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(2, "etaTrackCharmBach"); registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(3, "dcaCharmBaryonDau"); registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(4, "ptPiFromCharmBaryon"); - registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(5, "cosPaCascToOmegac"); - registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(6, "kfDcaXYPiFromOmegac"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(5, "kfptOmegac"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(6, "cosPaCascToOmegac"); registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(7, "chi2GeoOmegac"); registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(8, "chi2TopoOmegacToPv"); - registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(9, "chi2TopoPiFromOmegacToPv"); - registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(10, "chi2TopoCascToOmegac"); - registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(11, "decayLenXYOmegac"); - registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(12, "cTauOmegac"); - registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(13, "omegacldl"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(9, "chi2TopoCascToOmegac"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(10, "decayLenXYOmegac"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(11, "cTauOmegac"); + registry.get(HIST("hSelStatusHf"))->GetXaxis()->SetBinLabel(12, "omegacldl"); } - // invariant mass histograms - registry.add("hInvMassCharmBaryonWoPidInvMassCut", "Charm baryon invariant mass; inv. mass; entries", {HistType::kTH1F, {{500, 2.3, 3.1}}}); registry.add("hInvMassCharmBaryon", "Charm baryon invariant mass; inv. mass; entries", {HistType::kTH1F, {{500, 2.3, 3.1}}}); - registry.add("hInvMassCharmBaryonBkg", "Charm baryon invariant mass, rejected; inv. mass; entries", {HistType::kTH1F, {{500, 2.3, 3.1}}}); + registry.add("hPtCharmBaryon", "Charm baryon transverse momentum; p_{T} (GeV/#it{c}); entries", {HistType::kTH1F, {{8000, 0., 80.}}}); if (doprocessOmegac0SelectorWithKFParticle) { registry.add("hSelCompetingCasc", "hSelCompetingCasc;status;entries", {HistType::kTH1F, {axisSel}}); @@ -392,17 +387,6 @@ struct HfCandidateSelectorToOmegaPiQa { // registry.add("hSelcosPaCascToOmegac_V0ToCasc", "hSelcosPaCascToOmegac_V0ToCasc;status;entries", {HistType::kTH1D, {axisSel}}); // registry.add("hInvMassXiMinus_rej_cut", "hInvMassXiMinus_rej_cut", kTH1D, {{1000, 1.25f, 1.65f}}); // } - // if (applyMl) { - // hfMlResponse.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl); - // if (loadModelsFromCCDB) { - // ccdbApi.init(ccdbUrl); - // hfMlResponse.setModelPathsCCDB(onnxFileNames, ccdbApi, modelPathsCCDB, timestampCCDB); - // } else { - // hfMlResponse.setModelPathsLocal(onnxFileNames); - // } - // hfMlResponse.cacheInputFeaturesIndices(namesInputFeatures); - // hfMlResponse.init(); - // } // HfMlResponse initialization if (applyMl) { @@ -437,133 +421,147 @@ struct HfCandidateSelectorToOmegaPiQa { double etaV0NegDau = candidate.etaV0NegDau(); double etaKaFromCasc = candidate.etaBachFromCasc(); - if (std::abs(etaV0PosDau) > etaTrackLFDauMax || std::abs(etaV0NegDau) > etaTrackLFDauMax || std::abs(etaKaFromCasc) > etaTrackLFDauMax) { + if (std::abs(etaV0PosDau) > etaTrackLFDauMax) { return false; } registry.fill(HIST("hSelStatusLf"), 1.0); - // Minimum radius cut - double radiusV0 = RecoDecay::sqrtSumOfSquares(candidate.xDecayVtxV0(), candidate.yDecayVtxV0()); - double radiusCasc = RecoDecay::sqrtSumOfSquares(candidate.xDecayVtxCascade(), candidate.yDecayVtxCascade()); - - if (radiusV0 < radiusV0Min) { + if (std::abs(etaV0NegDau) > etaTrackLFDauMax) { return false; } registry.fill(HIST("hSelStatusLf"), 2.0); - if (radiusCasc < radiusCascMin) { + + if (std::abs(etaKaFromCasc) > etaTrackLFDauMax) { return false; } registry.fill(HIST("hSelStatusLf"), 3.0); - // Cosine of pointing angle - if (candidate.cosPAV0() < cuts->get(inputPtBin, "cosPAV0")) { + // Minimum radius cut + double radiusV0 = RecoDecay::sqrtSumOfSquares(candidate.xDecayVtxV0(), candidate.yDecayVtxV0()); + double radiusCasc = RecoDecay::sqrtSumOfSquares(candidate.xDecayVtxCascade(), candidate.yDecayVtxCascade()); + + if (radiusV0 < radiusV0Min) { return false; } registry.fill(HIST("hSelStatusLf"), 4.0); - if (candidate.cosPACasc() < cuts->get(inputPtBin, "cosPACasc")) { + if (radiusCasc < radiusCascMin) { return false; } registry.fill(HIST("hSelStatusLf"), 5.0); - // Distance of Closest Approach(DCA) - if (candidate.dcaV0Dau() > cuts->get(inputPtBin, "dcaV0Dau")) { + // Cosine of pointing angle + if (candidate.cosPAV0() < cosPAV0Min) { return false; } registry.fill(HIST("hSelStatusLf"), 6.0); - - if (candidate.dcaCascDau() > cuts->get(inputPtBin, "dcaCascDau")) { + if (candidate.cosPACasc() < cosPACascMin) { return false; } registry.fill(HIST("hSelStatusLf"), 7.0); - if (std::abs(candidate.dcaXYToPvV0Dau0()) < cuts->get(inputPtBin, "dcaXYToPvV0Dau0")) { + // Distance of Closest Approach(DCA) + if (candidate.dcaV0Dau() > dcaV0DauMax) { return false; } registry.fill(HIST("hSelStatusLf"), 8.0); - if (std::abs(candidate.dcaXYToPvV0Dau1()) < cuts->get(inputPtBin, "dcaXYToPvV0Dau1")) { + if (candidate.dcaCascDau() > dcaCascDauMax) { return false; } registry.fill(HIST("hSelStatusLf"), 9.0); - if (std::abs(candidate.dcaXYToPvCascDau()) < cuts->get(inputPtBin, "dcaXYToPvCascDau")) { + if (std::abs(candidate.dcaXYToPvV0Dau0()) < dcaPosToPvMin) { return false; } registry.fill(HIST("hSelStatusLf"), 10.0); + if (std::abs(candidate.dcaXYToPvV0Dau1()) < dcaNegToPvMin) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 11.0); + + if (std::abs(candidate.dcaXYToPvCascDau()) < dcaBachToPvMin) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 12.0); + // pT: Bachelor double ptKaFromCasc = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCasc(), candidate.pyBachFromCasc()); if (std::abs(ptKaFromCasc) < ptKaFromCascMin) { return false; } - registry.fill(HIST("hSelStatusLf"), 11.0); + registry.fill(HIST("hSelStatusLf"), 13.0); // Extra cuts for KFParticle if constexpr (svReco == doKfParticle) { - // Cosine of Pointing angle - if (candidate.cosPaV0ToCasc() < cuts->get(inputPtBin, "cosPaV0ToCasc")) { - return false; - } - registry.fill(HIST("hSelStatusLf"), 12.0); + if (kfConfigurableGroup.applyKFpreselections) { + // Cosine of Pointing angle + if (candidate.cosPaV0ToCasc() < kfConfigurableGroup.cosPaV0ToCascMin) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 14.0); - // DCA - if (std::abs(candidate.kfDcaXYCascToPv()) > cuts->get(inputPtBin, "kfDcaXYCascToPv")) { - return false; - } - registry.fill(HIST("hSelStatusLf"), 13.0); + // Chi2 + if (candidate.chi2GeoV0() < 0 || candidate.chi2GeoV0() > kfConfigurableGroup.v0Chi2OverNdfMax) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 15.0); + if (candidate.chi2GeoCasc() < 0 || candidate.chi2GeoCasc() > kfConfigurableGroup.cascChi2OverNdfMax) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 16.0); + if (candidate.chi2TopoCascToPv() < 0 || candidate.chi2TopoCascToPv() > kfConfigurableGroup.chi2TopoCascToPvMax) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 17.0); + if (candidate.chi2TopoV0ToCasc() < 0 || candidate.chi2TopoV0ToCasc() > kfConfigurableGroup.chi2TopoV0ToCascMax) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 18.0); - // Chi2 - if (candidate.chi2GeoV0() < 0 || candidate.chi2GeoV0() > cuts->get(inputPtBin, "chi2GeoV0")) { - return false; - } - registry.fill(HIST("hSelStatusLf"), 14.0); - if (candidate.chi2GeoCasc() < 0 || candidate.chi2GeoCasc() > cuts->get(inputPtBin, "chi2GeoCasc")) { - return false; - } - registry.fill(HIST("hSelStatusLf"), 15.0); - if (candidate.chi2TopoV0ToPv() > 0 && candidate.chi2TopoV0ToPv() < cuts->get(inputPtBin, "chi2TopoV0ToPv")) { - return false; - } - registry.fill(HIST("hSelStatusLf"), 16.0); - if (candidate.chi2TopoCascToPv() < 0 || candidate.chi2TopoCascToPv() > cuts->get(inputPtBin, "chi2TopoCascToPv")) { - return false; - } - registry.fill(HIST("hSelStatusLf"), 17.0); - if (candidate.chi2TopoV0ToCasc() < 0 || candidate.chi2TopoV0ToCasc() > cuts->get(inputPtBin, "chi2TopoV0ToCasc")) { - return false; - } - registry.fill(HIST("hSelStatusLf"), 18.0); + // ldl + if (candidate.v0ldl() < kfConfigurableGroup.v0LdlMin) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 19.0); + if (candidate.cascldl() < kfConfigurableGroup.cascLdlMin) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 20.0); - // ldl - if (candidate.v0ldl() < cuts->get(inputPtBin, "v0ldl")) { - return false; - } - registry.fill(HIST("hSelStatusLf"), 19.0); - if (candidate.cascldl() < cuts->get(inputPtBin, "cascldl")) { - return false; - } - registry.fill(HIST("hSelStatusLf"), 20.0); + // Decay length + if (std::abs(candidate.decayLenXYLambda()) < kfConfigurableGroup.decayLenXYLambdaMin) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 21.0); + if (std::abs(candidate.decayLenXYCasc()) < kfConfigurableGroup.decayLenXYCascMin) { + return false; + } + registry.fill(HIST("hSelStatusLf"), 22.0); - // Decay length - if (std::abs(candidate.decayLenXYLambda()) < cuts->get(inputPtBin, "decayLenXYLambda")) { - return false; - } - registry.fill(HIST("hSelStatusLf"), 21.0); - if (std::abs(candidate.decayLenXYCasc()) < cuts->get(inputPtBin, "decayLenXYCasc")) { - return false; - } - registry.fill(HIST("hSelStatusLf"), 22.0); + // Competing Xi rejection + if (kfConfigurableGroup.applyCompetingCascRejection) { + const auto invMassXiHypothesis = candidate.cascRejectInvmass(); + if (std::abs(invMassXiHypothesis - o2::constants::physics::MassXiMinus) < kfConfigurableGroup.cascadeRejMassWindow) { + registry.fill(HIST("hSelCompetingCasc"), 0.0); + return false; + } + + registry.fill(HIST("hSelCompetingCasc"), 1.0); + registry.fill(HIST("hInvMassXiMinus_rej_cut"), invMassXiHypothesis); + } + } } else { // Impact parameter(DCA?) if (std::abs(candidate.impactParCascXY()) < impactParameterXYCascMin || std::abs(candidate.impactParCascXY()) > impactParameterXYCascMax) { return false; } - registry.fill(HIST("hSelStatusLf"), 12.0); + registry.fill(HIST("hSelStatusLf"), 14.0); if (std::abs(candidate.impactParCascZ()) < impactParameterZCascMin || std::abs(candidate.impactParCascZ()) > impactParameterZCascMax) { return false; } - registry.fill(HIST("hSelStatusLf"), 13.0); + registry.fill(HIST("hSelStatusLf"), 15.0); } // If passes all cuts, return true @@ -576,7 +574,6 @@ struct HfCandidateSelectorToOmegaPiQa { template bool SelectOnHF(const T& candidate, const int& inputPtBin) { - registry.fill(HIST("hSelStatusHf"), 0.0); // eta selection on charm bayron bachelor @@ -585,67 +582,65 @@ struct HfCandidateSelectorToOmegaPiQa { } registry.fill(HIST("hSelStatusHf"), 1.0); // Distance of Closest Approach(DCA) - if (candidate.dcaCharmBaryonDau() > cuts->get(inputPtBin, "dcaCharmBaryonDau")) { + if (candidate.dcaCharmBaryonDau() > dcaCharmBaryonDauMax) { return false; } registry.fill(HIST("hSelStatusHf"), 2.0); // pT: Charm Bachelor double ptPiFromCharmBaryon = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()); - if (ptPiFromCharmBaryon < cuts->get(inputPtBin, "ptPiFromCharmBaryon")) { + if (ptPiFromCharmBaryon < ptPiFromCharmBaryonMin) { return false; } registry.fill(HIST("hSelStatusHf"), 3.0); // specific selections with KFParticle output if constexpr (svReco == doKfParticle) { - // Cosine of pointing angle - if (candidate.cosPaCascToOmegac() < cuts->get(inputPtBin, "cosPaCascToOmegac")) { - return false; - } - registry.fill(HIST("hSelStatusHf"), 4.0); + if (kfConfigurableGroup.applyKFpreselections) { + // Omegac Pt selection + if (std::abs(candidate.kfptOmegac()) <= ptCandMin || std::abs(candidate.kfptOmegac()) >= ptCandMax) { + return false; + } + registry.fill(HIST("hSelStatusHf"), 4.0); - // DCA - if (std::abs(candidate.kfDcaXYPiFromOmegac()) > cuts->get(inputPtBin, "kfDcaXYPiFromOmegac")) { - return false; - } - registry.fill(HIST("hSelStatusHf"), 5.0); + // Cosine of pointing angle + if (candidate.cosPaCascToOmegac() < kfConfigurableGroup.cosPaCascToOmegacMin) { + return false; + } + registry.fill(HIST("hSelStatusHf"), 5.0); - // Chi2 - if (candidate.chi2GeoOmegac() < 0 || candidate.chi2GeoOmegac() > cuts->get(inputPtBin, "chi2GeoOmegac")) { - return false; - } - registry.fill(HIST("hSelStatusHf"), 6.0); - if (candidate.chi2TopoOmegacToPv() < 0 || candidate.chi2TopoOmegacToPv() > cuts->get(inputPtBin, "chi2TopoOmegacToPv")) { - return false; - } - registry.fill(HIST("hSelStatusHf"), 7.0); - if (candidate.chi2TopoPiFromOmegacToPv() < 0 || candidate.chi2TopoPiFromOmegacToPv() > cuts->get(inputPtBin, "chi2TopoPiFromOmegacToPv")) { - return false; - } - registry.fill(HIST("hSelStatusHf"), 8.0); - if (candidate.chi2TopoCascToOmegac() < 0 || candidate.chi2TopoCascToOmegac() > cuts->get(inputPtBin, "chi2TopoCascToOmegac")) { - return false; - } - registry.fill(HIST("hSelStatusHf"), 9.0); + // Chi2 + if (candidate.chi2GeoOmegac() < 0 || candidate.chi2GeoOmegac() > kfConfigurableGroup.omegacChi2OverNdfMax) { + return false; + } + registry.fill(HIST("hSelStatusHf"), 6.0); + if (candidate.chi2TopoOmegacToPv() < 0 || candidate.chi2TopoOmegacToPv() > kfConfigurableGroup.chi2TopoOmegacToPvMax) { + return false; + } + registry.fill(HIST("hSelStatusHf"), 7.0); + if (candidate.chi2TopoCascToOmegac() < 0 || candidate.chi2TopoCascToOmegac() > kfConfigurableGroup.chi2TopoCascToOmegacMax) { + return false; + } + registry.fill(HIST("hSelStatusHf"), 8.0); - // Decay Length - if (std::abs(candidate.decayLenXYOmegac()) > cuts->get(inputPtBin, "decayLenXYOmegac")) { - return false; - } - registry.fill(HIST("hSelStatusHf"), 10.0); + // Decay Length + if (std::abs(candidate.decayLenXYOmegac()) > kfConfigurableGroup.decayLenXYOmegacMax) { + return false; + } + registry.fill(HIST("hSelStatusHf"), 9.0); - // ctau - if (std::abs(candidate.cTauOmegac()) > cuts->get(inputPtBin, "cTauOmegac")) { - return false; - } - registry.fill(HIST("hSelStatusHf"), 11.0); + // ctau + if (std::abs(candidate.cTauOmegac()) > kfConfigurableGroup.cTauOmegacMax) { + return false; + } + registry.fill(HIST("hSelStatusHf"), 10.0); - // Omegac l/dl - if (candidate.omegacldl() > omegacLdlMax) { - return false; + // Omegac l/dl + if (candidate.omegacldl() > kfConfigurableGroup.omegacLdlMax) { + return false; + } + registry.fill(HIST("hSelStatusHf"), 11.0); } - registry.fill(HIST("hSelStatusHf"), 12.0); } else { // Impact parameter(DCA?) if ((std::abs(candidate.impactParBachFromCharmBaryonXY()) < impactParameterXYPiFromCharmBaryonMin) || (std::abs(candidate.impactParBachFromCharmBaryonXY()) > impactParameterXYPiFromCharmBaryonMax)) { @@ -694,17 +689,18 @@ struct HfCandidateSelectorToOmegaPiQa { // pT selection auto ptCandOmegac = RecoDecay::pt(candidate.pxCharmBaryon(), candidate.pyCharmBaryon()); + + if (ptCandOmegac <= ptCandMin || ptCandOmegac >= ptCandMax) { + resultSelections = false; + continue; + } + int pTBin = findBin(binsPt, ptCandOmegac); if (pTBin == -1) { resultSelections = false; + continue; } - // // check that the candidate pT is within the analysis range - // if (ptCandOmegac <= ptCandMin || ptCandOmegac >= ptCandMax) { - // resultSelections = false; - // continue; - // } - // // check that the candidate pT is within the analysis range // auto pionPtFromOmegac = candidate.ptPiFromCharmBaryon(); // if (pionPtFromOmegac < cuts->get(pTBin, "pT pi from Omegac")) { @@ -720,21 +716,6 @@ struct HfCandidateSelectorToOmegaPiQa { if (!selectionResOnLF || !selectionResOnHF) { resultSelections = false; } - - // Competing Xi rejection (KF) Try to reject cases in which the candidate has a an inv. mass compatible with Xi (bachelor pion) instead of Omega (bachelor kaon) - if constexpr (svReco == doKfParticle) { - if (resultSelections && applyCompetingCascRejection) { - const auto invMassXiHypothesis = candidate.cascRejectInvmass(); - - if (std::abs(invMassXiHypothesis - o2::constants::physics::MassXiMinus) < cascadeRejMassWindow) { - resultSelections = false; - registry.fill(HIST("hSelCompetingCasc"), 0.0); - } else { - registry.fill(HIST("hSelCompetingCasc"), 1.0); - registry.fill(HIST("hInvMassXiMinus_rej_cut"), invMassXiHypothesis); - } - } - } // if (std::abs(etaV0PosDau) > etaTrackLFDauMax) { // resultSelections = false; @@ -1143,19 +1124,10 @@ struct HfCandidateSelectorToOmegaPiQa { } // ML BDT selection - // if (applyMl) { - // bool isSelectedMlOmegac = false; - // std::vector inputFeaturesOmegaC = hfMlResponse.getInputFeatures(candidate, trackPiFromLam, trackKaFromCasc, trackPiFromCharm); - // isSelectedMlOmegac = hfMlResponse.isSelectedMl(inputFeaturesOmegaC, ptCandOmegac, outputMlOmegac); - // if (!isSelectedMlOmegac) { - // continue; - // } - // hfMlSelToOmegaPi(outputMlOmegac); - // } if (applyMl) { bool isSelectedMlOmegac = false; std::vector inputFeaturesOmegaC = {}; - if constexpr (svReco == doDcaFitter) { + if constexpr (svReco == doKfParticle) { inputFeaturesOmegaC = hfMlResponse.getInputFeatures(candidate, trackPiFromLam, trackKaFromCasc, trackPiFromCharm); isSelectedMlOmegac = hfMlResponse.isSelectedMl(inputFeaturesOmegaC, ptCandOmegac, outputMlOmegac); @@ -1164,7 +1136,7 @@ struct HfCandidateSelectorToOmegaPiQa { } hfMlSelToOmegaPi(outputMlOmegac); } else { - // KFParticle path: skip ML application + // DCAFitter path: skip ML application } } @@ -1217,28 +1189,24 @@ struct HfCandidateSelectorToOmegaPiQa { // } // Fill in invariant mass histogram - if (resultSelections) { - registry.fill(HIST("hInvMassCharmBaryonWoPidInvMassCut"), invMassCharmBaryon); - } if (statusPidLambda && statusPidCascade && statusPidCharmBaryon && statusInvMassLambda && statusInvMassCascade && statusInvMassCharmBaryon && resultSelections) { registry.fill(HIST("hInvMassCharmBaryon"), invMassCharmBaryon); - } else { - registry.fill(HIST("hInvMassCharmBaryonBkg"), invMassCharmBaryon); + if constexpr (svReco == doKfParticle) { + registry.fill(HIST("hPtCharmBaryon"), candidate.kfptOmegac()); + } else { + registry.fill(HIST("hPtCharmBaryon"), ptCandOmegac); + } } - // if constexpr (dokf) { - // registry.fill(HIST("hPtCharmBaryon"), candidate.kfptOmegac()); - // } else { - // registry.fill(HIST("hPtCharmBaryon"), ptCandOmegac); - // } - } // end of candidate loop } // end run function /////////////////////////////////// /// Process with DCAFitter // /////////////////////////////////// - void processOmegac0SelectorWithDCAFitter(aod::HfCandToOmegaPi const& candidates, TracksSel const& tracks, TracksSelLf const& lfTracks) + void processOmegac0SelectorWithDCAFitter(aod::HfCandToOmegaPi const& candidates, + TracksSel const& tracks, + TracksSelLf const& lfTracks) { runOmegac0Selector(candidates, tracks, lfTracks); } @@ -1247,7 +1215,9 @@ struct HfCandidateSelectorToOmegaPiQa { //////////////////////////////////// /// Process with KFParticle // //////////////////////////////////// - void processOmegac0SelectorWithKFParticle(soa::Join const& candidates, TracksSel const& tracks, TracksSelLf const& lfTracks) + void processOmegac0SelectorWithKFParticle(soa::Join const& candidates, + TracksSel const& tracks, + TracksSelLf const& lfTracks) { runOmegac0Selector(candidates, tracks, lfTracks); } From 3bc0ba83f4d6142229780d9b4b023c12805046be Mon Sep 17 00:00:00 2001 From: mariafernandatorrescabrera Date: Thu, 9 Jul 2026 21:15:03 -0500 Subject: [PATCH 04/12] Update OmegaC candidate selector QA --- .../candidateSelectorOmegac0ToOmegaPiQa.cxx | 43 +++++++++---------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx index 015bec07feb..0537258c8b9 100755 --- a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx +++ b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx @@ -71,7 +71,7 @@ enum { struct HfCandidateSelectorToOmegaPiQa { // DCAFitter and KFParticle Produces hfSelToOmegaPi; - // ML selection - Filled with both DCAFitter and KFParticle + // ML selection - currently filled only for KFParticle Produces hfMlSelToOmegaPi; // cuts from SelectorCuts.h - pT dependent cuts @@ -390,7 +390,8 @@ struct HfCandidateSelectorToOmegaPiQa { // HfMlResponse initialization if (applyMl) { - if (doprocessOmegac0SelectorWithDCAFitter) { + if (doprocessOmegac0SelectorWithKFParticle) { + registry.add("hBDTScoreTest1", "hBDTScoreTest1", {HistType::kTH1D, {{100, 0.0f, 1.0f, "score"}}}); hfMlResponse.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl); if (loadModelsFromCCDB) { ccdbApi.init(ccdbUrl); @@ -401,8 +402,8 @@ struct HfCandidateSelectorToOmegaPiQa { hfMlResponse.cacheInputFeaturesIndices(namesInputFeatures); hfMlResponse.init(); } else { - // KFParticle path: ML is not yet implemented - LOGP(warning, "ML selection is currently only supported for DCAFitter."); + // DCAFitter: ML is not yet implemented + LOGP(warning, "ML selection is currently only supported for KFParticle."); } } } @@ -411,7 +412,7 @@ struct HfCandidateSelectorToOmegaPiQa { // Selection on LF related informations // returns true if all cuts are passed template - bool SelectOnLF(const T& candidate, const int& inputPtBin) + bool selectOnLf(const T& candidate, const int& inputPtBin) { registry.fill(HIST("hSelStatusLf"), 0.0); @@ -572,7 +573,7 @@ struct HfCandidateSelectorToOmegaPiQa { // Apply cuts with charm baryon & charm bachelor related informations // returns true if all cuts are passed template - bool SelectOnHF(const T& candidate, const int& inputPtBin) + bool selectOnHf(const T& candidate, const int& inputPtBin) { registry.fill(HIST("hSelStatusHf"), 0.0); @@ -692,13 +693,11 @@ struct HfCandidateSelectorToOmegaPiQa { if (ptCandOmegac <= ptCandMin || ptCandOmegac >= ptCandMax) { resultSelections = false; - continue; } int pTBin = findBin(binsPt, ptCandOmegac); if (pTBin == -1) { resultSelections = false; - continue; } // // check that the candidate pT is within the analysis range @@ -711,8 +710,8 @@ struct HfCandidateSelectorToOmegaPiQa { // } // Topological selection - const bool selectionResOnLF = SelectOnLF(candidate, pTBin); - const bool selectionResOnHF = SelectOnHF(candidate, pTBin); + const bool selectionResOnLF = selectOnLf(candidate, pTBin); + const bool selectionResOnHF = selectOnHf(candidate, pTBin); if (!selectionResOnLF || !selectionResOnHF) { resultSelections = false; } @@ -1123,27 +1122,25 @@ struct HfCandidateSelectorToOmegaPiQa { statusInvMassCharmBaryon = true; } - // ML BDT selection - if (applyMl) { - bool isSelectedMlOmegac = false; - std::vector inputFeaturesOmegaC = {}; - if constexpr (svReco == doKfParticle) { - inputFeaturesOmegaC = hfMlResponse.getInputFeatures(candidate, trackPiFromLam, trackKaFromCasc, trackPiFromCharm); + // ML BDT selection - curently only for KFParticle + if constexpr (svReco == doKfParticle) { + if (applyMl) { + bool isSelectedMlOmegac = false; + std::vector inputFeaturesOmegaC = hfMlResponse.getInputFeatures(candidate, trackPiFromLam, trackKaFromCasc, trackPiFromCharm); isSelectedMlOmegac = hfMlResponse.isSelectedMl(inputFeaturesOmegaC, ptCandOmegac, outputMlOmegac); - - if (!isSelectedMlOmegac) { - continue; + if (isSelectedMlOmegac) { + registry.fill(HIST("hBDTScoreTest1"), outputMlOmegac[0]); + } else { + resultSelections = false; } hfMlSelToOmegaPi(outputMlOmegac); - } else { - // DCAFitter path: skip ML application } } // Fill in selection result if (!statusPidLambda || !statusPidCascade || !statusPidCharmBaryon || !statusInvMassLambda || !statusInvMassCascade || !statusInvMassCharmBaryon) { - resultSelections = false; + resultSelections = false; } hfSelToOmegaPi(statusPidLambda, statusPidCascade, statusPidCharmBaryon, statusInvMassLambda, statusInvMassCascade, statusInvMassCharmBaryon, resultSelections, infoTpcStored, infoTofStored, trackPiFromCharm.tpcNSigmaPi(), trackKaFromCasc.tpcNSigmaKa(), trackPiFromLam.tpcNSigmaPi(), trackPrFromLam.tpcNSigmaPr(), @@ -1229,4 +1226,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ adaptAnalysisTask(cfgc)}; -} \ No newline at end of file +} From 3c24dab1f1421beb8fe90416769cd2ebc046223f Mon Sep 17 00:00:00 2001 From: mariafernandatorrescabrera Date: Mon, 13 Jul 2026 10:09:34 -0500 Subject: [PATCH 05/12] First draft for OmegaC tree creator QA --- .../treeCreatorOmegac0ToOmegaPiQa.cxx | 960 ++++++++++++++++++ 1 file changed, 960 insertions(+) create mode 100755 PWGHF/TableProducer/treeCreatorOmegac0ToOmegaPiQa.cxx diff --git a/PWGHF/TableProducer/treeCreatorOmegac0ToOmegaPiQa.cxx b/PWGHF/TableProducer/treeCreatorOmegac0ToOmegaPiQa.cxx new file mode 100755 index 00000000000..25aef82e090 --- /dev/null +++ b/PWGHF/TableProducer/treeCreatorOmegac0ToOmegaPiQa.cxx @@ -0,0 +1,960 @@ +// 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 treeCreatorOmegac0ToOmegaPiQa.cxx +/// \brief Writer of the omegac0 to Omega Pi candidates in the form of flat tables to be stored in TTrees. +/// In this file are defined and filled the output tables +/// +/// \author Fabio Catalano , University of Houston +/// \author Maria Fernanda Torres Cabrera , University of Houston + +#include "PWGHF/Core/CentralityEstimation.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" +// #include "PWGHF/DataModel/TrackIndexSkimmingTables.h" +#include "PWGLF/DataModel/mcCentrality.h" + +#include "Common/Core/RecoDecay.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include + +// #include + +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +// SV Reco method // -- added -- +enum { + DCAFITTER = 0, + KFPARTICLE +}; + +// Table size // -- added -- +enum { + FULL = 0, + LITE +}; + +namespace o2::aod +{ +namespace full +{ +// collision info +DECLARE_SOA_COLUMN(IsEventSel8, isEventSel8, bool); +DECLARE_SOA_COLUMN(IsEventSelZ, isEventSelZ, bool); +DECLARE_SOA_COLUMN(Centrality, centrality, float); // --- added --- +// from creator +DECLARE_SOA_COLUMN(XPv, xPv, float); +DECLARE_SOA_COLUMN(YPv, yPv, float); +DECLARE_SOA_COLUMN(ZPv, zPv, float); +DECLARE_SOA_COLUMN(XDecayVtxCharmBaryon, xDecayVtxCharmBaryon, float); +DECLARE_SOA_COLUMN(YDecayVtxCharmBaryon, yDecayVtxCharmBaryon, float); +DECLARE_SOA_COLUMN(ZDecayVtxCharmBaryon, zDecayVtxCharmBaryon, float); +DECLARE_SOA_COLUMN(XDecayVtxCascade, xDecayVtxCascade, float); +DECLARE_SOA_COLUMN(YDecayVtxCascade, yDecayVtxCascade, float); +DECLARE_SOA_COLUMN(ZDecayVtxCascade, zDecayVtxCascade, float); +DECLARE_SOA_COLUMN(XDecayVtxV0, xDecayVtxV0, float); +DECLARE_SOA_COLUMN(YDecayVtxV0, yDecayVtxV0, float); +DECLARE_SOA_COLUMN(ZDecayVtxV0, zDecayVtxV0, float); +DECLARE_SOA_COLUMN(SignDecay, signDecay, int8_t); // sign of ka <- omega +DECLARE_SOA_COLUMN(CovVtxCharmBaryonXX, covVtxCharmBaryonXX, float); // --- added --- +DECLARE_SOA_COLUMN(CovVtxCharmBaryonYY, covVtxCharmBaryonYY, float); // --- added --- +DECLARE_SOA_COLUMN(CovVtxCharmBaryonZZ, covVtxCharmBaryonZZ, float); // --- added --- +DECLARE_SOA_COLUMN(PxCharmBaryon, pxCharmBaryon, float); +DECLARE_SOA_COLUMN(PyCharmBaryon, pyCharmBaryon, float); +DECLARE_SOA_COLUMN(PzCharmBaryon, pzCharmBaryon, float); +DECLARE_SOA_COLUMN(PxCasc, pxCasc, float); // --- added --- +DECLARE_SOA_COLUMN(PyCasc, pyCasc, float); // --- added --- +DECLARE_SOA_COLUMN(PzCasc, pzCasc, float); // --- added --- +DECLARE_SOA_COLUMN(PxPiFromCharmBaryon, pxPiFromCharmBaryon, float); +DECLARE_SOA_COLUMN(PyPiFromCharmBaryon, pyPiFromCharmBaryon, float); +DECLARE_SOA_COLUMN(PzPiFromCharmBaryon, pzPiFromCharmBaryon, float); +DECLARE_SOA_COLUMN(PxLambda, pxLambda, float); // --- added --- +DECLARE_SOA_COLUMN(PyLambda, pyLambda, float); // --- added --- +DECLARE_SOA_COLUMN(PzLambda, pzLambda, float); // --- added --- +DECLARE_SOA_COLUMN(PtCharmBaryon, ptCharmBaryon, float); // --- added --- +DECLARE_SOA_COLUMN(PtPiFromCharmBaryon, ptPiFromCharmBaryon, float); // --- added --- +DECLARE_SOA_COLUMN(PxKaFromCasc, pxKaFromCasc, float); +DECLARE_SOA_COLUMN(PyKaFromCasc, pyKaFromCasc, float); +DECLARE_SOA_COLUMN(PzKaFromCasc, pzKaFromCasc, float); +DECLARE_SOA_COLUMN(PxPosV0Dau, pxPosV0Dau, float); +DECLARE_SOA_COLUMN(PyPosV0Dau, pyPosV0Dau, float); +DECLARE_SOA_COLUMN(PzPosV0Dau, pzPosV0Dau, float); +DECLARE_SOA_COLUMN(PxNegV0Dau, pxNegV0Dau, float); +DECLARE_SOA_COLUMN(PyNegV0Dau, pyNegV0Dau, float); +DECLARE_SOA_COLUMN(PzNegV0Dau, pzNegV0Dau, float); +DECLARE_SOA_COLUMN(ImpactParCascXY, impactParCascXY, float); +DECLARE_SOA_COLUMN(ImpactParPiFromCharmBaryonXY, impactParPiFromCharmBaryonXY, float); +DECLARE_SOA_COLUMN(ImpactParCascZ, impactParCascZ, float); // --- added --- +DECLARE_SOA_COLUMN(ImpactParPiFromCharmBaryonZ, impactParPiFromCharmBaryonZ, float); // --- added --- +DECLARE_SOA_COLUMN(ErrImpactParCascXY, errImpactParCascXY, float); +DECLARE_SOA_COLUMN(ErrImpactParPiFromCharmBaryonXY, errImpactParPiFromCharmBaryonXY, float); +DECLARE_SOA_COLUMN(InvMassLambda, invMassLambda, float); +DECLARE_SOA_COLUMN(InvMassCascade, invMassCascade, float); +DECLARE_SOA_COLUMN(InvMassCharmBaryon, invMassCharmBaryon, float); +DECLARE_SOA_COLUMN(CosPAV0, cosPAV0, float); // --- added --- +DECLARE_SOA_COLUMN(CosPACharmBaryon, cosPACharmBaryon, float); // --- added --- +DECLARE_SOA_COLUMN(CosPACasc, cosPACasc, float); // --- added --- +DECLARE_SOA_COLUMN(CosPAXYV0, cosPAXYV0, float); // --- added --- +DECLARE_SOA_COLUMN(CosPAXYCharmBaryon, cosPAXYCharmBaryon, float); // --- added --- +DECLARE_SOA_COLUMN(CosPAXYCasc, cosPAXYCasc, float); // --- added --- +DECLARE_SOA_COLUMN(CTauOmegac, cTauOmegac, float); // --- added --- +DECLARE_SOA_COLUMN(CTauCascade, cTauCascade, float); // --- added --- +DECLARE_SOA_COLUMN(CTauV0, cTauV0, float); // --- added --- +DECLARE_SOA_COLUMN(EtaV0PosDau, etaV0PosDau, float); +DECLARE_SOA_COLUMN(EtaV0NegDau, etaV0NegDau, float); +DECLARE_SOA_COLUMN(EtaKaFromCasc, etaKaFromCasc, float); +DECLARE_SOA_COLUMN(EtaPiFromCharmBaryon, etaPiFromCharmBaryon, float); +DECLARE_SOA_COLUMN(EtaCharmBaryon, etaCharmBaryon, float); // -- added --- +DECLARE_SOA_COLUMN(EtaCascade, etaCascade, float); // -- added --- +DECLARE_SOA_COLUMN(EtaV0, etaV0, float); // -- added --- +DECLARE_SOA_COLUMN(DcaXYToPvV0Dau0, dcaXYToPvV0Dau0, float); +DECLARE_SOA_COLUMN(DcaXYToPvV0Dau1, dcaXYToPvV0Dau1, float); +DECLARE_SOA_COLUMN(DcaXYToPvCascDau, dcaXYToPvCascDau, float); +DECLARE_SOA_COLUMN(DcaZToPvV0Dau0, dcaZToPvV0Dau0, float); // -- added --- +DECLARE_SOA_COLUMN(DcaZToPvV0Dau1, dcaZToPvV0Dau1, float); // -- added --- +DECLARE_SOA_COLUMN(DcaZToPvCascDau, dcaZToPvCascDau, float); // -- added --- +DECLARE_SOA_COLUMN(DcaCascDau, dcaCascDau, float); +DECLARE_SOA_COLUMN(DcaV0Dau, dcaV0Dau, float); +DECLARE_SOA_COLUMN(DcaCharmBaryonDau, dcaCharmBaryonDau, float); +DECLARE_SOA_COLUMN(DecLenCharmBaryon, decLenCharmBaryon, float); // --- added --- +DECLARE_SOA_COLUMN(DecLenCascade, decLenCascade, float); // --- added --- +DECLARE_SOA_COLUMN(DecLenV0, decLenV0, float); // --- added --- +DECLARE_SOA_COLUMN(ErrorDecayLengthCharmBaryon, errorDecayLengthCharmBaryon, float); +DECLARE_SOA_COLUMN(ErrorDecayLengthXYCharmBaryon, errorDecayLengthXYCharmBaryon, float); // -- added --- +DECLARE_SOA_COLUMN(NormImpParCascade, normImpParCascade, double); +DECLARE_SOA_COLUMN(NormImpParPiFromCharmBar, normImpParPiFromCharmBar, double); +DECLARE_SOA_COLUMN(NormDecayLenCharmBar, normDecayLenCharmBar, double); // -- added --- +DECLARE_SOA_COLUMN(IsPionGlbTrkWoDca, isPionGlbTrkWoDca, bool); +DECLARE_SOA_COLUMN(PionItsNCls, pionItsNCls, uint8_t); +DECLARE_SOA_COLUMN(NTpcRowsPion, nTpcRowsPion, int16_t); // -- added --- +DECLARE_SOA_COLUMN(NTpcRowsKaFromCasc, nTpcRowsKaFromCasc, int16_t); // -- added --- +DECLARE_SOA_COLUMN(NTpcRowsPosV0Dau, nTpcRowsPosV0Dau, int16_t); // -- added --- +DECLARE_SOA_COLUMN(NTpcRowsNegV0Dau, nTpcRowsNegV0Dau, int16_t); // -- added --- +// from creator KF +// DECLARE_SOA_COLUMN(NSigmaTPCPiFromOmegac, nSigmaTPCPiFromOmegac, float); +// DECLARE_SOA_COLUMN(NSigmaTOFPiFromOmegac, nSigmaTOFPiFromOmegac, float); +// DECLARE_SOA_COLUMN(NSigmaTPCKaFromCasc, nSigmaTPCKaFromCasc, float); +// DECLARE_SOA_COLUMN(NSigmaTOFKaFromCasc, nSigmaTOFKaFromCasc, float); +// DECLARE_SOA_COLUMN(NSigmaTPCPiFromV0, nSigmaTPCPiFromV0, float); +// DECLARE_SOA_COLUMN(NSigmaTPCPrFromV0, nSigmaTPCPrFromV0, float); +DECLARE_SOA_COLUMN(KfDcaXYPiFromOmegac, kfDcaXYPiFromOmegac, float); +DECLARE_SOA_COLUMN(KfDcaXYCascToPv, kfDcaXYCascToPv, float); +DECLARE_SOA_COLUMN(Chi2GeoV0, chi2GeoV0, float); +DECLARE_SOA_COLUMN(Chi2GeoCasc, chi2GeoCasc, float); +DECLARE_SOA_COLUMN(Chi2GeoOmegac, chi2GeoOmegac, float); +DECLARE_SOA_COLUMN(Chi2MassV0, chi2MassV0, float); +DECLARE_SOA_COLUMN(Chi2MassCasc, chi2MassCasc, float); +DECLARE_SOA_COLUMN(V0ldl, v0ldl, float); +DECLARE_SOA_COLUMN(Cascldl, cascldl, float); +DECLARE_SOA_COLUMN(Omegacldl, omegacldl, float); +DECLARE_SOA_COLUMN(Chi2TopoV0ToPv, chi2TopoV0ToPv, float); +DECLARE_SOA_COLUMN(Chi2TopoCascToPv, chi2TopoCascToPv, float); +DECLARE_SOA_COLUMN(Chi2TopoPiFromOmegacToPv, chi2TopoPiFromOmegacToPv, float); +DECLARE_SOA_COLUMN(Chi2TopoOmegacToPv, chi2TopoOmegacToPv, float); +// DECLARE_SOA_COLUMN(DeviationPiFromOmegacToPv, deviationPiFromOmegacToPv, float); +DECLARE_SOA_COLUMN(Chi2TopoV0ToCasc, chi2TopoV0ToCasc, float); +DECLARE_SOA_COLUMN(Chi2TopoCascToOmegac, chi2TopoCascToOmegac, float); +DECLARE_SOA_COLUMN(DecayLenXYLambda, decayLenXYLambda, float); +DECLARE_SOA_COLUMN(DecayLenXYCasc, decayLenXYCasc, float); +DECLARE_SOA_COLUMN(DecayLenXYOmegac, decayLenXYOmegac, float); +DECLARE_SOA_COLUMN(CosPaV0ToCasc, cosPaV0ToCasc, float); +DECLARE_SOA_COLUMN(CosPaV0ToPv, cosPaV0ToPv, float); +DECLARE_SOA_COLUMN(CosPaCascToOmegac, cosPaCascToOmegac, float); +DECLARE_SOA_COLUMN(CosPaCascToPv, cosPaCascToPv, float); +DECLARE_SOA_COLUMN(CosPaOmegacToPv, cosPaOmegacToPv, float); +DECLARE_SOA_COLUMN(KfRapOmegac, kfRapOmegac, float); +DECLARE_SOA_COLUMN(KfptPiFromOmegac, kfptPiFromOmegac, float); +DECLARE_SOA_COLUMN(KfptOmegac, kfptOmegac, float); +DECLARE_SOA_COLUMN(CosThetaStarPiFromOmegac, cosThetaStarPiFromOmegac, float); +DECLARE_SOA_COLUMN(CtOmegac, ctOmegac, float); +DECLARE_SOA_COLUMN(EtaOmegac, etaOmegac, float); +DECLARE_SOA_COLUMN(V0Ndf, v0Ndf, float); +DECLARE_SOA_COLUMN(CascNdf, cascNdf, float); +DECLARE_SOA_COLUMN(OmegacNdf, omegacNdf, float); +DECLARE_SOA_COLUMN(MassV0Ndf, massV0Ndf, float); +DECLARE_SOA_COLUMN(MassCascNdf, massCascNdf, float); +DECLARE_SOA_COLUMN(V0Chi2OverNdf, v0Chi2OverNdf, float); +DECLARE_SOA_COLUMN(CascChi2OverNdf, cascChi2OverNdf, float); +DECLARE_SOA_COLUMN(OmegacChi2OverNdf, omegacChi2OverNdf, float); +DECLARE_SOA_COLUMN(MassV0Chi2OverNdf, massV0Chi2OverNdf, float); +DECLARE_SOA_COLUMN(MassCascChi2OverNdf, massCascChi2OverNdf, float); +DECLARE_SOA_COLUMN(CascRejectInvmass, cascRejectInvmass, float); +// from creator - MC +DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); // reconstruction level +DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t); +DECLARE_SOA_COLUMN(CollisionMatched, collisionMatched, bool); +// from selector +DECLARE_SOA_COLUMN(StatusPidLambda, statusPidLambda, bool); // --- added --- +DECLARE_SOA_COLUMN(StatusPidCascade, statusPidCascade, bool); // --- added --- +DECLARE_SOA_COLUMN(StatusPidCharmBaryon, statusPidCharmBaryon, bool); // --- added --- +DECLARE_SOA_COLUMN(StatusInvMassLambda, statusInvMassLambda, bool); // --- added --- +DECLARE_SOA_COLUMN(StatusInvMassCascade, statusInvMassCascade, bool); // --- added --- +DECLARE_SOA_COLUMN(StatusInvMassCharmBaryon, statusInvMassCharmBaryon, bool); // --- added --- +DECLARE_SOA_COLUMN(ResultSelections, resultSelections, bool); // --- added --- +DECLARE_SOA_COLUMN(PidTpcInfoStored, pidTpcInfoStored, int); +DECLARE_SOA_COLUMN(PidTofInfoStored, pidTofInfoStored, int); +DECLARE_SOA_COLUMN(TpcNSigmaPiFromCharmBaryon, tpcNSigmaPiFromCharmBaryon, float); +DECLARE_SOA_COLUMN(TpcNSigmaKaFromCasc, tpcNSigmaKaFromCasc, float); +DECLARE_SOA_COLUMN(TpcNSigmaPiFromLambda, tpcNSigmaPiFromLambda, float); +DECLARE_SOA_COLUMN(TpcNSigmaPrFromLambda, tpcNSigmaPrFromLambda, float); +DECLARE_SOA_COLUMN(TofNSigmaPiFromCharmBaryon, tofNSigmaPiFromCharmBaryon, float); +DECLARE_SOA_COLUMN(TofNSigmaKaFromCasc, tofNSigmaKaFromCasc, float); +DECLARE_SOA_COLUMN(TofNSigmaPiFromLambda, tofNSigmaPiFromLambda, float); +DECLARE_SOA_COLUMN(TofNSigmaPrFromLambda, tofNSigmaPrFromLambda, float); +} // namespace full + +DECLARE_SOA_TABLE(HfToOmegaPiEvs, "AOD", "HFTOOMEPIEV", + full::IsEventSel8, full::IsEventSelZ); + +DECLARE_SOA_TABLE(HfOmegac0ToOmegaPiLites, "AOD", "HFTOOMEGAPILITE", + // full::XPv, full::YPv, full::ZPv, collision::NumContrib, collision::Chi2, cent::CentFT0M, + full::XPv, full::YPv, full::ZPv, full::Centrality, collision::NumContrib, collision::Chi2, // --- added --- + full::XDecayVtxCharmBaryon, full::YDecayVtxCharmBaryon, full::ZDecayVtxCharmBaryon, + full::XDecayVtxCascade, full::YDecayVtxCascade, full::ZDecayVtxCascade, + full::XDecayVtxV0, full::YDecayVtxV0, full::ZDecayVtxV0, + full::SignDecay, + full::PtCharmBaryon, full::PtPiFromCharmBaryon, + full::PxCharmBaryon, full::PyCharmBaryon, full::PzCharmBaryon, + full::PxPiFromCharmBaryon, full::PyPiFromCharmBaryon, full::PzPiFromCharmBaryon, + full::PxKaFromCasc, full::PyKaFromCasc, full::PzKaFromCasc, + full::PxPosV0Dau, full::PyPosV0Dau, full::PzPosV0Dau, + full::PxNegV0Dau, full::PyNegV0Dau, full::PzNegV0Dau, + full::ImpactParCascXY, full::ImpactParPiFromCharmBaryonXY, + full::ErrImpactParCascXY, full::ErrImpactParPiFromCharmBaryonXY, + full::InvMassLambda, full::InvMassCascade, full::InvMassCharmBaryon, + full::CosPAV0, full::CosPACharmBaryon, full::CosPACasc, // --- added --- + full::EtaV0PosDau, full::EtaV0NegDau, full::EtaKaFromCasc, full::EtaPiFromCharmBaryon, full::EtaCharmBaryon, + full::DcaXYToPvV0Dau0, full::DcaXYToPvV0Dau1, full::DcaXYToPvCascDau, + full::DcaCascDau, full::DcaV0Dau, full::DcaCharmBaryonDau, + full::ErrorDecayLengthCharmBaryon, full::NormImpParCascade, full::NormImpParPiFromCharmBar, + full::IsPionGlbTrkWoDca, full::PionItsNCls, + full::NTpcRowsPion, full::NTpcRowsKaFromCasc, full::NTpcRowsPosV0Dau, full::NTpcRowsNegV0Dau, + full::StatusPidLambda, full::StatusPidCascade, full::StatusPidCharmBaryon, + full::StatusInvMassLambda, full::StatusInvMassCascade, full::StatusInvMassCharmBaryon, full::ResultSelections, + full::PidTpcInfoStored, full::PidTofInfoStored, + full::TpcNSigmaPiFromCharmBaryon, full::TpcNSigmaKaFromCasc, full::TpcNSigmaPiFromLambda, full::TpcNSigmaPrFromLambda, + full::TofNSigmaPiFromCharmBaryon, full::TofNSigmaKaFromCasc, full::TofNSigmaPiFromLambda, full::TofNSigmaPrFromLambda, + // full::FlagMcMatchRec, full::OriginMcRec, full::CollisionMatched, hf_track_index::HFflag); + full::FlagMcMatchRec, full::OriginMcRec, full::CollisionMatched); + +DECLARE_SOA_TABLE(HfKfOmegacFulls, "AOD", "HFKFOMEGACFULL", + full::Centrality, // --- added --- + // full::StatusPidLambda, full::StatusPidCascade, full::StatusPidCharmBaryon, // --- added --- + // full::StatusInvMassLambda, full::StatusInvMassCascade, full::StatusInvMassCharmBaryon, // --- added --- + // full::NSigmaTPCPiFromOmegac, full::NSigmaTOFPiFromOmegac, full::NSigmaTPCKaFromCasc, full::NSigmaTOFKaFromCasc, + // full::NSigmaTPCPiFromV0, full::NSigmaTPCPrFromV0, + full::TpcNSigmaPiFromCharmBaryon, full::TofNSigmaPiFromCharmBaryon, full::TpcNSigmaKaFromCasc, full::TofNSigmaKaFromCasc, // --- added --- + full::TpcNSigmaPiFromLambda, full::TofNSigmaPiFromLambda, full::TpcNSigmaPrFromLambda, full::TofNSigmaPrFromLambda, // --- added --- + full::KfDcaXYPiFromOmegac, full::DcaCascDau, full::DcaV0Dau, full::DcaCharmBaryonDau, full::KfDcaXYCascToPv, + full::DcaXYToPvV0Dau0, full::DcaXYToPvV0Dau1, full::DcaXYToPvCascDau, + full::Chi2GeoV0, full::Chi2GeoCasc, full::Chi2GeoOmegac, + full::Chi2MassV0, full::Chi2MassCasc, + full::V0ldl, full::Cascldl, full::Omegacldl, + full::Chi2TopoV0ToPv, full::Chi2TopoCascToPv, full::Chi2TopoPiFromOmegacToPv, full::Chi2TopoOmegacToPv, // full::DeviationPiFromOmegacToPv, + full::Chi2TopoV0ToCasc, full::Chi2TopoCascToOmegac, + full::DecayLenXYLambda, full::DecayLenXYCasc, full::DecayLenXYOmegac, + full::CosPaV0ToCasc, full::CosPaV0ToPv, full::CosPaCascToOmegac, full::CosPaCascToPv, full::CosPaOmegacToPv, + full::InvMassLambda, full::InvMassCascade, full::InvMassCharmBaryon, + full::KfRapOmegac, full::KfptPiFromOmegac, full::KfptOmegac, + full::CosThetaStarPiFromOmegac, full::CtOmegac, full::EtaOmegac, + full::V0Ndf, full::CascNdf, full::OmegacNdf, + full::MassV0Ndf, full::MassCascNdf, + full::V0Chi2OverNdf, full::CascChi2OverNdf, full::OmegacChi2OverNdf, + full::MassV0Chi2OverNdf, full::MassCascChi2OverNdf, full::CascRejectInvmass, + full::ResultSelections, // --- added --- + // full::FlagMcMatchRec, full::OriginMcRec, full::CollisionMatched, hf_track_index::HFflag, collision::NumContrib, cent::CentFT0M); + full::FlagMcMatchRec, full::OriginMcRec, full::CollisionMatched); + +DECLARE_SOA_TABLE(HfKfOmegacLites, "AOD", "HFKFOMEGACLITE", + // full::NSigmaTPCPiFromOmegac, full::NSigmaTOFPiFromOmegac, full::NSigmaTPCKaFromCasc, full::NSigmaTOFKaFromCasc, + // full::NSigmaTPCPiFromV0, full::NSigmaTPCPrFromV0, + full::Centrality, + full::TpcNSigmaPiFromCharmBaryon, full::TofNSigmaPiFromCharmBaryon, + full::TpcNSigmaKaFromCasc, full::TofNSigmaKaFromCasc, + full::TpcNSigmaPiFromLambda, full::TofNSigmaPiFromLambda, + full::TpcNSigmaPrFromLambda, full::TofNSigmaPrFromLambda, + full::KfDcaXYPiFromOmegac, full::DcaCharmBaryonDau, full::KfDcaXYCascToPv, full::DcaCascDau, + full::V0ldl, full::Cascldl, full::Omegacldl, full::Chi2TopoPiFromOmegacToPv, full::Chi2TopoOmegacToPv, // full::DeviationPiFromOmegacToPv, + full::DecayLenXYOmegac, + full::CosPaCascToPv, full::CosPaOmegacToPv, + full::InvMassCascade, full::InvMassCharmBaryon, + full::KfptPiFromOmegac, full::KfptOmegac, + full::CosThetaStarPiFromOmegac, full::CtOmegac, full::EtaOmegac, + full::V0Chi2OverNdf, full::CascChi2OverNdf, full::OmegacChi2OverNdf, + full::CascRejectInvmass, + full::ResultSelections, // --- added --- + // full::FlagMcMatchRec, full::OriginMcRec, full::CollisionMatched, hf_track_index::HFflag, collision::NumContrib, cent::CentFT0M); + full::FlagMcMatchRec, full::OriginMcRec, full::CollisionMatched); +} // namespace o2::aod + +/// Writes the full information in an output TTree +struct HfTreeCreatorToOmegaPiQa { + + Produces rowCandidateLite; + Produces rowKfCandidateFull; + Produces rowKfCandidateLite; + Produces rowEv; + + Configurable zPvCut{"zPvCut", 10., "Cut on absolute value of primary vertex z coordinate"}; + Configurable keepOnlyMcSignal{"keepOnlyMcSignal", true, "Fill MC tree only with signal candidates"}; + + // using Tracks = soa::Join; + using MyTrackTable = soa::Join; + + using CandSel = soa::Filtered>; + using CandKfSel = soa::Filtered>; + using CandMcSel = soa::Filtered>; + using CandKfMcSel = soa::Filtered>; + + // using Colls = soa::Join; + // using CollsWithFT0M = soa::Join; + using MyEventTable = soa::Join; + using MyEventTableWithFT0M = soa::Join; + using CollsWithMcLabels = soa::Join; + using McCollsWithFT0M = soa::Join; + + Filter filterOmegaCToOmegaPiFlag = (o2::aod::hf_track_index::hfflag & static_cast(BIT(aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi))) != static_cast(0); + + void init(InitContext const&) + { + } + + ////////////////////////////////////////////////////// + // // + // Fill functions to fill in the tables // + // // + ////////////////////////////////////////////////////// + + // template + // void fillEvent(const C& collision, float cutZPv) + template // --- added --- + void fillEvent(const T& collision, float cutZPv) // --- added --- + { + rowEv(collision.sel8(), std::abs(collision.posZ()) < cutZPv); + } + + template // --- added --- + void fillCandidate(const T& candidate, int8_t flagMc, int8_t originMc, bool collisionMatched, float centrality = -999.f) + { + + // save all candidate information + if constexpr (useCentrality) { + if (centrality < -998.f) { + auto const& collision = candidate.template collision_as(); + centrality = o2::hf_centrality::getCentralityColl(collision); + } + } + + if constexpr (svReco == DCAFITTER) { // --- added --- + if constexpr (tableSize == LITE) { // --- added --- + rowCandidateLite(candidate.xPv(), + candidate.yPv(), + candidate.zPv(), + centrality, + candidate.template collision_as().numContrib(), + candidate.template collision_as().chi2(), + candidate.xDecayVtxCharmBaryon(), + candidate.yDecayVtxCharmBaryon(), + candidate.zDecayVtxCharmBaryon(), + candidate.xDecayVtxCascade(), + candidate.yDecayVtxCascade(), + candidate.zDecayVtxCascade(), + candidate.xDecayVtxV0(), + candidate.yDecayVtxV0(), + candidate.zDecayVtxV0(), + candidate.signDecay(), + RecoDecay::pt(candidate.pxCharmBaryon(), candidate.pyCharmBaryon()), // --- added --- + RecoDecay::pt(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()), // --- added --- + candidate.pxCharmBaryon(), + candidate.pyCharmBaryon(), + candidate.pzCharmBaryon(), + candidate.pxBachFromCharmBaryon(), + candidate.pyBachFromCharmBaryon(), + candidate.pzBachFromCharmBaryon(), + candidate.pxBachFromCasc(), + candidate.pyBachFromCasc(), + candidate.pzBachFromCasc(), + candidate.pxPosV0Dau(), + candidate.pyPosV0Dau(), + candidate.pzPosV0Dau(), + candidate.pxNegV0Dau(), + candidate.pyNegV0Dau(), + candidate.pzNegV0Dau(), + candidate.impactParCascXY(), + candidate.impactParBachFromCharmBaryonXY(), + candidate.errImpactParCascXY(), + candidate.errImpactParBachFromCharmBaryonXY(), + candidate.invMassLambda(), + candidate.invMassCascade(), + candidate.invMassCharmBaryon(), + candidate.cosPAV0(), // --- added --- + candidate.cosPACharmBaryon(), // --- added --- + candidate.cosPACasc(), // --- added --- + candidate.etaV0PosDau(), + candidate.etaV0NegDau(), + candidate.etaBachFromCasc(), + candidate.etaBachFromCharmBaryon(), + candidate.etaCharmBaryon(), + candidate.dcaXYToPvV0Dau0(), + candidate.dcaXYToPvV0Dau1(), + candidate.dcaXYToPvCascDau(), + candidate.dcaCascDau(), + candidate.dcaV0Dau(), + candidate.dcaCharmBaryonDau(), + candidate.errorDecayLengthCharmBaryon(), + candidate.impactParCascXY() / candidate.errImpactParCascXY(), + candidate.impactParBachFromCharmBaryonXY() / candidate.errImpactParBachFromCharmBaryonXY(), + candidate.template bachelorFromCharmBaryon_as().isGlobalTrackWoDCA(), + candidate.template bachelorFromCharmBaryon_as().itsNCls(), + candidate.template bachelorFromCharmBaryon_as().tpcNClsCrossedRows(), // --- added --- + candidate.template bachelor_as().tpcNClsCrossedRows(), // --- added --- + candidate.template posTrack_as().tpcNClsCrossedRows(), // --- added --- + candidate.template negTrack_as().tpcNClsCrossedRows(), // --- added --- + candidate.statusPidLambda(), // --- added --- + candidate.statusPidCascade(), // --- added --- + candidate.statusPidCharmBaryon(), // --- added --- + candidate.statusInvMassLambda(), // --- added --- + candidate.statusInvMassCascade(), // --- added --- + candidate.statusInvMassCharmBaryon(), // --- added --- + candidate.resultSelections(), // --- added --- + candidate.pidTpcInfoStored(), + candidate.pidTofInfoStored(), + candidate.tpcNSigmaPiFromCharmBaryon(), + candidate.tpcNSigmaKaFromCasc(), + candidate.tpcNSigmaPiFromLambda(), + candidate.tpcNSigmaPrFromLambda(), + candidate.tofNSigmaPiFromCharmBaryon(), + candidate.tofNSigmaKaFromCasc(), + candidate.tofNSigmaPiFromLambda(), + candidate.tofNSigmaPrFromLambda(), + flagMc, + originMc, + collisionMatched); + } else { + // Not available yet + } + } else { // --- added --- + if constexpr (tableSize == LITE) { + rowKfCandidateLite( + centrality, + candidate.tpcNSigmaPiFromCharmBaryon(), + candidate.tofNSigmaPiFromCharmBaryon(), + candidate.tpcNSigmaKaFromCasc(), + candidate.tofNSigmaKaFromCasc(), + candidate.tpcNSigmaPiFromLambda(), + candidate.tofNSigmaPiFromLambda(), + candidate.tpcNSigmaPrFromLambda(), + candidate.tofNSigmaPrFromLambda(), + candidate.kfDcaXYPiFromOmegac(), + candidate.dcaCharmBaryonDau(), + candidate.kfDcaXYCascToPv(), + candidate.dcaCascDau(), + candidate.v0ldl(), + candidate.cascldl(), + candidate.omegacldl(), + candidate.chi2TopoPiFromOmegacToPv(), + candidate.chi2TopoOmegacToPv(), + candidate.decayLenXYOmegac(), + candidate.cosPACasc(), + candidate.cosPACharmBaryon(), + candidate.invMassCascade(), + candidate.invMassCharmBaryon(), + candidate.kfptPiFromOmegac(), + candidate.kfptOmegac(), + candidate.cosThetaStarPiFromOmegac(), + candidate.cTauOmegac(), + candidate.etaCharmBaryon(), + candidate.v0Chi2OverNdf(), + candidate.cascChi2OverNdf(), + candidate.omegacChi2OverNdf(), + candidate.cascRejectInvmass(), + candidate.resultSelections(), + flagMc, + originMc, + collisionMatched); + } else { + rowKfCandidateFull(centrality, // --- added --- + candidate.tpcNSigmaPiFromCharmBaryon(), + candidate.tofNSigmaPiFromCharmBaryon(), + candidate.tpcNSigmaKaFromCasc(), + candidate.tofNSigmaKaFromCasc(), + candidate.tpcNSigmaPiFromLambda(), + candidate.tofNSigmaPiFromLambda(), + candidate.tpcNSigmaPrFromLambda(), + candidate.tofNSigmaPrFromLambda(), + candidate.kfDcaXYPiFromOmegac(), + candidate.dcaCascDau(), + candidate.dcaV0Dau(), + candidate.dcaCharmBaryonDau(), + candidate.kfDcaXYCascToPv(), + candidate.dcaXYToPvV0Dau0(), + candidate.dcaXYToPvV0Dau1(), + candidate.dcaXYToPvCascDau(), + candidate.chi2GeoV0(), + candidate.chi2GeoCasc(), + candidate.chi2GeoOmegac(), + candidate.chi2MassV0(), + candidate.chi2MassCasc(), + candidate.v0ldl(), + candidate.cascldl(), + candidate.omegacldl(), + candidate.chi2TopoV0ToPv(), + candidate.chi2TopoCascToPv(), + candidate.chi2TopoPiFromOmegacToPv(), + candidate.chi2TopoOmegacToPv(), + // candidate.deviationPiFromOmegacToPv(), + candidate.chi2TopoV0ToCasc(), + candidate.chi2TopoCascToOmegac(), + candidate.decayLenXYLambda(), + candidate.decayLenXYCasc(), + candidate.decayLenXYOmegac(), + candidate.cosPaV0ToCasc(), + candidate.cosPAV0(), + candidate.cosPaCascToOmegac(), + candidate.cosPACasc(), + candidate.cosPACharmBaryon(), + candidate.invMassLambda(), + candidate.invMassCascade(), + candidate.invMassCharmBaryon(), + candidate.kfRapOmegac(), + candidate.kfptPiFromOmegac(), + candidate.kfptOmegac(), + candidate.cosThetaStarPiFromOmegac(), + candidate.cTauOmegac(), + candidate.etaCharmBaryon(), + candidate.v0Ndf(), + candidate.cascNdf(), + candidate.omegacNdf(), + candidate.massV0Ndf(), + candidate.massCascNdf(), + candidate.v0Chi2OverNdf(), + candidate.cascChi2OverNdf(), + candidate.omegacChi2OverNdf(), + candidate.massV0Chi2OverNdf(), + candidate.massCascChi2OverNdf(), + candidate.cascRejectInvmass(), + candidate.resultSelections(), + flagMc, + originMc, + collisionMatched); + // candidate.hfflag(), + // candidate.template collision_as().numContrib(), + // centFt0m); + } + } + } + + // template + // void fillKfCandidateLite(const P& candidate, const C&, int8_t flagMc, int8_t originMc, bool collisionMatched, float centFt0m) + // { + // if (candidate.resultSelections() && candidate.statusPidCharmBaryon() && candidate.statusInvMassLambda() && candidate.statusInvMassCascade() && candidate.statusInvMassCharmBaryon()) { + + // rowKfCandidateLite( + // candidate.tpcNSigmaPiFromCharmBaryon(), + // candidate.tofNSigmaPiFromCharmBaryon(), + // candidate.tpcNSigmaKaFromCasc(), + // candidate.tofNSigmaKaFromCasc(), + // candidate.tpcNSigmaPiFromLambda(), + // candidate.tpcNSigmaPrFromLambda(), + // candidate.kfDcaXYPiFromOmegac(), + // candidate.dcaCharmBaryonDau(), + // candidate.kfDcaXYCascToPv(), + // candidate.dcaCascDau(), + // candidate.v0ldl(), + // candidate.cascldl(), + // candidate.omegacldl(), + // candidate.chi2TopoPiFromOmegacToPv(), + // candidate.chi2TopoOmegacToPv(), + // candidate.deviationPiFromOmegacToPv(), + // candidate.decayLenXYOmegac(), + // candidate.cosPACasc(), + // candidate.cosPACharmBaryon(), + // candidate.invMassCascade(), + // candidate.invMassCharmBaryon(), + // candidate.kfptPiFromOmegac(), + // candidate.kfptOmegac(), + // candidate.cosThetaStarPiFromOmegac(), + // candidate.cTauOmegac(), + // candidate.etaCharmBaryon(), + // candidate.v0Chi2OverNdf(), + // candidate.cascChi2OverNdf(), + // candidate.omegacChi2OverNdf(), + // candidate.cascRejectInvmass(), + // flagMc, + // originMc, + // collisionMatched, + // candidate.hfflag(), + // candidate.template collision_as().numContrib(), + // centFt0m); + // } + // } // fillKfCandidateLite end + + //////////////////////////////////// + // // + // Process functions // + // // + //////////////////////////////////// + + //*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*// + //*~~~~~~~Data with DCAFitter~~~~~~~~*// + //*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*// + + // void processData(Colls const& collisions, + // CandSel const& candidates, + // Tracks const&) + void processDataLite(MyEventTable const& collisions, + MyTrackTable const&, + CandSel const& candidates) + { + // Filling event properties + rowEv.reserve(collisions.size()); + for (const auto& collision : collisions) { + // fillEvent(collision, zPvCut); + fillEvent(collision, zPvCut); + } + + // Filling candidate properties + rowCandidateLite.reserve(candidates.size()); + for (const auto& candidate : candidates) { + // fillCandidateLite(candidate, collisions, -7, RecoDecay::OriginType::None, false, -1.); + fillCandidate(candidate, -7, RecoDecay::OriginType::None, false); // --- added --- + } + } + // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processData, "Process data", false); + + // void processDataCent(CollsWithFT0M const& collisions, + // CandSel const& candidates, + // Tracks const&) + void processDataLiteCent(MyEventTableWithFT0M const& collisions, + MyTrackTable const&, + CandSel const& candidates) + { + // Filling event properties + rowEv.reserve(collisions.size()); + for (const auto& collision : collisions) { + // fillEvent(collision, zPvCut); + fillEvent(collision, zPvCut); + } + + // Filling candidate properties + rowCandidateLite.reserve(candidates.size()); + for (const auto& candidate : candidates) { + // auto collision = candidate.collision_as(); + // float centFt0m = o2::hf_centrality::getCentralityColl(collision); + // fillCandidateLite(candidate, collisions, -7, RecoDecay::OriginType::None, false, centFt0m); + fillCandidate(candidate, -7, RecoDecay::OriginType::None, false); // --- added --- + } + } + // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processDataCent, "Process data with FT0M info", false); + + PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processDataLite, "Process data and produce lite table version", true); + PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processDataLiteCent, "Process data and produce lite table version with FT0M", false); + + //*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*// + //*~~~~~~~Data with KFParticle~~~~~~~~*// + //*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*// + + // void processKfData(Colls const& collisions, + // CandKfSel const& candidates) + void processKfData(MyEventTable const& collisions, + MyTrackTable const&, // --- added --- + CandKfSel const& candidates) + { + // Filling event properties + rowEv.reserve(collisions.size()); + for (const auto& collision : collisions) { + // fillEvent(collision, zPvCut); + fillEvent(collision, zPvCut); + } + + // Filling candidate properties + rowKfCandidateFull.reserve(candidates.size()); + for (const auto& candidate : candidates) { + // fillKfCandidate(candidate, collisions, -7, RecoDecay::OriginType::None, false, -1.); + fillCandidate(candidate, -7, RecoDecay::OriginType::None, false); // --- added --- + } + } + // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processKfData, "Process KF data", false); + + // void processKfDataLite(Colls const& collisions, + // CandKfSel const& candidates) + void processKfDataLite(MyEventTable const& collisions, + MyTrackTable const&, // --- added --- + CandKfSel const& candidates) + { + // Filling event properties + rowEv.reserve(collisions.size()); + for (const auto& collision : collisions) { + // fillEvent(collision, zPvCut); + fillEvent(collision, zPvCut); + } + + // Filling candidate properties + rowKfCandidateLite.reserve(candidates.size()); + for (const auto& candidate : candidates) { + // fillKfCandidateLite(candidate, collisions, -7, RecoDecay::OriginType::None, false, -1.); + fillCandidate(candidate, -7, RecoDecay::OriginType::None, false); + } + } + // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processKfDataLite, "Process KF data lite", false); + + // void processKfDataCent(CollsWithFT0M const& collisions, + // CandKfSel const& candidates) + void processKfDataCent(MyEventTableWithFT0M const& collisions, + MyTrackTable const&, // --- added --- + CandKfSel const& candidates) + { + // Filling event properties + rowEv.reserve(collisions.size()); + for (const auto& collision : collisions) { + // fillEvent(collision, zPvCut); + fillEvent(collision, zPvCut); + } + + // Filling candidate properties + rowKfCandidateFull.reserve(candidates.size()); + for (const auto& candidate : candidates) { + // auto collision = candidate.collision_as(); + // float centFt0m = o2::hf_centrality::getCentralityColl(collision); + // fillKfCandidate(candidate, collisions, -7, RecoDecay::OriginType::None, false, centFt0m); + fillCandidate(candidate, -7, RecoDecay::OriginType::None, false); // --- added --- + } + } + // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processKfDataCent, "Process KF data with FT0M info", false); + + // void processKfDataCentLite(CollsWithFT0M const& collisions, + // CandKfSel const& candidates) + void processKfDataCentLite(MyEventTableWithFT0M const& collisions, + MyTrackTable const&, // --- added --- + CandKfSel const& candidates) + { + // Filling event properties + rowEv.reserve(collisions.size()); + for (const auto& collision : collisions) { + // fillEvent(collision, zPvCut); + fillEvent(collision, zPvCut); + } + + // Filling candidate properties + rowKfCandidateLite.reserve(candidates.size()); + for (const auto& candidate : candidates) { + // auto collision = candidate.collision_as(); + // float centFt0m = o2::hf_centrality::getCentralityColl(collision); + // fillKfCandidateLite(candidate, collisions, -7, RecoDecay::OriginType::None, false, centFt0m); + fillCandidate(candidate, -7, RecoDecay::OriginType::None, false); + } + } + // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processKfDataCentLite, "Process KF data lite with FT0M info", false); + + PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processKfData, "Process KF data, no cent", false); + PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processKfDataLite, "Process KF data lite", false); + PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processKfDataCent, "Process KF data, with FT0M", false); + PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processKfDataCentLite, "Process KF data lite with FT0M", false); + + //*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*// + //*~~~~~~~MC with DCAFitter~~~~~~~~*// + //*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*// + + // void processMc(Colls const& collisions, + // CandMcSel const& candidates, + // Tracks const&) + void processMcLite(MyEventTable const& collisions, + MyTrackTable const&, + CandMcSel const& candidates) + { + // Filling event properties + rowEv.reserve(collisions.size()); + for (const auto& collision : collisions) { + // fillEvent(collision, zPvCut); + fillEvent(collision, zPvCut); + } + + // Filling candidate properties + rowCandidateLite.reserve(candidates.size()); + for (const auto& candidate : candidates) { + if (keepOnlyMcSignal && candidate.originMcRec() == RecoDecay::OriginType::None) { + continue; + } + fillCandidate(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched()); + } + } + // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processMc, "Process MC", false); + + // void processMcCent(CollsWithMcLabels const& collisions, + // CandMcSel const& candidates, + // Tracks const&, + // McCollsWithFT0M const&) + void processMcCentLite(CollsWithMcLabels const& collisions, + MyTrackTable const&, + CandMcSel const& candidates, + McCollsWithFT0M const&) + { + // Filling event properties + rowEv.reserve(collisions.size()); + for (const auto& collision : collisions) { + // fillEvent(collision, zPvCut); + fillEvent(collision, zPvCut); + } + + // Filling candidate properties + rowCandidateLite.reserve(candidates.size()); + for (const auto& candidate : candidates) { + if (keepOnlyMcSignal && candidate.originMcRec() == RecoDecay::OriginType::None) { + continue; + } + auto mcCollision = candidate.collision_as().mcCollision_as(); + float centFt0m = o2::hf_centrality::getCentralityColl(mcCollision); + // fillCandidateLite(candidate, collisions, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched(), centFt0m); + fillCandidate(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched(), centFt0m); + } + } + // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processMcCent, "Process MC with FT0M info", false); + + PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processMcLite, "Process and produce lite table version for omegac0", false); + PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processMcCentLite, "Process MC and produce lite table version for Omegac0 with FT0M", false); + + //*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*// + //*~~~~~~~MC with KFParticle~~~~~~~~*// + //*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*// + + // void processKFMc(Colls const& collisions, + // CandKfMcSel const& candidates) + void processKfMc(MyEventTable const& collisions, + MyTrackTable const&, // --- added --- + CandKfMcSel const& candidates) + + { + // Filling event properties + rowEv.reserve(collisions.size()); + for (const auto& collision : collisions) { + // fillEvent(collision, zPvCut); + fillEvent(collision, zPvCut); // --- added --- + } + + // Filling candidate properties + rowKfCandidateFull.reserve(candidates.size()); + for (const auto& candidate : candidates) { + if (keepOnlyMcSignal && candidate.originMcRec() == RecoDecay::OriginType::None) { + continue; + } + // fillKfCandidate(candidate, collisions, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched(), -1.); + fillCandidate(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched()); // --- added --- + } + } + // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processKFMc, "Process KF MC", false); + + // void processKFMcLite(Colls const& collisions, + // CandKfMcSel const& candidates) + void processKfMcLite(MyEventTable const& collisions, + MyTrackTable const&, // --- added --- + CandKfMcSel const& candidates) + { + // Filling event properties + rowEv.reserve(collisions.size()); + for (const auto& collision : collisions) { + // fillEvent(collision, zPvCut); + fillEvent(collision, zPvCut); + } + + // Filling candidate properties + rowKfCandidateLite.reserve(candidates.size()); + for (const auto& candidate : candidates) { + if (keepOnlyMcSignal && candidate.originMcRec() == RecoDecay::OriginType::None) { + continue; + } + // fillKfCandidateLite(candidate, collisions, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched(), -1.); + fillCandidate(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched()); + } + } + // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processKFMcLite, "Process KF MC Lite", false); + + // void processKFMcCent(CollsWithMcLabels const& collisions, + // CandKfMcSel const& candidates, + // McCollsWithFT0M const&) + void processKfMcCent(CollsWithMcLabels const& collisions, + MyTrackTable const&, // --- added --- + CandKfMcSel const& candidates, + McCollsWithFT0M const&) + { + // Filling event properties + rowEv.reserve(collisions.size()); + for (const auto& collision : collisions) { + // fillEvent(collision, zPvCut); + fillEvent(collision, zPvCut); + } + + // Filling candidate properties + rowKfCandidateFull.reserve(candidates.size()); + for (const auto& candidate : candidates) { + if (keepOnlyMcSignal && candidate.originMcRec() == RecoDecay::OriginType::None) { + continue; + } + auto mcCollision = candidate.collision_as().mcCollision_as(); + float centFt0m = o2::hf_centrality::getCentralityColl(mcCollision); + // fillKfCandidate(candidate, collisions, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched(), centFt0m); + fillCandidate(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched(), centFt0m); + } + } + // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processKFMcCent, "Process KF MC with FT0M info", false); + + // void processKFMcCentLite(CollsWithMcLabels const& collisions, + // CandKfMcSel const& candidates, + // McCollsWithFT0M const&) + void processKfMcCentLite(CollsWithMcLabels const& collisions, + MyTrackTable const&, // --- added --- + CandKfMcSel const& candidates, + McCollsWithFT0M const&) + { + // Filling event properties + rowEv.reserve(collisions.size()); + for (const auto& collision : collisions) { + // fillEvent(collision, zPvCut); + fillEvent(collision, zPvCut); + } + + // Filling candidate properties + rowKfCandidateLite.reserve(candidates.size()); + for (const auto& candidate : candidates) { + if (keepOnlyMcSignal && candidate.originMcRec() == RecoDecay::OriginType::None) { + continue; + } + auto mcCollision = candidate.collision_as().mcCollision_as(); + float centFt0m = o2::hf_centrality::getCentralityColl(mcCollision); + // fillKfCandidateLite(candidate, collisions, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched(), centFt0m); + + fillCandidate(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched(), centFt0m); + } + } + // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processKFMcCentLite, "Process KF MC Lite with FT0M info", false); + + PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processKfMc, "Process KF MC full for Omegac0", false); + PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processKfMcLite, "Process KF MC lite for Omegac0", false); + PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processKfMcCent, "Process KF MC full for Omegac0 with FT0M", false); + PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processKfMcCentLite, "Process KF MC lite for Omegac0 with FT0M", false); +}; // end of struct + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} \ No newline at end of file From 3fedfd7de3bf908f2ac0172f7ebb0eda95323463 Mon Sep 17 00:00:00 2001 From: mariafernandatorrescabrera Date: Wed, 9 Sep 2026 12:40:22 -0500 Subject: [PATCH 06/12] Add OmegaC QA task --- PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx | 554 +++++++++++++++++++++ 1 file changed, 554 insertions(+) create mode 100755 PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx diff --git a/PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx b/PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx new file mode 100755 index 00000000000..957cada2f25 --- /dev/null +++ b/PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx @@ -0,0 +1,554 @@ +// 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 taskOmegac0ToOmegaPiQa.cxx +/// \brief OmegaC0 analysis task +/// \author Yunfan Liu , China University of Geosciences +/// \author Fabio Catalano , University of Houston +/// \author Maria Fernanda Torres Cabrera , University of Houston + +#include "PWGHF/Core/CentralityEstimation.h" +#include "PWGHF/Core/DecayChannelsLegacy.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/DataModel/TrackIndexSkimmingTables.h" +#include "PWGLF/DataModel/mcCentrality.h" + +#include "Common/Core/RecoDecay.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" + +#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; + +namespace o2::aod +{ +namespace ml +{ +DECLARE_SOA_COLUMN(InvMassCharmBaryon, invMassCharmBaryon, float); +DECLARE_SOA_COLUMN(KfptOmegac, kfptOmegac, float); +DECLARE_SOA_COLUMN(KfptPiFromOmegac, kfptPiFromOmegac, float); +DECLARE_SOA_COLUMN(MlProbOmegac, mlProbOmegac, float); +DECLARE_SOA_COLUMN(Cent, cent, float); +} // namespace ml +DECLARE_SOA_TABLE(HfKfOmegacML, "AOD", "HFKFOMEGACML", + ml::InvMassCharmBaryon, ml::KfptOmegac, ml::KfptPiFromOmegac, ml::MlProbOmegac, ml::Cent); +} // namespace o2::aod + +/// Omegac0 analysis task +struct HfTaskOmegac0ToOmegaPiQa { + Produces kfCandMl; + + Configurable selectionFlagOmegac0{"selectionFlagOmegac0", true, "Select Omegac0 candidates"}; + Configurable yCandGenMax{"yCandGenMax", 0.5, "Max. gen particle rapidity"}; + Configurable yCandRecoMax{"yCandRecoMax", 0.8, "Max. cand. rapidity"}; + Configurable fillTree{"fillTree", false, "Fill tree for local analysis (enabled only with ML)"}; + + SliceCache cache; + + using Omegac0Cands = soa::Filtered>; + using Omegac0CandsKF = soa::Filtered>; + using Omegac0CandsMc = soa::Filtered>; + using OmegaC0CandsMcKF = soa::Filtered>; + using Omegac0CandsMl = soa::Filtered>; + using Omegac0CandsMlKF = soa::Filtered>; + using Omegac0CandsMlMcKF = soa::Filtered>; + + using Omegac0Gen = soa::Filtered>; + + using Collisions = soa::Join; + using CollisionsWithFT0C = soa::Join; + using CollisionsWithFT0M = soa::Join; + using CollisionsWithMcLabels = soa::Join; + + using McCollisionsWithFT0M = soa::Join; + + Filter filterOmegaCToOmegaPiFlag = (aod::hf_track_index::hfflag & static_cast(BIT(aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi))) != static_cast(0); + Filter filterOmegaCMatchedRec = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaPi)); + Filter filterOmegaCMatchedGen = nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(BIT(aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaPi)); + + Preslice candOmegacPerCollision = aod::hf_cand_xic0_omegac0::collisionId; + Preslice candOmegacKFPerCollision = aod::hf_cand_xic0_omegac0::collisionId; + // Preslice candOmegacMlPerCollision = aod::hf_cand_xic0_omegac0::collisionId; // Implementation still needed for ML DCAFitter + Preslice candOmegacKFMlPerCollision = aod::hf_cand_xic0_omegac0::collisionId; + + PresliceUnsorted colPerMcCollision = aod::mccollisionlabel::mcCollisionId; + + ConfigurableAxis thnConfigAxisMass{"thnConfigAxisMass", {700, 2.4, 3.1}, "Cand. inv. mass"}; + ConfigurableAxis thnConfigAxisPt{"thnConfigAxisPt", {500, 0, 50}, "Cand. pT"}; + ConfigurableAxis thnConfigAxisPtB{"thnConfigAxisPtB", {500, 0, 50}, "Cand. beauty mother pT"}; + ConfigurableAxis thnConfigAxisY{"thnConfigAxisY", {20, -1, 1}, "Cand. rapidity"}; + ConfigurableAxis thnConfigAxisOrigin{"thnConfigAxisOrigin", {3, -0.5, 2.5}, "Cand. origin"}; + ConfigurableAxis thnConfigAxisMatchFlag{"thnConfigAxisMatchFlag", {15, -7.5, 7.5}, "Cand. MC match flag"}; + ConfigurableAxis thnConfigAxisNumPvContr{"thnConfigAxisNumPvContr", {200, -0.5, 199.5}, "Coll. num. PV contributors"}; + ConfigurableAxis thnConfigAxisCent{"thnConfigAxisCent", {100, 0, 100}, "Coll. centrality precentile"}; + ConfigurableAxis thnConfigAxisPromptScore{"thnConfigAxisPromptScore", {100, 0, 1}, "Prompt score"}; + HistogramRegistry registry{"registry", {}}; + + void init(InitContext&) + { + std::array doprocess{doprocessDataDCAFitter, doprocessDataDCAFitterFT0C, doprocessDataDCAFitterFT0M, + doprocessDataKFParticle, doprocessDataKFParticleMl, doprocessDataKFParticleFT0C, doprocessDataKFParticleMlFT0C, + doprocessDataKFParticleFT0M, doprocessDataKFParticleMlFT0M, + doprocessMcDCAFitter, doprocessMcDCAFitterFT0M, + doprocessMcKFParticle, doprocessMcKFParticleMl, + doprocessMcKFParticleFT0M, doprocessMcKFParticleMlFT0M}; + if ((std::accumulate(doprocess.begin(), doprocess.end(), 0)) != 1) { + LOGP(fatal, "One and only one process function should be enabled at a time."); + } + + const AxisSpec thnAxisMass{thnConfigAxisMass, "Inv. mass (#Omega#pi) (GeV/#it{c}^{2})"}; + const AxisSpec thnAxisPt{thnConfigAxisPt, "#it{p}_{T} (GeV/#it{c})"}; + const AxisSpec thnAxisPtB{thnConfigAxisPtB, "#it{p}_{T}^{B} (GeV/#it{c})"}; + const AxisSpec thnAxisY{thnConfigAxisY, "y"}; + const AxisSpec thnAxisOrigin{thnConfigAxisOrigin, "Origin"}; + const AxisSpec thnAxisMatchFlag{thnConfigAxisMatchFlag, "MC match flag"}; + const AxisSpec thnAxisNumPvContr{thnConfigAxisNumPvContr, "Number of primary vtx. contributors"}; + const AxisSpec thnAxisCent{thnConfigAxisCent, "Centrality percentile"}; + const AxisSpec thnAxisCentMc{thnConfigAxisCent, "Centrality percentile (from gen. MC info)"}; + const AxisSpec thnAxisPromptScore{thnConfigAxisPromptScore, "BDT score prompt"}; + + std::vector axes = {thnAxisMass, thnAxisPt, thnAxisY}; + std::vector axesMcGen = {thnAxisPt, thnAxisPtB, thnAxisY, thnAxisOrigin}; + + if (doprocessDataDCAFitterFT0C || doprocessDataDCAFitterFT0M || doprocessDataKFParticleFT0C || doprocessDataKFParticleMlFT0C || doprocessDataKFParticleFT0M || doprocessDataKFParticleMlFT0M) { + axes.push_back(thnAxisCent); + axes.emplace_back(thnConfigAxisNumPvContr); + } + + if (doprocessMcDCAFitterFT0M || doprocessMcKFParticleFT0M || doprocessMcKFParticleMlFT0M) { + axes.push_back(thnAxisCentMc); + axes.emplace_back(thnConfigAxisNumPvContr); + axesMcGen.push_back(thnAxisCentMc); + axesMcGen.emplace_back(thnConfigAxisNumPvContr); + } + + if (doprocessMcDCAFitter || doprocessMcDCAFitterFT0M || doprocessMcKFParticle || doprocessMcKFParticleMl || doprocessMcKFParticleFT0M || doprocessMcKFParticleMlFT0M) { + registry.add("hMcGen", "Gen. #Omega_{c}^{0} from charm and beauty", HistType::kTHnSparseD, axesMcGen); + registry.get(HIST("hMcGen"))->Sumw2(); + + if (doprocessMcDCAFitterFT0M || doprocessMcKFParticleFT0M || doprocessMcKFParticleMlFT0M) { + registry.add("hMcGenWithRecoColl", "Gen. #Omega_{c}^{0} from charm and beauty (associated to a reco collision)", HistType::kTHnSparseD, axesMcGen); + registry.add("hNumRecoCollPerMcColl", "Number of reco collisions associated to a mc collision;Num. reco. coll. per Mc coll.;", {HistType::kTH1D, {{10, -0.5, 9.5}}}); + registry.get(HIST("hMcGenWithRecoColl"))->Sumw2(); + } + + axes.push_back(thnAxisPtB); + axes.push_back(thnAxisOrigin); + axes.push_back(thnAxisMatchFlag); + } + + if (doprocessDataKFParticleMl || doprocessDataKFParticleMlFT0C || doprocessDataKFParticleMlFT0M || doprocessMcKFParticleMl || doprocessMcKFParticleMlFT0M) { + axes.push_back(thnAxisPromptScore); + } + + registry.add("hReco", "Reco. #Omega_{c}^{0} candidates", HistType::kTHnSparseD, axes); + registry.get(HIST("hReco"))->Sumw2(); + } + + template + void processData(const CandType& candidates) + { + for (const auto& candidate : candidates) { + if (!(candidate.resultSelections() == true || (candidate.resultSelections() == false && !selectionFlagOmegac0))) { + continue; + } + + double yOmegac{0.}; + if constexpr (UseKfParticle) { + yOmegac = candidate.kfRapOmegac(); + } else { + yOmegac = candidate.y(o2::constants::physics::MassOmegaC0); + } + if (yCandRecoMax >= 0. && std::abs(yOmegac) > yCandRecoMax) { + continue; + } + + if constexpr (ApplyMl) { + registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), yOmegac, candidate.mlProbOmegac()[0]); + } else { + registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), yOmegac); + } + } + } + + template + void processDataCent(const CandType& candidate, CollType const& collision) + { + // for (const auto& collision : collisions) { + // auto thisCollId = collision.globalIndex(); + // auto groupedOmegacCandidates = ApplyMl ? candidates.sliceBy(candOmegacKFMlPerCollision, thisCollId) : candidates.sliceBy(candOmegacKFPerCollision, thisCollId); + // auto numPvContributors = collision.numContrib(); + + // for (const auto& candidate : groupedOmegacCandidates) { + // if (!(candidate.resultSelections() == true || (candidate.resultSelections() == false && !selectionFlagOmegac0))) { + // continue; + // } + + // if (yCandRecoMax >= 0. && std::abs(candidate.kfRapOmegac()) > yCandRecoMax) { + // continue; + // } + + // float const cent = o2::hf_centrality::getCentralityColl(collision); + + // if constexpr (ApplyMl) { + // registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfRapOmegac(), + // cent, numPvContributors, candidate.mlProbOmegac()[0]); + // if (fillTree) { + // kfCandMl(candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfptPiFromOmegac(), candidate.mlProbOmegac()[0], cent); + // } + // } else { + // registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfRapOmegac(), + // cent, numPvContributors); + // } + // } + // } + if (!(candidate.resultSelections() == true || (candidate.resultSelections() == false && !selectionFlagOmegac0))) { + return; + } + + double yOmegac{0.}; + if constexpr (UseKfParticle) { + yOmegac = candidate.kfRapOmegac(); + } else { + yOmegac = candidate.y(o2::constants::physics::MassOmegaC0); + } + + if (yCandRecoMax >= 0. && std::abs(yOmegac) > yCandRecoMax) { + return; + } + + auto numPvContributors = collision.numContrib(); + if constexpr (UseCentrality) { + float const cent = o2::hf_centrality::getCentralityColl(collision); + if constexpr (ApplyMl) { + registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), yOmegac, + cent, numPvContributors, candidate.mlProbOmegac()[0]); + if (fillTree) { + kfCandMl(candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfptPiFromOmegac(), candidate.mlProbOmegac()[0], cent); + } + } else { + registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), yOmegac, + cent, numPvContributors); + } + } else { + if constexpr (ApplyMl) { + registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), yOmegac, candidate.mlProbOmegac()[0]); + } else { + registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), yOmegac); + } + } + } + + template + void processMc(const CandType& candidates, Omegac0Gen const& mcParticles) + { + // MC rec. + for (const auto& candidate : candidates) { + if (!(candidate.resultSelections() == true || (candidate.resultSelections() == false && !selectionFlagOmegac0))) { + continue; + } + + double yOmegac{0.}; + if constexpr (UseKfParticle) { + yOmegac = candidate.kfRapOmegac(); + } else { + yOmegac = candidate.y(o2::constants::physics::MassOmegaC0); + } + + if (yCandRecoMax >= 0. && std::abs(yOmegac) > yCandRecoMax) { + continue; + } + + if constexpr (ApplyMl) { + registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), yOmegac, candidate.ptBhadMotherPart(), candidate.originMcRec(), candidate.flagMcMatchRec(), candidate.mlProbOmegac()[0]); + } else { + registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), yOmegac, candidate.ptBhadMotherPart(), candidate.originMcRec(), candidate.flagMcMatchRec()); + } + } + + // MC gen. + for (const auto& particle : mcParticles) { + if (yCandGenMax >= 0. && std::abs(particle.rapidityCharmBaryonGen()) > yCandGenMax) { + continue; + } + + auto ptGen = particle.pt(); + auto yGen = particle.rapidityCharmBaryonGen(); + + if (particle.originMcGen() == RecoDecay::OriginType::Prompt) { + registry.fill(HIST("hMcGen"), ptGen, -1., yGen, RecoDecay::OriginType::Prompt); + } else { + float const ptGenB = mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); + registry.fill(HIST("hMcGen"), ptGen, ptGenB, yGen, RecoDecay::OriginType::NonPrompt); + } + } + } + + template + void processMcCent(const CandType& candidates, Omegac0Gen const& mcParticles, + CollisionsWithMcLabels const& collisions, McCollisionWithCents const&) + { + // MC rec. + for (const auto& candidate : candidates) { + if (!(candidate.resultSelections() == true || (candidate.resultSelections() == false && !selectionFlagOmegac0))) { + continue; + } + + double yOmegac{0.}; + if constexpr (UseKfParticle) { + yOmegac = candidate.kfRapOmegac(); + } else { + yOmegac = candidate.y(o2::constants::physics::MassOmegaC0); + } + + if (yCandRecoMax >= 0. && std::abs(yOmegac) > yCandRecoMax) { + continue; + } + + auto collision = candidate.template collision_as(); + uint16_t const numPvContributors = collision.numContrib(); + float const mcCent = o2::hf_centrality::getCentralityColl(collision.template mcCollision_as()); + + if constexpr (ApplyMl) { + registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), yOmegac, mcCent, numPvContributors, candidate.ptBhadMotherPart(), candidate.originMcRec(), candidate.flagMcMatchRec(), candidate.mlProbOmegac()[0]); + } else { + registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), yOmegac, mcCent, numPvContributors, candidate.ptBhadMotherPart(), candidate.originMcRec(), candidate.flagMcMatchRec()); + } + } + + // MC gen. + for (const auto& particle : mcParticles) { + if (yCandGenMax >= 0. && std::abs(particle.rapidityCharmBaryonGen()) > yCandGenMax) { + continue; + } + + auto ptGen = particle.pt(); + auto yGen = particle.rapidityCharmBaryonGen(); + auto mcCollision = particle.template mcCollision_as(); + + int maxNumContrib = 0; + const auto& recoCollsPerMcColl = collisions.sliceBy(colPerMcCollision, mcCollision.globalIndex()); + for (const auto& recCol : recoCollsPerMcColl) { + maxNumContrib = recCol.numContrib() > maxNumContrib ? recCol.numContrib() : maxNumContrib; + } + + float const mcCent = o2::hf_centrality::getCentralityColl(mcCollision); + + if (particle.originMcGen() == RecoDecay::OriginType::Prompt) { + registry.fill(HIST("hMcGen"), ptGen, -1., yGen, RecoDecay::OriginType::Prompt, mcCent, maxNumContrib); + } else { + float const ptGenB = mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); + registry.fill(HIST("hMcGen"), ptGen, ptGenB, yGen, RecoDecay::OriginType::NonPrompt, mcCent, maxNumContrib); + } + + registry.fill(HIST("hNumRecoCollPerMcColl"), recoCollsPerMcColl.size()); + + // fill sparse only for gen particles associated to a reconstructed collision + if (recoCollsPerMcColl.size() >= 1) { + if (particle.originMcGen() == RecoDecay::OriginType::Prompt) { + registry.fill(HIST("hMcGenWithRecoColl"), ptGen, -1., yGen, RecoDecay::OriginType::Prompt, mcCent, maxNumContrib); + } else { + float const ptGenB = mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); + registry.fill(HIST("hMcGenWithRecoColl"), ptGen, ptGenB, yGen, RecoDecay::OriginType::NonPrompt, mcCent, maxNumContrib); + } + } + } + } + + /////////////////////////////////// + /// Data with DCAFitter // + /////////////////////////////////// + + void processDataDCAFitter(Omegac0Cands const& candidates) + { + processData(candidates); + } + PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processDataDCAFitter, "process data with DCAFitter", false); + + void processDataDCAFitterFT0C(Omegac0Cands const& candidates, + CollisionsWithFT0C const& collisions) + { + for (const auto& collision : collisions) { + auto groupedOmegacCandidates = candidates.sliceBy(candOmegacPerCollision, collision.globalIndex()); + + for (const auto& candidate : groupedOmegacCandidates) { + processDataCent(candidate, collision); + } + } + } + PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processDataDCAFitterFT0C, "process data with DCAFitter, FT0C centrality", false); + + void processDataDCAFitterFT0M(Omegac0Cands const& candidates, + CollisionsWithFT0M const& collisions) + { + for (const auto& collision : collisions) { + auto groupedOmegacCandidates = candidates.sliceBy(candOmegacPerCollision, collision.globalIndex()); + + for (const auto& candidate : groupedOmegacCandidates) { + processDataCent(candidate, collision); + } + } + } + PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processDataDCAFitterFT0M, "process data with DCAFitter, FT0M centrality", false); + + //////////////////////////////////// + /// Data with KFParticle // + //////////////////////////////////// + + void processDataKFParticle(Omegac0CandsKF const& candidates) + { + processData(candidates); + } + PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processDataKFParticle, "process data with KFParticle", false); + + void processDataKFParticleMl(Omegac0CandsMlKF const& candidates) + { + processData(candidates); + } + PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processDataKFParticleMl, "process data with KFParticle, ML selections", false); + + void processDataKFParticleFT0C(Omegac0CandsKF const& candidates, + CollisionsWithFT0C const& collisions) + { + for (const auto& collision : collisions) { + auto groupedOmegacCandidates = candidates.sliceBy(candOmegacKFPerCollision, collision.globalIndex()); + + for (const auto& candidate : groupedOmegacCandidates) { + processDataCent(candidate, collision); + } + } + } + PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processDataKFParticleFT0C, "process data with KFParticle, FT0C centrality", false); + + void processDataKFParticleMlFT0C(Omegac0CandsMlKF const& candidates, + CollisionsWithFT0C const& collisions) + { + for (const auto& collision : collisions) { + auto groupedOmegacCandidates = candidates.sliceBy(candOmegacKFMlPerCollision, collision.globalIndex()); + + for (const auto& candidate : groupedOmegacCandidates) { + processDataCent(candidate, collision); + } + } + } + PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processDataKFParticleMlFT0C, "process data with KFParticle, ML selections, FT0C centrality", false); + + void processDataKFParticleFT0M(Omegac0CandsKF const& candidates, + CollisionsWithFT0M const& collisions) + { + for (const auto& collision : collisions) { + auto groupedOmegacCandidates = candidates.sliceBy(candOmegacKFPerCollision, collision.globalIndex()); + + for (const auto& candidate : groupedOmegacCandidates) { + processDataCent(candidate, collision); + } + } + } + PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processDataKFParticleFT0M, "process data with KFParticle, FT0M centrality", false); + + void processDataKFParticleMlFT0M(Omegac0CandsMlKF const& candidates, + CollisionsWithFT0M const& collisions) + { + for (const auto& collision : collisions) { + auto groupedOmegacCandidates = candidates.sliceBy(candOmegacKFMlPerCollision, collision.globalIndex()); + + for (const auto& candidate : groupedOmegacCandidates) { + processDataCent(candidate, collision); + } + } + } + PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processDataKFParticleMlFT0M, "process data with KFParticle, ML selections, FT0M centrality", false); + + /////////////////////////////////// + /// MC with DCAFitter // + /////////////////////////////////// + + void processMcDCAFitter(Omegac0CandsMc const& omegaC0CandidatesMc, + Omegac0Gen const& mcParticles) + { + processMc(omegaC0CandidatesMc, mcParticles); + } + PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processMcDCAFitter, "Process MC with DCAFitter", false); + + void processMcDCAFitterFT0M(Omegac0CandsMc const& omegaC0CandidatesMc, + Omegac0Gen const& mcParticles, + CollisionsWithMcLabels const& collisions, + McCollisionsWithFT0M const& mcCollisions) + { + processMcCent(omegaC0CandidatesMc, mcParticles, collisions, mcCollisions); + } + PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processMcDCAFitterFT0M, "Process MC with DCAFitter, FT0M centrality (from MC)", false); + + + //////////////////////////////////// + /// MC with KFParticle // + //////////////////////////////////// + + void processMcKFParticle(OmegaC0CandsMcKF const& omegaC0CandidatesMcKF, + Omegac0Gen const& mcParticles) + { + processMc(omegaC0CandidatesMcKF, mcParticles); + } + PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processMcKFParticle, "Process MC with KFParticle", false); + + void processMcKFParticleMl(Omegac0CandsMlMcKF const& omegac0CandidatesMlMcKF, + Omegac0Gen const& mcParticles) + { + processMc(omegac0CandidatesMlMcKF, mcParticles); + } + PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processMcKFParticleMl, "Process MC with KFParticle, ML selections", false); + + void processMcKFParticleFT0M(OmegaC0CandsMcKF const& omegaC0CandidatesMcKF, + Omegac0Gen const& mcParticles, + CollisionsWithMcLabels const& collisions, + McCollisionsWithFT0M const& mcCollisions) + { + processMcCent(omegaC0CandidatesMcKF, mcParticles, collisions, mcCollisions); + } + PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processMcKFParticleFT0M, "Process MC with KFParticle, FT0M centrality (from MC)", false); + + void processMcKFParticleMlFT0M(Omegac0CandsMlMcKF const& omegac0CandidatesMlMcKF, + Omegac0Gen const& mcParticles, + CollisionsWithMcLabels const& collisions, + McCollisionsWithFT0M const& mcCollisions) + { + processMcCent(omegac0CandidatesMlMcKF, mcParticles, collisions, mcCollisions); + } + PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processMcKFParticleMlFT0M, "Process MC with KFParticle, ML selections, FT0M centrality (from MC)", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} From 7ae589eb549715bd486aba023c39dbd985001dad Mon Sep 17 00:00:00 2001 From: mariafernandatorrescabrera Date: Mon, 14 Sep 2026 14:59:16 -0500 Subject: [PATCH 07/12] Add OmegaC ML response QA header --- PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h | 244 +++++++++++++++++++++ 1 file changed, 244 insertions(+) create mode 100755 PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h diff --git a/PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h b/PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h new file mode 100755 index 00000000000..e9209a92fac --- /dev/null +++ b/PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h @@ -0,0 +1,244 @@ +// 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 HfMlResponseOmegacToOmegaPiQa.h +/// \brief Class to compute the ML response for Ωc± → Ω∓ π± analysis selections +/// \author Yunfan Liu , China University of Geosciences +/// \author Maria Fernanda Torres Cabrera , University of Houston + +#ifndef PWGHF_CORE_HFMLRESPONSEOMEGACTOOMEGAPIQA_H_ +#define PWGHF_CORE_HFMLRESPONSEOMEGACTOOMEGAPIQA_H_ + +#include "PWGHF/Core/HfMlResponse.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" + +#include "Tools/ML/MlResponse.h" + +#include +#include +#include +#include + +// Fill the map of available input features +// the key is the feature's name (std::string) +// the value is the corresponding value in EnumInputFeatures +#define FILL_MAP_OMEGAC0(FEATURE) \ + { \ + #FEATURE, static_cast(InputFeaturesOmegacToOmegaPi::FEATURE) \ + } + +// Check if the index of mCachedIndices (index associated to a FEATURE) +// matches the entry in EnumInputFeatures associated to this FEATURE +// if so, the inputFeatures vector is filled with the FEATURE's value +// by calling the corresponding GETTER from OBJECT +#define CHECK_AND_FILL_VEC_OMEGAC0_FULL(OBJECT, FEATURE, GETTER) \ + case static_cast(InputFeaturesOmegacToOmegaPi::FEATURE): { \ + inputFeatures.emplace_back(OBJECT.GETTER()); \ + break; \ + } + +// Specific case of CHECK_AND_FILL_VEC_OMEGAC0_FULL(OBJECT, FEATURE, GETTER) +// where OBJECT is named candidate and FEATURE = GETTER +#define CHECK_AND_FILL_VEC_OMEGAC0(GETTER) \ + case static_cast(InputFeaturesOmegacToOmegaPi::GETTER): { \ + inputFeatures.emplace_back(candidate.GETTER()); \ + break; \ + } + +// Variation of CHECK_AND_FILL_VEC_OMEGAC0_FULL(OBJECT, FEATURE, GETTER) +// where GETTER is a method of HfHelper +#define CHECK_AND_FILL_VEC_OMEGAC0_HFHELPER(OBJECT, FEATURE, GETTER) \ + case static_cast(InputFeaturesOmegacToOmegaPi::FEATURE): { \ + inputFeatures.emplace_back(HfHelper::GETTER(OBJECT)); \ + break; \ + } +namespace o2::analysis +{ +enum class InputFeaturesOmegacToOmegaPi : uint8_t { + + // Common variables + dcaCharmBaryonDau = 0, + dcaCascDau, + nSigmaTPCPiFromV0, + nSigmaTPCPiFromOmegac, + nSigmaTPCKaFromCasc, + + // DCAFitter variables + impactParBachFromCharmBaryonXY, + impactParBachFromCharmBaryonZ, + impactParCascXY, + impactParCascZ, + cosPACharmBaryon, + cosPACasc, + + // KFPartcile variables + cosPaOmegacToPv, + kfDcaXYPiFromOmegac, + chi2TopoPiFromOmegacToPv, + invMassCascade, + massCascChi2OverNdf, + kfDcaXYCascToPv, + cosPaCascToPv, + cosThetaStarPiFromOmegac, + chi2NdfTopoOmegacToPv, + ldlCasc, + cosPaCascToOmegac, + decayLenXYCasc, + decayLenXYOmegac, + ldlOmegac, + chi2NdfTopoCascToOmegac, + chi2NdfTopoCascToPv, + chi2GeoOmegac, + chi2GeoCasc, +}; + +template +class HfMlResponseOmegacToOmegaPi : public HfMlResponse +{ + public: + /// Default constructor + HfMlResponseOmegacToOmegaPi() = default; + /// Default destructor + virtual ~HfMlResponseOmegacToOmegaPi() = default; + + /// Method to get the input features vector needed for ML inference + /// \param candidate is the OMEGAC0 candidate + /// \param lamProngPi is the candidate's lamProngPi + /// \return inputFeatures vector + template + std::vector getInputFeatures(T1 const& candidate, T2 const& lamProngPi, T2 const& cascProng, T3 const& charmBaryonProng) + { + std::vector inputFeatures; + + for (const auto& idx : MlResponse::mCachedIndices) { + + // Variables common to DCAFitter and KFParticle + switch (idx) { + + CHECK_AND_FILL_VEC_OMEGAC0(dcaCharmBaryonDau); + CHECK_AND_FILL_VEC_OMEGAC0(dcaCascDau); + // TPC PID variables + CHECK_AND_FILL_VEC_OMEGAC0_FULL(lamProngPi, nSigmaTPCPiFromV0, tpcNSigmaPi); + CHECK_AND_FILL_VEC_OMEGAC0_FULL(cascProng, nSigmaTPCKaFromCasc, tpcNSigmaKa); + CHECK_AND_FILL_VEC_OMEGAC0_FULL(charmBaryonProng, nSigmaTPCPiFromOmegac, tpcNSigmaPi); + } + + // DCAFitter variables + if constexpr (reconstructionType == hf_cand_casc_lf::ConstructMethod::DcaFitter) { + + switch (idx) { + + CHECK_AND_FILL_VEC_OMEGAC0(impactParBachFromCharmBaryonXY); + CHECK_AND_FILL_VEC_OMEGAC0(impactParBachFromCharmBaryonZ); + CHECK_AND_FILL_VEC_OMEGAC0(impactParCascXY); + CHECK_AND_FILL_VEC_OMEGAC0(impactParCascZ); + CHECK_AND_FILL_VEC_OMEGAC0(cosPACharmBaryon); + CHECK_AND_FILL_VEC_OMEGAC0(cosPACasc); + } + } + + // KFParticle variables + if constexpr (reconstructionType == hf_cand_casc_lf::ConstructMethod::KfParticle) { + + switch (idx) { + + CHECK_AND_FILL_VEC_OMEGAC0_FULL(candidate, cosPaOmegacToPv, cosPACharmBaryon); + CHECK_AND_FILL_VEC_OMEGAC0(kfDcaXYPiFromOmegac); + CHECK_AND_FILL_VEC_OMEGAC0(chi2TopoPiFromOmegacToPv); + CHECK_AND_FILL_VEC_OMEGAC0(invMassCascade); + CHECK_AND_FILL_VEC_OMEGAC0(massCascChi2OverNdf); + CHECK_AND_FILL_VEC_OMEGAC0(kfDcaXYCascToPv); + CHECK_AND_FILL_VEC_OMEGAC0_FULL(candidate, cosPaCascToPv, cosPACasc); + CHECK_AND_FILL_VEC_OMEGAC0(cosThetaStarPiFromOmegac); + CHECK_AND_FILL_VEC_OMEGAC0_FULL(candidate, chi2NdfTopoOmegacToPv, chi2TopoOmegacToPv); + CHECK_AND_FILL_VEC_OMEGAC0_FULL(candidate, ldlCasc, cascldl); + CHECK_AND_FILL_VEC_OMEGAC0(cosPaCascToOmegac); + CHECK_AND_FILL_VEC_OMEGAC0(decayLenXYCasc); + CHECK_AND_FILL_VEC_OMEGAC0(decayLenXYOmegac); + CHECK_AND_FILL_VEC_OMEGAC0_FULL(candidate, ldlOmegac, omegacldl); + CHECK_AND_FILL_VEC_OMEGAC0_FULL(candidate, chi2NdfTopoCascToOmegac, chi2TopoCascToOmegac); + CHECK_AND_FILL_VEC_OMEGAC0_FULL(candidate, chi2NdfTopoCascToPv, chi2TopoCascToPv); + CHECK_AND_FILL_VEC_OMEGAC0(chi2GeoOmegac); + CHECK_AND_FILL_VEC_OMEGAC0(chi2GeoCasc); + } + } + } + + return inputFeatures; + } + + protected: + /// Method to fill the map of available input features + void setAvailableInputFeatures() + { + // Common variables + MlResponse::mAvailableInputFeatures = { + + FILL_MAP_OMEGAC0(dcaCharmBaryonDau), + FILL_MAP_OMEGAC0(dcaCascDau), + FILL_MAP_OMEGAC0(nSigmaTPCPiFromV0), + FILL_MAP_OMEGAC0(nSigmaTPCPiFromOmegac), + FILL_MAP_OMEGAC0(nSigmaTPCKaFromCasc) + }; + + // DCAFitter variables + if constexpr (reconstructionType == hf_cand_casc_lf::ConstructMethod::DcaFitter) { + + std::map mapDcaFeatures{ + + FILL_MAP_OMEGAC0(impactParBachFromCharmBaryonXY), + FILL_MAP_OMEGAC0(impactParBachFromCharmBaryonZ), + FILL_MAP_OMEGAC0(impactParCascXY), + FILL_MAP_OMEGAC0(impactParCascZ), + FILL_MAP_OMEGAC0(cosPACharmBaryon), + FILL_MAP_OMEGAC0(cosPACasc) + }; + + MlResponse::mAvailableInputFeatures.insert(mapDcaFeatures.begin(), mapDcaFeatures.end()); + } + + // KFPartcile variables + if constexpr (reconstructionType == hf_cand_casc_lf::ConstructMethod::KfParticle) { + + std::map mapKfFeatures{ + + FILL_MAP_OMEGAC0(cosPaOmegacToPv), + FILL_MAP_OMEGAC0(kfDcaXYPiFromOmegac), + FILL_MAP_OMEGAC0(chi2TopoPiFromOmegacToPv), + FILL_MAP_OMEGAC0(invMassCascade), + FILL_MAP_OMEGAC0(massCascChi2OverNdf), + FILL_MAP_OMEGAC0(kfDcaXYCascToPv), + FILL_MAP_OMEGAC0(cosPaCascToPv), + FILL_MAP_OMEGAC0(cosThetaStarPiFromOmegac), + FILL_MAP_OMEGAC0(chi2NdfTopoOmegacToPv), + FILL_MAP_OMEGAC0(ldlCasc), + FILL_MAP_OMEGAC0(cosPaCascToOmegac), + FILL_MAP_OMEGAC0(decayLenXYCasc), + FILL_MAP_OMEGAC0(decayLenXYOmegac), + FILL_MAP_OMEGAC0(ldlOmegac), + FILL_MAP_OMEGAC0(chi2NdfTopoCascToOmegac), + FILL_MAP_OMEGAC0(chi2NdfTopoCascToPv), + FILL_MAP_OMEGAC0(chi2GeoOmegac), + FILL_MAP_OMEGAC0(chi2GeoCasc) + }; + + MlResponse::mAvailableInputFeatures.insert(mapKfFeatures.begin(), mapKfFeatures.end()); + } + } +}; + +} // namespace o2::analysis + +#undef FILL_MAP_OMEGAC0 +#undef CHECK_AND_FILL_VEC_OMEGAC0_FULL +#undef CHECK_AND_FILL_VEC_OMEGAC0 +#undef CHECK_AND_FILL_VEC_OMEGAC0_HFHELPER +#endif // PWGHF_CORE_HFMLRESPONSEOMEGACTOOMEGAPIQA_H_ \ No newline at end of file From bd07df01a2abcaa61f5b7da420908450de011cf5 Mon Sep 17 00:00:00 2001 From: mariafernandatorrescabrera Date: Mon, 14 Sep 2026 23:49:38 -0500 Subject: [PATCH 08/12] Update on OmegaC ML response QA header --- PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h b/PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h index e9209a92fac..9b1c4c907f3 100755 --- a/PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h +++ b/PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h @@ -79,7 +79,7 @@ enum class InputFeaturesOmegacToOmegaPi : uint8_t { cosPACharmBaryon, cosPACasc, - // KFPartcile variables + // KFParticle variables cosPaOmegacToPv, kfDcaXYPiFromOmegac, chi2TopoPiFromOmegacToPv, @@ -100,7 +100,7 @@ enum class InputFeaturesOmegacToOmegaPi : uint8_t { chi2GeoCasc, }; -template +template class HfMlResponseOmegacToOmegaPi : public HfMlResponse { public: @@ -132,7 +132,7 @@ class HfMlResponseOmegacToOmegaPi : public HfMlResponse } // DCAFitter variables - if constexpr (reconstructionType == hf_cand_casc_lf::ConstructMethod::DcaFitter) { + if constexpr (reconstructionType == aod::hf_cand_casc_lf::ConstructMethod::DcaFitter) { switch (idx) { @@ -146,7 +146,7 @@ class HfMlResponseOmegacToOmegaPi : public HfMlResponse } // KFParticle variables - if constexpr (reconstructionType == hf_cand_casc_lf::ConstructMethod::KfParticle) { + if constexpr (reconstructionType == aod::hf_cand_casc_lf::ConstructMethod::KfParticle) { switch (idx) { @@ -190,7 +190,7 @@ class HfMlResponseOmegacToOmegaPi : public HfMlResponse }; // DCAFitter variables - if constexpr (reconstructionType == hf_cand_casc_lf::ConstructMethod::DcaFitter) { + if constexpr (reconstructionType == aod::hf_cand_casc_lf::ConstructMethod::DcaFitter) { std::map mapDcaFeatures{ @@ -205,8 +205,8 @@ class HfMlResponseOmegacToOmegaPi : public HfMlResponse MlResponse::mAvailableInputFeatures.insert(mapDcaFeatures.begin(), mapDcaFeatures.end()); } - // KFPartcile variables - if constexpr (reconstructionType == hf_cand_casc_lf::ConstructMethod::KfParticle) { + // KFParticle variables + if constexpr (reconstructionType == aod::hf_cand_casc_lf::ConstructMethod::KfParticle) { std::map mapKfFeatures{ @@ -241,4 +241,4 @@ class HfMlResponseOmegacToOmegaPi : public HfMlResponse #undef CHECK_AND_FILL_VEC_OMEGAC0_FULL #undef CHECK_AND_FILL_VEC_OMEGAC0 #undef CHECK_AND_FILL_VEC_OMEGAC0_HFHELPER -#endif // PWGHF_CORE_HFMLRESPONSEOMEGACTOOMEGAPIQA_H_ \ No newline at end of file +#endif // PWGHF_CORE_HFMLRESPONSEOMEGACTOOMEGAPIQA_H_ From b3cf2b203fac179e41d7cffbbd32223c3fad1a8e Mon Sep 17 00:00:00 2001 From: mariafernandatorrescabrera Date: Mon, 14 Sep 2026 23:59:10 -0500 Subject: [PATCH 09/12] Update OmegaC QA task --- PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx | 100 +++++++++++++-------- 1 file changed, 62 insertions(+), 38 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx b/PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx index 957cada2f25..6450e992115 100755 --- a/PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx +++ b/PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx @@ -82,6 +82,7 @@ struct HfTaskOmegac0ToOmegaPiQa { using OmegaC0CandsMcKF = soa::Filtered>; using Omegac0CandsMl = soa::Filtered>; using Omegac0CandsMlKF = soa::Filtered>; + using Omegac0CandsMlMc = soa::Filtered>; using Omegac0CandsMlMcKF = soa::Filtered>; using Omegac0Gen = soa::Filtered>; @@ -99,7 +100,7 @@ struct HfTaskOmegac0ToOmegaPiQa { Preslice candOmegacPerCollision = aod::hf_cand_xic0_omegac0::collisionId; Preslice candOmegacKFPerCollision = aod::hf_cand_xic0_omegac0::collisionId; - // Preslice candOmegacMlPerCollision = aod::hf_cand_xic0_omegac0::collisionId; // Implementation still needed for ML DCAFitter + Preslice candOmegacMlPerCollision = aod::hf_cand_xic0_omegac0::collisionId; Preslice candOmegacKFMlPerCollision = aod::hf_cand_xic0_omegac0::collisionId; PresliceUnsorted colPerMcCollision = aod::mccollisionlabel::mcCollisionId; @@ -117,10 +118,12 @@ struct HfTaskOmegac0ToOmegaPiQa { void init(InitContext&) { - std::array doprocess{doprocessDataDCAFitter, doprocessDataDCAFitterFT0C, doprocessDataDCAFitterFT0M, + std::array doprocess{doprocessDataDCAFitter, doprocessDataDCAFitterMl, doprocessDataDCAFitterFT0C, doprocessDataDCAFitterMlFT0C, + doprocessDataDCAFitterFT0M, doprocessDataDCAFitterMlFT0M, doprocessDataKFParticle, doprocessDataKFParticleMl, doprocessDataKFParticleFT0C, doprocessDataKFParticleMlFT0C, doprocessDataKFParticleFT0M, doprocessDataKFParticleMlFT0M, - doprocessMcDCAFitter, doprocessMcDCAFitterFT0M, + doprocessMcDCAFitter, doprocessMcDCAFitterMl, + doprocessMcDCAFitterFT0M, doprocessMcDCAFitterMlFT0M, doprocessMcKFParticle, doprocessMcKFParticleMl, doprocessMcKFParticleFT0M, doprocessMcKFParticleMlFT0M}; if ((std::accumulate(doprocess.begin(), doprocess.end(), 0)) != 1) { @@ -141,23 +144,23 @@ struct HfTaskOmegac0ToOmegaPiQa { std::vector axes = {thnAxisMass, thnAxisPt, thnAxisY}; std::vector axesMcGen = {thnAxisPt, thnAxisPtB, thnAxisY, thnAxisOrigin}; - if (doprocessDataDCAFitterFT0C || doprocessDataDCAFitterFT0M || doprocessDataKFParticleFT0C || doprocessDataKFParticleMlFT0C || doprocessDataKFParticleFT0M || doprocessDataKFParticleMlFT0M) { + if (doprocessDataDCAFitterFT0C || doprocessDataDCAFitterMlFT0C|| doprocessDataDCAFitterFT0M || doprocessDataDCAFitterMlFT0M || doprocessDataKFParticleFT0C || doprocessDataKFParticleMlFT0C || doprocessDataKFParticleFT0M || doprocessDataKFParticleMlFT0M) { axes.push_back(thnAxisCent); axes.emplace_back(thnConfigAxisNumPvContr); } - if (doprocessMcDCAFitterFT0M || doprocessMcKFParticleFT0M || doprocessMcKFParticleMlFT0M) { + if (doprocessMcDCAFitterFT0M || doprocessMcDCAFitterMlFT0M ||doprocessMcKFParticleFT0M || doprocessMcKFParticleMlFT0M) { axes.push_back(thnAxisCentMc); axes.emplace_back(thnConfigAxisNumPvContr); axesMcGen.push_back(thnAxisCentMc); axesMcGen.emplace_back(thnConfigAxisNumPvContr); } - if (doprocessMcDCAFitter || doprocessMcDCAFitterFT0M || doprocessMcKFParticle || doprocessMcKFParticleMl || doprocessMcKFParticleFT0M || doprocessMcKFParticleMlFT0M) { + if (doprocessMcDCAFitter || doprocessMcDCAFitterMl || doprocessMcDCAFitterFT0M || doprocessMcDCAFitterMlFT0M || doprocessMcKFParticle || doprocessMcKFParticleMl || doprocessMcKFParticleFT0M || doprocessMcKFParticleMlFT0M) { registry.add("hMcGen", "Gen. #Omega_{c}^{0} from charm and beauty", HistType::kTHnSparseD, axesMcGen); registry.get(HIST("hMcGen"))->Sumw2(); - if (doprocessMcDCAFitterFT0M || doprocessMcKFParticleFT0M || doprocessMcKFParticleMlFT0M) { + if (doprocessMcDCAFitterFT0M || doprocessMcDCAFitterMlFT0M || doprocessMcKFParticleFT0M || doprocessMcKFParticleMlFT0M) { registry.add("hMcGenWithRecoColl", "Gen. #Omega_{c}^{0} from charm and beauty (associated to a reco collision)", HistType::kTHnSparseD, axesMcGen); registry.add("hNumRecoCollPerMcColl", "Number of reco collisions associated to a mc collision;Num. reco. coll. per Mc coll.;", {HistType::kTH1D, {{10, -0.5, 9.5}}}); registry.get(HIST("hMcGenWithRecoColl"))->Sumw2(); @@ -168,7 +171,7 @@ struct HfTaskOmegac0ToOmegaPiQa { axes.push_back(thnAxisMatchFlag); } - if (doprocessDataKFParticleMl || doprocessDataKFParticleMlFT0C || doprocessDataKFParticleMlFT0M || doprocessMcKFParticleMl || doprocessMcKFParticleMlFT0M) { + if (doprocessDataKFParticleMl || doprocessDataKFParticleMlFT0C || doprocessDataKFParticleMlFT0M || doprocessDataDCAFitterMl || doprocessDataDCAFitterMlFT0C || doprocessDataDCAFitterMlFT0M || doprocessMcKFParticleMl || doprocessMcKFParticleMlFT0M || doprocessMcDCAFitterMl || doprocessMcDCAFitterMlFT0M) { axes.push_back(thnAxisPromptScore); } @@ -205,34 +208,6 @@ struct HfTaskOmegac0ToOmegaPiQa { template void processDataCent(const CandType& candidate, CollType const& collision) { - // for (const auto& collision : collisions) { - // auto thisCollId = collision.globalIndex(); - // auto groupedOmegacCandidates = ApplyMl ? candidates.sliceBy(candOmegacKFMlPerCollision, thisCollId) : candidates.sliceBy(candOmegacKFPerCollision, thisCollId); - // auto numPvContributors = collision.numContrib(); - - // for (const auto& candidate : groupedOmegacCandidates) { - // if (!(candidate.resultSelections() == true || (candidate.resultSelections() == false && !selectionFlagOmegac0))) { - // continue; - // } - - // if (yCandRecoMax >= 0. && std::abs(candidate.kfRapOmegac()) > yCandRecoMax) { - // continue; - // } - - // float const cent = o2::hf_centrality::getCentralityColl(collision); - - // if constexpr (ApplyMl) { - // registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfRapOmegac(), - // cent, numPvContributors, candidate.mlProbOmegac()[0]); - // if (fillTree) { - // kfCandMl(candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfptPiFromOmegac(), candidate.mlProbOmegac()[0], cent); - // } - // } else { - // registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfRapOmegac(), - // cent, numPvContributors); - // } - // } - // } if (!(candidate.resultSelections() == true || (candidate.resultSelections() == false && !selectionFlagOmegac0))) { return; } @@ -254,8 +229,10 @@ struct HfTaskOmegac0ToOmegaPiQa { if constexpr (ApplyMl) { registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), yOmegac, cent, numPvContributors, candidate.mlProbOmegac()[0]); - if (fillTree) { - kfCandMl(candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfptPiFromOmegac(), candidate.mlProbOmegac()[0], cent); + if constexpr (UseKfParticle) { + if (fillTree) { + kfCandMl(candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfptPiFromOmegac(), candidate.mlProbOmegac()[0], cent); + } } } else { registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), yOmegac, @@ -396,6 +373,12 @@ struct HfTaskOmegac0ToOmegaPiQa { } PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processDataDCAFitter, "process data with DCAFitter", false); + void processDataDCAFitterMl(Omegac0CandsMl const& candidates) + { + processData(candidates); + } + PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processDataDCAFitterMl, "process data with DCAFitter, ML selections", false); + void processDataDCAFitterFT0C(Omegac0Cands const& candidates, CollisionsWithFT0C const& collisions) { @@ -409,6 +392,19 @@ struct HfTaskOmegac0ToOmegaPiQa { } PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processDataDCAFitterFT0C, "process data with DCAFitter, FT0C centrality", false); + void processDataDCAFitterMlFT0C(Omegac0CandsMl const& candidates, + CollisionsWithFT0C const& collisions) + { + for (const auto& collision : collisions) { + auto groupedOmegacCandidates = candidates.sliceBy(candOmegacMlPerCollision, collision.globalIndex()); + + for (const auto& candidate : groupedOmegacCandidates) { + processDataCent(candidate, collision); + } + } + } + PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processDataDCAFitterMlFT0C, "process data with DCAFitter, ML selections, FT0C centrality", false); + void processDataDCAFitterFT0M(Omegac0Cands const& candidates, CollisionsWithFT0M const& collisions) { @@ -421,6 +417,19 @@ struct HfTaskOmegac0ToOmegaPiQa { } } PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processDataDCAFitterFT0M, "process data with DCAFitter, FT0M centrality", false); + + void processDataDCAFitterMlFT0M(Omegac0CandsMl const& candidates, + CollisionsWithFT0M const& collisions) + { + for (const auto& collision : collisions) { + auto groupedOmegacCandidates = candidates.sliceBy(candOmegacMlPerCollision, collision.globalIndex()); + + for (const auto& candidate : groupedOmegacCandidates) { + processDataCent(candidate, collision); + } + } + } + PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processDataDCAFitterMlFT0M, "process data with DCAFitter, ML selections, FT0M centrality", false); //////////////////////////////////// /// Data with KFParticle // @@ -501,6 +510,13 @@ struct HfTaskOmegac0ToOmegaPiQa { } PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processMcDCAFitter, "Process MC with DCAFitter", false); + void processMcDCAFitterMl(Omegac0CandsMlMc const& omegac0CandidatesMlMc, + Omegac0Gen const& mcParticles) + { + processMc(omegac0CandidatesMlMc, mcParticles); + } + PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processMcDCAFitterMl, "Process MC with DCAFitter, ML selections", false); + void processMcDCAFitterFT0M(Omegac0CandsMc const& omegaC0CandidatesMc, Omegac0Gen const& mcParticles, CollisionsWithMcLabels const& collisions, @@ -510,6 +526,14 @@ struct HfTaskOmegac0ToOmegaPiQa { } PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processMcDCAFitterFT0M, "Process MC with DCAFitter, FT0M centrality (from MC)", false); + void processMcDCAFitterMlFT0M(Omegac0CandsMlMc const& omegac0CandidatesMlMc, + Omegac0Gen const& mcParticles, + CollisionsWithMcLabels const& collisions, + McCollisionsWithFT0M const& mcCollisions) + { + processMcCent(omegac0CandidatesMlMc, mcParticles, collisions, mcCollisions); + } + PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processMcDCAFitterMlFT0M, "Process MC with DCAFitter, ML selections, FT0M centrality (from MC)", false); //////////////////////////////////// /// MC with KFParticle // From a793db1aec0a450c728e3874d93078fa31907d7e Mon Sep 17 00:00:00 2001 From: mariafernandatorrescabrera Date: Thu, 17 Sep 2026 14:36:22 -0500 Subject: [PATCH 10/12] Extend Omegac QA ML support to DCAFitter --- PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h | 9 --- PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx | 23 +------ .../candidateSelectorOmegac0ToOmegaPiQa.cxx | 61 +++++++++++++------ 3 files changed, 42 insertions(+), 51 deletions(-) diff --git a/PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h b/PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h index 9b1c4c907f3..d9018222979 100755 --- a/PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h +++ b/PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h @@ -52,14 +52,6 @@ inputFeatures.emplace_back(candidate.GETTER()); \ break; \ } - -// Variation of CHECK_AND_FILL_VEC_OMEGAC0_FULL(OBJECT, FEATURE, GETTER) -// where GETTER is a method of HfHelper -#define CHECK_AND_FILL_VEC_OMEGAC0_HFHELPER(OBJECT, FEATURE, GETTER) \ - case static_cast(InputFeaturesOmegacToOmegaPi::FEATURE): { \ - inputFeatures.emplace_back(HfHelper::GETTER(OBJECT)); \ - break; \ - } namespace o2::analysis { enum class InputFeaturesOmegacToOmegaPi : uint8_t { @@ -240,5 +232,4 @@ class HfMlResponseOmegacToOmegaPi : public HfMlResponse #undef FILL_MAP_OMEGAC0 #undef CHECK_AND_FILL_VEC_OMEGAC0_FULL #undef CHECK_AND_FILL_VEC_OMEGAC0 -#undef CHECK_AND_FILL_VEC_OMEGAC0_HFHELPER #endif // PWGHF_CORE_HFMLRESPONSEOMEGACTOOMEGAPIQA_H_ diff --git a/PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx b/PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx index 6450e992115..77092e88954 100755 --- a/PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx +++ b/PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx @@ -51,28 +51,12 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -namespace o2::aod -{ -namespace ml -{ -DECLARE_SOA_COLUMN(InvMassCharmBaryon, invMassCharmBaryon, float); -DECLARE_SOA_COLUMN(KfptOmegac, kfptOmegac, float); -DECLARE_SOA_COLUMN(KfptPiFromOmegac, kfptPiFromOmegac, float); -DECLARE_SOA_COLUMN(MlProbOmegac, mlProbOmegac, float); -DECLARE_SOA_COLUMN(Cent, cent, float); -} // namespace ml -DECLARE_SOA_TABLE(HfKfOmegacML, "AOD", "HFKFOMEGACML", - ml::InvMassCharmBaryon, ml::KfptOmegac, ml::KfptPiFromOmegac, ml::MlProbOmegac, ml::Cent); -} // namespace o2::aod - /// Omegac0 analysis task struct HfTaskOmegac0ToOmegaPiQa { - Produces kfCandMl; Configurable selectionFlagOmegac0{"selectionFlagOmegac0", true, "Select Omegac0 candidates"}; Configurable yCandGenMax{"yCandGenMax", 0.5, "Max. gen particle rapidity"}; Configurable yCandRecoMax{"yCandRecoMax", 0.8, "Max. cand. rapidity"}; - Configurable fillTree{"fillTree", false, "Fill tree for local analysis (enabled only with ML)"}; SliceCache cache; @@ -227,13 +211,8 @@ struct HfTaskOmegac0ToOmegaPiQa { if constexpr (UseCentrality) { float const cent = o2::hf_centrality::getCentralityColl(collision); if constexpr (ApplyMl) { - registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), yOmegac, + registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), yOmegac, cent, numPvContributors, candidate.mlProbOmegac()[0]); - if constexpr (UseKfParticle) { - if (fillTree) { - kfCandMl(candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfptPiFromOmegac(), candidate.mlProbOmegac()[0], cent); - } - } } else { registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), yOmegac, cent, numPvContributors); diff --git a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx index 0537258c8b9..67f05a249a0 100755 --- a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx +++ b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx @@ -15,7 +15,7 @@ /// \author Fabio Catalano , University of Houston /// \author Maria Fernanda Torres Cabrera , University of Houston -#include "PWGHF/Core/HfMlResponseOmegacToOmegaPi.h" +#include "PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h" #include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/DataModel/AliasTables.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" @@ -71,7 +71,7 @@ enum { struct HfCandidateSelectorToOmegaPiQa { // DCAFitter and KFParticle Produces hfSelToOmegaPi; - // ML selection - currently filled only for KFParticle + // ML selection - filled for both DCAFitter and KFParticle Produces hfMlSelToOmegaPi; // cuts from SelectorCuts.h - pT dependent cuts @@ -176,7 +176,9 @@ struct HfCandidateSelectorToOmegaPiQa { Configurable nClustersItsInnBarrMin{"nClustersItsInnBarrMin", 1, "Minimum number of ITS clusters in inner barrel requirement for pi <- charm baryon"}; Configurable itsChi2PerClusterMax{"itsChi2PerClusterMax", 36, "Maximum value of chi2 fit over ITS clusters for pi <- charm baryon"}; - o2::analysis::HfMlResponseOmegacToOmegaPi hfMlResponse; + // o2::analysis::HfMlResponseOmegacToOmegaPi hfMlResponse; + o2::analysis::HfMlResponseOmegacToOmegaPi hfMlResponseDca; + o2::analysis::HfMlResponseOmegacToOmegaPi hfMlResponseKf; std::vector outputMlOmegac = {}; o2::ccdb::CcdbApi ccdbApi; @@ -391,19 +393,27 @@ struct HfCandidateSelectorToOmegaPiQa { // HfMlResponse initialization if (applyMl) { if (doprocessOmegac0SelectorWithKFParticle) { - registry.add("hBDTScoreTest1", "hBDTScoreTest1", {HistType::kTH1D, {{100, 0.0f, 1.0f, "score"}}}); - hfMlResponse.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl); + registry.add("hBDTScoreKF", "hBDTScoreKF", {HistType::kTH1D, {{100, 0.0f, 1.0f, "score"}}}); + hfMlResponseKf.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl); if (loadModelsFromCCDB) { ccdbApi.init(ccdbUrl); - hfMlResponse.setModelPathsCCDB(onnxFileNames, ccdbApi, modelPathsCCDB, timestampCCDB); + hfMlResponseKf.setModelPathsCCDB(onnxFileNames, ccdbApi, modelPathsCCDB, timestampCCDB); } else { - hfMlResponse.setModelPathsLocal(onnxFileNames); + hfMlResponseKf.setModelPathsLocal(onnxFileNames); } - hfMlResponse.cacheInputFeaturesIndices(namesInputFeatures); - hfMlResponse.init(); - } else { - // DCAFitter: ML is not yet implemented - LOGP(warning, "ML selection is currently only supported for KFParticle."); + hfMlResponseKf.cacheInputFeaturesIndices(namesInputFeatures); + hfMlResponseKf.init(); + } else if (doprocessOmegac0SelectorWithDCAFitter) { + registry.add("hBDTScoreDCA", "hBDTScoreDCA", {HistType::kTH1D, {{100, 0.0f, 1.0f, "score"}}}); + hfMlResponseDca.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl); + if (loadModelsFromCCDB) { + ccdbApi.init(ccdbUrl); + hfMlResponseDca.setModelPathsCCDB(onnxFileNames, ccdbApi, modelPathsCCDB, timestampCCDB); + } else { + hfMlResponseDca.setModelPathsLocal(onnxFileNames); + } + hfMlResponseDca.cacheInputFeaturesIndices(namesInputFeatures); + hfMlResponseDca.init(); } } } @@ -1122,19 +1132,30 @@ struct HfCandidateSelectorToOmegaPiQa { statusInvMassCharmBaryon = true; } - // ML BDT selection - curently only for KFParticle - if constexpr (svReco == doKfParticle) { - if (applyMl) { - bool isSelectedMlOmegac = false; - std::vector inputFeaturesOmegaC = hfMlResponse.getInputFeatures(candidate, trackPiFromLam, trackKaFromCasc, trackPiFromCharm); - isSelectedMlOmegac = hfMlResponse.isSelectedMl(inputFeaturesOmegaC, ptCandOmegac, outputMlOmegac); + // ML BDT selection + if (applyMl) { + bool isSelectedMlOmegac = false; + std::vector inputFeaturesOmegaC = {}; + + if constexpr (svReco == doKfParticle) { + inputFeaturesOmegaC = hfMlResponseKf.getInputFeatures(candidate, trackPiFromLam, trackKaFromCasc, trackPiFromCharm); + isSelectedMlOmegac = hfMlResponseKf.isSelectedMl(inputFeaturesOmegaC, ptCandOmegac, outputMlOmegac); if (isSelectedMlOmegac) { - registry.fill(HIST("hBDTScoreTest1"), outputMlOmegac[0]); + registry.fill(HIST("hBDTScoreKF"), outputMlOmegac[0]); + } else { + resultSelections = false; + } + } else if constexpr (svReco == doDcaFitter) { + inputFeaturesOmegaC = hfMlResponseDca.getInputFeatures(candidate, trackPiFromLam, trackKaFromCasc, trackPiFromCharm); + isSelectedMlOmegac = hfMlResponseDca.isSelectedMl(inputFeaturesOmegaC, ptCandOmegac, outputMlOmegac); + if (isSelectedMlOmegac) { + registry.fill(HIST("hBDTScoreDCA"), outputMlOmegac[0]); } else { resultSelections = false; } - hfMlSelToOmegaPi(outputMlOmegac); } + + hfMlSelToOmegaPi(outputMlOmegac); } // Fill in selection result From 6a4c7881f23a02abe6c92d32edbb975db7c59404 Mon Sep 17 00:00:00 2001 From: mariafernandatorrescabrera Date: Wed, 30 Sep 2026 10:09:29 -0500 Subject: [PATCH 11/12] Refine Omegac QA ML implementation --- PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h | 2 + PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx | 6 +- .../treeCreatorOmegac0ToOmegaPiQa.cxx | 216 ++++-------------- 3 files changed, 51 insertions(+), 173 deletions(-) diff --git a/PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h b/PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h index d9018222979..b2665f1ce42 100755 --- a/PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h +++ b/PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h @@ -104,6 +104,8 @@ class HfMlResponseOmegacToOmegaPi : public HfMlResponse /// Method to get the input features vector needed for ML inference /// \param candidate is the OMEGAC0 candidate /// \param lamProngPi is the candidate's lamProngPi + /// \param cascProng is the bachelor track from the Omega decay + /// \param charmBaryonProng is the bachelor pion from the OmegaC decay /// \return inputFeatures vector template std::vector getInputFeatures(T1 const& candidate, T2 const& lamProngPi, T2 const& cascProng, T3 const& charmBaryonProng) diff --git a/PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx b/PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx index 77092e88954..5d7c235ae7a 100755 --- a/PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx +++ b/PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx @@ -63,7 +63,7 @@ struct HfTaskOmegac0ToOmegaPiQa { using Omegac0Cands = soa::Filtered>; using Omegac0CandsKF = soa::Filtered>; using Omegac0CandsMc = soa::Filtered>; - using OmegaC0CandsMcKF = soa::Filtered>; + using Omegac0CandsMcKF = soa::Filtered>; using Omegac0CandsMl = soa::Filtered>; using Omegac0CandsMlKF = soa::Filtered>; using Omegac0CandsMlMc = soa::Filtered>; @@ -518,7 +518,7 @@ struct HfTaskOmegac0ToOmegaPiQa { /// MC with KFParticle // //////////////////////////////////// - void processMcKFParticle(OmegaC0CandsMcKF const& omegaC0CandidatesMcKF, + void processMcKFParticle(Omegac0CandsMcKF const& omegaC0CandidatesMcKF, Omegac0Gen const& mcParticles) { processMc(omegaC0CandidatesMcKF, mcParticles); @@ -532,7 +532,7 @@ struct HfTaskOmegac0ToOmegaPiQa { } PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processMcKFParticleMl, "Process MC with KFParticle, ML selections", false); - void processMcKFParticleFT0M(OmegaC0CandsMcKF const& omegaC0CandidatesMcKF, + void processMcKFParticleFT0M(Omegac0CandsMcKF const& omegaC0CandidatesMcKF, Omegac0Gen const& mcParticles, CollisionsWithMcLabels const& collisions, McCollisionsWithFT0M const& mcCollisions) diff --git a/PWGHF/TableProducer/treeCreatorOmegac0ToOmegaPiQa.cxx b/PWGHF/TableProducer/treeCreatorOmegac0ToOmegaPiQa.cxx index 25aef82e090..ae229b4e0d7 100755 --- a/PWGHF/TableProducer/treeCreatorOmegac0ToOmegaPiQa.cxx +++ b/PWGHF/TableProducer/treeCreatorOmegac0ToOmegaPiQa.cxx @@ -35,21 +35,19 @@ #include #include -// #include - #include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -// SV Reco method // -- added -- +// SV Reco method enum { DCAFITTER = 0, KFPARTICLE }; -// Table size // -- added -- +// Table size enum { FULL = 0, LITE @@ -62,7 +60,7 @@ namespace full // collision info DECLARE_SOA_COLUMN(IsEventSel8, isEventSel8, bool); DECLARE_SOA_COLUMN(IsEventSelZ, isEventSelZ, bool); -DECLARE_SOA_COLUMN(Centrality, centrality, float); // --- added --- +DECLARE_SOA_COLUMN(Centrality, centrality, float); // from creator DECLARE_SOA_COLUMN(XPv, xPv, float); DECLARE_SOA_COLUMN(YPv, yPv, float); @@ -152,12 +150,6 @@ DECLARE_SOA_COLUMN(NTpcRowsKaFromCasc, nTpcRowsKaFromCasc, int16_t); // -- added DECLARE_SOA_COLUMN(NTpcRowsPosV0Dau, nTpcRowsPosV0Dau, int16_t); // -- added --- DECLARE_SOA_COLUMN(NTpcRowsNegV0Dau, nTpcRowsNegV0Dau, int16_t); // -- added --- // from creator KF -// DECLARE_SOA_COLUMN(NSigmaTPCPiFromOmegac, nSigmaTPCPiFromOmegac, float); -// DECLARE_SOA_COLUMN(NSigmaTOFPiFromOmegac, nSigmaTOFPiFromOmegac, float); -// DECLARE_SOA_COLUMN(NSigmaTPCKaFromCasc, nSigmaTPCKaFromCasc, float); -// DECLARE_SOA_COLUMN(NSigmaTOFKaFromCasc, nSigmaTOFKaFromCasc, float); -// DECLARE_SOA_COLUMN(NSigmaTPCPiFromV0, nSigmaTPCPiFromV0, float); -// DECLARE_SOA_COLUMN(NSigmaTPCPrFromV0, nSigmaTPCPrFromV0, float); DECLARE_SOA_COLUMN(KfDcaXYPiFromOmegac, kfDcaXYPiFromOmegac, float); DECLARE_SOA_COLUMN(KfDcaXYCascToPv, kfDcaXYCascToPv, float); DECLARE_SOA_COLUMN(Chi2GeoV0, chi2GeoV0, float); @@ -205,13 +197,13 @@ DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); // reconstruction le DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t); DECLARE_SOA_COLUMN(CollisionMatched, collisionMatched, bool); // from selector -DECLARE_SOA_COLUMN(StatusPidLambda, statusPidLambda, bool); // --- added --- -DECLARE_SOA_COLUMN(StatusPidCascade, statusPidCascade, bool); // --- added --- -DECLARE_SOA_COLUMN(StatusPidCharmBaryon, statusPidCharmBaryon, bool); // --- added --- -DECLARE_SOA_COLUMN(StatusInvMassLambda, statusInvMassLambda, bool); // --- added --- -DECLARE_SOA_COLUMN(StatusInvMassCascade, statusInvMassCascade, bool); // --- added --- -DECLARE_SOA_COLUMN(StatusInvMassCharmBaryon, statusInvMassCharmBaryon, bool); // --- added --- -DECLARE_SOA_COLUMN(ResultSelections, resultSelections, bool); // --- added --- +DECLARE_SOA_COLUMN(StatusPidLambda, statusPidLambda, bool); +DECLARE_SOA_COLUMN(StatusPidCascade, statusPidCascade, bool); +DECLARE_SOA_COLUMN(StatusPidCharmBaryon, statusPidCharmBaryon, bool); +DECLARE_SOA_COLUMN(StatusInvMassLambda, statusInvMassLambda, bool); +DECLARE_SOA_COLUMN(StatusInvMassCascade, statusInvMassCascade, bool); +DECLARE_SOA_COLUMN(StatusInvMassCharmBaryon, statusInvMassCharmBaryon, bool); +DECLARE_SOA_COLUMN(ResultSelections, resultSelections, bool); DECLARE_SOA_COLUMN(PidTpcInfoStored, pidTpcInfoStored, int); DECLARE_SOA_COLUMN(PidTofInfoStored, pidTofInfoStored, int); DECLARE_SOA_COLUMN(TpcNSigmaPiFromCharmBaryon, tpcNSigmaPiFromCharmBaryon, float); @@ -228,8 +220,7 @@ DECLARE_SOA_TABLE(HfToOmegaPiEvs, "AOD", "HFTOOMEPIEV", full::IsEventSel8, full::IsEventSelZ); DECLARE_SOA_TABLE(HfOmegac0ToOmegaPiLites, "AOD", "HFTOOMEGAPILITE", - // full::XPv, full::YPv, full::ZPv, collision::NumContrib, collision::Chi2, cent::CentFT0M, - full::XPv, full::YPv, full::ZPv, full::Centrality, collision::NumContrib, collision::Chi2, // --- added --- + full::XPv, full::YPv, full::ZPv, full::Centrality, collision::NumContrib, collision::Chi2, full::XDecayVtxCharmBaryon, full::YDecayVtxCharmBaryon, full::ZDecayVtxCharmBaryon, full::XDecayVtxCascade, full::YDecayVtxCascade, full::ZDecayVtxCascade, full::XDecayVtxV0, full::YDecayVtxV0, full::ZDecayVtxV0, @@ -259,13 +250,10 @@ DECLARE_SOA_TABLE(HfOmegac0ToOmegaPiLites, "AOD", "HFTOOMEGAPILITE", full::FlagMcMatchRec, full::OriginMcRec, full::CollisionMatched); DECLARE_SOA_TABLE(HfKfOmegacFulls, "AOD", "HFKFOMEGACFULL", - full::Centrality, // --- added --- - // full::StatusPidLambda, full::StatusPidCascade, full::StatusPidCharmBaryon, // --- added --- - // full::StatusInvMassLambda, full::StatusInvMassCascade, full::StatusInvMassCharmBaryon, // --- added --- - // full::NSigmaTPCPiFromOmegac, full::NSigmaTOFPiFromOmegac, full::NSigmaTPCKaFromCasc, full::NSigmaTOFKaFromCasc, - // full::NSigmaTPCPiFromV0, full::NSigmaTPCPrFromV0, - full::TpcNSigmaPiFromCharmBaryon, full::TofNSigmaPiFromCharmBaryon, full::TpcNSigmaKaFromCasc, full::TofNSigmaKaFromCasc, // --- added --- - full::TpcNSigmaPiFromLambda, full::TofNSigmaPiFromLambda, full::TpcNSigmaPrFromLambda, full::TofNSigmaPrFromLambda, // --- added --- + full::Centrality, + collision::NumContrib, + full::TpcNSigmaPiFromCharmBaryon, full::TofNSigmaPiFromCharmBaryon, full::TpcNSigmaKaFromCasc, full::TofNSigmaKaFromCasc, + full::TpcNSigmaPiFromLambda, full::TofNSigmaPiFromLambda, full::TpcNSigmaPrFromLambda, full::TofNSigmaPrFromLambda, full::KfDcaXYPiFromOmegac, full::DcaCascDau, full::DcaV0Dau, full::DcaCharmBaryonDau, full::KfDcaXYCascToPv, full::DcaXYToPvV0Dau0, full::DcaXYToPvV0Dau1, full::DcaXYToPvCascDau, full::Chi2GeoV0, full::Chi2GeoCasc, full::Chi2GeoOmegac, @@ -282,14 +270,13 @@ DECLARE_SOA_TABLE(HfKfOmegacFulls, "AOD", "HFKFOMEGACFULL", full::MassV0Ndf, full::MassCascNdf, full::V0Chi2OverNdf, full::CascChi2OverNdf, full::OmegacChi2OverNdf, full::MassV0Chi2OverNdf, full::MassCascChi2OverNdf, full::CascRejectInvmass, - full::ResultSelections, // --- added --- + full::ResultSelections, // full::FlagMcMatchRec, full::OriginMcRec, full::CollisionMatched, hf_track_index::HFflag, collision::NumContrib, cent::CentFT0M); - full::FlagMcMatchRec, full::OriginMcRec, full::CollisionMatched); + full::FlagMcMatchRec, full::OriginMcRec, full::CollisionMatched); DECLARE_SOA_TABLE(HfKfOmegacLites, "AOD", "HFKFOMEGACLITE", - // full::NSigmaTPCPiFromOmegac, full::NSigmaTOFPiFromOmegac, full::NSigmaTPCKaFromCasc, full::NSigmaTOFKaFromCasc, - // full::NSigmaTPCPiFromV0, full::NSigmaTPCPrFromV0, full::Centrality, + collision::NumContrib, full::TpcNSigmaPiFromCharmBaryon, full::TofNSigmaPiFromCharmBaryon, full::TpcNSigmaKaFromCasc, full::TofNSigmaKaFromCasc, full::TpcNSigmaPiFromLambda, full::TofNSigmaPiFromLambda, @@ -303,7 +290,7 @@ DECLARE_SOA_TABLE(HfKfOmegacLites, "AOD", "HFKFOMEGACLITE", full::CosThetaStarPiFromOmegac, full::CtOmegac, full::EtaOmegac, full::V0Chi2OverNdf, full::CascChi2OverNdf, full::OmegacChi2OverNdf, full::CascRejectInvmass, - full::ResultSelections, // --- added --- + full::ResultSelections, // full::FlagMcMatchRec, full::OriginMcRec, full::CollisionMatched, hf_track_index::HFflag, collision::NumContrib, cent::CentFT0M); full::FlagMcMatchRec, full::OriginMcRec, full::CollisionMatched); } // namespace o2::aod @@ -319,7 +306,6 @@ struct HfTreeCreatorToOmegaPiQa { Configurable zPvCut{"zPvCut", 10., "Cut on absolute value of primary vertex z coordinate"}; Configurable keepOnlyMcSignal{"keepOnlyMcSignal", true, "Fill MC tree only with signal candidates"}; - // using Tracks = soa::Join; using MyTrackTable = soa::Join; using CandSel = soa::Filtered>; @@ -327,8 +313,6 @@ struct HfTreeCreatorToOmegaPiQa { using CandMcSel = soa::Filtered>; using CandKfMcSel = soa::Filtered>; - // using Colls = soa::Join; - // using CollsWithFT0M = soa::Join; using MyEventTable = soa::Join; using MyEventTableWithFT0M = soa::Join; using CollsWithMcLabels = soa::Join; @@ -348,10 +332,10 @@ struct HfTreeCreatorToOmegaPiQa { // template // void fillEvent(const C& collision, float cutZPv) - template // --- added --- - void fillEvent(const T& collision, float cutZPv) // --- added --- + template + void fillEvent(const T& collision) { - rowEv(collision.sel8(), std::abs(collision.posZ()) < cutZPv); + rowEv(collision.sel8(), std::abs(collision.posZ()) < zPvCut); } template // --- added --- @@ -366,8 +350,8 @@ struct HfTreeCreatorToOmegaPiQa { } } - if constexpr (svReco == DCAFITTER) { // --- added --- - if constexpr (tableSize == LITE) { // --- added --- + if constexpr (svReco == DCAFITTER) { + if constexpr (tableSize == LITE) { rowCandidateLite(candidate.xPv(), candidate.yPv(), candidate.zPv(), @@ -454,10 +438,11 @@ struct HfTreeCreatorToOmegaPiQa { } else { // Not available yet } - } else { // --- added --- + } else { if constexpr (tableSize == LITE) { rowKfCandidateLite( centrality, + candidate.template collision_as().numContrib(), candidate.tpcNSigmaPiFromCharmBaryon(), candidate.tofNSigmaPiFromCharmBaryon(), candidate.tpcNSigmaKaFromCasc(), @@ -475,6 +460,7 @@ struct HfTreeCreatorToOmegaPiQa { candidate.omegacldl(), candidate.chi2TopoPiFromOmegacToPv(), candidate.chi2TopoOmegacToPv(), + // candidate.deviationPiFromOmegacToPv(), candidate.decayLenXYOmegac(), candidate.cosPACasc(), candidate.cosPACharmBaryon(), @@ -494,7 +480,8 @@ struct HfTreeCreatorToOmegaPiQa { originMc, collisionMatched); } else { - rowKfCandidateFull(centrality, // --- added --- + rowKfCandidateFull(centrality, + candidate.template collision_as().numContrib(), candidate.tpcNSigmaPiFromCharmBaryon(), candidate.tofNSigmaPiFromCharmBaryon(), candidate.tpcNSigmaKaFromCasc(), @@ -558,58 +545,10 @@ struct HfTreeCreatorToOmegaPiQa { flagMc, originMc, collisionMatched); - // candidate.hfflag(), - // candidate.template collision_as().numContrib(), - // centFt0m); } } } - // template - // void fillKfCandidateLite(const P& candidate, const C&, int8_t flagMc, int8_t originMc, bool collisionMatched, float centFt0m) - // { - // if (candidate.resultSelections() && candidate.statusPidCharmBaryon() && candidate.statusInvMassLambda() && candidate.statusInvMassCascade() && candidate.statusInvMassCharmBaryon()) { - - // rowKfCandidateLite( - // candidate.tpcNSigmaPiFromCharmBaryon(), - // candidate.tofNSigmaPiFromCharmBaryon(), - // candidate.tpcNSigmaKaFromCasc(), - // candidate.tofNSigmaKaFromCasc(), - // candidate.tpcNSigmaPiFromLambda(), - // candidate.tpcNSigmaPrFromLambda(), - // candidate.kfDcaXYPiFromOmegac(), - // candidate.dcaCharmBaryonDau(), - // candidate.kfDcaXYCascToPv(), - // candidate.dcaCascDau(), - // candidate.v0ldl(), - // candidate.cascldl(), - // candidate.omegacldl(), - // candidate.chi2TopoPiFromOmegacToPv(), - // candidate.chi2TopoOmegacToPv(), - // candidate.deviationPiFromOmegacToPv(), - // candidate.decayLenXYOmegac(), - // candidate.cosPACasc(), - // candidate.cosPACharmBaryon(), - // candidate.invMassCascade(), - // candidate.invMassCharmBaryon(), - // candidate.kfptPiFromOmegac(), - // candidate.kfptOmegac(), - // candidate.cosThetaStarPiFromOmegac(), - // candidate.cTauOmegac(), - // candidate.etaCharmBaryon(), - // candidate.v0Chi2OverNdf(), - // candidate.cascChi2OverNdf(), - // candidate.omegacChi2OverNdf(), - // candidate.cascRejectInvmass(), - // flagMc, - // originMc, - // collisionMatched, - // candidate.hfflag(), - // candidate.template collision_as().numContrib(), - // centFt0m); - // } - // } // fillKfCandidateLite end - //////////////////////////////////// // // // Process functions // @@ -620,9 +559,6 @@ struct HfTreeCreatorToOmegaPiQa { //*~~~~~~~Data with DCAFitter~~~~~~~~*// //*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*// - // void processData(Colls const& collisions, - // CandSel const& candidates, - // Tracks const&) void processDataLite(MyEventTable const& collisions, MyTrackTable const&, CandSel const& candidates) @@ -631,21 +567,16 @@ struct HfTreeCreatorToOmegaPiQa { rowEv.reserve(collisions.size()); for (const auto& collision : collisions) { // fillEvent(collision, zPvCut); - fillEvent(collision, zPvCut); + fillEvent(collision); } // Filling candidate properties rowCandidateLite.reserve(candidates.size()); for (const auto& candidate : candidates) { - // fillCandidateLite(candidate, collisions, -7, RecoDecay::OriginType::None, false, -1.); - fillCandidate(candidate, -7, RecoDecay::OriginType::None, false); // --- added --- + fillCandidate(candidate, -7, RecoDecay::OriginType::None, false); } } - // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processData, "Process data", false); - // void processDataCent(CollsWithFT0M const& collisions, - // CandSel const& candidates, - // Tracks const&) void processDataLiteCent(MyEventTableWithFT0M const& collisions, MyTrackTable const&, CandSel const& candidates) @@ -654,7 +585,7 @@ struct HfTreeCreatorToOmegaPiQa { rowEv.reserve(collisions.size()); for (const auto& collision : collisions) { // fillEvent(collision, zPvCut); - fillEvent(collision, zPvCut); + fillEvent(collision); } // Filling candidate properties @@ -662,11 +593,9 @@ struct HfTreeCreatorToOmegaPiQa { for (const auto& candidate : candidates) { // auto collision = candidate.collision_as(); // float centFt0m = o2::hf_centrality::getCentralityColl(collision); - // fillCandidateLite(candidate, collisions, -7, RecoDecay::OriginType::None, false, centFt0m); - fillCandidate(candidate, -7, RecoDecay::OriginType::None, false); // --- added --- + fillCandidate(candidate, -7, RecoDecay::OriginType::None, false); } } - // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processDataCent, "Process data with FT0M info", false); PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processDataLite, "Process data and produce lite table version", true); PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processDataLiteCent, "Process data and produce lite table version with FT0M", false); @@ -675,61 +604,48 @@ struct HfTreeCreatorToOmegaPiQa { //*~~~~~~~Data with KFParticle~~~~~~~~*// //*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*// - // void processKfData(Colls const& collisions, - // CandKfSel const& candidates) void processKfData(MyEventTable const& collisions, - MyTrackTable const&, // --- added --- CandKfSel const& candidates) { // Filling event properties rowEv.reserve(collisions.size()); for (const auto& collision : collisions) { // fillEvent(collision, zPvCut); - fillEvent(collision, zPvCut); + fillEvent(collision); } // Filling candidate properties rowKfCandidateFull.reserve(candidates.size()); for (const auto& candidate : candidates) { - // fillKfCandidate(candidate, collisions, -7, RecoDecay::OriginType::None, false, -1.); - fillCandidate(candidate, -7, RecoDecay::OriginType::None, false); // --- added --- + fillCandidate(candidate, -7, RecoDecay::OriginType::None, false); } } - // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processKfData, "Process KF data", false); - // void processKfDataLite(Colls const& collisions, - // CandKfSel const& candidates) void processKfDataLite(MyEventTable const& collisions, - MyTrackTable const&, // --- added --- CandKfSel const& candidates) { // Filling event properties rowEv.reserve(collisions.size()); for (const auto& collision : collisions) { // fillEvent(collision, zPvCut); - fillEvent(collision, zPvCut); + fillEvent(collision); } // Filling candidate properties rowKfCandidateLite.reserve(candidates.size()); for (const auto& candidate : candidates) { - // fillKfCandidateLite(candidate, collisions, -7, RecoDecay::OriginType::None, false, -1.); fillCandidate(candidate, -7, RecoDecay::OriginType::None, false); } } - // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processKfDataLite, "Process KF data lite", false); - // void processKfDataCent(CollsWithFT0M const& collisions, - // CandKfSel const& candidates) void processKfDataCent(MyEventTableWithFT0M const& collisions, - MyTrackTable const&, // --- added --- CandKfSel const& candidates) { // Filling event properties rowEv.reserve(collisions.size()); for (const auto& collision : collisions) { // fillEvent(collision, zPvCut); - fillEvent(collision, zPvCut); + fillEvent(collision); } // Filling candidate properties @@ -737,23 +653,18 @@ struct HfTreeCreatorToOmegaPiQa { for (const auto& candidate : candidates) { // auto collision = candidate.collision_as(); // float centFt0m = o2::hf_centrality::getCentralityColl(collision); - // fillKfCandidate(candidate, collisions, -7, RecoDecay::OriginType::None, false, centFt0m); - fillCandidate(candidate, -7, RecoDecay::OriginType::None, false); // --- added --- + fillCandidate(candidate, -7, RecoDecay::OriginType::None, false); } } - // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processKfDataCent, "Process KF data with FT0M info", false); - // void processKfDataCentLite(CollsWithFT0M const& collisions, - // CandKfSel const& candidates) void processKfDataCentLite(MyEventTableWithFT0M const& collisions, - MyTrackTable const&, // --- added --- CandKfSel const& candidates) { // Filling event properties rowEv.reserve(collisions.size()); for (const auto& collision : collisions) { // fillEvent(collision, zPvCut); - fillEvent(collision, zPvCut); + fillEvent(collision); } // Filling candidate properties @@ -761,11 +672,9 @@ struct HfTreeCreatorToOmegaPiQa { for (const auto& candidate : candidates) { // auto collision = candidate.collision_as(); // float centFt0m = o2::hf_centrality::getCentralityColl(collision); - // fillKfCandidateLite(candidate, collisions, -7, RecoDecay::OriginType::None, false, centFt0m); fillCandidate(candidate, -7, RecoDecay::OriginType::None, false); } } - // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processKfDataCentLite, "Process KF data lite with FT0M info", false); PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processKfData, "Process KF data, no cent", false); PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processKfDataLite, "Process KF data lite", false); @@ -776,9 +685,6 @@ struct HfTreeCreatorToOmegaPiQa { //*~~~~~~~MC with DCAFitter~~~~~~~~*// //*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*// - // void processMc(Colls const& collisions, - // CandMcSel const& candidates, - // Tracks const&) void processMcLite(MyEventTable const& collisions, MyTrackTable const&, CandMcSel const& candidates) @@ -787,7 +693,7 @@ struct HfTreeCreatorToOmegaPiQa { rowEv.reserve(collisions.size()); for (const auto& collision : collisions) { // fillEvent(collision, zPvCut); - fillEvent(collision, zPvCut); + fillEvent(collision); } // Filling candidate properties @@ -799,12 +705,7 @@ struct HfTreeCreatorToOmegaPiQa { fillCandidate(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched()); } } - // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processMc, "Process MC", false); - // void processMcCent(CollsWithMcLabels const& collisions, - // CandMcSel const& candidates, - // Tracks const&, - // McCollsWithFT0M const&) void processMcCentLite(CollsWithMcLabels const& collisions, MyTrackTable const&, CandMcSel const& candidates, @@ -814,7 +715,7 @@ struct HfTreeCreatorToOmegaPiQa { rowEv.reserve(collisions.size()); for (const auto& collision : collisions) { // fillEvent(collision, zPvCut); - fillEvent(collision, zPvCut); + fillEvent(collision); } // Filling candidate properties @@ -825,11 +726,9 @@ struct HfTreeCreatorToOmegaPiQa { } auto mcCollision = candidate.collision_as().mcCollision_as(); float centFt0m = o2::hf_centrality::getCentralityColl(mcCollision); - // fillCandidateLite(candidate, collisions, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched(), centFt0m); fillCandidate(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched(), centFt0m); } } - // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processMcCent, "Process MC with FT0M info", false); PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processMcLite, "Process and produce lite table version for omegac0", false); PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processMcCentLite, "Process MC and produce lite table version for Omegac0 with FT0M", false); @@ -838,10 +737,7 @@ struct HfTreeCreatorToOmegaPiQa { //*~~~~~~~MC with KFParticle~~~~~~~~*// //*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*// - // void processKFMc(Colls const& collisions, - // CandKfMcSel const& candidates) void processKfMc(MyEventTable const& collisions, - MyTrackTable const&, // --- added --- CandKfMcSel const& candidates) { @@ -849,7 +745,7 @@ struct HfTreeCreatorToOmegaPiQa { rowEv.reserve(collisions.size()); for (const auto& collision : collisions) { // fillEvent(collision, zPvCut); - fillEvent(collision, zPvCut); // --- added --- + fillEvent(collision); } // Filling candidate properties @@ -858,23 +754,18 @@ struct HfTreeCreatorToOmegaPiQa { if (keepOnlyMcSignal && candidate.originMcRec() == RecoDecay::OriginType::None) { continue; } - // fillKfCandidate(candidate, collisions, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched(), -1.); - fillCandidate(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched()); // --- added --- + fillCandidate(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched()); } } - // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processKFMc, "Process KF MC", false); - // void processKFMcLite(Colls const& collisions, - // CandKfMcSel const& candidates) void processKfMcLite(MyEventTable const& collisions, - MyTrackTable const&, // --- added --- CandKfMcSel const& candidates) { // Filling event properties rowEv.reserve(collisions.size()); for (const auto& collision : collisions) { // fillEvent(collision, zPvCut); - fillEvent(collision, zPvCut); + fillEvent(collision); } // Filling candidate properties @@ -883,17 +774,11 @@ struct HfTreeCreatorToOmegaPiQa { if (keepOnlyMcSignal && candidate.originMcRec() == RecoDecay::OriginType::None) { continue; } - // fillKfCandidateLite(candidate, collisions, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched(), -1.); fillCandidate(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched()); } } - // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processKFMcLite, "Process KF MC Lite", false); - // void processKFMcCent(CollsWithMcLabels const& collisions, - // CandKfMcSel const& candidates, - // McCollsWithFT0M const&) void processKfMcCent(CollsWithMcLabels const& collisions, - MyTrackTable const&, // --- added --- CandKfMcSel const& candidates, McCollsWithFT0M const&) { @@ -901,7 +786,7 @@ struct HfTreeCreatorToOmegaPiQa { rowEv.reserve(collisions.size()); for (const auto& collision : collisions) { // fillEvent(collision, zPvCut); - fillEvent(collision, zPvCut); + fillEvent(collision); } // Filling candidate properties @@ -912,17 +797,11 @@ struct HfTreeCreatorToOmegaPiQa { } auto mcCollision = candidate.collision_as().mcCollision_as(); float centFt0m = o2::hf_centrality::getCentralityColl(mcCollision); - // fillKfCandidate(candidate, collisions, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched(), centFt0m); fillCandidate(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched(), centFt0m); } } - // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processKFMcCent, "Process KF MC with FT0M info", false); - // void processKFMcCentLite(CollsWithMcLabels const& collisions, - // CandKfMcSel const& candidates, - // McCollsWithFT0M const&) void processKfMcCentLite(CollsWithMcLabels const& collisions, - MyTrackTable const&, // --- added --- CandKfMcSel const& candidates, McCollsWithFT0M const&) { @@ -930,7 +809,7 @@ struct HfTreeCreatorToOmegaPiQa { rowEv.reserve(collisions.size()); for (const auto& collision : collisions) { // fillEvent(collision, zPvCut); - fillEvent(collision, zPvCut); + fillEvent(collision); } // Filling candidate properties @@ -941,12 +820,9 @@ struct HfTreeCreatorToOmegaPiQa { } auto mcCollision = candidate.collision_as().mcCollision_as(); float centFt0m = o2::hf_centrality::getCentralityColl(mcCollision); - // fillKfCandidateLite(candidate, collisions, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched(), centFt0m); - fillCandidate(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched(), centFt0m); } } - // PROCESS_SWITCH(HfTreeCreatorOmegac0ToOmegaPi, processKFMcCentLite, "Process KF MC Lite with FT0M info", false); PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processKfMc, "Process KF MC full for Omegac0", false); PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processKfMcLite, "Process KF MC lite for Omegac0", false); From 988a58a940c26d615e22db393c3872887a070669 Mon Sep 17 00:00:00 2001 From: mariafernandatorrescabrera Date: Wed, 30 Sep 2026 13:26:38 -0500 Subject: [PATCH 12/12] Fix formatting issues in Omegac QA workflow --- PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h | 24 ++- PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx | 22 +-- .../candidateSelectorOmegac0ToOmegaPiQa.cxx | 20 +-- .../treeCreatorOmegac0ToOmegaPiQa.cxx | 161 +++++++++--------- 4 files changed, 111 insertions(+), 116 deletions(-) diff --git a/PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h b/PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h index b2665f1ce42..a4d8e6e05b6 100755 --- a/PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h +++ b/PWGHF/Core/HfMlResponseOmegacToOmegaPiQa.h @@ -30,10 +30,9 @@ // Fill the map of available input features // the key is the feature's name (std::string) // the value is the corresponding value in EnumInputFeatures -#define FILL_MAP_OMEGAC0(FEATURE) \ - { \ - #FEATURE, static_cast(InputFeaturesOmegacToOmegaPi::FEATURE) \ - } +#define FILL_MAP_OMEGAC0(FEATURE) \ + { \ + #FEATURE, static_cast(InputFeaturesOmegacToOmegaPi::FEATURE)} // Check if the index of mCachedIndices (index associated to a FEATURE) // matches the entry in EnumInputFeatures associated to this FEATURE @@ -70,7 +69,7 @@ enum class InputFeaturesOmegacToOmegaPi : uint8_t { impactParCascZ, cosPACharmBaryon, cosPACasc, - + // KFParticle variables cosPaOmegacToPv, kfDcaXYPiFromOmegac, @@ -113,7 +112,7 @@ class HfMlResponseOmegacToOmegaPi : public HfMlResponse std::vector inputFeatures; for (const auto& idx : MlResponse::mCachedIndices) { - + // Variables common to DCAFitter and KFParticle switch (idx) { @@ -124,7 +123,7 @@ class HfMlResponseOmegacToOmegaPi : public HfMlResponse CHECK_AND_FILL_VEC_OMEGAC0_FULL(cascProng, nSigmaTPCKaFromCasc, tpcNSigmaKa); CHECK_AND_FILL_VEC_OMEGAC0_FULL(charmBaryonProng, nSigmaTPCPiFromOmegac, tpcNSigmaPi); } - + // DCAFitter variables if constexpr (reconstructionType == aod::hf_cand_casc_lf::ConstructMethod::DcaFitter) { @@ -138,7 +137,7 @@ class HfMlResponseOmegacToOmegaPi : public HfMlResponse CHECK_AND_FILL_VEC_OMEGAC0(cosPACasc); } } - + // KFParticle variables if constexpr (reconstructionType == aod::hf_cand_casc_lf::ConstructMethod::KfParticle) { @@ -180,8 +179,7 @@ class HfMlResponseOmegacToOmegaPi : public HfMlResponse FILL_MAP_OMEGAC0(dcaCascDau), FILL_MAP_OMEGAC0(nSigmaTPCPiFromV0), FILL_MAP_OMEGAC0(nSigmaTPCPiFromOmegac), - FILL_MAP_OMEGAC0(nSigmaTPCKaFromCasc) - }; + FILL_MAP_OMEGAC0(nSigmaTPCKaFromCasc)}; // DCAFitter variables if constexpr (reconstructionType == aod::hf_cand_casc_lf::ConstructMethod::DcaFitter) { @@ -193,8 +191,7 @@ class HfMlResponseOmegacToOmegaPi : public HfMlResponse FILL_MAP_OMEGAC0(impactParCascXY), FILL_MAP_OMEGAC0(impactParCascZ), FILL_MAP_OMEGAC0(cosPACharmBaryon), - FILL_MAP_OMEGAC0(cosPACasc) - }; + FILL_MAP_OMEGAC0(cosPACasc)}; MlResponse::mAvailableInputFeatures.insert(mapDcaFeatures.begin(), mapDcaFeatures.end()); } @@ -221,8 +218,7 @@ class HfMlResponseOmegacToOmegaPi : public HfMlResponse FILL_MAP_OMEGAC0(chi2NdfTopoCascToOmegac), FILL_MAP_OMEGAC0(chi2NdfTopoCascToPv), FILL_MAP_OMEGAC0(chi2GeoOmegac), - FILL_MAP_OMEGAC0(chi2GeoCasc) - }; + FILL_MAP_OMEGAC0(chi2GeoCasc)}; MlResponse::mAvailableInputFeatures.insert(mapKfFeatures.begin(), mapKfFeatures.end()); } diff --git a/PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx b/PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx index 5d7c235ae7a..812149383b2 100755 --- a/PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx +++ b/PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx @@ -102,10 +102,10 @@ struct HfTaskOmegac0ToOmegaPiQa { void init(InitContext&) { - std::array doprocess{doprocessDataDCAFitter, doprocessDataDCAFitterMl, doprocessDataDCAFitterFT0C, doprocessDataDCAFitterMlFT0C, + std::array doprocess{doprocessDataDCAFitter, doprocessDataDCAFitterMl, doprocessDataDCAFitterFT0C, doprocessDataDCAFitterMlFT0C, doprocessDataDCAFitterFT0M, doprocessDataDCAFitterMlFT0M, doprocessDataKFParticle, doprocessDataKFParticleMl, doprocessDataKFParticleFT0C, doprocessDataKFParticleMlFT0C, - doprocessDataKFParticleFT0M, doprocessDataKFParticleMlFT0M, + doprocessDataKFParticleFT0M, doprocessDataKFParticleMlFT0M, doprocessMcDCAFitter, doprocessMcDCAFitterMl, doprocessMcDCAFitterFT0M, doprocessMcDCAFitterMlFT0M, doprocessMcKFParticle, doprocessMcKFParticleMl, @@ -128,12 +128,12 @@ struct HfTaskOmegac0ToOmegaPiQa { std::vector axes = {thnAxisMass, thnAxisPt, thnAxisY}; std::vector axesMcGen = {thnAxisPt, thnAxisPtB, thnAxisY, thnAxisOrigin}; - if (doprocessDataDCAFitterFT0C || doprocessDataDCAFitterMlFT0C|| doprocessDataDCAFitterFT0M || doprocessDataDCAFitterMlFT0M || doprocessDataKFParticleFT0C || doprocessDataKFParticleMlFT0C || doprocessDataKFParticleFT0M || doprocessDataKFParticleMlFT0M) { + if (doprocessDataDCAFitterFT0C || doprocessDataDCAFitterMlFT0C || doprocessDataDCAFitterFT0M || doprocessDataDCAFitterMlFT0M || doprocessDataKFParticleFT0C || doprocessDataKFParticleMlFT0C || doprocessDataKFParticleFT0M || doprocessDataKFParticleMlFT0M) { axes.push_back(thnAxisCent); axes.emplace_back(thnConfigAxisNumPvContr); } - if (doprocessMcDCAFitterFT0M || doprocessMcDCAFitterMlFT0M ||doprocessMcKFParticleFT0M || doprocessMcKFParticleMlFT0M) { + if (doprocessMcDCAFitterFT0M || doprocessMcDCAFitterMlFT0M || doprocessMcKFParticleFT0M || doprocessMcKFParticleMlFT0M) { axes.push_back(thnAxisCentMc); axes.emplace_back(thnConfigAxisNumPvContr); axesMcGen.push_back(thnAxisCentMc); @@ -170,7 +170,7 @@ struct HfTaskOmegac0ToOmegaPiQa { if (!(candidate.resultSelections() == true || (candidate.resultSelections() == false && !selectionFlagOmegac0))) { continue; } - + double yOmegac{0.}; if constexpr (UseKfParticle) { yOmegac = candidate.kfRapOmegac(); @@ -211,7 +211,7 @@ struct HfTaskOmegac0ToOmegaPiQa { if constexpr (UseCentrality) { float const cent = o2::hf_centrality::getCentralityColl(collision); if constexpr (ApplyMl) { - registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), yOmegac, + registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), yOmegac, cent, numPvContributors, candidate.mlProbOmegac()[0]); } else { registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), yOmegac, @@ -280,7 +280,7 @@ struct HfTaskOmegac0ToOmegaPiQa { if (!(candidate.resultSelections() == true || (candidate.resultSelections() == false && !selectionFlagOmegac0))) { continue; } - + double yOmegac{0.}; if constexpr (UseKfParticle) { yOmegac = candidate.kfRapOmegac(); @@ -408,8 +408,8 @@ struct HfTaskOmegac0ToOmegaPiQa { } } } - PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processDataDCAFitterMlFT0M, "process data with DCAFitter, ML selections, FT0M centrality", false); - + PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processDataDCAFitterMlFT0M, "process data with DCAFitter, ML selections, FT0M centrality", false); + //////////////////////////////////// /// Data with KFParticle // //////////////////////////////////// @@ -467,7 +467,7 @@ struct HfTaskOmegac0ToOmegaPiQa { void processDataKFParticleMlFT0M(Omegac0CandsMlKF const& candidates, CollisionsWithFT0M const& collisions) - { + { for (const auto& collision : collisions) { auto groupedOmegacCandidates = candidates.sliceBy(candOmegacKFMlPerCollision, collision.globalIndex()); @@ -495,7 +495,7 @@ struct HfTaskOmegac0ToOmegaPiQa { processMc(omegac0CandidatesMlMc, mcParticles); } PROCESS_SWITCH(HfTaskOmegac0ToOmegaPiQa, processMcDCAFitterMl, "Process MC with DCAFitter, ML selections", false); - + void processMcDCAFitterFT0M(Omegac0CandsMc const& omegaC0CandidatesMc, Omegac0Gen const& mcParticles, CollisionsWithMcLabels const& collisions, diff --git a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx index 67f05a249a0..91cf4c95c9c 100755 --- a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx +++ b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx @@ -69,7 +69,7 @@ enum { /// Struct for applying Omegac0 -> Omega pi selection cuts struct HfCandidateSelectorToOmegaPiQa { - // DCAFitter and KFParticle + // DCAFitter and KFParticle Produces hfSelToOmegaPi; // ML selection - filled for both DCAFitter and KFParticle Produces hfMlSelToOmegaPi; @@ -369,7 +369,7 @@ struct HfCandidateSelectorToOmegaPiQa { registry.add("hInvMassCharmBaryon", "Charm baryon invariant mass; inv. mass; entries", {HistType::kTH1F, {{500, 2.3, 3.1}}}); registry.add("hPtCharmBaryon", "Charm baryon transverse momentum; p_{T} (GeV/#it{c}); entries", {HistType::kTH1F, {{8000, 0., 80.}}}); - + if (doprocessOmegac0SelectorWithKFParticle) { registry.add("hSelCompetingCasc", "hSelCompetingCasc;status;entries", {HistType::kTH1F, {axisSel}}); registry.add("hInvMassXiMinus_rej_cut", "hInvMassXiMinus_rej_cut;m_{#Lambda#pi} under Xi hypothesis (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{1000, 1.25f, 1.65f}}}); @@ -670,7 +670,7 @@ struct HfCandidateSelectorToOmegaPiQa { // template template - void runOmegac0Selector(TCandTable const& candidates, + void runOmegac0Selector(TCandTable const& candidates, TracksSel const& tracks, TracksSelLf const& lfTracks) { @@ -696,11 +696,11 @@ struct HfCandidateSelectorToOmegaPiQa { registry.fill(HIST("hSelSignDec"), 1); // anti-particle decay } else { registry.fill(HIST("hSelSignDec"), 0); // particle decay - } + } // pT selection auto ptCandOmegac = RecoDecay::pt(candidate.pxCharmBaryon(), candidate.pyCharmBaryon()); - + if (ptCandOmegac <= ptCandMin || ptCandOmegac >= ptCandMax) { resultSelections = false; } @@ -725,7 +725,7 @@ struct HfCandidateSelectorToOmegaPiQa { if (!selectionResOnLF || !selectionResOnHF) { resultSelections = false; } - + // if (std::abs(etaV0PosDau) > etaTrackLFDauMax) { // resultSelections = false; // registry.fill(HIST("hSelEtaPosV0Dau"), 0); @@ -1222,8 +1222,8 @@ struct HfCandidateSelectorToOmegaPiQa { /////////////////////////////////// /// Process with DCAFitter // /////////////////////////////////// - void processOmegac0SelectorWithDCAFitter(aod::HfCandToOmegaPi const& candidates, - TracksSel const& tracks, + void processOmegac0SelectorWithDCAFitter(aod::HfCandToOmegaPi const& candidates, + TracksSel const& tracks, TracksSelLf const& lfTracks) { runOmegac0Selector(candidates, tracks, lfTracks); @@ -1233,8 +1233,8 @@ struct HfCandidateSelectorToOmegaPiQa { //////////////////////////////////// /// Process with KFParticle // //////////////////////////////////// - void processOmegac0SelectorWithKFParticle(soa::Join const& candidates, - TracksSel const& tracks, + void processOmegac0SelectorWithKFParticle(soa::Join const& candidates, + TracksSel const& tracks, TracksSelLf const& lfTracks) { runOmegac0Selector(candidates, tracks, lfTracks); diff --git a/PWGHF/TableProducer/treeCreatorOmegac0ToOmegaPiQa.cxx b/PWGHF/TableProducer/treeCreatorOmegac0ToOmegaPiQa.cxx index ae229b4e0d7..b8284940fba 100755 --- a/PWGHF/TableProducer/treeCreatorOmegac0ToOmegaPiQa.cxx +++ b/PWGHF/TableProducer/treeCreatorOmegac0ToOmegaPiQa.cxx @@ -74,7 +74,7 @@ DECLARE_SOA_COLUMN(ZDecayVtxCascade, zDecayVtxCascade, float); DECLARE_SOA_COLUMN(XDecayVtxV0, xDecayVtxV0, float); DECLARE_SOA_COLUMN(YDecayVtxV0, yDecayVtxV0, float); DECLARE_SOA_COLUMN(ZDecayVtxV0, zDecayVtxV0, float); -DECLARE_SOA_COLUMN(SignDecay, signDecay, int8_t); // sign of ka <- omega +DECLARE_SOA_COLUMN(SignDecay, signDecay, int8_t); // sign of ka <- omega DECLARE_SOA_COLUMN(CovVtxCharmBaryonXX, covVtxCharmBaryonXX, float); // --- added --- DECLARE_SOA_COLUMN(CovVtxCharmBaryonYY, covVtxCharmBaryonYY, float); // --- added --- DECLARE_SOA_COLUMN(CovVtxCharmBaryonZZ, covVtxCharmBaryonZZ, float); // --- added --- @@ -87,13 +87,13 @@ DECLARE_SOA_COLUMN(PzCasc, pzCasc, float); // --- added --- DECLARE_SOA_COLUMN(PxPiFromCharmBaryon, pxPiFromCharmBaryon, float); DECLARE_SOA_COLUMN(PyPiFromCharmBaryon, pyPiFromCharmBaryon, float); DECLARE_SOA_COLUMN(PzPiFromCharmBaryon, pzPiFromCharmBaryon, float); -DECLARE_SOA_COLUMN(PxLambda, pxLambda, float); // --- added --- -DECLARE_SOA_COLUMN(PyLambda, pyLambda, float); // --- added --- -DECLARE_SOA_COLUMN(PzLambda, pzLambda, float); // --- added --- -DECLARE_SOA_COLUMN(PtCharmBaryon, ptCharmBaryon, float); // --- added --- +DECLARE_SOA_COLUMN(PxLambda, pxLambda, float); // --- added --- +DECLARE_SOA_COLUMN(PyLambda, pyLambda, float); // --- added --- +DECLARE_SOA_COLUMN(PzLambda, pzLambda, float); // --- added --- +DECLARE_SOA_COLUMN(PtCharmBaryon, ptCharmBaryon, float); // --- added --- DECLARE_SOA_COLUMN(PtPiFromCharmBaryon, ptPiFromCharmBaryon, float); // --- added --- DECLARE_SOA_COLUMN(PxKaFromCasc, pxKaFromCasc, float); -DECLARE_SOA_COLUMN(PyKaFromCasc, pyKaFromCasc, float); +DECLARE_SOA_COLUMN(PyKaFromCasc, pyKaFromCasc, float); DECLARE_SOA_COLUMN(PzKaFromCasc, pzKaFromCasc, float); DECLARE_SOA_COLUMN(PxPosV0Dau, pxPosV0Dau, float); DECLARE_SOA_COLUMN(PyPosV0Dau, pyPosV0Dau, float); @@ -103,41 +103,41 @@ DECLARE_SOA_COLUMN(PyNegV0Dau, pyNegV0Dau, float); DECLARE_SOA_COLUMN(PzNegV0Dau, pzNegV0Dau, float); DECLARE_SOA_COLUMN(ImpactParCascXY, impactParCascXY, float); DECLARE_SOA_COLUMN(ImpactParPiFromCharmBaryonXY, impactParPiFromCharmBaryonXY, float); -DECLARE_SOA_COLUMN(ImpactParCascZ, impactParCascZ, float); // --- added --- +DECLARE_SOA_COLUMN(ImpactParCascZ, impactParCascZ, float); // --- added --- DECLARE_SOA_COLUMN(ImpactParPiFromCharmBaryonZ, impactParPiFromCharmBaryonZ, float); // --- added --- DECLARE_SOA_COLUMN(ErrImpactParCascXY, errImpactParCascXY, float); DECLARE_SOA_COLUMN(ErrImpactParPiFromCharmBaryonXY, errImpactParPiFromCharmBaryonXY, float); DECLARE_SOA_COLUMN(InvMassLambda, invMassLambda, float); DECLARE_SOA_COLUMN(InvMassCascade, invMassCascade, float); DECLARE_SOA_COLUMN(InvMassCharmBaryon, invMassCharmBaryon, float); -DECLARE_SOA_COLUMN(CosPAV0, cosPAV0, float); // --- added --- -DECLARE_SOA_COLUMN(CosPACharmBaryon, cosPACharmBaryon, float); // --- added --- -DECLARE_SOA_COLUMN(CosPACasc, cosPACasc, float); // --- added --- -DECLARE_SOA_COLUMN(CosPAXYV0, cosPAXYV0, float); // --- added --- +DECLARE_SOA_COLUMN(CosPAV0, cosPAV0, float); // --- added --- +DECLARE_SOA_COLUMN(CosPACharmBaryon, cosPACharmBaryon, float); // --- added --- +DECLARE_SOA_COLUMN(CosPACasc, cosPACasc, float); // --- added --- +DECLARE_SOA_COLUMN(CosPAXYV0, cosPAXYV0, float); // --- added --- DECLARE_SOA_COLUMN(CosPAXYCharmBaryon, cosPAXYCharmBaryon, float); // --- added --- -DECLARE_SOA_COLUMN(CosPAXYCasc, cosPAXYCasc, float); // --- added --- -DECLARE_SOA_COLUMN(CTauOmegac, cTauOmegac, float); // --- added --- -DECLARE_SOA_COLUMN(CTauCascade, cTauCascade, float); // --- added --- -DECLARE_SOA_COLUMN(CTauV0, cTauV0, float); // --- added --- +DECLARE_SOA_COLUMN(CosPAXYCasc, cosPAXYCasc, float); // --- added --- +DECLARE_SOA_COLUMN(CTauOmegac, cTauOmegac, float); // --- added --- +DECLARE_SOA_COLUMN(CTauCascade, cTauCascade, float); // --- added --- +DECLARE_SOA_COLUMN(CTauV0, cTauV0, float); // --- added --- DECLARE_SOA_COLUMN(EtaV0PosDau, etaV0PosDau, float); DECLARE_SOA_COLUMN(EtaV0NegDau, etaV0NegDau, float); DECLARE_SOA_COLUMN(EtaKaFromCasc, etaKaFromCasc, float); DECLARE_SOA_COLUMN(EtaPiFromCharmBaryon, etaPiFromCharmBaryon, float); DECLARE_SOA_COLUMN(EtaCharmBaryon, etaCharmBaryon, float); // -- added --- -DECLARE_SOA_COLUMN(EtaCascade, etaCascade, float); // -- added --- -DECLARE_SOA_COLUMN(EtaV0, etaV0, float); // -- added --- +DECLARE_SOA_COLUMN(EtaCascade, etaCascade, float); // -- added --- +DECLARE_SOA_COLUMN(EtaV0, etaV0, float); // -- added --- DECLARE_SOA_COLUMN(DcaXYToPvV0Dau0, dcaXYToPvV0Dau0, float); DECLARE_SOA_COLUMN(DcaXYToPvV0Dau1, dcaXYToPvV0Dau1, float); DECLARE_SOA_COLUMN(DcaXYToPvCascDau, dcaXYToPvCascDau, float); -DECLARE_SOA_COLUMN(DcaZToPvV0Dau0, dcaZToPvV0Dau0, float); // -- added --- -DECLARE_SOA_COLUMN(DcaZToPvV0Dau1, dcaZToPvV0Dau1, float); // -- added --- +DECLARE_SOA_COLUMN(DcaZToPvV0Dau0, dcaZToPvV0Dau0, float); // -- added --- +DECLARE_SOA_COLUMN(DcaZToPvV0Dau1, dcaZToPvV0Dau1, float); // -- added --- DECLARE_SOA_COLUMN(DcaZToPvCascDau, dcaZToPvCascDau, float); // -- added --- DECLARE_SOA_COLUMN(DcaCascDau, dcaCascDau, float); DECLARE_SOA_COLUMN(DcaV0Dau, dcaV0Dau, float); DECLARE_SOA_COLUMN(DcaCharmBaryonDau, dcaCharmBaryonDau, float); DECLARE_SOA_COLUMN(DecLenCharmBaryon, decLenCharmBaryon, float); // --- added --- -DECLARE_SOA_COLUMN(DecLenCascade, decLenCascade, float); // --- added --- -DECLARE_SOA_COLUMN(DecLenV0, decLenV0, float); // --- added --- +DECLARE_SOA_COLUMN(DecLenCascade, decLenCascade, float); // --- added --- +DECLARE_SOA_COLUMN(DecLenV0, decLenV0, float); // --- added --- DECLARE_SOA_COLUMN(ErrorDecayLengthCharmBaryon, errorDecayLengthCharmBaryon, float); DECLARE_SOA_COLUMN(ErrorDecayLengthXYCharmBaryon, errorDecayLengthXYCharmBaryon, float); // -- added --- DECLARE_SOA_COLUMN(NormImpParCascade, normImpParCascade, double); @@ -145,10 +145,10 @@ DECLARE_SOA_COLUMN(NormImpParPiFromCharmBar, normImpParPiFromCharmBar, double); DECLARE_SOA_COLUMN(NormDecayLenCharmBar, normDecayLenCharmBar, double); // -- added --- DECLARE_SOA_COLUMN(IsPionGlbTrkWoDca, isPionGlbTrkWoDca, bool); DECLARE_SOA_COLUMN(PionItsNCls, pionItsNCls, uint8_t); -DECLARE_SOA_COLUMN(NTpcRowsPion, nTpcRowsPion, int16_t); // -- added --- +DECLARE_SOA_COLUMN(NTpcRowsPion, nTpcRowsPion, int16_t); // -- added --- DECLARE_SOA_COLUMN(NTpcRowsKaFromCasc, nTpcRowsKaFromCasc, int16_t); // -- added --- -DECLARE_SOA_COLUMN(NTpcRowsPosV0Dau, nTpcRowsPosV0Dau, int16_t); // -- added --- -DECLARE_SOA_COLUMN(NTpcRowsNegV0Dau, nTpcRowsNegV0Dau, int16_t); // -- added --- +DECLARE_SOA_COLUMN(NTpcRowsPosV0Dau, nTpcRowsPosV0Dau, int16_t); // -- added --- +DECLARE_SOA_COLUMN(NTpcRowsNegV0Dau, nTpcRowsNegV0Dau, int16_t); // -- added --- // from creator KF DECLARE_SOA_COLUMN(KfDcaXYPiFromOmegac, kfDcaXYPiFromOmegac, float); DECLARE_SOA_COLUMN(KfDcaXYCascToPv, kfDcaXYCascToPv, float); @@ -164,7 +164,7 @@ DECLARE_SOA_COLUMN(Chi2TopoV0ToPv, chi2TopoV0ToPv, float); DECLARE_SOA_COLUMN(Chi2TopoCascToPv, chi2TopoCascToPv, float); DECLARE_SOA_COLUMN(Chi2TopoPiFromOmegacToPv, chi2TopoPiFromOmegacToPv, float); DECLARE_SOA_COLUMN(Chi2TopoOmegacToPv, chi2TopoOmegacToPv, float); -// DECLARE_SOA_COLUMN(DeviationPiFromOmegacToPv, deviationPiFromOmegacToPv, float); +// DECLARE_SOA_COLUMN(DeviationPiFromOmegacToPv, deviationPiFromOmegacToPv, float); DECLARE_SOA_COLUMN(Chi2TopoV0ToCasc, chi2TopoV0ToCasc, float); DECLARE_SOA_COLUMN(Chi2TopoCascToOmegac, chi2TopoCascToOmegac, float); DECLARE_SOA_COLUMN(DecayLenXYLambda, decayLenXYLambda, float); @@ -194,7 +194,7 @@ DECLARE_SOA_COLUMN(MassCascChi2OverNdf, massCascChi2OverNdf, float); DECLARE_SOA_COLUMN(CascRejectInvmass, cascRejectInvmass, float); // from creator - MC DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); // reconstruction level -DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t); +DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t); DECLARE_SOA_COLUMN(CollisionMatched, collisionMatched, bool); // from selector DECLARE_SOA_COLUMN(StatusPidLambda, statusPidLambda, bool); @@ -292,7 +292,7 @@ DECLARE_SOA_TABLE(HfKfOmegacLites, "AOD", "HFKFOMEGACLITE", full::CascRejectInvmass, full::ResultSelections, // full::FlagMcMatchRec, full::OriginMcRec, full::CollisionMatched, hf_track_index::HFflag, collision::NumContrib, cent::CentFT0M); - full::FlagMcMatchRec, full::OriginMcRec, full::CollisionMatched); + full::FlagMcMatchRec, full::OriginMcRec, full::CollisionMatched); } // namespace o2::aod /// Writes the full information in an output TTree @@ -368,7 +368,7 @@ struct HfTreeCreatorToOmegaPiQa { candidate.yDecayVtxV0(), candidate.zDecayVtxV0(), candidate.signDecay(), - RecoDecay::pt(candidate.pxCharmBaryon(), candidate.pyCharmBaryon()), // --- added --- + RecoDecay::pt(candidate.pxCharmBaryon(), candidate.pyCharmBaryon()), // --- added --- RecoDecay::pt(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()), // --- added --- candidate.pxCharmBaryon(), candidate.pyCharmBaryon(), @@ -392,9 +392,9 @@ struct HfTreeCreatorToOmegaPiQa { candidate.invMassLambda(), candidate.invMassCascade(), candidate.invMassCharmBaryon(), - candidate.cosPAV0(), // --- added --- + candidate.cosPAV0(), // --- added --- candidate.cosPACharmBaryon(), // --- added --- - candidate.cosPACasc(), // --- added --- + candidate.cosPACasc(), // --- added --- candidate.etaV0PosDau(), candidate.etaV0NegDau(), candidate.etaBachFromCasc(), @@ -412,16 +412,16 @@ struct HfTreeCreatorToOmegaPiQa { candidate.template bachelorFromCharmBaryon_as().isGlobalTrackWoDCA(), candidate.template bachelorFromCharmBaryon_as().itsNCls(), candidate.template bachelorFromCharmBaryon_as().tpcNClsCrossedRows(), // --- added --- - candidate.template bachelor_as().tpcNClsCrossedRows(), // --- added --- - candidate.template posTrack_as().tpcNClsCrossedRows(), // --- added --- - candidate.template negTrack_as().tpcNClsCrossedRows(), // --- added --- - candidate.statusPidLambda(), // --- added --- - candidate.statusPidCascade(), // --- added --- - candidate.statusPidCharmBaryon(), // --- added --- - candidate.statusInvMassLambda(), // --- added --- - candidate.statusInvMassCascade(), // --- added --- - candidate.statusInvMassCharmBaryon(), // --- added --- - candidate.resultSelections(), // --- added --- + candidate.template bachelor_as().tpcNClsCrossedRows(), // --- added --- + candidate.template posTrack_as().tpcNClsCrossedRows(), // --- added --- + candidate.template negTrack_as().tpcNClsCrossedRows(), // --- added --- + candidate.statusPidLambda(), // --- added --- + candidate.statusPidCascade(), // --- added --- + candidate.statusPidCharmBaryon(), // --- added --- + candidate.statusInvMassLambda(), // --- added --- + candidate.statusInvMassCascade(), // --- added --- + candidate.statusInvMassCharmBaryon(), // --- added --- + candidate.resultSelections(), // --- added --- candidate.pidTpcInfoStored(), candidate.pidTofInfoStored(), candidate.tpcNSigmaPiFromCharmBaryon(), @@ -440,45 +440,44 @@ struct HfTreeCreatorToOmegaPiQa { } } else { if constexpr (tableSize == LITE) { - rowKfCandidateLite( - centrality, - candidate.template collision_as().numContrib(), - candidate.tpcNSigmaPiFromCharmBaryon(), - candidate.tofNSigmaPiFromCharmBaryon(), - candidate.tpcNSigmaKaFromCasc(), - candidate.tofNSigmaKaFromCasc(), - candidate.tpcNSigmaPiFromLambda(), - candidate.tofNSigmaPiFromLambda(), - candidate.tpcNSigmaPrFromLambda(), - candidate.tofNSigmaPrFromLambda(), - candidate.kfDcaXYPiFromOmegac(), - candidate.dcaCharmBaryonDau(), - candidate.kfDcaXYCascToPv(), - candidate.dcaCascDau(), - candidate.v0ldl(), - candidate.cascldl(), - candidate.omegacldl(), - candidate.chi2TopoPiFromOmegacToPv(), - candidate.chi2TopoOmegacToPv(), - // candidate.deviationPiFromOmegacToPv(), - candidate.decayLenXYOmegac(), - candidate.cosPACasc(), - candidate.cosPACharmBaryon(), - candidate.invMassCascade(), - candidate.invMassCharmBaryon(), - candidate.kfptPiFromOmegac(), - candidate.kfptOmegac(), - candidate.cosThetaStarPiFromOmegac(), - candidate.cTauOmegac(), - candidate.etaCharmBaryon(), - candidate.v0Chi2OverNdf(), - candidate.cascChi2OverNdf(), - candidate.omegacChi2OverNdf(), - candidate.cascRejectInvmass(), - candidate.resultSelections(), - flagMc, - originMc, - collisionMatched); + rowKfCandidateLite(centrality, + candidate.template collision_as().numContrib(), + candidate.tpcNSigmaPiFromCharmBaryon(), + candidate.tofNSigmaPiFromCharmBaryon(), + candidate.tpcNSigmaKaFromCasc(), + candidate.tofNSigmaKaFromCasc(), + candidate.tpcNSigmaPiFromLambda(), + candidate.tofNSigmaPiFromLambda(), + candidate.tpcNSigmaPrFromLambda(), + candidate.tofNSigmaPrFromLambda(), + candidate.kfDcaXYPiFromOmegac(), + candidate.dcaCharmBaryonDau(), + candidate.kfDcaXYCascToPv(), + candidate.dcaCascDau(), + candidate.v0ldl(), + candidate.cascldl(), + candidate.omegacldl(), + candidate.chi2TopoPiFromOmegacToPv(), + candidate.chi2TopoOmegacToPv(), + // candidate.deviationPiFromOmegacToPv(), + candidate.decayLenXYOmegac(), + candidate.cosPACasc(), + candidate.cosPACharmBaryon(), + candidate.invMassCascade(), + candidate.invMassCharmBaryon(), + candidate.kfptPiFromOmegac(), + candidate.kfptOmegac(), + candidate.cosThetaStarPiFromOmegac(), + candidate.cTauOmegac(), + candidate.etaCharmBaryon(), + candidate.v0Chi2OverNdf(), + candidate.cascChi2OverNdf(), + candidate.omegacChi2OverNdf(), + candidate.cascRejectInvmass(), + candidate.resultSelections(), + flagMc, + originMc, + collisionMatched); } else { rowKfCandidateFull(centrality, candidate.template collision_as().numContrib(), @@ -823,7 +822,7 @@ struct HfTreeCreatorToOmegaPiQa { fillCandidate(candidate, candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.collisionMatched(), centFt0m); } } - + PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processKfMc, "Process KF MC full for Omegac0", false); PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processKfMcLite, "Process KF MC lite for Omegac0", false); PROCESS_SWITCH(HfTreeCreatorToOmegaPiQa, processKfMcCent, "Process KF MC full for Omegac0 with FT0M", false); @@ -833,4 +832,4 @@ struct HfTreeCreatorToOmegaPiQa { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} \ No newline at end of file +}