From 10030411062e4150d6b03e3f799200b159b259f8 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sun, 17 Aug 2025 14:28:59 +0200 Subject: [PATCH 01/20] Tuning TOF PID for strangeness tasks --- PWGLF/DataModel/LFStrangenessPIDTables.h | 81 ++- .../TableProducer/Strangeness/CMakeLists.txt | 9 +- ...mbdakzeropid.cxx => strangenesstofpid.cxx} | 480 +++++++++++++++--- 3 files changed, 481 insertions(+), 89 deletions(-) rename PWGLF/TableProducer/Strangeness/{lambdakzeropid.cxx => strangenesstofpid.cxx} (50%) diff --git a/PWGLF/DataModel/LFStrangenessPIDTables.h b/PWGLF/DataModel/LFStrangenessPIDTables.h index e689dc28141..ad124882752 100644 --- a/PWGLF/DataModel/LFStrangenessPIDTables.h +++ b/PWGLF/DataModel/LFStrangenessPIDTables.h @@ -79,6 +79,45 @@ DECLARE_SOA_COLUMN(TOFNSigmaALaPi, tofNSigmaALaPi, float); //! positive DECLARE_SOA_COLUMN(TOFNSigmaK0PiPlus, tofNSigmaK0PiPlus, float); //! positive track NSigma from pion <- k0short expectation DECLARE_SOA_COLUMN(TOFNSigmaK0PiMinus, tofNSigmaK0PiMinus, float); //! negative track NSigma from pion <- k0short expectation +// dynamics based on n-sigmas with use-only-if-tof-present logic +DECLARE_SOA_DYNAMIC_COLUMN(TofLambdaCompatibility, tofLambdaCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas + [](float tofNSigmaLaPr, float tofNSigmaLaPi, float nsigma) -> float { + bool compatible = true; + if(std::abs(tofNSigmaLaPr+1000.0f)>1e-3 && std::abs(tofNSigmaLaPr)>nsigma){ + compatible = false; // reject only if info present and incompatible + } + if(std::abs(tofNSigmaLaPi+1000.0f)>1e-3 && std::abs(tofNSigmaLaPi)>nsigma){ + compatible = false; // reject only if info present and incompatible + } + return compatible; + }); + +// dynamics based on n-sigmas with use-only-if-tof-present logic +DECLARE_SOA_DYNAMIC_COLUMN(TofAntiLambdaCompatibility, tofAntiLambdaCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas + [](float tofNSigmaALaPr, float tofNSigmaALaPi, float nsigma) -> float { + bool compatible = true; + if(std::abs(tofNSigmaALaPr+1000.0f)>1e-3 && std::abs(tofNSigmaALaPr)>nsigma){ + compatible = false; // reject only if info present and incompatible + } + if(std::abs(tofNSigmaALaPi+1000.0f)>1e-3 && std::abs(tofNSigmaALaPi)>nsigma){ + compatible = false; // reject only if info present and incompatible + } + return compatible; + }); + +// dynamics based on n-sigmas with use-only-if-tof-present logic +DECLARE_SOA_DYNAMIC_COLUMN(TofK0ShortCompatibility, tofK0ShortCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas + [](float tofNSigmaK0PiPlus, float tofNSigmaK0PiMinus, float nsigma) -> float { + bool compatible = true; + if(std::abs(tofNSigmaK0PiPlus+1000.0f)>1e-3 && std::abs(tofNSigmaK0PiPlus)>nsigma){ + compatible = false; // reject only if info present and incompatible + } + if(std::abs(tofNSigmaK0PiMinus+1000.0f)>1e-3 && std::abs(tofNSigmaK0PiMinus)>nsigma){ + compatible = false; // reject only if info present and incompatible + } + return compatible; + }); + // beta values DECLARE_SOA_COLUMN(TofBetaLambda, tofBetaLambda, float); //! beta value with Lambda hypothesis DECLARE_SOA_COLUMN(TofBetaAntiLambda, tofBetaAntiLambda, float); //! beta value with AntiLambda hypothesis @@ -120,7 +159,10 @@ DECLARE_SOA_TABLE(V0TOFBetas, "AOD", "V0TOFBETA", // processed info table (for a DECLARE_SOA_TABLE(V0TOFNSigmas, "AOD", "V0TOFNSIGMA", // processed NSigma table (for analysis) v0data::TOFNSigmaLaPr, v0data::TOFNSigmaLaPi, v0data::TOFNSigmaALaPr, v0data::TOFNSigmaALaPi, - v0data::TOFNSigmaK0PiPlus, v0data::TOFNSigmaK0PiMinus); + v0data::TOFNSigmaK0PiPlus, v0data::TOFNSigmaK0PiMinus, + v0data::TofLambdaCompatibility, + v0data::TofAntiLambdaCompatibility, + v0data::TofK0ShortCompatibility); namespace cascdata { @@ -154,6 +196,39 @@ DECLARE_SOA_COLUMN(TOFNSigmaXiPi, tofNSigmaXiPi, float); //! bachelor track DECLARE_SOA_COLUMN(TOFNSigmaOmLaPi, tofNSigmaOmLaPi, float); //! meson track NSigma from pion <- lambda <- om expectation DECLARE_SOA_COLUMN(TOFNSigmaOmLaPr, tofNSigmaOmLaPr, float); //! baryon track NSigma from proton <- lambda <- om expectation DECLARE_SOA_COLUMN(TOFNSigmaOmKa, tofNSigmaOmKa, float); //! bachelor track NSigma from kaon <- om expectation + +// dynamics based on n-sigmas with use-only-if-tof-present logic +DECLARE_SOA_DYNAMIC_COLUMN(TofXiCompatibility, tofXiCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas + [](float tofNSigmaXiLaPr, float tofNSigmaXiLaPi, float tofNSigmaXiPi, float nsigma) -> float { + bool compatible = true; + if(std::abs(tofNSigmaXiLaPr+1000.0f)>1e-3 && std::abs(tofNSigmaXiLaPr)>nsigma){ + compatible = false; // reject only if info present and incompatible + } + if(std::abs(tofNSigmaXiLaPi+1000.0f)>1e-3 && std::abs(tofNSigmaXiLaPi)>nsigma){ + compatible = false; // reject only if info present and incompatible + } + if(std::abs(tofNSigmaXiPi+1000.0f)>1e-3 && std::abs(tofNSigmaXiPi)>nsigma){ + compatible = false; // reject only if info present and incompatible + } + return compatible; + }); + +DECLARE_SOA_DYNAMIC_COLUMN(TofOmCompatibility, tofOmCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas + [](float tofNSigmaOmLaPr, float tofNSigmaOmLaPi, float tofNSigmaOmKa, float nsigma) -> float { + bool compatible = true; + if(std::abs(tofNSigmaOmLaPr+1000.0f)>1e-3 && std::abs(tofNSigmaOmLaPr)>nsigma){ + compatible = false; // reject only if info present and incompatible + } + if(std::abs(tofNSigmaOmLaPi+1000.0f)>1e-3 && std::abs(tofNSigmaOmLaPi)>nsigma){ + compatible = false; // reject only if info present and incompatible + } + if(std::abs(tofNSigmaOmKa+1000.0f)>1e-3 && std::abs(tofNSigmaOmKa)>nsigma){ + compatible = false; // reject only if info present and incompatible + } + return compatible; + }); + + } // namespace cascdata // /-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/ @@ -173,7 +248,9 @@ DECLARE_SOA_TABLE(CascTOFPIDs, "AOD", "CASCTOFPID", // processed information for cascdata::BachTOFDeltaTOmKa); DECLARE_SOA_TABLE(CascTOFNSigmas, "AOD", "CascTOFNSigmas", // Nsigmas for cascades cascdata::TOFNSigmaXiLaPi, cascdata::TOFNSigmaXiLaPr, cascdata::TOFNSigmaXiPi, - cascdata::TOFNSigmaOmLaPi, cascdata::TOFNSigmaOmLaPr, cascdata::TOFNSigmaOmKa); + cascdata::TOFNSigmaOmLaPi, cascdata::TOFNSigmaOmLaPr, cascdata::TOFNSigmaOmKa, + cascdata::TofXiCompatibility, + cascdata::TofOmCompatibility); } // namespace o2::aod #endif // PWGLF_DATAMODEL_LFSTRANGENESSPIDTABLES_H_ diff --git a/PWGLF/TableProducer/Strangeness/CMakeLists.txt b/PWGLF/TableProducer/Strangeness/CMakeLists.txt index 9e4a3fa04f8..b9ae33532f2 100644 --- a/PWGLF/TableProducer/Strangeness/CMakeLists.txt +++ b/PWGLF/TableProducer/Strangeness/CMakeLists.txt @@ -36,8 +36,8 @@ o2physics_add_dpl_workflow(cascademcfinder PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(cascadepid - SOURCES cascadepid.cxx +o2physics_add_dpl_workflow(strangenesstofpid + SOURCES strangenesstofpid.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsBase COMPONENT_NAME Analysis) @@ -81,11 +81,6 @@ o2physics_add_dpl_workflow(lambdakzeromcfinder PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(lambdakzeropid - SOURCES lambdakzeropid.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsBase - COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(lambdakzerospawner SOURCES lambdakzerospawner.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore diff --git a/PWGLF/TableProducer/Strangeness/lambdakzeropid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx similarity index 50% rename from PWGLF/TableProducer/Strangeness/lambdakzeropid.cxx rename to PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index c6041aa0e02..376dee94f93 100644 --- a/PWGLF/TableProducer/Strangeness/lambdakzeropid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -30,6 +30,8 @@ #include #include +#include "TableHelper.h" + #include "Framework/runDataProcessing.h" #include "Framework/RunningWorkflowInfo.h" #include "Framework/AnalysisTask.h" @@ -61,41 +63,60 @@ using std::array; // For original data loops using V0OriginalDatas = soa::Join; -using TracksWithAllExtras = soa::Join; +using CascOriginalDatas = soa::Join; +using TracksWithAllExtras = soa::Join; // For derived data analysis using dauTracks = soa::Join; using V0DerivedDatas = soa::Join; +using CascDerivedDatas = soa::Join; -struct lambdakzeropid { +struct strangenesstofpid { // TOF pid for strangeness (recalculated with topology) Produces v0tofpid; // table with Nsigmas Produces v0tofbeta; // table with betas Produces v0tofdebugs; // table with extra debug information Produces v0tofnsigmas; // table with nsigmas + Produces casctofpids; // cascades: table with base info + Produces casctofnsigmas; // cascades: table with Nsigmas Service ccdb; // mean vertex position to be used if no collision associated o2::dataformats::MeanVertexObject* mVtx = nullptr; - // For manual sliceBy - Preslice perCollisionOriginal = o2::aod::v0data::collisionId; - ; - Preslice perCollisionDerived = o2::aod::v0data::straCollisionId; - HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + // master switches + Configurable calculateV0s{"calculateV0s", -1, "calculate V0-related TOF PID (0: no, 1: yes, -1: auto)"}; + Configurable calculateCascades{"calculateCascades", -1, "calculate cascade-related TOF PID (0: no, 1: yes, -1: auto)"}; + // Operation and minimisation criteria Configurable d_bz_input{"d_bz", -999, "bz field, -999 is automatic"}; Configurable tofPosition{"tofPosition", 377.934f, "TOF effective (inscribed) radius"}; Configurable doQA{"doQA", true, "create QA histos"}; - Configurable doQANSigma{"doQANSigma", true, "create QA of Nsigma histos"}; - Configurable qaDCADau{"qaDCADau", 0.5, "DCA daughters (cm) for QA plots"}; - Configurable qaCosPA{"qaCosPA", 0.999, "CosPA for QA plots"}; - Configurable qaMassWindow{"qaMassWindow", 0.005, "Mass window around expected (in GeV/c2) for QA plots"}; - Configurable qaTPCNSigma{"qaTPCNSigma", 5, "TPC N-sigma to apply for qa plots"}; Configurable doNSigmas{"doNSigmas", false, "calculate TOF N-sigma"}; + Configurable doQANSigma{"doQANSigma", true, "create QA of Nsigma histos"}; + + // configurables related to V0s + struct : ConfigurableGroup { + std::string prefix = "v0Calibration"; + Configurable qaDCADau{"qaDCADau", 0.5, "DCA daughters (cm) for QA plots"}; + Configurable qaCosPA{"qaCosPA", 0.999, "CosPA for QA plots"}; + Configurable qaMassWindow{"qaMassWindow", 0.005, "Mass window around expected (in GeV/c2) for QA plots"}; + Configurable qaTPCNSigma{"qaTPCNSigma", 5, "TPC N-sigma to apply for qa plots"}; + } v0Group; + + // configurables related to V0s + struct : ConfigurableGroup { + std::string prefix = "cascadeCalibration"; + Configurable qaV0DCADau{"qaV0DCADau", 0.5, "DCA daughters (cm) for QA plots"}; + Configurable qaCascDCADau{"qaCascDCADau", 0.5, "DCA daughters (cm) for QA plots"}; + Configurable qaV0CosPA{"qaV0CosPA", 0.995, "CosPA for QA plots"}; + Configurable qaCascCosPA{"qaCascCosPA", 0.995, "CosPA for QA plots"}; + Configurable qaMassWindow{"qaMassWindow", 0.005, "Mass window around expected (in GeV/c2) for QA plots"}; + Configurable qaTPCNSigma{"qaTPCNSigma", 5, "TPC N-sigma to apply for qa plots"}; + } cascadeGroup; // CCDB options Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; @@ -125,6 +146,16 @@ struct lambdakzeropid { TH1 *hMeanNegLaPr, *hSigmaNegLaPr; TH1 *hMeanPosK0Pi, *hSigmaPosK0Pi; TH1 *hMeanNegK0Pi, *hSigmaNegK0Pi; + TH1 *hMeanPosXiPi, *hSigmaPosXiPi; + TH1 *hMeanPosXiPr, *hSigmaPosXiPr; + TH1 *hMeanNegXiPi, *hSigmaNegXiPi; + TH1 *hMeanNegXiPr, *hSigmaNegXiPr; + TH1 *hMeanBachXiPi, *hSigmaBachXiPi; + TH1 *hMeanPosOmPi, *hSigmaPosOmPi; + TH1 *hMeanPosOmPr, *hSigmaPosOmPr; + TH1 *hMeanNegOmPi, *hSigmaNegOmPi; + TH1 *hMeanNegOmPr, *hSigmaNegOmPr; + TH1 *hMeanBachOmKa, *hSigmaBachOmKa; int mRunNumber; float d_bz; @@ -264,8 +295,23 @@ struct lambdakzeropid { return length; } - void init(InitContext&) + void init(InitContext& initContext) { + if(calculateV0s.value<0){ + // check if TOF information is required, enable if so + calculateV0s.value = isTableRequiredInWorkflow(initContext, "V0TOFNSigmas"); + if(calculateV0s.value>0){ + LOGF(info, "Strangeness TOF PID: V0 calculations enabled automatically"); + } + } + if(calculateCascades.value<0){ + // check if TOF information is required, enable if so + calculateCascades.value = isTableRequiredInWorkflow(initContext, "CascTOFNSigmas"); + if(calculateCascades.value>0){ + LOGF(info, "Strangeness TOF PID: Cascade calculations enabled automatically"); + } + } + nSigmaCalibLoaded = false; nSigmaCalibObjects = nullptr; @@ -301,6 +347,19 @@ struct lambdakzeropid { histos.add("h2dProtonMeasuredVsExpected", "h2dProtonMeasuredVsExpected", {HistType::kTH2F, {axisTime, axisTime}}); histos.add("h2dPionMeasuredVsExpected", "h2dPionMeasuredVsExpected", {HistType::kTH2F, {axisTime, axisTime}}); + histos.add("hArcDebug", "hArcDebug", kTH2F, {axisPt, {500, -5.0f, 10.0f}}); + histos.add("h2dposDeltaTimeAsXiPi", "h2dposDeltaTimeAsXiPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dposDeltaTimeAsXiPr", "h2dposDeltaTimeAsXiPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dnegDeltaTimeAsXiPi", "h2dnegDeltaTimeAsXiPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dnegDeltaTimeAsXiPr", "h2dnegDeltaTimeAsXiPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dbachDeltaTimeAsXiPi", "h2dbachDeltaTimeAsXiPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + + histos.add("h2dposDeltaTimeAsOmPi", "h2dposDeltaTimeAsOmPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dposDeltaTimeAsOmPr", "h2dposDeltaTimeAsOmPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dnegDeltaTimeAsOmPi", "h2dnegDeltaTimeAsOmPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dnegDeltaTimeAsOmPr", "h2dnegDeltaTimeAsOmPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dbachDeltaTimeAsOmKa", "h2dbachDeltaTimeAsOmKa", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + // standard deltaTime values histos.add("h2dDeltaTimePositiveLambdaPi", "h2dDeltaTimePositiveLambdaPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); histos.add("h2dDeltaTimeNegativeLambdaPi", "h2dDeltaTimeNegativeLambdaPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); @@ -371,34 +430,69 @@ struct lambdakzeropid { if (nSigmaCalibObjects) { LOGF(info, "loaded TList with this many objects: %i", nSigmaCalibObjects->GetEntries()); - hMeanPosLaPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosLaPi")); - hMeanPosLaPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosLaPr")); - hMeanNegLaPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegLaPi")); - hMeanNegLaPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegLaPr")); - hMeanPosK0Pi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosK0Pi")); - hMeanNegK0Pi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegK0Pi")); - - hSigmaPosLaPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaPosLaPi")); - hSigmaPosLaPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaPosLaPr")); - hSigmaNegLaPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaNegLaPi")); - hSigmaNegLaPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaNegLaPr")); - hSigmaPosK0Pi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaPosK0Pi")); - hSigmaNegK0Pi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaNegK0Pi")); - - if (!hMeanPosLaPi) - LOG(info) << "Problems finding mean histogram hMeanPosLaPi!"; - if (!hMeanPosLaPr) - LOG(info) << "Problems finding mean histogram hMeanPosLaPr!"; - if (!hMeanNegLaPi) - LOG(info) << "Problems finding mean histogram hMeanNegLaPi!"; - if (!hMeanNegLaPr) - LOG(info) << "Problems finding mean histogram hMeanNegLaPr!"; - if (!hMeanPosK0Pi) - LOG(info) << "Problems finding mean histogram hMeanPosK0Pi!"; - if (!hMeanNegK0Pi) - LOG(info) << "Problems finding mean histogram hMeanNegK0Pi!"; - if (!hSigmaPosK0Pi || !hSigmaNegK0Pi || !hSigmaPosLaPi || !hSigmaPosLaPr || !hSigmaNegLaPi || !hSigmaNegLaPr) { - LOG(info) << "Problems finding sigma histograms!"; + if(calculateV0s.value){ + hMeanPosLaPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosLaPi")); + hMeanPosLaPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosLaPr")); + hMeanNegLaPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegLaPi")); + hMeanNegLaPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegLaPr")); + hMeanPosK0Pi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosK0Pi")); + hMeanNegK0Pi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegK0Pi")); + + hSigmaPosLaPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaPosLaPi")); + hSigmaPosLaPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaPosLaPr")); + hSigmaNegLaPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaNegLaPi")); + hSigmaNegLaPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaNegLaPr")); + hSigmaPosK0Pi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaPosK0Pi")); + hSigmaNegK0Pi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaNegK0Pi")); + + if (!hMeanPosLaPi) + LOG(info) << "Problems finding mean histogram hMeanPosLaPi!"; + if (!hMeanPosLaPr) + LOG(info) << "Problems finding mean histogram hMeanPosLaPr!"; + if (!hMeanNegLaPi) + LOG(info) << "Problems finding mean histogram hMeanNegLaPi!"; + if (!hMeanNegLaPr) + LOG(info) << "Problems finding mean histogram hMeanNegLaPr!"; + if (!hMeanPosK0Pi) + LOG(info) << "Problems finding mean histogram hMeanPosK0Pi!"; + if (!hMeanNegK0Pi) + LOG(info) << "Problems finding mean histogram hMeanNegK0Pi!"; + if (!hSigmaPosK0Pi || !hSigmaNegK0Pi || !hSigmaPosLaPi || !hSigmaPosLaPr || !hSigmaNegLaPi || !hSigmaNegLaPr) { + LOG(info) << "Problems finding sigma histograms!"; + } + + if(calculateCascades.value){ + hMeanPosXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosXiPi")); + hMeanPosXiPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosXiPr")); + hMeanNegXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegXiPi")); + hMeanNegXiPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegXiPr")); + hMeanBachXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanBachXiPi")); + hMeanPosOmPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosOmPi")); + hMeanPosOmPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosOmPr")); + hMeanNegOmPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegOmPi")); + hMeanNegOmPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegOmPr")); + hMeanBachOmKa = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanBachOmKa")); + + hSigmaPosXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaPosXiPi")); + hSigmaPosXiPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaPosXiPr")); + hSigmaNegXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaNegXiPi")); + hSigmaNegXiPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaNegXiPr")); + hSigmaBachXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaBachXiPi")); + hSigmaPosOmPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaPosOmPi")); + hSigmaPosOmPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaPosOmPr")); + hSigmaNegOmPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaNegOmPi")); + hSigmaNegOmPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaNegOmPr")); + hSigmaBachOmKa = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaBachOmKa")); + + if (!hMeanPosXiPi || !hMeanPosXiPr || !hMeanNegXiPi || !hMeanNegXiPr || !hMeanBachXiPi) + LOG(info) << "Problems finding xi mean histograms!"; + if (!hMeanPosOmPi || !hMeanPosOmPr || !hMeanNegOmPi || !hMeanNegOmPr || !hMeanBachOmKa) + LOG(info) << "Problems finding omega sigma histograms!"; + if (!hSigmaPosXiPi || !hSigmaPosXiPr || !hSigmaNegXiPi || !hSigmaNegXiPr || !hSigmaBachXiPi) + LOG(info) << "Problems finding xi sigma histograms!"; + if (!hSigmaPosOmPi || !hSigmaPosOmPr || !hSigmaNegOmPi || !hSigmaNegOmPr || !hSigmaBachOmKa) + LOG(info) << "Problems finding omega sigma histograms!"; + } } } } @@ -516,7 +610,7 @@ struct lambdakzeropid { v0tofdebugs(timeLambda, timeK0Short, timePositivePr, timePositivePi, timeNegativePr, timeNegativePi); // do Nsigmas if requested - if (doNSigmas) { + if (doNSigmas && nSigmaCalibLoaded) { // sweep through all viable hypotheses and produce N-sigma if (deltaTimePositiveLambdaPi > -1e+5) @@ -543,18 +637,18 @@ struct lambdakzeropid { histos.fill(HIST("h2dProtonMeasuredVsExpected"), (timeLambda + timePositivePr), (pTra.tofSignal() - pTra.tofEvTime())); - if (v0.v0cosPA() > qaCosPA && v0.dcaV0daughters() < qaDCADau) { - if (std::abs(v0.mLambda() - 1.115683) < qaMassWindow && fabs(pTra.tpcNSigmaPr()) < qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < qaTPCNSigma) { + if (v0.v0cosPA() > v0Group.qaCosPA && v0.dcaV0daughters() < v0Group.qaDCADau) { + if (std::abs(v0.mLambda() - 1.115683) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPr()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma) { histos.fill(HIST("h2dDeltaTimePositiveLambdaPr"), v0.pt(), v0.eta(), deltaTimePositiveLambdaPr); if (doQANSigma) histos.fill(HIST("h2dNSigmaPositiveLambdaPr"), v0.pt(), nSigmaPositiveLambdaPr); } - if (std::abs(v0.mAntiLambda() - 1.115683) < qaMassWindow && fabs(pTra.tpcNSigmaPi()) < qaTPCNSigma && fabs(nTra.tpcNSigmaPr()) < qaTPCNSigma) { + if (std::abs(v0.mAntiLambda() - 1.115683) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPr()) < v0Group.qaTPCNSigma) { histos.fill(HIST("h2dDeltaTimePositiveLambdaPi"), v0.pt(), v0.eta(), deltaTimePositiveLambdaPi); if (doQANSigma) histos.fill(HIST("h2dNSigmaPositiveLambdaPi"), v0.pt(), nSigmaPositiveLambdaPi); } - if (std::abs(v0.mK0Short() - 0.497) < qaMassWindow && fabs(pTra.tpcNSigmaPi()) < qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < qaTPCNSigma) { + if (std::abs(v0.mK0Short() - 0.497) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma) { histos.fill(HIST("h2dDeltaTimePositiveK0ShortPi"), v0.pt(), v0.eta(), deltaTimePositiveK0ShortPi); if (doQANSigma) histos.fill(HIST("h2dNSigmaPositiveK0ShortPi"), v0.pt(), nSigmaPositiveK0ShortPi); @@ -566,18 +660,18 @@ struct lambdakzeropid { histos.fill(HIST("h2dPionMeasuredVsExpected"), (timeLambda + timeNegativePi), (nTra.tofSignal() - nTra.tofEvTime())); - if (v0.v0cosPA() > qaCosPA && v0.dcaV0daughters() < qaDCADau) { - if (std::abs(v0.mLambda() - 1.115683) < qaMassWindow && fabs(pTra.tpcNSigmaPr()) < qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < qaTPCNSigma) { + if (v0.v0cosPA() > v0Group.qaCosPA && v0.dcaV0daughters() < v0Group.qaDCADau) { + if (std::abs(v0.mLambda() - 1.115683) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPr()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma) { histos.fill(HIST("h2dDeltaTimeNegativeLambdaPi"), v0.pt(), v0.eta(), deltaTimeNegativeLambdaPi); if (doQANSigma) histos.fill(HIST("h2dNSigmaNegativeLambdaPi"), v0.pt(), nSigmaNegativeLambdaPi); } - if (std::abs(v0.mAntiLambda() - 1.115683) < qaMassWindow && fabs(pTra.tpcNSigmaPi()) < qaTPCNSigma && fabs(nTra.tpcNSigmaPr()) < qaTPCNSigma) { + if (std::abs(v0.mAntiLambda() - 1.115683) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPr()) < v0Group.qaTPCNSigma) { histos.fill(HIST("h2dDeltaTimeNegativeLambdaPr"), v0.pt(), v0.eta(), deltaTimeNegativeLambdaPr); if (doQANSigma) histos.fill(HIST("h2dNSigmaNegativeLambdaPr"), v0.pt(), nSigmaNegativeLambdaPr); } - if (std::abs(v0.mK0Short() - 0.497) < qaMassWindow && fabs(pTra.tpcNSigmaPi()) < qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < qaTPCNSigma) { + if (std::abs(v0.mK0Short() - 0.497) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma) { histos.fill(HIST("h2dDeltaTimeNegativeK0ShortPi"), v0.pt(), v0.eta(), deltaTimeNegativeK0ShortPi); if (doQANSigma) histos.fill(HIST("h2dNSigmaNegativeK0ShortPi"), v0.pt(), nSigmaNegativeK0ShortPi); @@ -589,7 +683,191 @@ struct lambdakzeropid { } } - void processStandardData(aod::Collisions const& collisions, V0OriginalDatas const& V0s, TracksWithAllExtras const&, aod::BCsWithTimestamps const& /*bcs*/) + + template + void processCascadeCandidate(TCollision const& collision, TCascade const& cascade, TTrack const& pTra, TTrack const& nTra, TTrack const& bTra) + { + // initialize from positions and momenta as needed + o2::track::TrackPar posTrack = o2::track::TrackPar({cascade.xlambda(), cascade.ylambda(), cascade.zlambda()}, {cascade.pxpos(), cascade.pypos(), cascade.pzpos()}, +1); + o2::track::TrackPar negTrack = o2::track::TrackPar({cascade.xlambda(), cascade.ylambda(), cascade.zlambda()}, {cascade.pxneg(), cascade.pyneg(), cascade.pzneg()}, -1); + o2::track::TrackPar bachTrack = o2::track::TrackPar({cascade.x(), cascade.y(), cascade.z()}, {cascade.pxbach(), cascade.pybach(), cascade.pzbach()}, cascade.sign()); + o2::track::TrackPar cascTrack = o2::track::TrackPar({cascade.x(), cascade.y(), cascade.z()}, {cascade.px(), cascade.py(), cascade.pz()}, cascade.sign()); + + // start calculation: calculate velocities + float velocityPositivePr = velocity(posTrack.getP(), o2::constants::physics::MassProton); + float velocityPositivePi = velocity(posTrack.getP(), o2::constants::physics::MassPionCharged); + float velocityNegativePr = velocity(negTrack.getP(), o2::constants::physics::MassProton); + float velocityNegativePi = velocity(negTrack.getP(), o2::constants::physics::MassPionCharged); + float velocityBachelorPi = velocity(bachTrack.getP(), o2::constants::physics::MassPionCharged); + float velocityBachelorKa = velocity(bachTrack.getP(), o2::constants::physics::MassKaonCharged); + float velocityXi = velocity(cascTrack.getP(), o2::constants::physics::MassXiMinus); + float velocityOm = velocity(cascTrack.getP(), o2::constants::physics::MassOmegaMinus); + float velocityLa = velocity(std::hypot(cascade.pxlambda(), cascade.pylambda(), cascade.pzlambda()), o2::constants::physics::MassLambda); + + // calculate daughter length to TOF intercept + float lengthPositive = findInterceptLength(posTrack, d_bz); // FIXME: tofPosition ok? adjust? + float lengthNegative = findInterceptLength(negTrack, d_bz); // FIXME: tofPosition ok? adjust? + float lengthBachelor = findInterceptLength(bachTrack, d_bz); // FIXME: tofPosition ok? adjust? + + // calculate mother lengths + float lengthV0 = std::hypot(cascade.xlambda() - cascade.x(), cascade.ylambda() - cascade.y(), cascade.zlambda() - cascade.z()); + float lengthCascade = -1e+6; + const o2::math_utils::Point3D collVtx{collision.getX(), collision.getY(), collision.getZ()}; + bool successPropag = o2::base::Propagator::Instance()->propagateToDCA(collVtx, cascTrack, d_bz, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrNONE); + float d = -1.0f, d3d = 0.0f; + float linearToPV = std::hypot(cascade.x() - collision.getX(), cascade.y() - collision.getY(), cascade.z() - collision.getZ()); + if (successPropag) { + std::array cascCloseToPVPosition; + cascTrack.getXYZGlo(cascCloseToPVPosition); + o2::math_utils::CircleXYf_t trcCircleCascade; + float sna, csa; + cascTrack.getCircleParams(d_bz, trcCircleCascade, sna, csa); + + // calculate 2D distance between two points + d = std::hypot(cascade.x() - cascCloseToPVPosition[0], cascade.y() - cascCloseToPVPosition[1]); + d3d = std::hypot(cascade.x() - cascCloseToPVPosition[0], cascade.y() - cascCloseToPVPosition[1], cascade.z() - cascCloseToPVPosition[2]); // cross-check variable + float sinThetaOverTwo = d / (2.0f * trcCircleCascade.rC); + lengthCascade = 2.0f * trcCircleCascade.rC * TMath::ASin(sinThetaOverTwo); + lengthCascade *= sqrt(1.0f + cascTrack.getTgl() * cascTrack.getTgl()); + } + + if (!successPropag) { + lengthCascade = linearToPV; // if propagation failed, use linear estimate (optional: actually do not define?) + } + + // lambda, xi and omega flight time is always defined + float lambdaFlight = lengthV0 / velocityLa; + float xiFlight = lengthCascade / velocityXi; + float omFlight = lengthCascade / velocityOm; + float posFlightPi = lengthPositive / velocityPositivePi; + float posFlightPr = lengthPositive / velocityPositivePr; + float negFlightPi = lengthNegative / velocityNegativePi; + float negFlightPr = lengthNegative / velocityNegativePr; + float bachFlightPi = lengthBachelor / velocityBachelorPi; + float bachFlightKa = lengthBachelor / velocityBachelorKa; + + // initialize delta-times (actual PID variables) + float posDeltaTimeAsXiPi = -1e+6, posDeltaTimeAsXiPr = -1e+6; + float negDeltaTimeAsXiPi = -1e+6, negDeltaTimeAsXiPr = -1e+6; + float bachDeltaTimeAsXiPi = -1e+6; + float posDeltaTimeAsOmPi = -1e+6, posDeltaTimeAsOmPr = -1e+6; + float negDeltaTimeAsOmPi = -1e+6, negDeltaTimeAsOmPr = -1e+6; + float bachDeltaTimeAsOmKa = -1e+6; + + if (pTra.hasTOF()) { + posDeltaTimeAsXiPi = (pTra.tofSignal() - pTra.tofEvTime()) - (xiFlight + lambdaFlight + posFlightPi); + posDeltaTimeAsXiPr = (pTra.tofSignal() - pTra.tofEvTime()) - (xiFlight + lambdaFlight + posFlightPr); + posDeltaTimeAsOmPi = (pTra.tofSignal() - pTra.tofEvTime()) - (omFlight + lambdaFlight + posFlightPi); + posDeltaTimeAsOmPr = (pTra.tofSignal() - pTra.tofEvTime()) - (omFlight + lambdaFlight + posFlightPr); + } + if (nTra.hasTOF()) { + negDeltaTimeAsXiPi = (nTra.tofSignal() - nTra.tofEvTime()) - (xiFlight + lambdaFlight + negFlightPi); + negDeltaTimeAsXiPr = (nTra.tofSignal() - nTra.tofEvTime()) - (xiFlight + lambdaFlight + negFlightPr); + negDeltaTimeAsOmPi = (nTra.tofSignal() - nTra.tofEvTime()) - (omFlight + lambdaFlight + negFlightPi); + negDeltaTimeAsOmPr = (nTra.tofSignal() - nTra.tofEvTime()) - (omFlight + lambdaFlight + negFlightPr); + } + if (bTra.hasTOF()) { + bachDeltaTimeAsXiPi = (bTra.tofSignal() - bTra.tofEvTime()) - (xiFlight + bachFlightPi); + bachDeltaTimeAsOmKa = (bTra.tofSignal() - bTra.tofEvTime()) - (omFlight + bachFlightKa); + } + + casctofpids( + posDeltaTimeAsXiPi, posDeltaTimeAsXiPr, negDeltaTimeAsXiPi, negDeltaTimeAsXiPr, bachDeltaTimeAsXiPi, + posDeltaTimeAsOmPi, posDeltaTimeAsOmPr, negDeltaTimeAsOmPi, negDeltaTimeAsOmPr, bachDeltaTimeAsOmKa); + + float nSigmaXiLaPr = -1e+6; + float nSigmaXiLaPi = -1e+6; + float nSigmaXiPi = -1e+6; + float nSigmaOmLaPr = -1e+6; + float nSigmaOmLaPi = -1e+6; + float nSigmaOmKa = -1e+6; + + // go for Nsigma values if requested + if (doNSigmas && nSigmaCalibLoaded) { + // Xi hypothesis ________________________ + if (cascade.sign() < 0) { // XiMinus + if (posDeltaTimeAsXiPr > -1e+5) // proton from Lambda from XiMinus has signal + nSigmaXiLaPr = (posDeltaTimeAsXiPr - hMeanPosXiPr->Interpolate(cascade.pt())) / hSigmaPosXiPr->Interpolate(cascade.pt()); + if (negDeltaTimeAsXiPi > -1e+5) // pion from Lambda from XiMinus has signal + nSigmaXiLaPi = (negDeltaTimeAsXiPi - hMeanNegXiPi->Interpolate(cascade.pt())) / hSigmaNegXiPi->Interpolate(cascade.pt()); + if (bachDeltaTimeAsXiPi > -1e+5) // pion from XiMinus has signal + nSigmaXiPi = (bachDeltaTimeAsXiPi - hMeanBachXiPi->Interpolate(cascade.pt())) / hSigmaBachXiPi->Interpolate(cascade.pt()); + if (posDeltaTimeAsOmPr > -1e+5) // proton from Lambda from OmegaMinus has signal + nSigmaOmLaPr = (posDeltaTimeAsOmPr - hMeanPosOmPr->Interpolate(cascade.pt())) / hSigmaPosOmPr->Interpolate(cascade.pt()); + if (negDeltaTimeAsOmPi > -1e+5) // pion from Lambda from OmegaMinus has signal + nSigmaOmLaPi = (negDeltaTimeAsOmPi - hMeanNegOmPi->Interpolate(cascade.pt())) / hSigmaNegOmPi->Interpolate(cascade.pt()); + if (bachDeltaTimeAsOmKa > -1e+5) // kaon from OmegaMinus has signal + nSigmaOmKa = (bachDeltaTimeAsOmKa - hMeanBachOmKa->Interpolate(cascade.pt())) / hSigmaBachOmKa->Interpolate(cascade.pt()); + } else { + if (posDeltaTimeAsXiPi > -1e+5) // proton from Lambda from XiMinus has signal + nSigmaXiLaPi = (posDeltaTimeAsXiPi - hMeanPosXiPi->Interpolate(cascade.pt())) / hSigmaPosXiPi->Interpolate(cascade.pt()); + if (negDeltaTimeAsXiPr > -1e+5) // pion from Lambda from XiMinus has signal + nSigmaXiLaPr = (negDeltaTimeAsXiPr - hMeanNegXiPr->Interpolate(cascade.pt())) / hSigmaNegXiPr->Interpolate(cascade.pt()); + if (bachDeltaTimeAsXiPi > -1e+5) // pion from XiMinus has signal + nSigmaXiPi = (bachDeltaTimeAsXiPi - hMeanBachXiPi->Interpolate(cascade.pt())) / hSigmaBachXiPi->Interpolate(cascade.pt()); + if (posDeltaTimeAsOmPi > -1e+5) // proton from Lambda from OmegaMinus has signal + nSigmaOmLaPi = (posDeltaTimeAsOmPi - hMeanPosOmPi->Interpolate(cascade.pt())) / hSigmaPosOmPi->Interpolate(cascade.pt()); + if (negDeltaTimeAsOmPr > -1e+5) // pion from Lambda from OmegaMinus has signal + nSigmaOmLaPr = (negDeltaTimeAsOmPr - hMeanNegOmPr->Interpolate(cascade.pt())) / hSigmaNegOmPr->Interpolate(cascade.pt()); + if (bachDeltaTimeAsOmKa > -1e+5) // kaon from OmegaMinus has signal + nSigmaOmKa = (bachDeltaTimeAsOmKa - hMeanBachOmKa->Interpolate(cascade.pt())) / hSigmaBachOmKa->Interpolate(cascade.pt()); + } + casctofnsigmas(nSigmaXiLaPi, nSigmaXiLaPr, nSigmaXiPi, nSigmaOmLaPi, nSigmaOmLaPr, nSigmaOmKa); + } + + if (doQA) { + // fill QA histograms for cross-checking + histos.fill(HIST("hArcDebug"), cascade.pt(), lengthCascade - d3d); // for debugging purposes + + if (cascade.dcaV0daughters() < cascadeGroup.qaV0DCADau && cascade.dcacascdaughters() < cascadeGroup.qaCascDCADau && cascade.v0cosPA(collision.getX(), collision.getY(), collision.getZ()) > cascadeGroup.qaV0CosPA && cascade.casccosPA(collision.getX(), collision.getY(), collision.getZ()) > cascadeGroup.qaCascCosPA) { + if (cascade.sign() < 0) { + if (std::abs(cascade.mXi() - 1.32171) < cascadeGroup.qaMassWindow && fabs(pTra.tpcNSigmaPr()) < cascadeGroup.qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < cascadeGroup.qaTPCNSigma && fabs(bTra.tpcNSigmaPi()) < cascadeGroup.qaTPCNSigma) { + histos.fill(HIST("h2dposDeltaTimeAsXiPr"), cascade.pt(), cascade.eta(), posDeltaTimeAsXiPr); + histos.fill(HIST("h2dnegDeltaTimeAsXiPi"), cascade.pt(), cascade.eta(), negDeltaTimeAsXiPi); + histos.fill(HIST("h2dbachDeltaTimeAsXiPi"), cascade.pt(), cascade.eta(), bachDeltaTimeAsXiPi); + if (doQANSigma) { + histos.fill(HIST("h2dNSigmaXiLaPi"), cascade.pt(), nSigmaXiLaPi); + histos.fill(HIST("h2dNSigmaXiLaPr"), cascade.pt(), nSigmaXiLaPr); + histos.fill(HIST("h2dNSigmaXiPi"), cascade.pt(), nSigmaXiPi); + } + } + if (std::abs(cascade.mOmega() - 1.67245) < cascadeGroup.qaMassWindow && fabs(pTra.tpcNSigmaPr()) < cascadeGroup.qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < cascadeGroup.qaTPCNSigma && fabs(bTra.tpcNSigmaKa()) < cascadeGroup.qaTPCNSigma) { + histos.fill(HIST("h2dposDeltaTimeAsOmPr"), cascade.pt(), cascade.eta(), posDeltaTimeAsOmPr); + histos.fill(HIST("h2dnegDeltaTimeAsOmPi"), cascade.pt(), cascade.eta(), negDeltaTimeAsOmPi); + histos.fill(HIST("h2dbachDeltaTimeAsOmKa"), cascade.pt(), cascade.eta(), bachDeltaTimeAsOmKa); + if (doQANSigma) { + histos.fill(HIST("h2dNSigmaOmLaPi"), cascade.pt(), nSigmaOmLaPi); + histos.fill(HIST("h2dNSigmaOmLaPr"), cascade.pt(), nSigmaOmLaPr); + histos.fill(HIST("h2dNSigmaOmKa"), cascade.pt(), nSigmaOmKa); + } + } + } else { + if (std::abs(cascade.mXi() - 1.32171) < cascadeGroup.qaMassWindow && fabs(pTra.tpcNSigmaPi()) < cascadeGroup.qaTPCNSigma && fabs(nTra.tpcNSigmaPr()) < cascadeGroup.qaTPCNSigma && fabs(bTra.tpcNSigmaPi()) < cascadeGroup.qaTPCNSigma) { + histos.fill(HIST("h2dposDeltaTimeAsXiPi"), cascade.pt(), cascade.eta(), posDeltaTimeAsXiPi); + histos.fill(HIST("h2dnegDeltaTimeAsXiPr"), cascade.pt(), cascade.eta(), negDeltaTimeAsXiPr); + histos.fill(HIST("h2dbachDeltaTimeAsXiPi"), cascade.pt(), cascade.eta(), bachDeltaTimeAsXiPi); + if (doQANSigma) { + histos.fill(HIST("h2dNSigmaXiLaPi"), cascade.pt(), nSigmaXiLaPi); + histos.fill(HIST("h2dNSigmaXiLaPr"), cascade.pt(), nSigmaXiLaPr); + histos.fill(HIST("h2dNSigmaXiPi"), cascade.pt(), nSigmaXiPi); + } + } + if (std::abs(cascade.mOmega() - 1.67245) < cascadeGroup.qaMassWindow && fabs(pTra.tpcNSigmaPi()) < cascadeGroup.qaTPCNSigma && fabs(nTra.tpcNSigmaPr()) < cascadeGroup.qaTPCNSigma && fabs(bTra.tpcNSigmaKa()) < cascadeGroup.qaTPCNSigma) { + histos.fill(HIST("h2dposDeltaTimeAsOmPi"), cascade.pt(), cascade.eta(), posDeltaTimeAsOmPi); + histos.fill(HIST("h2dnegDeltaTimeAsOmPr"), cascade.pt(), cascade.eta(), negDeltaTimeAsOmPr); + histos.fill(HIST("h2dbachDeltaTimeAsOmKa"), cascade.pt(), cascade.eta(), bachDeltaTimeAsOmKa); + if (doQANSigma) { + histos.fill(HIST("h2dNSigmaOmLaPi"), cascade.pt(), nSigmaOmLaPi); + histos.fill(HIST("h2dNSigmaOmLaPr"), cascade.pt(), nSigmaOmLaPr); + histos.fill(HIST("h2dNSigmaOmKa"), cascade.pt(), nSigmaOmKa); + } + } + } + } + } + } + + void processStandardData(aod::Collisions const& collisions, V0OriginalDatas const& V0s, CascOriginalDatas const& cascades,TracksWithAllExtras const&, aod::BCsWithTimestamps const& /*bcs*/) { // Fire up CCDB with first collision in record. If no collisions, bypass if (useCustomRunNumber || collisions.size() < 1) { @@ -600,24 +878,45 @@ struct lambdakzeropid { initCCDB(bc.runNumber()); } - for (const auto& V0 : V0s) { - // for storing whatever is the relevant quantity for the PV - o2::dataformats::VertexBase primaryVertex; - if (V0.has_collision()) { - auto const& collision = V0.collision(); - primaryVertex.setPos({collision.posX(), collision.posY(), collision.posZ()}); - primaryVertex.setCov(collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ()); - } else { - primaryVertex.setPos({mVtx->getX(), mVtx->getY(), mVtx->getZ()}); + if(calculateV0s.value){ + for (const auto& V0 : V0s) { + // for storing whatever is the relevant quantity for the PV + o2::dataformats::VertexBase primaryVertex; + if (V0.has_collision()) { + auto const& collision = V0.collision(); + primaryVertex.setPos({collision.posX(), collision.posY(), collision.posZ()}); + primaryVertex.setCov(collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ()); + } else { + primaryVertex.setPos({mVtx->getX(), mVtx->getY(), mVtx->getZ()}); + } + + auto pTra = V0.posTrack_as(); + auto nTra = V0.negTrack_as(); + processV0Candidate(primaryVertex, V0, pTra, nTra); } + } - auto pTra = V0.posTrack_as(); - auto nTra = V0.negTrack_as(); - processV0Candidate(primaryVertex, V0, pTra, nTra); + if(calculateCascades.value){ + for (const auto& cascade : cascades) { + // for storing whatever is the relevant quantity for the PV + o2::dataformats::VertexBase primaryVertex; + if (cascade.has_collision()) { + auto const& collision = cascade.collision(); + primaryVertex.setPos({collision.posX(), collision.posY(), collision.posZ()}); + primaryVertex.setCov(collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ()); + } else { + primaryVertex.setPos({mVtx->getX(), mVtx->getY(), mVtx->getZ()}); + } + + auto pTra = cascade.posTrack_as(); + auto nTra = cascade.negTrack_as(); + auto bTra = cascade.bachelor_as(); + processCascadeCandidate(primaryVertex, cascade, pTra, nTra, bTra); + } } } - void processDerivedData(soa::Join const& collisions, V0DerivedDatas const& V0s, dauTracks const&) + void processDerivedData(soa::Join const& collisions, V0DerivedDatas const& V0s, CascDerivedDatas const& cascades, dauTracks const&) { // Fire up CCDB with first collision in record. If no collisions, bypass if (useCustomRunNumber || collisions.size() < 1) { @@ -627,30 +926,51 @@ struct lambdakzeropid { initCCDB(collision.runNumber()); } - for (const auto& V0 : V0s) { - // for storing whatever is the relevant quantity for the PV - o2::dataformats::VertexBase primaryVertex; - if (V0.has_straCollision()) { - auto const& collision = V0.straCollision_as>(); - primaryVertex.setPos({collision.posX(), collision.posY(), collision.posZ()}); - // cov: won't be used anyways, all fine - primaryVertex.setCov(1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6); - } else { - primaryVertex.setPos({mVtx->getX(), mVtx->getY(), mVtx->getZ()}); + if(calculateV0s.value){ + for (const auto& V0 : V0s) { + // for storing whatever is the relevant quantity for the PV + o2::dataformats::VertexBase primaryVertex; + if (V0.has_straCollision()) { + auto const& collision = V0.straCollision_as>(); + primaryVertex.setPos({collision.posX(), collision.posY(), collision.posZ()}); + // cov: won't be used anyways, all fine + primaryVertex.setCov(1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6); + } else { + primaryVertex.setPos({mVtx->getX(), mVtx->getY(), mVtx->getZ()}); + } + + auto pTra = V0.posTrackExtra_as(); + auto nTra = V0.negTrackExtra_as(); + processV0Candidate(primaryVertex, V0, pTra, nTra); } + } - auto pTra = V0.posTrackExtra_as(); - auto nTra = V0.negTrackExtra_as(); - processV0Candidate(primaryVertex, V0, pTra, nTra); + if(calculateCascades.value){ + for (const auto& cascade : cascades) { + // for storing whatever is the relevant quantity for the PV + o2::dataformats::VertexBase primaryVertex; + if (cascade.has_straCollision()) { + auto const& collision = cascade.straCollision_as>(); + primaryVertex.setPos({collision.posX(), collision.posY(), collision.posZ()}); + primaryVertex.setCov(1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6); + } else { + primaryVertex.setPos({mVtx->getX(), mVtx->getY(), mVtx->getZ()}); + } + + auto pTra = cascade.posTrackExtra_as(); + auto nTra = cascade.negTrackExtra_as(); + auto bTra = cascade.bachTrackExtra_as(); + processCascadeCandidate(primaryVertex, cascade, pTra, nTra, bTra); + } } } - PROCESS_SWITCH(lambdakzeropid, processStandardData, "Process standard data", true); - PROCESS_SWITCH(lambdakzeropid, processDerivedData, "Process derived data", false); + PROCESS_SWITCH(strangenesstofpid, processStandardData, "Process standard data", true); + PROCESS_SWITCH(strangenesstofpid, processDerivedData, "Process derived data", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; } From 001f07e9058352ab04277de68e6a6a7f30504b53 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sun, 17 Aug 2025 16:27:51 +0200 Subject: [PATCH 02/20] Minor fixes --- .../Strangeness/strangenesstofpid.cxx | 63 ++++++++++++------- 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index 376dee94f93..60c952f7111 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -348,37 +348,52 @@ struct strangenesstofpid { histos.add("h2dPionMeasuredVsExpected", "h2dPionMeasuredVsExpected", {HistType::kTH2F, {axisTime, axisTime}}); histos.add("hArcDebug", "hArcDebug", kTH2F, {axisPt, {500, -5.0f, 10.0f}}); - histos.add("h2dposDeltaTimeAsXiPi", "h2dposDeltaTimeAsXiPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dposDeltaTimeAsXiPr", "h2dposDeltaTimeAsXiPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dnegDeltaTimeAsXiPi", "h2dnegDeltaTimeAsXiPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dnegDeltaTimeAsXiPr", "h2dnegDeltaTimeAsXiPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dbachDeltaTimeAsXiPi", "h2dbachDeltaTimeAsXiPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - - histos.add("h2dposDeltaTimeAsOmPi", "h2dposDeltaTimeAsOmPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dposDeltaTimeAsOmPr", "h2dposDeltaTimeAsOmPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dnegDeltaTimeAsOmPi", "h2dnegDeltaTimeAsOmPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dnegDeltaTimeAsOmPr", "h2dnegDeltaTimeAsOmPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dbachDeltaTimeAsOmKa", "h2dbachDeltaTimeAsOmKa", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); // standard deltaTime values - histos.add("h2dDeltaTimePositiveLambdaPi", "h2dDeltaTimePositiveLambdaPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dDeltaTimeNegativeLambdaPi", "h2dDeltaTimeNegativeLambdaPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dDeltaTimePositiveLambdaPr", "h2dDeltaTimePositiveLambdaPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dDeltaTimeNegativeLambdaPr", "h2dDeltaTimeNegativeLambdaPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dDeltaTimePositiveK0ShortPi", "h2dDeltaTimePositiveK0ShortPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dDeltaTimeNegativeK0ShortPi", "h2dDeltaTimeNegativeK0ShortPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + if(calculateV0s.value>0){ + histos.add("h2dDeltaTimePositiveLambdaPi", "h2dDeltaTimePositiveLambdaPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dDeltaTimeNegativeLambdaPi", "h2dDeltaTimeNegativeLambdaPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dDeltaTimePositiveLambdaPr", "h2dDeltaTimePositiveLambdaPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dDeltaTimeNegativeLambdaPr", "h2dDeltaTimeNegativeLambdaPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dDeltaTimePositiveK0ShortPi", "h2dDeltaTimePositiveK0ShortPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dDeltaTimeNegativeK0ShortPi", "h2dDeltaTimeNegativeK0ShortPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + } + + if(calculateCascades.value>0){ + histos.add("h2dposDeltaTimeAsXiPi", "h2dposDeltaTimeAsXiPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dposDeltaTimeAsXiPr", "h2dposDeltaTimeAsXiPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dnegDeltaTimeAsXiPi", "h2dnegDeltaTimeAsXiPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dnegDeltaTimeAsXiPr", "h2dnegDeltaTimeAsXiPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dbachDeltaTimeAsXiPi", "h2dbachDeltaTimeAsXiPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + + histos.add("h2dposDeltaTimeAsOmPi", "h2dposDeltaTimeAsOmPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dposDeltaTimeAsOmPr", "h2dposDeltaTimeAsOmPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dnegDeltaTimeAsOmPi", "h2dnegDeltaTimeAsOmPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dnegDeltaTimeAsOmPr", "h2dnegDeltaTimeAsOmPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dbachDeltaTimeAsOmKa", "h2dbachDeltaTimeAsOmKa", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + } histos.add("h2dPositiveTOFProperties", "h2dPositiveTOFProperties", {HistType::kTH2F, {axisPt, {4, -0.5, 3.5f}}}); histos.add("h2dNegativeTOFProperties", "h2dNegativeTOFProperties", {HistType::kTH2F, {axisPt, {4, -0.5, 3.5f}}}); if (doQANSigma) { - // standard NSigma values - histos.add("h2dNSigmaPositiveLambdaPi", "h2dNSigmaPositiveLambdaPi", {HistType::kTH2F, {axisPt, axisNSigma}}); - histos.add("h2dNSigmaNegativeLambdaPi", "h2dNSigmaNegativeLambdaPi", {HistType::kTH2F, {axisPt, axisNSigma}}); - histos.add("h2dNSigmaPositiveLambdaPr", "h2dNSigmaPositiveLambdaPr", {HistType::kTH2F, {axisPt, axisNSigma}}); - histos.add("h2dNSigmaNegativeLambdaPr", "h2dNSigmaNegativeLambdaPr", {HistType::kTH2F, {axisPt, axisNSigma}}); - histos.add("h2dNSigmaPositiveK0ShortPi", "h2dNSigmaPositiveK0ShortPi", {HistType::kTH2F, {axisPt, axisNSigma}}); - histos.add("h2dNSigmaNegativeK0ShortPi", "h2dNSigmaNegativeK0ShortPi", {HistType::kTH2F, {axisPt, axisNSigma}}); + if(calculateV0s.value>0){ + histos.add("h2dNSigmaPositiveLambdaPi", "h2dNSigmaPositiveLambdaPi", {HistType::kTH2F, {axisPt, axisNSigma}}); + histos.add("h2dNSigmaNegativeLambdaPi", "h2dNSigmaNegativeLambdaPi", {HistType::kTH2F, {axisPt, axisNSigma}}); + histos.add("h2dNSigmaPositiveLambdaPr", "h2dNSigmaPositiveLambdaPr", {HistType::kTH2F, {axisPt, axisNSigma}}); + histos.add("h2dNSigmaNegativeLambdaPr", "h2dNSigmaNegativeLambdaPr", {HistType::kTH2F, {axisPt, axisNSigma}}); + histos.add("h2dNSigmaPositiveK0ShortPi", "h2dNSigmaPositiveK0ShortPi", {HistType::kTH2F, {axisPt, axisNSigma}}); + histos.add("h2dNSigmaNegativeK0ShortPi", "h2dNSigmaNegativeK0ShortPi", {HistType::kTH2F, {axisPt, axisNSigma}}); + } + + if(calculateCascades.value>0){ + histos.add("h2dNSigmaXiLaPi", "h2dNSigmaXiLaPi", {HistType::kTH2F, {axisPt, axisNSigma}}); + histos.add("h2dNSigmaXiLaPr", "h2dNSigmaXiLaPr", {HistType::kTH2F, {axisPt, axisNSigma}}); + histos.add("h2dNSigmaXiPi", "h2dNSigmaXiPi", {HistType::kTH2F, {axisPt, axisNSigma}}); + histos.add("h2dNSigmaOmLaPi", "h2dNSigmaOmLaPi", {HistType::kTH2F, {axisPt, axisNSigma}}); + histos.add("h2dNSigmaOmLaPr", "h2dNSigmaOmLaPr", {HistType::kTH2F, {axisPt, axisNSigma}}); + histos.add("h2dNSigmaOmKa", "h2dNSigmaOmKa", {HistType::kTH2F, {axisPt, axisNSigma}}); + } } // delta lambda decay time From 96d11b248aad729a49a71671d0fa1a99767b142a Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sun, 17 Aug 2025 17:19:04 +0200 Subject: [PATCH 03/20] Modifications to strangeness pid QA --- PWGLF/Tasks/QC/strangepidqa.cxx | 85 +++++++++++++++++++++++---------- 1 file changed, 59 insertions(+), 26 deletions(-) diff --git a/PWGLF/Tasks/QC/strangepidqa.cxx b/PWGLF/Tasks/QC/strangepidqa.cxx index c2bd9d89774..4c24745fe09 100644 --- a/PWGLF/Tasks/QC/strangepidqa.cxx +++ b/PWGLF/Tasks/QC/strangepidqa.cxx @@ -54,11 +54,13 @@ struct strangepidqa { ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "p_{T} (GeV/c)"}; ConfigurableAxis axisRadius{"axisRadius", {200, 0.0f, 100.0f}, "V0 radius (cm)"}; - AxisSpec centAxis = {100, 0.0f, 100.0f, "mult percentile"}; + ConfigurableAxis centAxis{"centAxis", {VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 50.0f, 70.0f, 100.0f}, "FT0C centrality"}; + AxisSpec massAxisXi = {200, 1.222f, 1.422f, "Inv. Mass (GeV/c^{2})"}; AxisSpec massAxisOmega = {200, 1.572f, 1.772f, "Inv. Mass (GeV/c^{2})"}; // Invariant Mass + ConfigurableAxis axisK0ShortMass{"axisK0ShortMass", {200, 0.497f-0.050f, 0.497f+0.050f}, "M_{K0s} (GeV/c^{2})"}; ConfigurableAxis axisLambdaMass{"axisLambdaMass", {200, 1.08f, 1.16f}, "M_{#Lambda} (GeV/c^{2})"}; // time axes @@ -117,6 +119,9 @@ struct strangepidqa { Configurable tofNsigmaOmLaPr{"tpcNsigmaOmLaPr", 1e+5, "TOF NSigma proton <- lambda <- Omega (>10 is no cut)"}; Configurable tofNsigmaOmLaPi{"tpcNsigmaOmLaPi", 1e+5, "TOF NSigma pion <- lambda <- Omega (>10 is no cut)"}; Configurable tofNsigmaOmKa{"tpcNsigmaOmKa", 1e+5, "TOF NSigma Kaon <- Omega (>10 is no cut)"}; + + Configurable tofNsigmaCompatibility{"tofNsigmaCompatibility", 4, "compatibility check for V0s"}; + Configurable tofNsigmaCompatibilityCascades{"tofNsigmaCompatibilityCascades", 4, "compatibility check for cascades"}; //*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+* void init(InitContext const&) @@ -215,6 +220,14 @@ struct strangepidqa { histos.add("h2dTimeVsLengthProtonProng", "h2dTimeVsLengthProtonProng", {HistType::kTH2F, {axisLength, axisTime}}); histos.add("h2dTimeVsLengthPionProng", "h2dTimeVsLengthPionProng", {HistType::kTH2F, {axisLength, axisTime}}); + histos.add("h3dMassK0Short", "h3dMassK0Short", {HistType::kTH3F, {centAxis, axisPt, axisK0ShortMass}}); + histos.add("h3dMassLambda", "h3dMassLambda", {HistType::kTH3F, {centAxis, axisPt, axisLambdaMass}}); + histos.add("h3dMassAntiLambda", "h3dMassAntiLambda", {HistType::kTH3F, {centAxis, axisPt, axisLambdaMass}}); + + histos.add("h3dMassCompatibleK0Short", "h3dMassCompatibleK0Short", {HistType::kTH3F, {centAxis, axisPt, axisK0ShortMass}}); + histos.add("h3dMassCompatibleLambda", "h3dMassCompatibleLambda", {HistType::kTH3F, {centAxis, axisPt, axisLambdaMass}}); + histos.add("h3dMassCompatibleAntiLambda", "h3dMassCompatibleAntiLambda", {HistType::kTH3F, {centAxis, axisPt, axisLambdaMass}}); + // --- ASSOCIATED --- // V0 Radius if (doprocessSim) { @@ -247,10 +260,15 @@ struct strangepidqa { histos.add("h3dMassXiPlus", "h3dMassXiPlus", {HistType::kTH3F, {centAxis, axisPt, massAxisXi}}); histos.add("h3dMassOmegaMinus", "h3dMassOmegaMinus", {HistType::kTH3F, {centAxis, axisPt, massAxisOmega}}); histos.add("h3dMassOmegaPlus", "h3dMassOmegaPlus", {HistType::kTH3F, {centAxis, axisPt, massAxisOmega}}); + + histos.add("h3dMassCompatibleXiMinus", "h3dMassCompatibleXiMinus", {HistType::kTH3F, {centAxis, axisPt, massAxisXi}}); + histos.add("h3dMassCompatibleXiPlus", "h3dMassCompatibleXiPlus", {HistType::kTH3F, {centAxis, axisPt, massAxisXi}}); + histos.add("h3dMassCompatibleOmegaMinus", "h3dMassCompatibleOmegaMinus", {HistType::kTH3F, {centAxis, axisPt, massAxisOmega}}); + histos.add("h3dMassCompatibleOmegaPlus", "h3dMassCompatibleOmegaPlus", {HistType::kTH3F, {centAxis, axisPt, massAxisOmega}}); } } - void processReal(soa::Join::iterator const& coll, soa::Join const& v0s) + void processReal(soa::Join::iterator const& coll, soa::Join const& v0s, soa::Join const&) { histos.fill(HIST("hEventVertexZ"), coll.posZ()); @@ -262,6 +280,33 @@ struct strangepidqa { if (TMath::Abs(lambda.eta()) > 0.5) continue; + auto negExtra = lambda.negTrackExtra_as>(); + auto posExtra = lambda.posTrackExtra_as>(); + + if (TMath::Abs(posExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(negExtra.tpcNSigmaPi()) < tpcNsigmaPion) { + // lambda case + histos.fill(HIST("h3dMassLambda"), coll.centFT0C(), lambda.pt(), lambda.mLambda()); + if(lambda.tofLambdaCompatibility(tofNsigmaCompatibility.value)){ + histos.fill(HIST("h3dMassCompatibleLambda"), coll.centFT0C(), lambda.pt(), lambda.mLambda()); + } + } + + if (TMath::Abs(posExtra.tpcNSigmaPi()) < tpcNsigmaProton && TMath::Abs(negExtra.tpcNSigmaPr()) < tpcNsigmaPion) { + // lambda case + histos.fill(HIST("h3dMassAntiLambda"), coll.centFT0C(), lambda.pt(), lambda.mLambda()); + if(lambda.tofAntiLambdaCompatibility(tofNsigmaCompatibility.value)){ + histos.fill(HIST("h3dMassCompatibleAntiambda"), coll.centFT0C(), lambda.pt(), lambda.mLambda()); + } + } + + if (TMath::Abs(posExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(negExtra.tpcNSigmaPr()) < tpcNsigmaPion) { + // lambda case + histos.fill(HIST("h3dMassK0Short"), coll.centFT0C(), lambda.pt(), lambda.mK0Short()); + if(lambda.tofAntiLambdaCompatibility(tofNsigmaCompatibility.value)){ + histos.fill(HIST("h3dMassCompatibleK0Short"), coll.centFT0C(), lambda.pt(), lambda.mK0Short()); + } + } + histos.fill(HIST("h2dLambdaMassVsTOFCut"), lambda.mLambda(), TMath::Abs(lambda.posTOFDeltaTLaPr())); histos.fill(HIST("h2dLambdaMassVsTOFCutMeson"), lambda.mLambda(), TMath::Abs(lambda.negTOFDeltaTLaPi())); @@ -397,42 +442,30 @@ struct strangepidqa { if (casc.sign() < 0) { if (TMath::Abs(posExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(negExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(bachExtra.tpcNSigmaPi()) < tpcNsigmaBachelor) { - if (tofNsigmaXiLaPr < 100 && fabs(casc.tofNSigmaXiLaPr()) > tofNsigmaXiLaPr) - continue; - if (tofNsigmaXiLaPi < 100 && fabs(casc.tofNSigmaXiLaPi()) > tofNsigmaXiLaPi) - continue; - if (tofNsigmaXiPi < 100 && fabs(casc.tofNSigmaXiPi()) > tofNsigmaXiPi) - continue; histos.fill(HIST("h3dMassXiMinus"), col.centFT0C(), casc.pt(), casc.mXi()); + if(casc.tofXiCompatibility(tofNsigmaCompatibilityCascades.value)){ + histos.fill(HIST("h3dMassCompatibleXiMinus"), col.centFT0C(), casc.pt(), casc.mXi()); + } } if (TMath::Abs(posExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(negExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(bachExtra.tpcNSigmaKa()) < tpcNsigmaBachelor) { - if (tofNsigmaOmLaPr < 100 && fabs(casc.tofNSigmaOmLaPr()) > tofNsigmaOmLaPr) - continue; - if (tofNsigmaOmLaPi < 100 && fabs(casc.tofNSigmaOmLaPi()) > tofNsigmaOmLaPi) - continue; - if (tofNsigmaOmKa < 100 && fabs(casc.tofNSigmaOmKa()) > tofNsigmaOmKa) - continue; histos.fill(HIST("h3dMassOmegaMinus"), col.centFT0C(), casc.pt(), casc.mOmega()); + if(casc.tofOmCompatibility(tofNsigmaCompatibilityCascades.value)){ + histos.fill(HIST("h3dMassCompatibleOmegaMinus"), col.centFT0C(), casc.pt(), casc.mOmega()); + } } } else { if (TMath::Abs(posExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(negExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(bachExtra.tpcNSigmaPi()) < tpcNsigmaBachelor) { - if (tofNsigmaXiLaPr < 100 && fabs(casc.tofNSigmaXiLaPr()) > tofNsigmaXiLaPr) - continue; - if (tofNsigmaXiLaPi < 100 && fabs(casc.tofNSigmaXiLaPi()) > tofNsigmaXiLaPi) - continue; - if (tofNsigmaXiPi < 100 && fabs(casc.tofNSigmaXiPi()) > tofNsigmaXiPi) - continue; histos.fill(HIST("h3dMassXiPlus"), col.centFT0C(), casc.pt(), casc.mXi()); + if(casc.tofXiCompatibility(tofNsigmaCompatibilityCascades.value)){ + histos.fill(HIST("h3dMassCompatibleXiPlus"), col.centFT0C(), casc.pt(), casc.mXi()); + } } if (TMath::Abs(posExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(negExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(bachExtra.tpcNSigmaKa()) < tpcNsigmaBachelor) { - if (tofNsigmaOmLaPr < 100 && fabs(casc.tofNSigmaOmLaPr()) > tofNsigmaOmLaPr) - continue; - if (tofNsigmaOmLaPi < 100 && fabs(casc.tofNSigmaOmLaPi()) > tofNsigmaOmLaPi) - continue; - if (tofNsigmaOmKa < 100 && fabs(casc.tofNSigmaOmKa()) > tofNsigmaOmKa) - continue; histos.fill(HIST("h3dMassOmegaPlus"), col.centFT0C(), casc.pt(), casc.mOmega()); + if(casc.tofOmCompatibility(tofNsigmaCompatibilityCascades.value)){ + histos.fill(HIST("h3dMassCompatibleOmegaPlus"), col.centFT0C(), casc.pt(), casc.mOmega()); + } } } } From e47a3b941a654b95e63fa4dcbc2775f31bb7efb0 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sun, 17 Aug 2025 20:56:40 +0200 Subject: [PATCH 04/20] Minor fix --- PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index 60c952f7111..98b43f04124 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -97,7 +97,7 @@ struct strangenesstofpid { Configurable doQA{"doQA", true, "create QA histos"}; Configurable doNSigmas{"doNSigmas", false, "calculate TOF N-sigma"}; Configurable doQANSigma{"doQANSigma", true, "create QA of Nsigma histos"}; - + // configurables related to V0s struct : ConfigurableGroup { std::string prefix = "v0Calibration"; @@ -123,7 +123,6 @@ struct strangenesstofpid { Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; Configurable lutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"}; - Configurable geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; Configurable nSigmaPath{"nSigmaPath", "Users/d/ddobrigk/stratof", "Path of information for n-sigma calculation"}; Configurable mVtxPath{"mVtxPath", "GLO/Calib/MeanVertex", "Path of the mean vertex file"}; @@ -444,6 +443,7 @@ struct strangenesstofpid { nSigmaCalibObjects = ccdb->getForRun(nSigmaPath, runNumber); if (nSigmaCalibObjects) { LOGF(info, "loaded TList with this many objects: %i", nSigmaCalibObjects->GetEntries()); + nSigmaCalibLoaded = true; // made it thus far, mark loaded if(calculateV0s.value){ hMeanPosLaPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosLaPi")); From ac2b281714e1223951d145511e2d2b9663d9e0cc Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sun, 17 Aug 2025 20:59:34 +0200 Subject: [PATCH 05/20] Fix --- PWGLF/Tasks/QC/strangepidqa.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/PWGLF/Tasks/QC/strangepidqa.cxx b/PWGLF/Tasks/QC/strangepidqa.cxx index 4c24745fe09..15025c48740 100644 --- a/PWGLF/Tasks/QC/strangepidqa.cxx +++ b/PWGLF/Tasks/QC/strangepidqa.cxx @@ -270,8 +270,6 @@ struct strangepidqa { void processReal(soa::Join::iterator const& coll, soa::Join const& v0s, soa::Join const&) { - histos.fill(HIST("hEventVertexZ"), coll.posZ()); - if (coll.centFT0C() > maxCentrality || coll.centFT0C() < minCentrality) return; From 3d665fe8187cea72fd91bd159fc57b54312eebb5 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sun, 17 Aug 2025 21:01:40 +0200 Subject: [PATCH 06/20] Fix typo --- PWGLF/Tasks/QC/strangepidqa.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/QC/strangepidqa.cxx b/PWGLF/Tasks/QC/strangepidqa.cxx index 15025c48740..965f712ddad 100644 --- a/PWGLF/Tasks/QC/strangepidqa.cxx +++ b/PWGLF/Tasks/QC/strangepidqa.cxx @@ -293,7 +293,7 @@ struct strangepidqa { // lambda case histos.fill(HIST("h3dMassAntiLambda"), coll.centFT0C(), lambda.pt(), lambda.mLambda()); if(lambda.tofAntiLambdaCompatibility(tofNsigmaCompatibility.value)){ - histos.fill(HIST("h3dMassCompatibleAntiambda"), coll.centFT0C(), lambda.pt(), lambda.mLambda()); + histos.fill(HIST("h3dMassCompatibleAntiLambda"), coll.centFT0C(), lambda.pt(), lambda.mLambda()); } } From dff96391c42121e20784a3cf350e0ec6f6418d66 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sun, 17 Aug 2025 21:08:50 +0200 Subject: [PATCH 07/20] Minor adjustments --- PWGLF/Tasks/QC/strangepidqa.cxx | 36 +++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/QC/strangepidqa.cxx b/PWGLF/Tasks/QC/strangepidqa.cxx index 965f712ddad..76d879943d7 100644 --- a/PWGLF/Tasks/QC/strangepidqa.cxx +++ b/PWGLF/Tasks/QC/strangepidqa.cxx @@ -220,6 +220,13 @@ struct strangepidqa { histos.add("h2dTimeVsLengthProtonProng", "h2dTimeVsLengthProtonProng", {HistType::kTH2F, {axisLength, axisTime}}); histos.add("h2dTimeVsLengthPionProng", "h2dTimeVsLengthPionProng", {HistType::kTH2F, {axisLength, axisTime}}); + histos.add("h1dMassK0Short", "h1dMassK0Short", {HistType::kTH1F, {axisK0ShortMass}}); + histos.add("h1dMassLambda", "h1dMassLambda", {HistType::kTH1F, {axisLambdaMass}}); + histos.add("h1dMassAntiLambda", "h1dMassAntiLambda", {HistType::kTH1F, {axisLambdaMass}}); + histos.add("h1dMassCompatibleK0Short", "h1dMassCompatibleK0Short", {HistType::kTH1F, {axisK0ShortMass}}); + histos.add("h1dMassCompatibleLambda", "h1dMassCompatibleLambda", {HistType::kTH1F, {axisLambdaMass}}); + histos.add("h1dMassCompatibleAntiLambda", "h1dMassCompatibleAntiLambda", {HistType::kTH1F, {axisLambdaMass}}); + histos.add("h3dMassK0Short", "h3dMassK0Short", {HistType::kTH3F, {centAxis, axisPt, axisK0ShortMass}}); histos.add("h3dMassLambda", "h3dMassLambda", {HistType::kTH3F, {centAxis, axisPt, axisLambdaMass}}); histos.add("h3dMassAntiLambda", "h3dMassAntiLambda", {HistType::kTH3F, {centAxis, axisPt, axisLambdaMass}}); @@ -256,6 +263,15 @@ struct strangepidqa { } if (doprocessCascades) { + histos.add("h1dMassXiMinus", "h1dMassXiMinus", {HistType::kTH1F, {massAxisXi}}); + histos.add("h1dMassXiPlus", "h1dMassXiPlus", {HistType::kTH1F, {massAxisXi}}); + histos.add("h1dMassOmegaMinus", "h1dMassOmegaMinus", {HistType::kTH1F, {massAxisXi}}); + histos.add("h1dMassOmegaPlus", "h1dMassOmegaPlus", {HistType::kTH1F, {massAxisXi}}); + histos.add("h1dMassCompatibleXiMinus", "h1dMassCompatibleXiMinus", {HistType::kTH1F, {massAxisXi}}); + histos.add("h1dMassCompatibleXiPlus", "h1dMassCompatibleXiPlus", {HistType::kTH1F, {massAxisXi}}); + histos.add("h1dMassCompatibleOmegaMinus", "h1dMassCompatibleOmegaMinus", {HistType::kTH1F, {massAxisXi}}); + histos.add("h1dMassCompatibleOmegaPlus", "h1dMassCompatibleOmegaPlus", {HistType::kTH1F, {massAxisXi}}); + histos.add("h3dMassXiMinus", "h3dMassXiMinus", {HistType::kTH3F, {centAxis, axisPt, massAxisXi}}); histos.add("h3dMassXiPlus", "h3dMassXiPlus", {HistType::kTH3F, {centAxis, axisPt, massAxisXi}}); histos.add("h3dMassOmegaMinus", "h3dMassOmegaMinus", {HistType::kTH3F, {centAxis, axisPt, massAxisOmega}}); @@ -284,24 +300,30 @@ struct strangepidqa { if (TMath::Abs(posExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(negExtra.tpcNSigmaPi()) < tpcNsigmaPion) { // lambda case histos.fill(HIST("h3dMassLambda"), coll.centFT0C(), lambda.pt(), lambda.mLambda()); + histos.fill(HIST("h1dMassLambda"), lambda.mLambda()); if(lambda.tofLambdaCompatibility(tofNsigmaCompatibility.value)){ histos.fill(HIST("h3dMassCompatibleLambda"), coll.centFT0C(), lambda.pt(), lambda.mLambda()); + histos.fill(HIST("h1dMassCompatibleLambda"), lambda.mLambda()); } } if (TMath::Abs(posExtra.tpcNSigmaPi()) < tpcNsigmaProton && TMath::Abs(negExtra.tpcNSigmaPr()) < tpcNsigmaPion) { // lambda case - histos.fill(HIST("h3dMassAntiLambda"), coll.centFT0C(), lambda.pt(), lambda.mLambda()); + histos.fill(HIST("h3dMassAntiLambda"), coll.centFT0C(), lambda.pt(), lambda.mAntiLambda()); + histos.fill(HIST("h1dMassAntiLambda"), lambda.mAntiLambda()); if(lambda.tofAntiLambdaCompatibility(tofNsigmaCompatibility.value)){ - histos.fill(HIST("h3dMassCompatibleAntiLambda"), coll.centFT0C(), lambda.pt(), lambda.mLambda()); + histos.fill(HIST("h3dMassCompatibleAntiLambda"), coll.centFT0C(), lambda.pt(), lambda.mAntiLambda()); + histos.fill(HIST("h1dMassCompatibleAntiLambda"), lambda.mAntiLambda()); } } if (TMath::Abs(posExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(negExtra.tpcNSigmaPr()) < tpcNsigmaPion) { // lambda case histos.fill(HIST("h3dMassK0Short"), coll.centFT0C(), lambda.pt(), lambda.mK0Short()); + histos.fill(HIST("h1dMassK0Short"), lambda.mK0Short()); if(lambda.tofAntiLambdaCompatibility(tofNsigmaCompatibility.value)){ histos.fill(HIST("h3dMassCompatibleK0Short"), coll.centFT0C(), lambda.pt(), lambda.mK0Short()); + histos.fill(HIST("h1dMassCompatibleK0Short"), lambda.mK0Short()); } } @@ -421,6 +443,8 @@ struct strangepidqa { void processCascades(soa::Join::iterator const& col, soa::Filtered> const& Cascades, soa::Join const&) { histos.fill(HIST("hEventCentrality"), col.centFT0C()); + if (coll.centFT0C() > maxCentrality || coll.centFT0C() < minCentrality) + return; for (auto& casc : Cascades) { // major selections here @@ -441,28 +465,36 @@ struct strangepidqa { if (casc.sign() < 0) { if (TMath::Abs(posExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(negExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(bachExtra.tpcNSigmaPi()) < tpcNsigmaBachelor) { histos.fill(HIST("h3dMassXiMinus"), col.centFT0C(), casc.pt(), casc.mXi()); + histos.fill(HIST("h1dMassXiMinus"), casc.mXi()); if(casc.tofXiCompatibility(tofNsigmaCompatibilityCascades.value)){ histos.fill(HIST("h3dMassCompatibleXiMinus"), col.centFT0C(), casc.pt(), casc.mXi()); + histos.fill(HIST("h1dMassCompatibleXiMinus"), casc.mXi()); } } if (TMath::Abs(posExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(negExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(bachExtra.tpcNSigmaKa()) < tpcNsigmaBachelor) { histos.fill(HIST("h3dMassOmegaMinus"), col.centFT0C(), casc.pt(), casc.mOmega()); + histos.fill(HIST("h1dMassOmegaMinus"), casc.mOmega()); if(casc.tofOmCompatibility(tofNsigmaCompatibilityCascades.value)){ histos.fill(HIST("h3dMassCompatibleOmegaMinus"), col.centFT0C(), casc.pt(), casc.mOmega()); + histos.fill(HIST("h1dMassCompatibleOmegaMinus"), casc.mOmega()); } } } else { if (TMath::Abs(posExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(negExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(bachExtra.tpcNSigmaPi()) < tpcNsigmaBachelor) { histos.fill(HIST("h3dMassXiPlus"), col.centFT0C(), casc.pt(), casc.mXi()); + histos.fill(HIST("h1dMassXiPlus"), casc.mXi()); if(casc.tofXiCompatibility(tofNsigmaCompatibilityCascades.value)){ histos.fill(HIST("h3dMassCompatibleXiPlus"), col.centFT0C(), casc.pt(), casc.mXi()); + histos.fill(HIST("h1dCompatibleMassXiPlus"), casc.mXi()); } } if (TMath::Abs(posExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(negExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(bachExtra.tpcNSigmaKa()) < tpcNsigmaBachelor) { histos.fill(HIST("h3dMassOmegaPlus"), col.centFT0C(), casc.pt(), casc.mOmega()); + histos.fill(HIST("h1dMassOmegaPlus"), casc.mOmega()); if(casc.tofOmCompatibility(tofNsigmaCompatibilityCascades.value)){ histos.fill(HIST("h3dMassCompatibleOmegaPlus"), col.centFT0C(), casc.pt(), casc.mOmega()); + histos.fill(HIST("h1dMassCompatibleOmegaPlus"), casc.mOmega()); } } } From 709b4f24ba51e358507a3df2193a71aabe6408e3 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sun, 17 Aug 2025 21:09:47 +0200 Subject: [PATCH 08/20] Minor fix --- PWGLF/Tasks/QC/strangepidqa.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/QC/strangepidqa.cxx b/PWGLF/Tasks/QC/strangepidqa.cxx index 76d879943d7..0e93bcfcd4b 100644 --- a/PWGLF/Tasks/QC/strangepidqa.cxx +++ b/PWGLF/Tasks/QC/strangepidqa.cxx @@ -443,7 +443,7 @@ struct strangepidqa { void processCascades(soa::Join::iterator const& col, soa::Filtered> const& Cascades, soa::Join const&) { histos.fill(HIST("hEventCentrality"), col.centFT0C()); - if (coll.centFT0C() > maxCentrality || coll.centFT0C() < minCentrality) + if (col.centFT0C() > maxCentrality || col.centFT0C() < minCentrality) return; for (auto& casc : Cascades) { From edb014f5c4d2af879407eac4bd9ccc7e2def073b Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sun, 17 Aug 2025 21:11:39 +0200 Subject: [PATCH 09/20] Minor fix 2 --- PWGLF/Tasks/QC/strangepidqa.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/QC/strangepidqa.cxx b/PWGLF/Tasks/QC/strangepidqa.cxx index 0e93bcfcd4b..6f5296f5efb 100644 --- a/PWGLF/Tasks/QC/strangepidqa.cxx +++ b/PWGLF/Tasks/QC/strangepidqa.cxx @@ -485,7 +485,7 @@ struct strangepidqa { histos.fill(HIST("h1dMassXiPlus"), casc.mXi()); if(casc.tofXiCompatibility(tofNsigmaCompatibilityCascades.value)){ histos.fill(HIST("h3dMassCompatibleXiPlus"), col.centFT0C(), casc.pt(), casc.mXi()); - histos.fill(HIST("h1dCompatibleMassXiPlus"), casc.mXi()); + histos.fill(HIST("h1dMassCompatibleXiPlus"), casc.mXi()); } } From 11d3e234cb96a431e39f8be7cf027ce547119953 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sun, 17 Aug 2025 21:24:09 +0200 Subject: [PATCH 10/20] Minor fix 3 --- PWGLF/Tasks/QC/strangepidqa.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGLF/Tasks/QC/strangepidqa.cxx b/PWGLF/Tasks/QC/strangepidqa.cxx index 6f5296f5efb..845af42beba 100644 --- a/PWGLF/Tasks/QC/strangepidqa.cxx +++ b/PWGLF/Tasks/QC/strangepidqa.cxx @@ -265,12 +265,12 @@ struct strangepidqa { if (doprocessCascades) { histos.add("h1dMassXiMinus", "h1dMassXiMinus", {HistType::kTH1F, {massAxisXi}}); histos.add("h1dMassXiPlus", "h1dMassXiPlus", {HistType::kTH1F, {massAxisXi}}); - histos.add("h1dMassOmegaMinus", "h1dMassOmegaMinus", {HistType::kTH1F, {massAxisXi}}); - histos.add("h1dMassOmegaPlus", "h1dMassOmegaPlus", {HistType::kTH1F, {massAxisXi}}); + histos.add("h1dMassOmegaMinus", "h1dMassOmegaMinus", {HistType::kTH1F, {massAxisOmega}}); + histos.add("h1dMassOmegaPlus", "h1dMassOmegaPlus", {HistType::kTH1F, {massAxisOmega}}); histos.add("h1dMassCompatibleXiMinus", "h1dMassCompatibleXiMinus", {HistType::kTH1F, {massAxisXi}}); histos.add("h1dMassCompatibleXiPlus", "h1dMassCompatibleXiPlus", {HistType::kTH1F, {massAxisXi}}); - histos.add("h1dMassCompatibleOmegaMinus", "h1dMassCompatibleOmegaMinus", {HistType::kTH1F, {massAxisXi}}); - histos.add("h1dMassCompatibleOmegaPlus", "h1dMassCompatibleOmegaPlus", {HistType::kTH1F, {massAxisXi}}); + histos.add("h1dMassCompatibleOmegaMinus", "h1dMassCompatibleOmegaMinus", {HistType::kTH1F, {massAxisOmega}}); + histos.add("h1dMassCompatibleOmegaPlus", "h1dMassCompatibleOmegaPlus", {HistType::kTH1F, {massAxisOmega}}); histos.add("h3dMassXiMinus", "h3dMassXiMinus", {HistType::kTH3F, {centAxis, axisPt, massAxisXi}}); histos.add("h3dMassXiPlus", "h3dMassXiPlus", {HistType::kTH3F, {centAxis, axisPt, massAxisXi}}); @@ -321,7 +321,7 @@ struct strangepidqa { // lambda case histos.fill(HIST("h3dMassK0Short"), coll.centFT0C(), lambda.pt(), lambda.mK0Short()); histos.fill(HIST("h1dMassK0Short"), lambda.mK0Short()); - if(lambda.tofAntiLambdaCompatibility(tofNsigmaCompatibility.value)){ + if(lambda.tofK0ShortCompatibility(tofNsigmaCompatibility.value)){ histos.fill(HIST("h3dMassCompatibleK0Short"), coll.centFT0C(), lambda.pt(), lambda.mK0Short()); histos.fill(HIST("h1dMassCompatibleK0Short"), lambda.mK0Short()); } From 493718a95f4d428135cea318b2d0ed82648cc5d8 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sun, 17 Aug 2025 21:28:24 +0200 Subject: [PATCH 11/20] Minor fix 4 --- PWGLF/DataModel/LFStrangenessPIDTables.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PWGLF/DataModel/LFStrangenessPIDTables.h b/PWGLF/DataModel/LFStrangenessPIDTables.h index ad124882752..7e2bc65ca6f 100644 --- a/PWGLF/DataModel/LFStrangenessPIDTables.h +++ b/PWGLF/DataModel/LFStrangenessPIDTables.h @@ -201,13 +201,13 @@ DECLARE_SOA_COLUMN(TOFNSigmaOmKa, tofNSigmaOmKa, float); //! bachelor track DECLARE_SOA_DYNAMIC_COLUMN(TofXiCompatibility, tofXiCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas [](float tofNSigmaXiLaPr, float tofNSigmaXiLaPi, float tofNSigmaXiPi, float nsigma) -> float { bool compatible = true; - if(std::abs(tofNSigmaXiLaPr+1000.0f)>1e-3 && std::abs(tofNSigmaXiLaPr)>nsigma){ + if(std::abs(tofNSigmaXiLaPr+1000000.0f)>1e-3 && std::abs(tofNSigmaXiLaPr)>nsigma){ compatible = false; // reject only if info present and incompatible } - if(std::abs(tofNSigmaXiLaPi+1000.0f)>1e-3 && std::abs(tofNSigmaXiLaPi)>nsigma){ + if(std::abs(tofNSigmaXiLaPi+1000000.0f)>1e-3 && std::abs(tofNSigmaXiLaPi)>nsigma){ compatible = false; // reject only if info present and incompatible } - if(std::abs(tofNSigmaXiPi+1000.0f)>1e-3 && std::abs(tofNSigmaXiPi)>nsigma){ + if(std::abs(tofNSigmaXiPi+1000000.0f)>1e-3 && std::abs(tofNSigmaXiPi)>nsigma){ compatible = false; // reject only if info present and incompatible } return compatible; @@ -216,13 +216,13 @@ DECLARE_SOA_DYNAMIC_COLUMN(TofXiCompatibility, tofXiCompatibility, //! compatibi DECLARE_SOA_DYNAMIC_COLUMN(TofOmCompatibility, tofOmCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas [](float tofNSigmaOmLaPr, float tofNSigmaOmLaPi, float tofNSigmaOmKa, float nsigma) -> float { bool compatible = true; - if(std::abs(tofNSigmaOmLaPr+1000.0f)>1e-3 && std::abs(tofNSigmaOmLaPr)>nsigma){ + if(std::abs(tofNSigmaOmLaPr+1000000.0f)>1e-3 && std::abs(tofNSigmaOmLaPr)>nsigma){ compatible = false; // reject only if info present and incompatible } - if(std::abs(tofNSigmaOmLaPi+1000.0f)>1e-3 && std::abs(tofNSigmaOmLaPi)>nsigma){ + if(std::abs(tofNSigmaOmLaPi+1000000.0f)>1e-3 && std::abs(tofNSigmaOmLaPi)>nsigma){ compatible = false; // reject only if info present and incompatible } - if(std::abs(tofNSigmaOmKa+1000.0f)>1e-3 && std::abs(tofNSigmaOmKa)>nsigma){ + if(std::abs(tofNSigmaOmKa+1000000.0f)>1e-3 && std::abs(tofNSigmaOmKa)>nsigma){ compatible = false; // reject only if info present and incompatible } return compatible; From db5cc458330a77485040fcbc319c01a2aa6f31b6 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Mon, 18 Aug 2025 09:36:14 +0200 Subject: [PATCH 12/20] Changes for eloss correction --- .../Strangeness/strangenesstofpid.cxx | 210 +++++++++--------- 1 file changed, 109 insertions(+), 101 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index 98b43f04124..3214b38a3ed 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -132,9 +132,15 @@ struct strangenesstofpid { ConfigurableAxis axisEta{"axisEta", {20, -1.0f, +1.0f}, "#eta"}; ConfigurableAxis axisDeltaTime{"axisDeltaTime", {2000, -1000.0f, +1000.0f}, "delta-time (ps)"}; - ConfigurableAxis axisTime{"axisTime", {200, 0.0f, +20000.0f}, "T (ps)"}; + ConfigurableAxis axisTime{"axisTime", {200, 10000.0f, +20000.0f}, "T (ps)"}; ConfigurableAxis axisNSigma{"axisNSigma", {200, -10.0f, +10.0f}, "N(#sigma)"}; - ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "p_{T} (GeV/c)"}; + ConfigurableAxis axisExpectedOverMeasured{"axisExpectedOverMeasured", {200, 0.9f, 2.9f}, "T_{exp}/T_{meas}"}; + + // master p axis + ConfigurableAxis axisP{"axisP", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "p_{T} (GeV/c)"}; + + // for zooming in at low values only (e-loss studies and effective correction) + ConfigurableAxis axisSmallP{"axisSmallP", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f}, "p_{T} (GeV/c)"}; // for n-sigma calibration bool nSigmaCalibLoaded; @@ -343,60 +349,61 @@ struct strangenesstofpid { // measured vs expected total time QA if (doQA) { - histos.add("h2dProtonMeasuredVsExpected", "h2dProtonMeasuredVsExpected", {HistType::kTH2F, {axisTime, axisTime}}); - histos.add("h2dPionMeasuredVsExpected", "h2dPionMeasuredVsExpected", {HistType::kTH2F, {axisTime, axisTime}}); + // plots for effective eloss corrections - Lambda case + histos.add("h2dProtonMeasuredVsExpected", "h2dProtonMeasuredVsExpected", {HistType::kTH2F, {axisExpectedOverMeasured, axisSmallP}}); + histos.add("h2dPionMeasuredVsExpected", "h2dPionMeasuredVsExpected", {HistType::kTH2F, {axisExpectedOverMeasured, axisSmallP}}); - histos.add("hArcDebug", "hArcDebug", kTH2F, {axisPt, {500, -5.0f, 10.0f}}); + histos.add("hArcDebug", "hArcDebug", kTH2F, {axisP, {50, -5.0f, 10.0f}}); // standard deltaTime values if(calculateV0s.value>0){ - histos.add("h2dDeltaTimePositiveLambdaPi", "h2dDeltaTimePositiveLambdaPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dDeltaTimeNegativeLambdaPi", "h2dDeltaTimeNegativeLambdaPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dDeltaTimePositiveLambdaPr", "h2dDeltaTimePositiveLambdaPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dDeltaTimeNegativeLambdaPr", "h2dDeltaTimeNegativeLambdaPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dDeltaTimePositiveK0ShortPi", "h2dDeltaTimePositiveK0ShortPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dDeltaTimeNegativeK0ShortPi", "h2dDeltaTimeNegativeK0ShortPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dDeltaTimePositiveLambdaPi", "h2dDeltaTimePositiveLambdaPi", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); + histos.add("h2dDeltaTimeNegativeLambdaPi", "h2dDeltaTimeNegativeLambdaPi", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); + histos.add("h2dDeltaTimePositiveLambdaPr", "h2dDeltaTimePositiveLambdaPr", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); + histos.add("h2dDeltaTimeNegativeLambdaPr", "h2dDeltaTimeNegativeLambdaPr", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); + histos.add("h2dDeltaTimePositiveK0ShortPi", "h2dDeltaTimePositiveK0ShortPi", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); + histos.add("h2dDeltaTimeNegativeK0ShortPi", "h2dDeltaTimeNegativeK0ShortPi", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); } if(calculateCascades.value>0){ - histos.add("h2dposDeltaTimeAsXiPi", "h2dposDeltaTimeAsXiPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dposDeltaTimeAsXiPr", "h2dposDeltaTimeAsXiPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dnegDeltaTimeAsXiPi", "h2dnegDeltaTimeAsXiPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dnegDeltaTimeAsXiPr", "h2dnegDeltaTimeAsXiPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dbachDeltaTimeAsXiPi", "h2dbachDeltaTimeAsXiPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - - histos.add("h2dposDeltaTimeAsOmPi", "h2dposDeltaTimeAsOmPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dposDeltaTimeAsOmPr", "h2dposDeltaTimeAsOmPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dnegDeltaTimeAsOmPi", "h2dnegDeltaTimeAsOmPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dnegDeltaTimeAsOmPr", "h2dnegDeltaTimeAsOmPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dbachDeltaTimeAsOmKa", "h2dbachDeltaTimeAsOmKa", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dposDeltaTimeAsXiPi", "h2dposDeltaTimeAsXiPi", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); + histos.add("h2dposDeltaTimeAsXiPr", "h2dposDeltaTimeAsXiPr", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); + histos.add("h2dnegDeltaTimeAsXiPi", "h2dnegDeltaTimeAsXiPi", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); + histos.add("h2dnegDeltaTimeAsXiPr", "h2dnegDeltaTimeAsXiPr", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); + histos.add("h2dbachDeltaTimeAsXiPi", "h2dbachDeltaTimeAsXiPi", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); + + histos.add("h2dposDeltaTimeAsOmPi", "h2dposDeltaTimeAsOmPi", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); + histos.add("h2dposDeltaTimeAsOmPr", "h2dposDeltaTimeAsOmPr", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); + histos.add("h2dnegDeltaTimeAsOmPi", "h2dnegDeltaTimeAsOmPi", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); + histos.add("h2dnegDeltaTimeAsOmPr", "h2dnegDeltaTimeAsOmPr", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); + histos.add("h2dbachDeltaTimeAsOmKa", "h2dbachDeltaTimeAsOmKa", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); } - histos.add("h2dPositiveTOFProperties", "h2dPositiveTOFProperties", {HistType::kTH2F, {axisPt, {4, -0.5, 3.5f}}}); - histos.add("h2dNegativeTOFProperties", "h2dNegativeTOFProperties", {HistType::kTH2F, {axisPt, {4, -0.5, 3.5f}}}); + histos.add("h2dPositiveTOFProperties", "h2dPositiveTOFProperties", {HistType::kTH2F, {axisP, {4, -0.5, 3.5f}}}); + histos.add("h2dNegativeTOFProperties", "h2dNegativeTOFProperties", {HistType::kTH2F, {axisP, {4, -0.5, 3.5f}}}); if (doQANSigma) { if(calculateV0s.value>0){ - histos.add("h2dNSigmaPositiveLambdaPi", "h2dNSigmaPositiveLambdaPi", {HistType::kTH2F, {axisPt, axisNSigma}}); - histos.add("h2dNSigmaNegativeLambdaPi", "h2dNSigmaNegativeLambdaPi", {HistType::kTH2F, {axisPt, axisNSigma}}); - histos.add("h2dNSigmaPositiveLambdaPr", "h2dNSigmaPositiveLambdaPr", {HistType::kTH2F, {axisPt, axisNSigma}}); - histos.add("h2dNSigmaNegativeLambdaPr", "h2dNSigmaNegativeLambdaPr", {HistType::kTH2F, {axisPt, axisNSigma}}); - histos.add("h2dNSigmaPositiveK0ShortPi", "h2dNSigmaPositiveK0ShortPi", {HistType::kTH2F, {axisPt, axisNSigma}}); - histos.add("h2dNSigmaNegativeK0ShortPi", "h2dNSigmaNegativeK0ShortPi", {HistType::kTH2F, {axisPt, axisNSigma}}); + histos.add("h2dNSigmaPositiveLambdaPi", "h2dNSigmaPositiveLambdaPi", {HistType::kTH2F, {axisP, axisNSigma}}); + histos.add("h2dNSigmaNegativeLambdaPi", "h2dNSigmaNegativeLambdaPi", {HistType::kTH2F, {axisP, axisNSigma}}); + histos.add("h2dNSigmaPositiveLambdaPr", "h2dNSigmaPositiveLambdaPr", {HistType::kTH2F, {axisP, axisNSigma}}); + histos.add("h2dNSigmaNegativeLambdaPr", "h2dNSigmaNegativeLambdaPr", {HistType::kTH2F, {axisP, axisNSigma}}); + histos.add("h2dNSigmaPositiveK0ShortPi", "h2dNSigmaPositiveK0ShortPi", {HistType::kTH2F, {axisP, axisNSigma}}); + histos.add("h2dNSigmaNegativeK0ShortPi", "h2dNSigmaNegativeK0ShortPi", {HistType::kTH2F, {axisP, axisNSigma}}); } if(calculateCascades.value>0){ - histos.add("h2dNSigmaXiLaPi", "h2dNSigmaXiLaPi", {HistType::kTH2F, {axisPt, axisNSigma}}); - histos.add("h2dNSigmaXiLaPr", "h2dNSigmaXiLaPr", {HistType::kTH2F, {axisPt, axisNSigma}}); - histos.add("h2dNSigmaXiPi", "h2dNSigmaXiPi", {HistType::kTH2F, {axisPt, axisNSigma}}); - histos.add("h2dNSigmaOmLaPi", "h2dNSigmaOmLaPi", {HistType::kTH2F, {axisPt, axisNSigma}}); - histos.add("h2dNSigmaOmLaPr", "h2dNSigmaOmLaPr", {HistType::kTH2F, {axisPt, axisNSigma}}); - histos.add("h2dNSigmaOmKa", "h2dNSigmaOmKa", {HistType::kTH2F, {axisPt, axisNSigma}}); + histos.add("h2dNSigmaXiLaPi", "h2dNSigmaXiLaPi", {HistType::kTH2F, {axisP, axisNSigma}}); + histos.add("h2dNSigmaXiLaPr", "h2dNSigmaXiLaPr", {HistType::kTH2F, {axisP, axisNSigma}}); + histos.add("h2dNSigmaXiPi", "h2dNSigmaXiPi", {HistType::kTH2F, {axisP, axisNSigma}}); + histos.add("h2dNSigmaOmLaPi", "h2dNSigmaOmLaPi", {HistType::kTH2F, {axisP, axisNSigma}}); + histos.add("h2dNSigmaOmLaPr", "h2dNSigmaOmLaPr", {HistType::kTH2F, {axisP, axisNSigma}}); + histos.add("h2dNSigmaOmKa", "h2dNSigmaOmKa", {HistType::kTH2F, {axisP, axisNSigma}}); } } // delta lambda decay time - histos.add("h2dLambdaDeltaDecayTime", "h2dLambdaDeltaDecayTime", {HistType::kTH2F, {axisPt, axisDeltaTime}}); + histos.add("h2dLambdaDeltaDecayTime", "h2dLambdaDeltaDecayTime", {HistType::kTH2F, {axisP, axisDeltaTime}}); } } @@ -587,8 +594,8 @@ struct strangenesstofpid { if (nTra.hasTOF()) negProperties = negProperties | (static_cast(1) << kHasTOF); - histos.fill(HIST("h2dPositiveTOFProperties"), v0.pt(), posProperties); - histos.fill(HIST("h2dNegativeTOFProperties"), v0.pt(), negProperties); + histos.fill(HIST("h2dPositiveTOFProperties"), v0.p(), posProperties); + histos.fill(HIST("h2dNegativeTOFProperties"), v0.p(), negProperties); } float deltaDecayTimeLambda = -10e+4; @@ -629,17 +636,17 @@ struct strangenesstofpid { // sweep through all viable hypotheses and produce N-sigma if (deltaTimePositiveLambdaPi > -1e+5) - nSigmaPositiveLambdaPi = (deltaTimePositiveLambdaPi - hMeanPosLaPi->Interpolate(v0.pt())) / hSigmaPosLaPi->Interpolate(v0.pt()); + nSigmaPositiveLambdaPi = (deltaTimePositiveLambdaPi - hMeanPosLaPi->Interpolate(v0.p())) / hSigmaPosLaPi->Interpolate(v0.p()); if (deltaTimePositiveLambdaPr > -1e+5) - nSigmaPositiveLambdaPr = (deltaTimePositiveLambdaPr - hMeanPosLaPr->Interpolate(v0.pt())) / hSigmaPosLaPr->Interpolate(v0.pt()); + nSigmaPositiveLambdaPr = (deltaTimePositiveLambdaPr - hMeanPosLaPr->Interpolate(v0.p())) / hSigmaPosLaPr->Interpolate(v0.p()); if (deltaTimeNegativeLambdaPi > -1e+5) - nSigmaNegativeLambdaPi = (deltaTimeNegativeLambdaPi - hMeanNegLaPi->Interpolate(v0.pt())) / hSigmaNegLaPi->Interpolate(v0.pt()); + nSigmaNegativeLambdaPi = (deltaTimeNegativeLambdaPi - hMeanNegLaPi->Interpolate(v0.p())) / hSigmaNegLaPi->Interpolate(v0.p()); if (deltaTimeNegativeLambdaPr > -1e+5) - nSigmaNegativeLambdaPr = (deltaTimeNegativeLambdaPr - hMeanNegLaPr->Interpolate(v0.pt())) / hSigmaNegLaPr->Interpolate(v0.pt()); + nSigmaNegativeLambdaPr = (deltaTimeNegativeLambdaPr - hMeanNegLaPr->Interpolate(v0.p())) / hSigmaNegLaPr->Interpolate(v0.p()); if (deltaTimePositiveK0ShortPi > -1e+5) - nSigmaPositiveK0ShortPi = (deltaTimePositiveK0ShortPi - hMeanPosK0Pi->Interpolate(v0.pt())) / hSigmaPosK0Pi->Interpolate(v0.pt()); + nSigmaPositiveK0ShortPi = (deltaTimePositiveK0ShortPi - hMeanPosK0Pi->Interpolate(v0.p())) / hSigmaPosK0Pi->Interpolate(v0.p()); if (deltaTimeNegativeK0ShortPi > -1e+5) - nSigmaNegativeK0ShortPi = (deltaTimeNegativeK0ShortPi - hMeanNegK0Pi->Interpolate(v0.pt())) / hSigmaNegK0Pi->Interpolate(v0.pt()); + nSigmaNegativeK0ShortPi = (deltaTimeNegativeK0ShortPi - hMeanNegK0Pi->Interpolate(v0.p())) / hSigmaNegK0Pi->Interpolate(v0.p()); v0tofnsigmas( nSigmaPositiveLambdaPr, nSigmaNegativeLambdaPi, @@ -649,52 +656,53 @@ struct strangenesstofpid { if (doQA) { if (pTra.hasTOF()) { - histos.fill(HIST("h2dProtonMeasuredVsExpected"), - (timeLambda + timePositivePr), - (pTra.tofSignal() - pTra.tofEvTime())); if (v0.v0cosPA() > v0Group.qaCosPA && v0.dcaV0daughters() < v0Group.qaDCADau) { if (std::abs(v0.mLambda() - 1.115683) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPr()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma) { - histos.fill(HIST("h2dDeltaTimePositiveLambdaPr"), v0.pt(), v0.eta(), deltaTimePositiveLambdaPr); + histos.fill(HIST("h2dDeltaTimePositiveLambdaPr"), v0.p(), v0.eta(), deltaTimePositiveLambdaPr); + histos.fill(HIST("h2dProtonMeasuredVsExpected"), + (timeLambda + timePositivePr)/(pTra.tofSignal() - pTra.tofEvTime()), + v0.p()); + if (doQANSigma) - histos.fill(HIST("h2dNSigmaPositiveLambdaPr"), v0.pt(), nSigmaPositiveLambdaPr); + histos.fill(HIST("h2dNSigmaPositiveLambdaPr"), v0.p(), nSigmaPositiveLambdaPr); } if (std::abs(v0.mAntiLambda() - 1.115683) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPr()) < v0Group.qaTPCNSigma) { - histos.fill(HIST("h2dDeltaTimePositiveLambdaPi"), v0.pt(), v0.eta(), deltaTimePositiveLambdaPi); + histos.fill(HIST("h2dDeltaTimePositiveLambdaPi"), v0.p(), v0.eta(), deltaTimePositiveLambdaPi); if (doQANSigma) - histos.fill(HIST("h2dNSigmaPositiveLambdaPi"), v0.pt(), nSigmaPositiveLambdaPi); + histos.fill(HIST("h2dNSigmaPositiveLambdaPi"), v0.p(), nSigmaPositiveLambdaPi); } if (std::abs(v0.mK0Short() - 0.497) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma) { - histos.fill(HIST("h2dDeltaTimePositiveK0ShortPi"), v0.pt(), v0.eta(), deltaTimePositiveK0ShortPi); + histos.fill(HIST("h2dDeltaTimePositiveK0ShortPi"), v0.p(), v0.eta(), deltaTimePositiveK0ShortPi); if (doQANSigma) - histos.fill(HIST("h2dNSigmaPositiveK0ShortPi"), v0.pt(), nSigmaPositiveK0ShortPi); + histos.fill(HIST("h2dNSigmaPositiveK0ShortPi"), v0.p(), nSigmaPositiveK0ShortPi); } } } if (nTra.hasTOF()) { - histos.fill(HIST("h2dPionMeasuredVsExpected"), - (timeLambda + timeNegativePi), - (nTra.tofSignal() - nTra.tofEvTime())); if (v0.v0cosPA() > v0Group.qaCosPA && v0.dcaV0daughters() < v0Group.qaDCADau) { if (std::abs(v0.mLambda() - 1.115683) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPr()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma) { - histos.fill(HIST("h2dDeltaTimeNegativeLambdaPi"), v0.pt(), v0.eta(), deltaTimeNegativeLambdaPi); + histos.fill(HIST("h2dDeltaTimeNegativeLambdaPi"), v0.p(), v0.eta(), deltaTimeNegativeLambdaPi); + histos.fill(HIST("h2dPionMeasuredVsExpected"), + (timeLambda + timeNegativePi)/(nTra.tofSignal() - nTra.tofEvTime()), + v0.p()); if (doQANSigma) - histos.fill(HIST("h2dNSigmaNegativeLambdaPi"), v0.pt(), nSigmaNegativeLambdaPi); + histos.fill(HIST("h2dNSigmaNegativeLambdaPi"), v0.p(), nSigmaNegativeLambdaPi); } if (std::abs(v0.mAntiLambda() - 1.115683) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPr()) < v0Group.qaTPCNSigma) { - histos.fill(HIST("h2dDeltaTimeNegativeLambdaPr"), v0.pt(), v0.eta(), deltaTimeNegativeLambdaPr); + histos.fill(HIST("h2dDeltaTimeNegativeLambdaPr"), v0.p(), v0.eta(), deltaTimeNegativeLambdaPr); if (doQANSigma) - histos.fill(HIST("h2dNSigmaNegativeLambdaPr"), v0.pt(), nSigmaNegativeLambdaPr); + histos.fill(HIST("h2dNSigmaNegativeLambdaPr"), v0.p(), nSigmaNegativeLambdaPr); } if (std::abs(v0.mK0Short() - 0.497) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma) { - histos.fill(HIST("h2dDeltaTimeNegativeK0ShortPi"), v0.pt(), v0.eta(), deltaTimeNegativeK0ShortPi); + histos.fill(HIST("h2dDeltaTimeNegativeK0ShortPi"), v0.p(), v0.eta(), deltaTimeNegativeK0ShortPi); if (doQANSigma) - histos.fill(HIST("h2dNSigmaNegativeK0ShortPi"), v0.pt(), nSigmaNegativeK0ShortPi); + histos.fill(HIST("h2dNSigmaNegativeK0ShortPi"), v0.p(), nSigmaNegativeK0ShortPi); } } } // delta lambda decay time - histos.fill(HIST("h2dLambdaDeltaDecayTime"), v0.pt(), deltaDecayTimeLambda); + histos.fill(HIST("h2dLambdaDeltaDecayTime"), v0.p(), deltaDecayTimeLambda); } } @@ -802,79 +810,79 @@ struct strangenesstofpid { // Xi hypothesis ________________________ if (cascade.sign() < 0) { // XiMinus if (posDeltaTimeAsXiPr > -1e+5) // proton from Lambda from XiMinus has signal - nSigmaXiLaPr = (posDeltaTimeAsXiPr - hMeanPosXiPr->Interpolate(cascade.pt())) / hSigmaPosXiPr->Interpolate(cascade.pt()); + nSigmaXiLaPr = (posDeltaTimeAsXiPr - hMeanPosXiPr->Interpolate(cascade.p())) / hSigmaPosXiPr->Interpolate(cascade.p()); if (negDeltaTimeAsXiPi > -1e+5) // pion from Lambda from XiMinus has signal - nSigmaXiLaPi = (negDeltaTimeAsXiPi - hMeanNegXiPi->Interpolate(cascade.pt())) / hSigmaNegXiPi->Interpolate(cascade.pt()); + nSigmaXiLaPi = (negDeltaTimeAsXiPi - hMeanNegXiPi->Interpolate(cascade.p())) / hSigmaNegXiPi->Interpolate(cascade.p()); if (bachDeltaTimeAsXiPi > -1e+5) // pion from XiMinus has signal - nSigmaXiPi = (bachDeltaTimeAsXiPi - hMeanBachXiPi->Interpolate(cascade.pt())) / hSigmaBachXiPi->Interpolate(cascade.pt()); + nSigmaXiPi = (bachDeltaTimeAsXiPi - hMeanBachXiPi->Interpolate(cascade.p())) / hSigmaBachXiPi->Interpolate(cascade.p()); if (posDeltaTimeAsOmPr > -1e+5) // proton from Lambda from OmegaMinus has signal - nSigmaOmLaPr = (posDeltaTimeAsOmPr - hMeanPosOmPr->Interpolate(cascade.pt())) / hSigmaPosOmPr->Interpolate(cascade.pt()); + nSigmaOmLaPr = (posDeltaTimeAsOmPr - hMeanPosOmPr->Interpolate(cascade.p())) / hSigmaPosOmPr->Interpolate(cascade.p()); if (negDeltaTimeAsOmPi > -1e+5) // pion from Lambda from OmegaMinus has signal - nSigmaOmLaPi = (negDeltaTimeAsOmPi - hMeanNegOmPi->Interpolate(cascade.pt())) / hSigmaNegOmPi->Interpolate(cascade.pt()); + nSigmaOmLaPi = (negDeltaTimeAsOmPi - hMeanNegOmPi->Interpolate(cascade.p())) / hSigmaNegOmPi->Interpolate(cascade.p()); if (bachDeltaTimeAsOmKa > -1e+5) // kaon from OmegaMinus has signal - nSigmaOmKa = (bachDeltaTimeAsOmKa - hMeanBachOmKa->Interpolate(cascade.pt())) / hSigmaBachOmKa->Interpolate(cascade.pt()); + nSigmaOmKa = (bachDeltaTimeAsOmKa - hMeanBachOmKa->Interpolate(cascade.p())) / hSigmaBachOmKa->Interpolate(cascade.p()); } else { if (posDeltaTimeAsXiPi > -1e+5) // proton from Lambda from XiMinus has signal - nSigmaXiLaPi = (posDeltaTimeAsXiPi - hMeanPosXiPi->Interpolate(cascade.pt())) / hSigmaPosXiPi->Interpolate(cascade.pt()); + nSigmaXiLaPi = (posDeltaTimeAsXiPi - hMeanPosXiPi->Interpolate(cascade.p())) / hSigmaPosXiPi->Interpolate(cascade.p()); if (negDeltaTimeAsXiPr > -1e+5) // pion from Lambda from XiMinus has signal - nSigmaXiLaPr = (negDeltaTimeAsXiPr - hMeanNegXiPr->Interpolate(cascade.pt())) / hSigmaNegXiPr->Interpolate(cascade.pt()); + nSigmaXiLaPr = (negDeltaTimeAsXiPr - hMeanNegXiPr->Interpolate(cascade.p())) / hSigmaNegXiPr->Interpolate(cascade.p()); if (bachDeltaTimeAsXiPi > -1e+5) // pion from XiMinus has signal - nSigmaXiPi = (bachDeltaTimeAsXiPi - hMeanBachXiPi->Interpolate(cascade.pt())) / hSigmaBachXiPi->Interpolate(cascade.pt()); + nSigmaXiPi = (bachDeltaTimeAsXiPi - hMeanBachXiPi->Interpolate(cascade.p())) / hSigmaBachXiPi->Interpolate(cascade.p()); if (posDeltaTimeAsOmPi > -1e+5) // proton from Lambda from OmegaMinus has signal - nSigmaOmLaPi = (posDeltaTimeAsOmPi - hMeanPosOmPi->Interpolate(cascade.pt())) / hSigmaPosOmPi->Interpolate(cascade.pt()); + nSigmaOmLaPi = (posDeltaTimeAsOmPi - hMeanPosOmPi->Interpolate(cascade.p())) / hSigmaPosOmPi->Interpolate(cascade.p()); if (negDeltaTimeAsOmPr > -1e+5) // pion from Lambda from OmegaMinus has signal - nSigmaOmLaPr = (negDeltaTimeAsOmPr - hMeanNegOmPr->Interpolate(cascade.pt())) / hSigmaNegOmPr->Interpolate(cascade.pt()); + nSigmaOmLaPr = (negDeltaTimeAsOmPr - hMeanNegOmPr->Interpolate(cascade.p())) / hSigmaNegOmPr->Interpolate(cascade.p()); if (bachDeltaTimeAsOmKa > -1e+5) // kaon from OmegaMinus has signal - nSigmaOmKa = (bachDeltaTimeAsOmKa - hMeanBachOmKa->Interpolate(cascade.pt())) / hSigmaBachOmKa->Interpolate(cascade.pt()); + nSigmaOmKa = (bachDeltaTimeAsOmKa - hMeanBachOmKa->Interpolate(cascade.p())) / hSigmaBachOmKa->Interpolate(cascade.p()); } casctofnsigmas(nSigmaXiLaPi, nSigmaXiLaPr, nSigmaXiPi, nSigmaOmLaPi, nSigmaOmLaPr, nSigmaOmKa); } if (doQA) { // fill QA histograms for cross-checking - histos.fill(HIST("hArcDebug"), cascade.pt(), lengthCascade - d3d); // for debugging purposes + histos.fill(HIST("hArcDebug"), cascade.p(), lengthCascade - d3d); // for debugging purposes if (cascade.dcaV0daughters() < cascadeGroup.qaV0DCADau && cascade.dcacascdaughters() < cascadeGroup.qaCascDCADau && cascade.v0cosPA(collision.getX(), collision.getY(), collision.getZ()) > cascadeGroup.qaV0CosPA && cascade.casccosPA(collision.getX(), collision.getY(), collision.getZ()) > cascadeGroup.qaCascCosPA) { if (cascade.sign() < 0) { if (std::abs(cascade.mXi() - 1.32171) < cascadeGroup.qaMassWindow && fabs(pTra.tpcNSigmaPr()) < cascadeGroup.qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < cascadeGroup.qaTPCNSigma && fabs(bTra.tpcNSigmaPi()) < cascadeGroup.qaTPCNSigma) { - histos.fill(HIST("h2dposDeltaTimeAsXiPr"), cascade.pt(), cascade.eta(), posDeltaTimeAsXiPr); - histos.fill(HIST("h2dnegDeltaTimeAsXiPi"), cascade.pt(), cascade.eta(), negDeltaTimeAsXiPi); - histos.fill(HIST("h2dbachDeltaTimeAsXiPi"), cascade.pt(), cascade.eta(), bachDeltaTimeAsXiPi); + histos.fill(HIST("h2dposDeltaTimeAsXiPr"), cascade.p(), cascade.eta(), posDeltaTimeAsXiPr); + histos.fill(HIST("h2dnegDeltaTimeAsXiPi"), cascade.p(), cascade.eta(), negDeltaTimeAsXiPi); + histos.fill(HIST("h2dbachDeltaTimeAsXiPi"), cascade.p(), cascade.eta(), bachDeltaTimeAsXiPi); if (doQANSigma) { - histos.fill(HIST("h2dNSigmaXiLaPi"), cascade.pt(), nSigmaXiLaPi); - histos.fill(HIST("h2dNSigmaXiLaPr"), cascade.pt(), nSigmaXiLaPr); - histos.fill(HIST("h2dNSigmaXiPi"), cascade.pt(), nSigmaXiPi); + histos.fill(HIST("h2dNSigmaXiLaPi"), cascade.p(), nSigmaXiLaPi); + histos.fill(HIST("h2dNSigmaXiLaPr"), cascade.p(), nSigmaXiLaPr); + histos.fill(HIST("h2dNSigmaXiPi"), cascade.p(), nSigmaXiPi); } } if (std::abs(cascade.mOmega() - 1.67245) < cascadeGroup.qaMassWindow && fabs(pTra.tpcNSigmaPr()) < cascadeGroup.qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < cascadeGroup.qaTPCNSigma && fabs(bTra.tpcNSigmaKa()) < cascadeGroup.qaTPCNSigma) { - histos.fill(HIST("h2dposDeltaTimeAsOmPr"), cascade.pt(), cascade.eta(), posDeltaTimeAsOmPr); - histos.fill(HIST("h2dnegDeltaTimeAsOmPi"), cascade.pt(), cascade.eta(), negDeltaTimeAsOmPi); - histos.fill(HIST("h2dbachDeltaTimeAsOmKa"), cascade.pt(), cascade.eta(), bachDeltaTimeAsOmKa); + histos.fill(HIST("h2dposDeltaTimeAsOmPr"), cascade.p(), cascade.eta(), posDeltaTimeAsOmPr); + histos.fill(HIST("h2dnegDeltaTimeAsOmPi"), cascade.p(), cascade.eta(), negDeltaTimeAsOmPi); + histos.fill(HIST("h2dbachDeltaTimeAsOmKa"), cascade.p(), cascade.eta(), bachDeltaTimeAsOmKa); if (doQANSigma) { - histos.fill(HIST("h2dNSigmaOmLaPi"), cascade.pt(), nSigmaOmLaPi); - histos.fill(HIST("h2dNSigmaOmLaPr"), cascade.pt(), nSigmaOmLaPr); - histos.fill(HIST("h2dNSigmaOmKa"), cascade.pt(), nSigmaOmKa); + histos.fill(HIST("h2dNSigmaOmLaPi"), cascade.p(), nSigmaOmLaPi); + histos.fill(HIST("h2dNSigmaOmLaPr"), cascade.p(), nSigmaOmLaPr); + histos.fill(HIST("h2dNSigmaOmKa"), cascade.p(), nSigmaOmKa); } } } else { if (std::abs(cascade.mXi() - 1.32171) < cascadeGroup.qaMassWindow && fabs(pTra.tpcNSigmaPi()) < cascadeGroup.qaTPCNSigma && fabs(nTra.tpcNSigmaPr()) < cascadeGroup.qaTPCNSigma && fabs(bTra.tpcNSigmaPi()) < cascadeGroup.qaTPCNSigma) { - histos.fill(HIST("h2dposDeltaTimeAsXiPi"), cascade.pt(), cascade.eta(), posDeltaTimeAsXiPi); - histos.fill(HIST("h2dnegDeltaTimeAsXiPr"), cascade.pt(), cascade.eta(), negDeltaTimeAsXiPr); - histos.fill(HIST("h2dbachDeltaTimeAsXiPi"), cascade.pt(), cascade.eta(), bachDeltaTimeAsXiPi); + histos.fill(HIST("h2dposDeltaTimeAsXiPi"), cascade.p(), cascade.eta(), posDeltaTimeAsXiPi); + histos.fill(HIST("h2dnegDeltaTimeAsXiPr"), cascade.p(), cascade.eta(), negDeltaTimeAsXiPr); + histos.fill(HIST("h2dbachDeltaTimeAsXiPi"), cascade.p(), cascade.eta(), bachDeltaTimeAsXiPi); if (doQANSigma) { - histos.fill(HIST("h2dNSigmaXiLaPi"), cascade.pt(), nSigmaXiLaPi); - histos.fill(HIST("h2dNSigmaXiLaPr"), cascade.pt(), nSigmaXiLaPr); - histos.fill(HIST("h2dNSigmaXiPi"), cascade.pt(), nSigmaXiPi); + histos.fill(HIST("h2dNSigmaXiLaPi"), cascade.p(), nSigmaXiLaPi); + histos.fill(HIST("h2dNSigmaXiLaPr"), cascade.p(), nSigmaXiLaPr); + histos.fill(HIST("h2dNSigmaXiPi"), cascade.p(), nSigmaXiPi); } } if (std::abs(cascade.mOmega() - 1.67245) < cascadeGroup.qaMassWindow && fabs(pTra.tpcNSigmaPi()) < cascadeGroup.qaTPCNSigma && fabs(nTra.tpcNSigmaPr()) < cascadeGroup.qaTPCNSigma && fabs(bTra.tpcNSigmaKa()) < cascadeGroup.qaTPCNSigma) { - histos.fill(HIST("h2dposDeltaTimeAsOmPi"), cascade.pt(), cascade.eta(), posDeltaTimeAsOmPi); - histos.fill(HIST("h2dnegDeltaTimeAsOmPr"), cascade.pt(), cascade.eta(), negDeltaTimeAsOmPr); - histos.fill(HIST("h2dbachDeltaTimeAsOmKa"), cascade.pt(), cascade.eta(), bachDeltaTimeAsOmKa); + histos.fill(HIST("h2dposDeltaTimeAsOmPi"), cascade.p(), cascade.eta(), posDeltaTimeAsOmPi); + histos.fill(HIST("h2dnegDeltaTimeAsOmPr"), cascade.p(), cascade.eta(), negDeltaTimeAsOmPr); + histos.fill(HIST("h2dbachDeltaTimeAsOmKa"), cascade.p(), cascade.eta(), bachDeltaTimeAsOmKa); if (doQANSigma) { - histos.fill(HIST("h2dNSigmaOmLaPi"), cascade.pt(), nSigmaOmLaPi); - histos.fill(HIST("h2dNSigmaOmLaPr"), cascade.pt(), nSigmaOmLaPr); - histos.fill(HIST("h2dNSigmaOmKa"), cascade.pt(), nSigmaOmKa); + histos.fill(HIST("h2dNSigmaOmLaPi"), cascade.p(), nSigmaOmLaPi); + histos.fill(HIST("h2dNSigmaOmLaPr"), cascade.p(), nSigmaOmLaPr); + histos.fill(HIST("h2dNSigmaOmKa"), cascade.p(), nSigmaOmKa); } } } From d6cd1b5c0a86415c5f98f0d568084bf1cde9e1db Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Mon, 18 Aug 2025 10:22:38 +0200 Subject: [PATCH 13/20] fix axes --- PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index 3214b38a3ed..32dd99c1940 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -350,8 +350,8 @@ struct strangenesstofpid { // measured vs expected total time QA if (doQA) { // plots for effective eloss corrections - Lambda case - histos.add("h2dProtonMeasuredVsExpected", "h2dProtonMeasuredVsExpected", {HistType::kTH2F, {axisExpectedOverMeasured, axisSmallP}}); - histos.add("h2dPionMeasuredVsExpected", "h2dPionMeasuredVsExpected", {HistType::kTH2F, {axisExpectedOverMeasured, axisSmallP}}); + histos.add("h2dProtonMeasuredVsExpected", "h2dProtonMeasuredVsExpected", {HistType::kTH2F, {axisSmallP, axisExpectedOverMeasured}}); + histos.add("h2dPionMeasuredVsExpected", "h2dPionMeasuredVsExpected", {HistType::kTH2F, {axisSmallP, axisExpectedOverMeasured}}); histos.add("hArcDebug", "hArcDebug", kTH2F, {axisP, {50, -5.0f, 10.0f}}); From b0523c289effc2082afd87b1b93421223217b10f Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Mon, 18 Aug 2025 11:09:23 +0200 Subject: [PATCH 14/20] Momentum adjust --- PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index 32dd99c1940..3a641e3dbac 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -654,6 +654,9 @@ struct strangenesstofpid { nSigmaPositiveK0ShortPi, nSigmaNegativeK0ShortPi); } + float positiveP = std::hypot(v0.pxpos(), v0.pypos(), v0.pzpos()); + float negativeP = std::hypot(v0.pxneg(), v0.pyneg(), v0.pzneg()); + if (doQA) { if (pTra.hasTOF()) { if (v0.v0cosPA() > v0Group.qaCosPA && v0.dcaV0daughters() < v0Group.qaDCADau) { @@ -661,8 +664,7 @@ struct strangenesstofpid { histos.fill(HIST("h2dDeltaTimePositiveLambdaPr"), v0.p(), v0.eta(), deltaTimePositiveLambdaPr); histos.fill(HIST("h2dProtonMeasuredVsExpected"), (timeLambda + timePositivePr)/(pTra.tofSignal() - pTra.tofEvTime()), - v0.p()); - + positiveP); if (doQANSigma) histos.fill(HIST("h2dNSigmaPositiveLambdaPr"), v0.p(), nSigmaPositiveLambdaPr); } @@ -685,7 +687,7 @@ struct strangenesstofpid { histos.fill(HIST("h2dDeltaTimeNegativeLambdaPi"), v0.p(), v0.eta(), deltaTimeNegativeLambdaPi); histos.fill(HIST("h2dPionMeasuredVsExpected"), (timeLambda + timeNegativePi)/(nTra.tofSignal() - nTra.tofEvTime()), - v0.p()); + negativeP); if (doQANSigma) histos.fill(HIST("h2dNSigmaNegativeLambdaPi"), v0.p(), nSigmaNegativeLambdaPi); } From fab8c8b73a3386e14c1fcc223562d276290ee6b0 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Mon, 18 Aug 2025 11:31:54 +0200 Subject: [PATCH 15/20] eta differentiation in eloss --- PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index 3a641e3dbac..a460856c34a 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -350,8 +350,8 @@ struct strangenesstofpid { // measured vs expected total time QA if (doQA) { // plots for effective eloss corrections - Lambda case - histos.add("h2dProtonMeasuredVsExpected", "h2dProtonMeasuredVsExpected", {HistType::kTH2F, {axisSmallP, axisExpectedOverMeasured}}); - histos.add("h2dPionMeasuredVsExpected", "h2dPionMeasuredVsExpected", {HistType::kTH2F, {axisSmallP, axisExpectedOverMeasured}}); + histos.add("h2dProtonMeasuredVsExpected", "h2dProtonMeasuredVsExpected", {HistType::kTH2F, {axisSmallP, axisExpectedOverMeasured, axisEta}}); + histos.add("h2dPionMeasuredVsExpected", "h2dPionMeasuredVsExpected", {HistType::kTH2F, {axisSmallP, axisExpectedOverMeasured, axisEta}}); histos.add("hArcDebug", "hArcDebug", kTH2F, {axisP, {50, -5.0f, 10.0f}}); @@ -664,7 +664,7 @@ struct strangenesstofpid { histos.fill(HIST("h2dDeltaTimePositiveLambdaPr"), v0.p(), v0.eta(), deltaTimePositiveLambdaPr); histos.fill(HIST("h2dProtonMeasuredVsExpected"), (timeLambda + timePositivePr)/(pTra.tofSignal() - pTra.tofEvTime()), - positiveP); + positiveP, v0.positiveeta()); if (doQANSigma) histos.fill(HIST("h2dNSigmaPositiveLambdaPr"), v0.p(), nSigmaPositiveLambdaPr); } @@ -687,7 +687,7 @@ struct strangenesstofpid { histos.fill(HIST("h2dDeltaTimeNegativeLambdaPi"), v0.p(), v0.eta(), deltaTimeNegativeLambdaPi); histos.fill(HIST("h2dPionMeasuredVsExpected"), (timeLambda + timeNegativePi)/(nTra.tofSignal() - nTra.tofEvTime()), - negativeP); + negativeP, v0.negativeeta()); if (doQANSigma) histos.fill(HIST("h2dNSigmaNegativeLambdaPi"), v0.p(), nSigmaNegativeLambdaPi); } From aceb0b1a30e3555df2b134577b1844aa5d9498f4 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Mon, 18 Aug 2025 11:33:55 +0200 Subject: [PATCH 16/20] Fix --- PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index a460856c34a..5927ea730f4 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -350,8 +350,8 @@ struct strangenesstofpid { // measured vs expected total time QA if (doQA) { // plots for effective eloss corrections - Lambda case - histos.add("h2dProtonMeasuredVsExpected", "h2dProtonMeasuredVsExpected", {HistType::kTH2F, {axisSmallP, axisExpectedOverMeasured, axisEta}}); - histos.add("h2dPionMeasuredVsExpected", "h2dPionMeasuredVsExpected", {HistType::kTH2F, {axisSmallP, axisExpectedOverMeasured, axisEta}}); + histos.add("h2dProtonMeasuredVsExpected", "h2dProtonMeasuredVsExpected", {HistType::kTH3F, {axisSmallP, axisExpectedOverMeasured, axisEta}}); + histos.add("h2dPionMeasuredVsExpected", "h2dPionMeasuredVsExpected", {HistType::kTH3F, {axisSmallP, axisExpectedOverMeasured, axisEta}}); histos.add("hArcDebug", "hArcDebug", kTH2F, {axisP, {50, -5.0f, 10.0f}}); From 63f4400cb1b448404ffc3b7a6a1cec03dd902f3b Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Mon, 18 Aug 2025 14:08:38 +0200 Subject: [PATCH 17/20] Last adjustments --- PWGLF/DataModel/LFStrangenessPIDTables.h | 32 ++++++---- .../Strangeness/strangenesstofpid.cxx | 58 +++++++++---------- 2 files changed, 49 insertions(+), 41 deletions(-) diff --git a/PWGLF/DataModel/LFStrangenessPIDTables.h b/PWGLF/DataModel/LFStrangenessPIDTables.h index 7e2bc65ca6f..68c1df6ff9d 100644 --- a/PWGLF/DataModel/LFStrangenessPIDTables.h +++ b/PWGLF/DataModel/LFStrangenessPIDTables.h @@ -47,6 +47,10 @@ DECLARE_SOA_TABLE(DauTrackTOFPIDs, "AOD", "DAUTRACKTOFPID", // raw table (for po namespace v0data { +// define constants for NSigma operation +const float kNoTOFValue = -1e+6; +const float kEpsilon = 1e-4; + // ==== TOF INFORMATION === // lengths as stored in the AO2D for TOF calculations DECLARE_SOA_COLUMN(PosTOFLengthToPV, posTOFLengthToPV, float); //! positive track length to PV @@ -83,10 +87,10 @@ DECLARE_SOA_COLUMN(TOFNSigmaK0PiMinus, tofNSigmaK0PiMinus, float); //! negative DECLARE_SOA_DYNAMIC_COLUMN(TofLambdaCompatibility, tofLambdaCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas [](float tofNSigmaLaPr, float tofNSigmaLaPi, float nsigma) -> float { bool compatible = true; - if(std::abs(tofNSigmaLaPr+1000.0f)>1e-3 && std::abs(tofNSigmaLaPr)>nsigma){ + if(std::abs(tofNSigmaLaPr-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaLaPr)>nsigma){ compatible = false; // reject only if info present and incompatible } - if(std::abs(tofNSigmaLaPi+1000.0f)>1e-3 && std::abs(tofNSigmaLaPi)>nsigma){ + if(std::abs(tofNSigmaLaPi-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaLaPi)>nsigma){ compatible = false; // reject only if info present and incompatible } return compatible; @@ -96,10 +100,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(TofLambdaCompatibility, tofLambdaCompatibility, //! c DECLARE_SOA_DYNAMIC_COLUMN(TofAntiLambdaCompatibility, tofAntiLambdaCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas [](float tofNSigmaALaPr, float tofNSigmaALaPi, float nsigma) -> float { bool compatible = true; - if(std::abs(tofNSigmaALaPr+1000.0f)>1e-3 && std::abs(tofNSigmaALaPr)>nsigma){ + if(std::abs(tofNSigmaALaPr-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaALaPr)>nsigma){ compatible = false; // reject only if info present and incompatible } - if(std::abs(tofNSigmaALaPi+1000.0f)>1e-3 && std::abs(tofNSigmaALaPi)>nsigma){ + if(std::abs(tofNSigmaALaPi-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaALaPi)>nsigma){ compatible = false; // reject only if info present and incompatible } return compatible; @@ -109,10 +113,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(TofAntiLambdaCompatibility, tofAntiLambdaCompatibilit DECLARE_SOA_DYNAMIC_COLUMN(TofK0ShortCompatibility, tofK0ShortCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas [](float tofNSigmaK0PiPlus, float tofNSigmaK0PiMinus, float nsigma) -> float { bool compatible = true; - if(std::abs(tofNSigmaK0PiPlus+1000.0f)>1e-3 && std::abs(tofNSigmaK0PiPlus)>nsigma){ + if(std::abs(tofNSigmaK0PiPlus-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaK0PiPlus)>nsigma){ compatible = false; // reject only if info present and incompatible } - if(std::abs(tofNSigmaK0PiMinus+1000.0f)>1e-3 && std::abs(tofNSigmaK0PiMinus)>nsigma){ + if(std::abs(tofNSigmaK0PiMinus-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaK0PiMinus)>nsigma){ compatible = false; // reject only if info present and incompatible } return compatible; @@ -166,6 +170,10 @@ DECLARE_SOA_TABLE(V0TOFNSigmas, "AOD", "V0TOFNSIGMA", // processed NSigma table namespace cascdata { +// define constants for NSigma operation +const float kNoTOFValue = -1e+6; +const float kEpsilon = 1e-4; + // lengths as stored in the AO2D for TOF calculations DECLARE_SOA_COLUMN(PosTOFLengthToPV, posTOFLengthToPV, float); //! positive track length DECLARE_SOA_COLUMN(NegTOFLengthToPV, negTOFLengthToPV, float); //! negative track length @@ -201,13 +209,13 @@ DECLARE_SOA_COLUMN(TOFNSigmaOmKa, tofNSigmaOmKa, float); //! bachelor track DECLARE_SOA_DYNAMIC_COLUMN(TofXiCompatibility, tofXiCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas [](float tofNSigmaXiLaPr, float tofNSigmaXiLaPi, float tofNSigmaXiPi, float nsigma) -> float { bool compatible = true; - if(std::abs(tofNSigmaXiLaPr+1000000.0f)>1e-3 && std::abs(tofNSigmaXiLaPr)>nsigma){ + if(std::abs(tofNSigmaXiLaPr-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaXiLaPr)>nsigma){ compatible = false; // reject only if info present and incompatible } - if(std::abs(tofNSigmaXiLaPi+1000000.0f)>1e-3 && std::abs(tofNSigmaXiLaPi)>nsigma){ + if(std::abs(tofNSigmaXiLaPi-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaXiLaPi)>nsigma){ compatible = false; // reject only if info present and incompatible } - if(std::abs(tofNSigmaXiPi+1000000.0f)>1e-3 && std::abs(tofNSigmaXiPi)>nsigma){ + if(std::abs(tofNSigmaXiPi-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaXiPi)>nsigma){ compatible = false; // reject only if info present and incompatible } return compatible; @@ -216,13 +224,13 @@ DECLARE_SOA_DYNAMIC_COLUMN(TofXiCompatibility, tofXiCompatibility, //! compatibi DECLARE_SOA_DYNAMIC_COLUMN(TofOmCompatibility, tofOmCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas [](float tofNSigmaOmLaPr, float tofNSigmaOmLaPi, float tofNSigmaOmKa, float nsigma) -> float { bool compatible = true; - if(std::abs(tofNSigmaOmLaPr+1000000.0f)>1e-3 && std::abs(tofNSigmaOmLaPr)>nsigma){ + if(std::abs(tofNSigmaOmLaPr-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaOmLaPr)>nsigma){ compatible = false; // reject only if info present and incompatible } - if(std::abs(tofNSigmaOmLaPi+1000000.0f)>1e-3 && std::abs(tofNSigmaOmLaPi)>nsigma){ + if(std::abs(tofNSigmaOmLaPi-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaOmLaPi)>nsigma){ compatible = false; // reject only if info present and incompatible } - if(std::abs(tofNSigmaOmKa+1000000.0f)>1e-3 && std::abs(tofNSigmaOmKa)>nsigma){ + if(std::abs(tofNSigmaOmKa-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaOmKa)>nsigma){ compatible = false; // reject only if info present and incompatible } return compatible; diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index 5927ea730f4..7f783414457 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -544,19 +544,19 @@ struct strangenesstofpid { o2::track::TrackPar posTrack = o2::track::TrackPar({v0.x(), v0.y(), v0.z()}, {v0.pxpos(), v0.pypos(), v0.pzpos()}, +1); o2::track::TrackPar negTrack = o2::track::TrackPar({v0.x(), v0.y(), v0.z()}, {v0.pxneg(), v0.pyneg(), v0.pzneg()}, -1); - float deltaTimePositiveLambdaPi = -1e+6; - float deltaTimeNegativeLambdaPi = -1e+6; - float deltaTimePositiveLambdaPr = -1e+6; - float deltaTimeNegativeLambdaPr = -1e+6; - float deltaTimePositiveK0ShortPi = -1e+6; - float deltaTimeNegativeK0ShortPi = -1e+6; - - float nSigmaPositiveLambdaPi = -1e+3; - float nSigmaPositiveLambdaPr = -1e+3; - float nSigmaNegativeLambdaPi = -1e+3; - float nSigmaNegativeLambdaPr = -1e+3; - float nSigmaPositiveK0ShortPi = -1e+3; - float nSigmaNegativeK0ShortPi = -1e+3; + float deltaTimePositiveLambdaPi = o2::aod::v0data::kNoTOFValue; + float deltaTimeNegativeLambdaPi = o2::aod::v0data::kNoTOFValue; + float deltaTimePositiveLambdaPr = o2::aod::v0data::kNoTOFValue; + float deltaTimeNegativeLambdaPr = o2::aod::v0data::kNoTOFValue; + float deltaTimePositiveK0ShortPi = o2::aod::v0data::kNoTOFValue; + float deltaTimeNegativeK0ShortPi = o2::aod::v0data::kNoTOFValue; + + float nSigmaPositiveLambdaPi = o2::aod::v0data::kNoTOFValue; + float nSigmaPositiveLambdaPr = o2::aod::v0data::kNoTOFValue; + float nSigmaNegativeLambdaPi = o2::aod::v0data::kNoTOFValue; + float nSigmaNegativeLambdaPr = o2::aod::v0data::kNoTOFValue; + float nSigmaPositiveK0ShortPi = o2::aod::v0data::kNoTOFValue; + float nSigmaNegativeK0ShortPi = o2::aod::v0data::kNoTOFValue; float velocityPositivePr = velocity(posTrack.getP(), o2::constants::physics::MassProton); float velocityPositivePi = velocity(posTrack.getP(), o2::constants::physics::MassPionCharged); @@ -614,9 +614,9 @@ struct strangenesstofpid { float decayTimeAntiLambda = 0.5f * ((pTra.tofSignal() - timePositivePi) + (nTra.tofSignal() - timeNegativePr)) - evTimeMean; float decayTimeK0Short = 0.5f * ((pTra.tofSignal() - timePositivePi) + (nTra.tofSignal() - timeNegativePi)) - evTimeMean; - float betaLambda = -1e+6; - float betaAntiLambda = -1e+6; - float betaK0Short = -1e+6; + float betaLambda = o2::aod::cascdata::kNoTOFValue;; + float betaAntiLambda = o2::aod::cascdata::kNoTOFValue;; + float betaK0Short = o2::aod::cascdata::kNoTOFValue;; if (nTra.hasTOF() && pTra.hasTOF()) { betaLambda = (lengthV0 / decayTimeLambda) / 0.0299792458; @@ -736,7 +736,7 @@ struct strangenesstofpid { // calculate mother lengths float lengthV0 = std::hypot(cascade.xlambda() - cascade.x(), cascade.ylambda() - cascade.y(), cascade.zlambda() - cascade.z()); - float lengthCascade = -1e+6; + float lengthCascade = o2::aod::cascdata::kNoTOFValue;; const o2::math_utils::Point3D collVtx{collision.getX(), collision.getY(), collision.getZ()}; bool successPropag = o2::base::Propagator::Instance()->propagateToDCA(collVtx, cascTrack, d_bz, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrNONE); float d = -1.0f, d3d = 0.0f; @@ -772,12 +772,12 @@ struct strangenesstofpid { float bachFlightKa = lengthBachelor / velocityBachelorKa; // initialize delta-times (actual PID variables) - float posDeltaTimeAsXiPi = -1e+6, posDeltaTimeAsXiPr = -1e+6; - float negDeltaTimeAsXiPi = -1e+6, negDeltaTimeAsXiPr = -1e+6; - float bachDeltaTimeAsXiPi = -1e+6; - float posDeltaTimeAsOmPi = -1e+6, posDeltaTimeAsOmPr = -1e+6; - float negDeltaTimeAsOmPi = -1e+6, negDeltaTimeAsOmPr = -1e+6; - float bachDeltaTimeAsOmKa = -1e+6; + float posDeltaTimeAsXiPi = o2::aod::cascdata::kNoTOFValue, posDeltaTimeAsXiPr = o2::aod::cascdata::kNoTOFValue; + float negDeltaTimeAsXiPi = o2::aod::cascdata::kNoTOFValue, negDeltaTimeAsXiPr = o2::aod::cascdata::kNoTOFValue; + float bachDeltaTimeAsXiPi = o2::aod::cascdata::kNoTOFValue; + float posDeltaTimeAsOmPi = o2::aod::cascdata::kNoTOFValue, posDeltaTimeAsOmPr = o2::aod::cascdata::kNoTOFValue; + float negDeltaTimeAsOmPi = o2::aod::cascdata::kNoTOFValue, negDeltaTimeAsOmPr = o2::aod::cascdata::kNoTOFValue; + float bachDeltaTimeAsOmKa = o2::aod::cascdata::kNoTOFValue; if (pTra.hasTOF()) { posDeltaTimeAsXiPi = (pTra.tofSignal() - pTra.tofEvTime()) - (xiFlight + lambdaFlight + posFlightPi); @@ -800,12 +800,12 @@ struct strangenesstofpid { posDeltaTimeAsXiPi, posDeltaTimeAsXiPr, negDeltaTimeAsXiPi, negDeltaTimeAsXiPr, bachDeltaTimeAsXiPi, posDeltaTimeAsOmPi, posDeltaTimeAsOmPr, negDeltaTimeAsOmPi, negDeltaTimeAsOmPr, bachDeltaTimeAsOmKa); - float nSigmaXiLaPr = -1e+6; - float nSigmaXiLaPi = -1e+6; - float nSigmaXiPi = -1e+6; - float nSigmaOmLaPr = -1e+6; - float nSigmaOmLaPi = -1e+6; - float nSigmaOmKa = -1e+6; + float nSigmaXiLaPr = o2::aod::cascdata::kNoTOFValue;; + float nSigmaXiLaPi = o2::aod::cascdata::kNoTOFValue;; + float nSigmaXiPi = o2::aod::cascdata::kNoTOFValue;; + float nSigmaOmLaPr = o2::aod::cascdata::kNoTOFValue;; + float nSigmaOmLaPi = o2::aod::cascdata::kNoTOFValue;; + float nSigmaOmKa = o2::aod::cascdata::kNoTOFValue;; // go for Nsigma values if requested if (doNSigmas && nSigmaCalibLoaded) { From 49e8d358c02d398daad844dbb5f09affd816de6a Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Mon, 18 Aug 2025 14:48:24 +0200 Subject: [PATCH 18/20] Minor change to getter name --- PWGLF/DataModel/LFStrangenessPIDTables.h | 4 ++-- PWGLF/Tasks/QC/strangepidqa.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGLF/DataModel/LFStrangenessPIDTables.h b/PWGLF/DataModel/LFStrangenessPIDTables.h index 68c1df6ff9d..69a3c48fa28 100644 --- a/PWGLF/DataModel/LFStrangenessPIDTables.h +++ b/PWGLF/DataModel/LFStrangenessPIDTables.h @@ -221,7 +221,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(TofXiCompatibility, tofXiCompatibility, //! compatibi return compatible; }); -DECLARE_SOA_DYNAMIC_COLUMN(TofOmCompatibility, tofOmCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas +DECLARE_SOA_DYNAMIC_COLUMN(TofOmegaCompatibility, tofOmegaCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas [](float tofNSigmaOmLaPr, float tofNSigmaOmLaPi, float tofNSigmaOmKa, float nsigma) -> float { bool compatible = true; if(std::abs(tofNSigmaOmLaPr-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaOmLaPr)>nsigma){ @@ -258,7 +258,7 @@ DECLARE_SOA_TABLE(CascTOFNSigmas, "AOD", "CascTOFNSigmas", // Nsigmas for cascad cascdata::TOFNSigmaXiLaPi, cascdata::TOFNSigmaXiLaPr, cascdata::TOFNSigmaXiPi, cascdata::TOFNSigmaOmLaPi, cascdata::TOFNSigmaOmLaPr, cascdata::TOFNSigmaOmKa, cascdata::TofXiCompatibility, - cascdata::TofOmCompatibility); + cascdata::TofOmegaCompatibility); } // namespace o2::aod #endif // PWGLF_DATAMODEL_LFSTRANGENESSPIDTABLES_H_ diff --git a/PWGLF/Tasks/QC/strangepidqa.cxx b/PWGLF/Tasks/QC/strangepidqa.cxx index 845af42beba..f06f5ea00d9 100644 --- a/PWGLF/Tasks/QC/strangepidqa.cxx +++ b/PWGLF/Tasks/QC/strangepidqa.cxx @@ -474,7 +474,7 @@ struct strangepidqa { if (TMath::Abs(posExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(negExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(bachExtra.tpcNSigmaKa()) < tpcNsigmaBachelor) { histos.fill(HIST("h3dMassOmegaMinus"), col.centFT0C(), casc.pt(), casc.mOmega()); histos.fill(HIST("h1dMassOmegaMinus"), casc.mOmega()); - if(casc.tofOmCompatibility(tofNsigmaCompatibilityCascades.value)){ + if(casc.tofOmegaCompatibility(tofNsigmaCompatibilityCascades.value)){ histos.fill(HIST("h3dMassCompatibleOmegaMinus"), col.centFT0C(), casc.pt(), casc.mOmega()); histos.fill(HIST("h1dMassCompatibleOmegaMinus"), casc.mOmega()); } @@ -492,7 +492,7 @@ struct strangepidqa { if (TMath::Abs(posExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(negExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(bachExtra.tpcNSigmaKa()) < tpcNsigmaBachelor) { histos.fill(HIST("h3dMassOmegaPlus"), col.centFT0C(), casc.pt(), casc.mOmega()); histos.fill(HIST("h1dMassOmegaPlus"), casc.mOmega()); - if(casc.tofOmCompatibility(tofNsigmaCompatibilityCascades.value)){ + if(casc.tofOmegaCompatibility(tofNsigmaCompatibilityCascades.value)){ histos.fill(HIST("h3dMassCompatibleOmegaPlus"), col.centFT0C(), casc.pt(), casc.mOmega()); histos.fill(HIST("h1dMassCompatibleOmegaPlus"), casc.mOmega()); } From b5c8ed5cd50cd1af8486411f369a352f04901fd1 Mon Sep 17 00:00:00 2001 From: ALICE Builder Date: Mon, 18 Aug 2025 14:50:52 +0200 Subject: [PATCH 19/20] Please consider the following formatting changes (#463) --- PWGLF/DataModel/LFStrangenessPIDTables.h | 121 ++++++----- .../Strangeness/strangenesstofpid.cxx | 193 +++++++++--------- PWGLF/Tasks/QC/strangepidqa.cxx | 20 +- 3 files changed, 172 insertions(+), 162 deletions(-) diff --git a/PWGLF/DataModel/LFStrangenessPIDTables.h b/PWGLF/DataModel/LFStrangenessPIDTables.h index 69a3c48fa28..0b7e95ce302 100644 --- a/PWGLF/DataModel/LFStrangenessPIDTables.h +++ b/PWGLF/DataModel/LFStrangenessPIDTables.h @@ -47,8 +47,8 @@ DECLARE_SOA_TABLE(DauTrackTOFPIDs, "AOD", "DAUTRACKTOFPID", // raw table (for po namespace v0data { -// define constants for NSigma operation -const float kNoTOFValue = -1e+6; +// define constants for NSigma operation +const float kNoTOFValue = -1e+6; const float kEpsilon = 1e-4; // ==== TOF INFORMATION === @@ -85,42 +85,42 @@ DECLARE_SOA_COLUMN(TOFNSigmaK0PiMinus, tofNSigmaK0PiMinus, float); //! negative // dynamics based on n-sigmas with use-only-if-tof-present logic DECLARE_SOA_DYNAMIC_COLUMN(TofLambdaCompatibility, tofLambdaCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas - [](float tofNSigmaLaPr, float tofNSigmaLaPi, float nsigma) -> float { - bool compatible = true; - if(std::abs(tofNSigmaLaPr-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaLaPr)>nsigma){ - compatible = false; // reject only if info present and incompatible - } - if(std::abs(tofNSigmaLaPi-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaLaPi)>nsigma){ - compatible = false; // reject only if info present and incompatible - } - return compatible; - }); + [](float tofNSigmaLaPr, float tofNSigmaLaPi, float nsigma) -> float { + bool compatible = true; + if (std::abs(tofNSigmaLaPr - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaLaPr) > nsigma) { + compatible = false; // reject only if info present and incompatible + } + if (std::abs(tofNSigmaLaPi - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaLaPi) > nsigma) { + compatible = false; // reject only if info present and incompatible + } + return compatible; + }); // dynamics based on n-sigmas with use-only-if-tof-present logic DECLARE_SOA_DYNAMIC_COLUMN(TofAntiLambdaCompatibility, tofAntiLambdaCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas - [](float tofNSigmaALaPr, float tofNSigmaALaPi, float nsigma) -> float { - bool compatible = true; - if(std::abs(tofNSigmaALaPr-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaALaPr)>nsigma){ - compatible = false; // reject only if info present and incompatible - } - if(std::abs(tofNSigmaALaPi-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaALaPi)>nsigma){ - compatible = false; // reject only if info present and incompatible - } - return compatible; - }); + [](float tofNSigmaALaPr, float tofNSigmaALaPi, float nsigma) -> float { + bool compatible = true; + if (std::abs(tofNSigmaALaPr - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaALaPr) > nsigma) { + compatible = false; // reject only if info present and incompatible + } + if (std::abs(tofNSigmaALaPi - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaALaPi) > nsigma) { + compatible = false; // reject only if info present and incompatible + } + return compatible; + }); // dynamics based on n-sigmas with use-only-if-tof-present logic DECLARE_SOA_DYNAMIC_COLUMN(TofK0ShortCompatibility, tofK0ShortCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas - [](float tofNSigmaK0PiPlus, float tofNSigmaK0PiMinus, float nsigma) -> float { - bool compatible = true; - if(std::abs(tofNSigmaK0PiPlus-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaK0PiPlus)>nsigma){ - compatible = false; // reject only if info present and incompatible - } - if(std::abs(tofNSigmaK0PiMinus-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaK0PiMinus)>nsigma){ - compatible = false; // reject only if info present and incompatible - } - return compatible; - }); + [](float tofNSigmaK0PiPlus, float tofNSigmaK0PiMinus, float nsigma) -> float { + bool compatible = true; + if (std::abs(tofNSigmaK0PiPlus - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaK0PiPlus) > nsigma) { + compatible = false; // reject only if info present and incompatible + } + if (std::abs(tofNSigmaK0PiMinus - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaK0PiMinus) > nsigma) { + compatible = false; // reject only if info present and incompatible + } + return compatible; + }); // beta values DECLARE_SOA_COLUMN(TofBetaLambda, tofBetaLambda, float); //! beta value with Lambda hypothesis @@ -170,8 +170,8 @@ DECLARE_SOA_TABLE(V0TOFNSigmas, "AOD", "V0TOFNSIGMA", // processed NSigma table namespace cascdata { -// define constants for NSigma operation -const float kNoTOFValue = -1e+6; +// define constants for NSigma operation +const float kNoTOFValue = -1e+6; const float kEpsilon = 1e-4; // lengths as stored in the AO2D for TOF calculations @@ -207,35 +207,34 @@ DECLARE_SOA_COLUMN(TOFNSigmaOmKa, tofNSigmaOmKa, float); //! bachelor track // dynamics based on n-sigmas with use-only-if-tof-present logic DECLARE_SOA_DYNAMIC_COLUMN(TofXiCompatibility, tofXiCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas - [](float tofNSigmaXiLaPr, float tofNSigmaXiLaPi, float tofNSigmaXiPi, float nsigma) -> float { - bool compatible = true; - if(std::abs(tofNSigmaXiLaPr-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaXiLaPr)>nsigma){ - compatible = false; // reject only if info present and incompatible - } - if(std::abs(tofNSigmaXiLaPi-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaXiLaPi)>nsigma){ - compatible = false; // reject only if info present and incompatible - } - if(std::abs(tofNSigmaXiPi-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaXiPi)>nsigma){ - compatible = false; // reject only if info present and incompatible - } - return compatible; - }); + [](float tofNSigmaXiLaPr, float tofNSigmaXiLaPi, float tofNSigmaXiPi, float nsigma) -> float { + bool compatible = true; + if (std::abs(tofNSigmaXiLaPr - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaXiLaPr) > nsigma) { + compatible = false; // reject only if info present and incompatible + } + if (std::abs(tofNSigmaXiLaPi - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaXiLaPi) > nsigma) { + compatible = false; // reject only if info present and incompatible + } + if (std::abs(tofNSigmaXiPi - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaXiPi) > nsigma) { + compatible = false; // reject only if info present and incompatible + } + return compatible; + }); DECLARE_SOA_DYNAMIC_COLUMN(TofOmegaCompatibility, tofOmegaCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas - [](float tofNSigmaOmLaPr, float tofNSigmaOmLaPi, float tofNSigmaOmKa, float nsigma) -> float { - bool compatible = true; - if(std::abs(tofNSigmaOmLaPr-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaOmLaPr)>nsigma){ - compatible = false; // reject only if info present and incompatible - } - if(std::abs(tofNSigmaOmLaPi-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaOmLaPi)>nsigma){ - compatible = false; // reject only if info present and incompatible - } - if(std::abs(tofNSigmaOmKa-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaOmKa)>nsigma){ - compatible = false; // reject only if info present and incompatible - } - return compatible; - }); - + [](float tofNSigmaOmLaPr, float tofNSigmaOmLaPi, float tofNSigmaOmKa, float nsigma) -> float { + bool compatible = true; + if (std::abs(tofNSigmaOmLaPr - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaOmLaPr) > nsigma) { + compatible = false; // reject only if info present and incompatible + } + if (std::abs(tofNSigmaOmLaPi - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaOmLaPi) > nsigma) { + compatible = false; // reject only if info present and incompatible + } + if (std::abs(tofNSigmaOmKa - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaOmKa) > nsigma) { + compatible = false; // reject only if info present and incompatible + } + return compatible; + }); } // namespace cascdata diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index 7f783414457..75cb771dbea 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -23,38 +23,40 @@ // (strange, weakly-decaying) particle. This task is meant to be a test, as // it hasn't been fully tested yet! Use at your own peril for now :-) -#include -#include -#include -#include -#include -#include - #include "TableHelper.h" -#include "Framework/runDataProcessing.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "DCAFitter/DCAFitterN.h" -#include "ReconstructionDataFormats/Track.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/trackUtilities.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" -#include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFParticleIdentification.h" +#include "PWGLF/DataModel/LFStrangenessPIDTables.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" + +#include "Common/Core/RecoDecay.h" #include "Common/Core/TrackSelection.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/PIDResponse.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "DetectorsBase/Propagator.h" -#include "DetectorsBase/GeometryManager.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DataFormatsParameters/GRPMagField.h" +#include "Common/TableProducer/PID/pidTOFBase.h" + #include "CCDB/BasicCCDBManager.h" -#include "DataFormatsCalibration/MeanVertexObject.h" #include "CommonConstants/PhysicsConstants.h" -#include "Common/TableProducer/PID/pidTOFBase.h" -#include "Common/DataModel/PIDResponse.h" +#include "DCAFitter/DCAFitterN.h" +#include "DataFormatsCalibration/MeanVertexObject.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "DataFormatsParameters/GRPObject.h" +#include "DetectorsBase/GeometryManager.h" +#include "DetectorsBase/Propagator.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/RunningWorkflowInfo.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Track.h" + +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; @@ -73,10 +75,10 @@ using CascDerivedDatas = soa::Join v0tofpid; // table with Nsigmas - Produces v0tofbeta; // table with betas - Produces v0tofdebugs; // table with extra debug information - Produces v0tofnsigmas; // table with nsigmas + Produces v0tofpid; // table with Nsigmas + Produces v0tofbeta; // table with betas + Produces v0tofdebugs; // table with extra debug information + Produces v0tofnsigmas; // table with nsigmas Produces casctofpids; // cascades: table with base info Produces casctofnsigmas; // cascades: table with Nsigmas @@ -87,7 +89,7 @@ struct strangenesstofpid { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - // master switches + // master switches Configurable calculateV0s{"calculateV0s", -1, "calculate V0-related TOF PID (0: no, 1: yes, -1: auto)"}; Configurable calculateCascades{"calculateCascades", -1, "calculate cascade-related TOF PID (0: no, 1: yes, -1: auto)"}; @@ -302,17 +304,17 @@ struct strangenesstofpid { void init(InitContext& initContext) { - if(calculateV0s.value<0){ + if (calculateV0s.value < 0) { // check if TOF information is required, enable if so calculateV0s.value = isTableRequiredInWorkflow(initContext, "V0TOFNSigmas"); - if(calculateV0s.value>0){ + if (calculateV0s.value > 0) { LOGF(info, "Strangeness TOF PID: V0 calculations enabled automatically"); } } - if(calculateCascades.value<0){ + if (calculateCascades.value < 0) { // check if TOF information is required, enable if so calculateCascades.value = isTableRequiredInWorkflow(initContext, "CascTOFNSigmas"); - if(calculateCascades.value>0){ + if (calculateCascades.value > 0) { LOGF(info, "Strangeness TOF PID: Cascade calculations enabled automatically"); } } @@ -356,7 +358,7 @@ struct strangenesstofpid { histos.add("hArcDebug", "hArcDebug", kTH2F, {axisP, {50, -5.0f, 10.0f}}); // standard deltaTime values - if(calculateV0s.value>0){ + if (calculateV0s.value > 0) { histos.add("h2dDeltaTimePositiveLambdaPi", "h2dDeltaTimePositiveLambdaPi", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); histos.add("h2dDeltaTimeNegativeLambdaPi", "h2dDeltaTimeNegativeLambdaPi", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); histos.add("h2dDeltaTimePositiveLambdaPr", "h2dDeltaTimePositiveLambdaPr", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); @@ -365,7 +367,7 @@ struct strangenesstofpid { histos.add("h2dDeltaTimeNegativeK0ShortPi", "h2dDeltaTimeNegativeK0ShortPi", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); } - if(calculateCascades.value>0){ + if (calculateCascades.value > 0) { histos.add("h2dposDeltaTimeAsXiPi", "h2dposDeltaTimeAsXiPi", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); histos.add("h2dposDeltaTimeAsXiPr", "h2dposDeltaTimeAsXiPr", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); histos.add("h2dnegDeltaTimeAsXiPi", "h2dnegDeltaTimeAsXiPi", {HistType::kTH3F, {axisP, axisEta, axisDeltaTime}}); @@ -383,7 +385,7 @@ struct strangenesstofpid { histos.add("h2dNegativeTOFProperties", "h2dNegativeTOFProperties", {HistType::kTH2F, {axisP, {4, -0.5, 3.5f}}}); if (doQANSigma) { - if(calculateV0s.value>0){ + if (calculateV0s.value > 0) { histos.add("h2dNSigmaPositiveLambdaPi", "h2dNSigmaPositiveLambdaPi", {HistType::kTH2F, {axisP, axisNSigma}}); histos.add("h2dNSigmaNegativeLambdaPi", "h2dNSigmaNegativeLambdaPi", {HistType::kTH2F, {axisP, axisNSigma}}); histos.add("h2dNSigmaPositiveLambdaPr", "h2dNSigmaPositiveLambdaPr", {HistType::kTH2F, {axisP, axisNSigma}}); @@ -392,7 +394,7 @@ struct strangenesstofpid { histos.add("h2dNSigmaNegativeK0ShortPi", "h2dNSigmaNegativeK0ShortPi", {HistType::kTH2F, {axisP, axisNSigma}}); } - if(calculateCascades.value>0){ + if (calculateCascades.value > 0) { histos.add("h2dNSigmaXiLaPi", "h2dNSigmaXiLaPi", {HistType::kTH2F, {axisP, axisNSigma}}); histos.add("h2dNSigmaXiLaPr", "h2dNSigmaXiLaPr", {HistType::kTH2F, {axisP, axisNSigma}}); histos.add("h2dNSigmaXiPi", "h2dNSigmaXiPi", {HistType::kTH2F, {axisP, axisNSigma}}); @@ -452,7 +454,7 @@ struct strangenesstofpid { LOGF(info, "loaded TList with this many objects: %i", nSigmaCalibObjects->GetEntries()); nSigmaCalibLoaded = true; // made it thus far, mark loaded - if(calculateV0s.value){ + if (calculateV0s.value) { hMeanPosLaPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosLaPi")); hMeanPosLaPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosLaPr")); hMeanNegLaPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegLaPi")); @@ -481,39 +483,39 @@ struct strangenesstofpid { LOG(info) << "Problems finding mean histogram hMeanNegK0Pi!"; if (!hSigmaPosK0Pi || !hSigmaNegK0Pi || !hSigmaPosLaPi || !hSigmaPosLaPr || !hSigmaNegLaPi || !hSigmaNegLaPr) { LOG(info) << "Problems finding sigma histograms!"; - } + } - if(calculateCascades.value){ - hMeanPosXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosXiPi")); - hMeanPosXiPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosXiPr")); - hMeanNegXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegXiPi")); - hMeanNegXiPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegXiPr")); - hMeanBachXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanBachXiPi")); - hMeanPosOmPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosOmPi")); - hMeanPosOmPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosOmPr")); - hMeanNegOmPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegOmPi")); - hMeanNegOmPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegOmPr")); - hMeanBachOmKa = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanBachOmKa")); - - hSigmaPosXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaPosXiPi")); - hSigmaPosXiPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaPosXiPr")); - hSigmaNegXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaNegXiPi")); - hSigmaNegXiPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaNegXiPr")); - hSigmaBachXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaBachXiPi")); - hSigmaPosOmPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaPosOmPi")); - hSigmaPosOmPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaPosOmPr")); - hSigmaNegOmPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaNegOmPi")); - hSigmaNegOmPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaNegOmPr")); - hSigmaBachOmKa = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaBachOmKa")); - - if (!hMeanPosXiPi || !hMeanPosXiPr || !hMeanNegXiPi || !hMeanNegXiPr || !hMeanBachXiPi) - LOG(info) << "Problems finding xi mean histograms!"; - if (!hMeanPosOmPi || !hMeanPosOmPr || !hMeanNegOmPi || !hMeanNegOmPr || !hMeanBachOmKa) - LOG(info) << "Problems finding omega sigma histograms!"; - if (!hSigmaPosXiPi || !hSigmaPosXiPr || !hSigmaNegXiPi || !hSigmaNegXiPr || !hSigmaBachXiPi) - LOG(info) << "Problems finding xi sigma histograms!"; - if (!hSigmaPosOmPi || !hSigmaPosOmPr || !hSigmaNegOmPi || !hSigmaNegOmPr || !hSigmaBachOmKa) - LOG(info) << "Problems finding omega sigma histograms!"; + if (calculateCascades.value) { + hMeanPosXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosXiPi")); + hMeanPosXiPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosXiPr")); + hMeanNegXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegXiPi")); + hMeanNegXiPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegXiPr")); + hMeanBachXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanBachXiPi")); + hMeanPosOmPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosOmPi")); + hMeanPosOmPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosOmPr")); + hMeanNegOmPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegOmPi")); + hMeanNegOmPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegOmPr")); + hMeanBachOmKa = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanBachOmKa")); + + hSigmaPosXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaPosXiPi")); + hSigmaPosXiPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaPosXiPr")); + hSigmaNegXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaNegXiPi")); + hSigmaNegXiPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaNegXiPr")); + hSigmaBachXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaBachXiPi")); + hSigmaPosOmPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaPosOmPi")); + hSigmaPosOmPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaPosOmPr")); + hSigmaNegOmPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaNegOmPi")); + hSigmaNegOmPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaNegOmPr")); + hSigmaBachOmKa = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaBachOmKa")); + + if (!hMeanPosXiPi || !hMeanPosXiPr || !hMeanNegXiPi || !hMeanNegXiPr || !hMeanBachXiPi) + LOG(info) << "Problems finding xi mean histograms!"; + if (!hMeanPosOmPi || !hMeanPosOmPr || !hMeanNegOmPi || !hMeanNegOmPr || !hMeanBachOmKa) + LOG(info) << "Problems finding omega sigma histograms!"; + if (!hSigmaPosXiPi || !hSigmaPosXiPr || !hSigmaNegXiPi || !hSigmaNegXiPr || !hSigmaBachXiPi) + LOG(info) << "Problems finding xi sigma histograms!"; + if (!hSigmaPosOmPi || !hSigmaPosOmPr || !hSigmaNegOmPi || !hSigmaNegOmPr || !hSigmaBachOmKa) + LOG(info) << "Problems finding omega sigma histograms!"; } } } @@ -614,9 +616,12 @@ struct strangenesstofpid { float decayTimeAntiLambda = 0.5f * ((pTra.tofSignal() - timePositivePi) + (nTra.tofSignal() - timeNegativePr)) - evTimeMean; float decayTimeK0Short = 0.5f * ((pTra.tofSignal() - timePositivePi) + (nTra.tofSignal() - timeNegativePi)) - evTimeMean; - float betaLambda = o2::aod::cascdata::kNoTOFValue;; - float betaAntiLambda = o2::aod::cascdata::kNoTOFValue;; - float betaK0Short = o2::aod::cascdata::kNoTOFValue;; + float betaLambda = o2::aod::cascdata::kNoTOFValue; + ; + float betaAntiLambda = o2::aod::cascdata::kNoTOFValue; + ; + float betaK0Short = o2::aod::cascdata::kNoTOFValue; + ; if (nTra.hasTOF() && pTra.hasTOF()) { betaLambda = (lengthV0 / decayTimeLambda) / 0.0299792458; @@ -663,8 +668,8 @@ struct strangenesstofpid { if (std::abs(v0.mLambda() - 1.115683) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPr()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma) { histos.fill(HIST("h2dDeltaTimePositiveLambdaPr"), v0.p(), v0.eta(), deltaTimePositiveLambdaPr); histos.fill(HIST("h2dProtonMeasuredVsExpected"), - (timeLambda + timePositivePr)/(pTra.tofSignal() - pTra.tofEvTime()), - positiveP, v0.positiveeta()); + (timeLambda + timePositivePr) / (pTra.tofSignal() - pTra.tofEvTime()), + positiveP, v0.positiveeta()); if (doQANSigma) histos.fill(HIST("h2dNSigmaPositiveLambdaPr"), v0.p(), nSigmaPositiveLambdaPr); } @@ -686,8 +691,8 @@ struct strangenesstofpid { if (std::abs(v0.mLambda() - 1.115683) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPr()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma) { histos.fill(HIST("h2dDeltaTimeNegativeLambdaPi"), v0.p(), v0.eta(), deltaTimeNegativeLambdaPi); histos.fill(HIST("h2dPionMeasuredVsExpected"), - (timeLambda + timeNegativePi)/(nTra.tofSignal() - nTra.tofEvTime()), - negativeP, v0.negativeeta()); + (timeLambda + timeNegativePi) / (nTra.tofSignal() - nTra.tofEvTime()), + negativeP, v0.negativeeta()); if (doQANSigma) histos.fill(HIST("h2dNSigmaNegativeLambdaPi"), v0.p(), nSigmaNegativeLambdaPi); } @@ -708,7 +713,6 @@ struct strangenesstofpid { } } - template void processCascadeCandidate(TCollision const& collision, TCascade const& cascade, TTrack const& pTra, TTrack const& nTra, TTrack const& bTra) { @@ -736,7 +740,8 @@ struct strangenesstofpid { // calculate mother lengths float lengthV0 = std::hypot(cascade.xlambda() - cascade.x(), cascade.ylambda() - cascade.y(), cascade.zlambda() - cascade.z()); - float lengthCascade = o2::aod::cascdata::kNoTOFValue;; + float lengthCascade = o2::aod::cascdata::kNoTOFValue; + ; const o2::math_utils::Point3D collVtx{collision.getX(), collision.getY(), collision.getZ()}; bool successPropag = o2::base::Propagator::Instance()->propagateToDCA(collVtx, cascTrack, d_bz, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrNONE); float d = -1.0f, d3d = 0.0f; @@ -800,12 +805,18 @@ struct strangenesstofpid { posDeltaTimeAsXiPi, posDeltaTimeAsXiPr, negDeltaTimeAsXiPi, negDeltaTimeAsXiPr, bachDeltaTimeAsXiPi, posDeltaTimeAsOmPi, posDeltaTimeAsOmPr, negDeltaTimeAsOmPi, negDeltaTimeAsOmPr, bachDeltaTimeAsOmKa); - float nSigmaXiLaPr = o2::aod::cascdata::kNoTOFValue;; - float nSigmaXiLaPi = o2::aod::cascdata::kNoTOFValue;; - float nSigmaXiPi = o2::aod::cascdata::kNoTOFValue;; - float nSigmaOmLaPr = o2::aod::cascdata::kNoTOFValue;; - float nSigmaOmLaPi = o2::aod::cascdata::kNoTOFValue;; - float nSigmaOmKa = o2::aod::cascdata::kNoTOFValue;; + float nSigmaXiLaPr = o2::aod::cascdata::kNoTOFValue; + ; + float nSigmaXiLaPi = o2::aod::cascdata::kNoTOFValue; + ; + float nSigmaXiPi = o2::aod::cascdata::kNoTOFValue; + ; + float nSigmaOmLaPr = o2::aod::cascdata::kNoTOFValue; + ; + float nSigmaOmLaPi = o2::aod::cascdata::kNoTOFValue; + ; + float nSigmaOmKa = o2::aod::cascdata::kNoTOFValue; + ; // go for Nsigma values if requested if (doNSigmas && nSigmaCalibLoaded) { @@ -892,7 +903,7 @@ struct strangenesstofpid { } } - void processStandardData(aod::Collisions const& collisions, V0OriginalDatas const& V0s, CascOriginalDatas const& cascades,TracksWithAllExtras const&, aod::BCsWithTimestamps const& /*bcs*/) + void processStandardData(aod::Collisions const& collisions, V0OriginalDatas const& V0s, CascOriginalDatas const& cascades, TracksWithAllExtras const&, aod::BCsWithTimestamps const& /*bcs*/) { // Fire up CCDB with first collision in record. If no collisions, bypass if (useCustomRunNumber || collisions.size() < 1) { @@ -903,7 +914,7 @@ struct strangenesstofpid { initCCDB(bc.runNumber()); } - if(calculateV0s.value){ + if (calculateV0s.value) { for (const auto& V0 : V0s) { // for storing whatever is the relevant quantity for the PV o2::dataformats::VertexBase primaryVertex; @@ -921,7 +932,7 @@ struct strangenesstofpid { } } - if(calculateCascades.value){ + if (calculateCascades.value) { for (const auto& cascade : cascades) { // for storing whatever is the relevant quantity for the PV o2::dataformats::VertexBase primaryVertex; @@ -951,7 +962,7 @@ struct strangenesstofpid { initCCDB(collision.runNumber()); } - if(calculateV0s.value){ + if (calculateV0s.value) { for (const auto& V0 : V0s) { // for storing whatever is the relevant quantity for the PV o2::dataformats::VertexBase primaryVertex; @@ -970,7 +981,7 @@ struct strangenesstofpid { } } - if(calculateCascades.value){ + if (calculateCascades.value) { for (const auto& cascade : cascades) { // for storing whatever is the relevant quantity for the PV o2::dataformats::VertexBase primaryVertex; diff --git a/PWGLF/Tasks/QC/strangepidqa.cxx b/PWGLF/Tasks/QC/strangepidqa.cxx index f06f5ea00d9..2dd9c58b4e7 100644 --- a/PWGLF/Tasks/QC/strangepidqa.cxx +++ b/PWGLF/Tasks/QC/strangepidqa.cxx @@ -60,7 +60,7 @@ struct strangepidqa { AxisSpec massAxisOmega = {200, 1.572f, 1.772f, "Inv. Mass (GeV/c^{2})"}; // Invariant Mass - ConfigurableAxis axisK0ShortMass{"axisK0ShortMass", {200, 0.497f-0.050f, 0.497f+0.050f}, "M_{K0s} (GeV/c^{2})"}; + ConfigurableAxis axisK0ShortMass{"axisK0ShortMass", {200, 0.497f - 0.050f, 0.497f + 0.050f}, "M_{K0s} (GeV/c^{2})"}; ConfigurableAxis axisLambdaMass{"axisLambdaMass", {200, 1.08f, 1.16f}, "M_{#Lambda} (GeV/c^{2})"}; // time axes @@ -301,7 +301,7 @@ struct strangepidqa { // lambda case histos.fill(HIST("h3dMassLambda"), coll.centFT0C(), lambda.pt(), lambda.mLambda()); histos.fill(HIST("h1dMassLambda"), lambda.mLambda()); - if(lambda.tofLambdaCompatibility(tofNsigmaCompatibility.value)){ + if (lambda.tofLambdaCompatibility(tofNsigmaCompatibility.value)) { histos.fill(HIST("h3dMassCompatibleLambda"), coll.centFT0C(), lambda.pt(), lambda.mLambda()); histos.fill(HIST("h1dMassCompatibleLambda"), lambda.mLambda()); } @@ -311,7 +311,7 @@ struct strangepidqa { // lambda case histos.fill(HIST("h3dMassAntiLambda"), coll.centFT0C(), lambda.pt(), lambda.mAntiLambda()); histos.fill(HIST("h1dMassAntiLambda"), lambda.mAntiLambda()); - if(lambda.tofAntiLambdaCompatibility(tofNsigmaCompatibility.value)){ + if (lambda.tofAntiLambdaCompatibility(tofNsigmaCompatibility.value)) { histos.fill(HIST("h3dMassCompatibleAntiLambda"), coll.centFT0C(), lambda.pt(), lambda.mAntiLambda()); histos.fill(HIST("h1dMassCompatibleAntiLambda"), lambda.mAntiLambda()); } @@ -321,7 +321,7 @@ struct strangepidqa { // lambda case histos.fill(HIST("h3dMassK0Short"), coll.centFT0C(), lambda.pt(), lambda.mK0Short()); histos.fill(HIST("h1dMassK0Short"), lambda.mK0Short()); - if(lambda.tofK0ShortCompatibility(tofNsigmaCompatibility.value)){ + if (lambda.tofK0ShortCompatibility(tofNsigmaCompatibility.value)) { histos.fill(HIST("h3dMassCompatibleK0Short"), coll.centFT0C(), lambda.pt(), lambda.mK0Short()); histos.fill(HIST("h1dMassCompatibleK0Short"), lambda.mK0Short()); } @@ -465,16 +465,16 @@ struct strangepidqa { if (casc.sign() < 0) { if (TMath::Abs(posExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(negExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(bachExtra.tpcNSigmaPi()) < tpcNsigmaBachelor) { histos.fill(HIST("h3dMassXiMinus"), col.centFT0C(), casc.pt(), casc.mXi()); - histos.fill(HIST("h1dMassXiMinus"), casc.mXi()); - if(casc.tofXiCompatibility(tofNsigmaCompatibilityCascades.value)){ + histos.fill(HIST("h1dMassXiMinus"), casc.mXi()); + if (casc.tofXiCompatibility(tofNsigmaCompatibilityCascades.value)) { histos.fill(HIST("h3dMassCompatibleXiMinus"), col.centFT0C(), casc.pt(), casc.mXi()); - histos.fill(HIST("h1dMassCompatibleXiMinus"), casc.mXi()); + histos.fill(HIST("h1dMassCompatibleXiMinus"), casc.mXi()); } } if (TMath::Abs(posExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(negExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(bachExtra.tpcNSigmaKa()) < tpcNsigmaBachelor) { histos.fill(HIST("h3dMassOmegaMinus"), col.centFT0C(), casc.pt(), casc.mOmega()); histos.fill(HIST("h1dMassOmegaMinus"), casc.mOmega()); - if(casc.tofOmegaCompatibility(tofNsigmaCompatibilityCascades.value)){ + if (casc.tofOmegaCompatibility(tofNsigmaCompatibilityCascades.value)) { histos.fill(HIST("h3dMassCompatibleOmegaMinus"), col.centFT0C(), casc.pt(), casc.mOmega()); histos.fill(HIST("h1dMassCompatibleOmegaMinus"), casc.mOmega()); } @@ -483,7 +483,7 @@ struct strangepidqa { if (TMath::Abs(posExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(negExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(bachExtra.tpcNSigmaPi()) < tpcNsigmaBachelor) { histos.fill(HIST("h3dMassXiPlus"), col.centFT0C(), casc.pt(), casc.mXi()); histos.fill(HIST("h1dMassXiPlus"), casc.mXi()); - if(casc.tofXiCompatibility(tofNsigmaCompatibilityCascades.value)){ + if (casc.tofXiCompatibility(tofNsigmaCompatibilityCascades.value)) { histos.fill(HIST("h3dMassCompatibleXiPlus"), col.centFT0C(), casc.pt(), casc.mXi()); histos.fill(HIST("h1dMassCompatibleXiPlus"), casc.mXi()); } @@ -492,7 +492,7 @@ struct strangepidqa { if (TMath::Abs(posExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(negExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(bachExtra.tpcNSigmaKa()) < tpcNsigmaBachelor) { histos.fill(HIST("h3dMassOmegaPlus"), col.centFT0C(), casc.pt(), casc.mOmega()); histos.fill(HIST("h1dMassOmegaPlus"), casc.mOmega()); - if(casc.tofOmegaCompatibility(tofNsigmaCompatibilityCascades.value)){ + if (casc.tofOmegaCompatibility(tofNsigmaCompatibilityCascades.value)) { histos.fill(HIST("h3dMassCompatibleOmegaPlus"), col.centFT0C(), casc.pt(), casc.mOmega()); histos.fill(HIST("h1dMassCompatibleOmegaPlus"), casc.mOmega()); } From f39072ac3b921d02d96fa6aba47004abd45b15c0 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Mon, 18 Aug 2025 16:00:33 +0200 Subject: [PATCH 20/20] Remove cascadepid task --- .../TableProducer/Strangeness/cascadepid.cxx | 632 ------------------ 1 file changed, 632 deletions(-) delete mode 100644 PWGLF/TableProducer/Strangeness/cascadepid.cxx diff --git a/PWGLF/TableProducer/Strangeness/cascadepid.cxx b/PWGLF/TableProducer/Strangeness/cascadepid.cxx deleted file mode 100644 index 3c7c82dacdd..00000000000 --- a/PWGLF/TableProducer/Strangeness/cascadepid.cxx +++ /dev/null @@ -1,632 +0,0 @@ -// 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. -// -// *+-+*+-+*+-+*+-+*+-+*+-+* -// Cascade PID tables -// *+-+*+-+*+-+*+-+*+-+*+-+* -// -/// \author Nicolò Jacazio -/// \author David Dobrigkeit Chinellato -/// \since 22/11/2023 -/// \brief Table producer for Casc daughter PID info -// -// This task produces daughter PID information for strange daughters -// taking into account the (candidate-by-candidate) time spent as a heavier -// (strange, weakly-decaying) particle. This task is meant to be a test, as -// it hasn't been fully tested yet! Use at your own peril for now :-) - -#include -#include -#include -#include -#include -#include - -#include "Framework/runDataProcessing.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "DCAFitter/DCAFitterN.h" -#include "ReconstructionDataFormats/Track.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/trackUtilities.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" -#include "PWGLF/DataModel/LFStrangenessPIDTables.h" -#include "PWGLF/DataModel/LFParticleIdentification.h" -#include "Common/Core/TrackSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "DetectorsBase/Propagator.h" -#include "DetectorsBase/GeometryManager.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Common/TableProducer/PID/pidTOFBase.h" -#include "Common/DataModel/PIDResponse.h" - -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; -using std::array; - -// For original data loops -using CascOriginalDatas = soa::Join; -using TracksWithAllExtras = soa::Join; - -// Cores with references and TOF pid -using dauTracks = soa::Join; -using CascDerivedDatas = soa::Join; - -struct cascadepid { - // TOF pid for strangeness (recalculated with topology) - Produces casctofpids; // table with base info - Produces casctofnsigmas; // table with Nsigmas - - Service ccdb; - - // For manual sliceBy - Preslice perCollisionOriginal = o2::aod::cascdata::collisionId; - ; - Preslice perCollisionDerived = o2::aod::cascdata::straCollisionId; - - HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - - // Operation and minimisation criteria - Configurable d_bz_input{"d_bz", -999, "bz field, -999 is automatic"}; - Configurable tofPosition{"tofPosition", 377.934f, "TOF effective (inscribed) radius"}; - Configurable doQA{"doQA", true, "create QA histos"}; - Configurable qaV0DCADau{"qaV0DCADau", 0.5, "DCA daughters (cm) for QA plots"}; - Configurable qaCascDCADau{"qaCascDCADau", 0.5, "DCA daughters (cm) for QA plots"}; - Configurable qaV0CosPA{"qaV0CosPA", 0.995, "CosPA for QA plots"}; - Configurable qaCascCosPA{"qaCascCosPA", 0.995, "CosPA for QA plots"}; - Configurable qaMassWindow{"qaMassWindow", 0.005, "Mass window around expected (in GeV/c2) for QA plots"}; - Configurable qaTPCNSigma{"qaTPCNSigma", 5, "TPC N-sigma to apply for qa plots"}; - Configurable doNSigmas{"doNSigmas", false, "calculate TOF N-sigma"}; - Configurable doQANSigma{"doQANSigma", false, "create QA of Nsigma histos"}; - - // CCDB options - Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; - Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; - Configurable lutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"}; - Configurable geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; - Configurable nSigmaPath{"nSigmaPath", "Users/d/ddobrigk/stratof", "Path of information for n-sigma calculation"}; - - // manual - Configurable useCustomRunNumber{"useCustomRunNumber", false, "Use custom timestamp"}; - Configurable manualRunNumber{"manualRunNumber", 544122, "manual run number if no collisions saved"}; - - ConfigurableAxis axisEta{"axisEta", {20, -1.0f, +1.0f}, "#eta"}; - ConfigurableAxis axisDeltaTime{"axisDeltaTime", {2000, -1000.0f, +1000.0f}, "delta-time (ps)"}; - ConfigurableAxis axisNSigma{"axisNSigma", {200, -10.0f, +10.0f}, "N(#sigma)"}; - ConfigurableAxis axisTime{"axisTime", {200, 0.0f, +20000.0f}, "T (ps)"}; - ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "p_{T} (GeV/c)"}; - - bool nSigmaCalibLoaded; - TList* nSigmaCalibObjects; - TH1 *hMeanPosXiPi, *hSigmaPosXiPi; - TH1 *hMeanPosXiPr, *hSigmaPosXiPr; - TH1 *hMeanNegXiPi, *hSigmaNegXiPi; - TH1 *hMeanNegXiPr, *hSigmaNegXiPr; - TH1 *hMeanBachXiPi, *hSigmaBachXiPi; - TH1 *hMeanPosOmPi, *hSigmaPosOmPi; - TH1 *hMeanPosOmPr, *hSigmaPosOmPr; - TH1 *hMeanNegOmPi, *hSigmaNegOmPi; - TH1 *hMeanNegOmPr, *hSigmaNegOmPr; - TH1 *hMeanBachOmKa, *hSigmaBachOmKa; - - int mRunNumber; - float d_bz; - float maxSnp; // max sine phi for propagation - float maxStep; // max step size (cm) for propagation - - /// function to calculate track length of this track up to a certain segment of a detector - /// to be used internally in another funcrtion that calculates length until it finds the proper one - /// warning: this could be optimised further for speed - /// \param track the input track - /// \param x1 x of the first point of the detector segment - /// \param y1 y of the first point of the detector segment - /// \param x2 x of the first point of the detector segment - /// \param y2 y of the first point of the detector segment - /// \param magneticField the magnetic field to use when propagating - float trackLengthToSegment(o2::track::TrackPar track, float x1, float y1, float x2, float y2, float magneticField) - { - // don't make use of the track parametrization - float length = -104; - - // causality protection - std::array mom; - track.getPxPyPzGlo(mom); - // get start point - std::array startPoint; - track.getXYZGlo(startPoint); - - // better replaced with scalar momentum check later - // if (((x1 + x2) * mom[0] + (y1 + y2) * mom[1]) < 0.0f) - // return -101; - - // get circle X, Y please - o2::math_utils::CircleXYf_t trcCircle; - float sna, csa; - track.getCircleParams(magneticField, trcCircle, sna, csa); - - // Calculate necessary inner product - float segmentModulus = std::hypot(x2 - x1, y2 - y1); - float alongSegment = ((trcCircle.xC - x1) * (x2 - x1) + (trcCircle.yC - y1) * (y2 - y1)) / segmentModulus; - - // find point of closest approach between segment and circle center - float pcaX = (x2 - x1) * alongSegment / segmentModulus + x1; - float pcaY = (y2 - y1) * alongSegment / segmentModulus + y1; - - float centerDistToPC = std::hypot(pcaX - trcCircle.xC, pcaY - trcCircle.yC); - - // distance pca-to-intercept in multiples of segment modulus (for convenience) - if (centerDistToPC > trcCircle.rC) - return -103; - - float pcaToIntercept = TMath::Sqrt(TMath::Abs(trcCircle.rC * trcCircle.rC - centerDistToPC * centerDistToPC)); - - float interceptX1 = pcaX + (x2 - x1) / segmentModulus * pcaToIntercept; - float interceptY1 = pcaY + (y2 - y1) / segmentModulus * pcaToIntercept; - float interceptX2 = pcaX - (x2 - x1) / segmentModulus * pcaToIntercept; - float interceptY2 = pcaY - (y2 - y1) / segmentModulus * pcaToIntercept; - - float scalarCheck1 = ((x2 - x1) * (interceptX1 - x1) + (y2 - y1) * (interceptY1 - y1)) / segmentModulus; - float scalarCheck2 = ((x2 - x1) * (interceptX2 - x1) + (y2 - y1) * (interceptY2 - y1)) / segmentModulus; - - float cosAngle1 = -1000, sinAngle1 = -1000, modulus1 = -1000; - float cosAngle2 = -1000, sinAngle2 = -1000, modulus2 = -1000; - float length1 = -1000, length2 = -1000; - - modulus1 = std::hypot(interceptX1 - trcCircle.xC, interceptY1 - trcCircle.yC) * std::hypot(startPoint[0] - trcCircle.xC, startPoint[1] - trcCircle.yC); - cosAngle1 = (interceptX1 - trcCircle.xC) * (startPoint[0] - trcCircle.xC) + (interceptY1 - trcCircle.yC) * (startPoint[1] - trcCircle.yC); - sinAngle1 = (interceptX1 - trcCircle.xC) * (startPoint[1] - trcCircle.yC) - (interceptY1 - trcCircle.yC) * (startPoint[0] - trcCircle.xC); - cosAngle1 /= modulus1; - sinAngle1 /= modulus1; - length1 = trcCircle.rC * TMath::ACos(cosAngle1); - length1 *= sqrt(1.0f + track.getTgl() * track.getTgl()); - - modulus2 = std::hypot(interceptX2 - trcCircle.xC, interceptY2 - trcCircle.yC) * std::hypot(startPoint[0] - trcCircle.xC, startPoint[1] - trcCircle.yC); - cosAngle2 = (interceptX2 - trcCircle.xC) * (startPoint[0] - trcCircle.xC) + (interceptY2 - trcCircle.yC) * (startPoint[1] - trcCircle.yC); - sinAngle2 = (interceptX2 - trcCircle.xC) * (startPoint[1] - trcCircle.yC) - (interceptY2 - trcCircle.yC) * (startPoint[0] - trcCircle.xC); - cosAngle2 /= modulus2; - sinAngle2 /= modulus2; - length2 = trcCircle.rC * TMath::ACos(cosAngle2); - length2 *= sqrt(1.0f + track.getTgl() * track.getTgl()); - - // rotate transverse momentum vector such that it is at intercepts - float angle1 = TMath::ACos(cosAngle1); - if (sinAngle1 < 0) - angle1 *= -1.0f; - float px1 = +TMath::Cos(angle1) * mom[0] + TMath::Sin(angle1) * mom[1]; - float py1 = -TMath::Sin(angle1) * mom[0] + TMath::Cos(angle1) * mom[1]; - - float angle2 = TMath::ACos(cosAngle2); - if (sinAngle2 < 0) - angle2 *= -1.0f; - float px2 = +TMath::Cos(angle2) * mom[0] + TMath::Sin(angle2) * mom[1]; - float py2 = -TMath::Sin(angle2) * mom[0] + TMath::Cos(angle2) * mom[1]; - - float midSegX = 0.5f * (x2 + x1); - float midSegY = 0.5f * (y2 + y1); - - float scalarMomentumCheck1 = px1 * midSegX + py1 * midSegY; - float scalarMomentumCheck2 = px2 * midSegX + py2 * midSegY; - - if (scalarCheck1 > 0.0f && scalarCheck1 < segmentModulus && scalarMomentumCheck1 > 0.0f) { - length = length1; - // X = interceptX1; Y = interceptY1; - } - if (scalarCheck2 > 0.0f && scalarCheck2 < segmentModulus && scalarMomentumCheck2 > 0.0f) { - length = length2; - // X = interceptX2; Y = interceptY2; - } - return length; - } - - /// function to calculate track length of this track up to a certain segmented detector - /// \param track the input track - /// \param magneticField the magnetic field to use when propagating - float findInterceptLength(o2::track::TrackPar track, float magneticField) - { - float length = 1e+6; - for (int iSeg = 0; iSeg < 18; iSeg++) { - // Detector segmentation loop - float segmentAngle = 20.0f / 180.0f * TMath::Pi(); - float theta = static_cast(iSeg) * 20.0f / 180.0f * TMath::Pi(); - float halfWidth = tofPosition * TMath::Tan(0.5f * segmentAngle); - float x1 = TMath::Cos(theta) * (-halfWidth) + TMath::Sin(theta) * tofPosition; - float y1 = -TMath::Sin(theta) * (-halfWidth) + TMath::Cos(theta) * tofPosition; - float x2 = TMath::Cos(theta) * (+halfWidth) + TMath::Sin(theta) * tofPosition; - float y2 = -TMath::Sin(theta) * (+halfWidth) + TMath::Cos(theta) * tofPosition; - float thisLength = trackLengthToSegment(track, x1, y1, x2, y2, magneticField); - if (thisLength < length && thisLength > 0) - length = thisLength; - } - if (length > 1e+5) - length = -100; // force negative to avoid misunderstandings - return length; - } - - void init(InitContext&) - { - mRunNumber = 0; - d_bz = 0; - maxSnp = 0.85f; // could be changed later - maxStep = 2.00f; // could be changed later - - ccdb->setURL(ccdburl); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); - ccdb->setFatalWhenNull(false); - - nSigmaCalibLoaded = false; - nSigmaCalibObjects = nullptr; - - // measured vs expected total time QA - if (doQA) { - // standard deltaTime values - histos.add("hArcDebug", "hArcDebug", kTH2F, {axisPt, {500, -5.0f, 10.0f}}); - histos.add("h2dposDeltaTimeAsXiPi", "h2dposDeltaTimeAsXiPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dposDeltaTimeAsXiPr", "h2dposDeltaTimeAsXiPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dnegDeltaTimeAsXiPi", "h2dnegDeltaTimeAsXiPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dnegDeltaTimeAsXiPr", "h2dnegDeltaTimeAsXiPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dbachDeltaTimeAsXiPi", "h2dbachDeltaTimeAsXiPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - - histos.add("h2dposDeltaTimeAsOmPi", "h2dposDeltaTimeAsOmPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dposDeltaTimeAsOmPr", "h2dposDeltaTimeAsOmPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dnegDeltaTimeAsOmPi", "h2dnegDeltaTimeAsOmPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dnegDeltaTimeAsOmPr", "h2dnegDeltaTimeAsOmPr", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - histos.add("h2dbachDeltaTimeAsOmKa", "h2dbachDeltaTimeAsOmKa", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); - } - - if (doQANSigma) { - // standard NSigma values - histos.add("h2dNSigmaXiLaPi", "h2dNSigmaXiLaPi", {HistType::kTH2F, {axisPt, axisNSigma}}); - histos.add("h2dNSigmaXiLaPr", "h2dNSigmaXiLaPr", {HistType::kTH2F, {axisPt, axisNSigma}}); - histos.add("h2dNSigmaXiPi", "h2dNSigmaXiPi", {HistType::kTH2F, {axisPt, axisNSigma}}); - histos.add("h2dNSigmaOmLaPi", "h2dNSigmaOmLaPi", {HistType::kTH2F, {axisPt, axisNSigma}}); - histos.add("h2dNSigmaOmLaPr", "h2dNSigmaOmLaPr", {HistType::kTH2F, {axisPt, axisNSigma}}); - histos.add("h2dNSigmaOmKa", "h2dNSigmaOmKa", {HistType::kTH2F, {axisPt, axisNSigma}}); - } - } - - void initCCDB(int runNumber) - { - if (mRunNumber == runNumber) { - return; - } - - // In case override, don't proceed, please - no CCDB access required - if (d_bz_input > -990) { - d_bz = d_bz_input; - o2::parameters::GRPMagField grpmag; - if (fabs(d_bz) > 1e-5) { - grpmag.setL3Current(30000.f / (d_bz / 5.0f)); - } - o2::base::Propagator::initFieldFromGRP(&grpmag); - mRunNumber = runNumber; - return; - } - - o2::parameters::GRPObject* grpo = ccdb->getForRun(grpPath, runNumber); - o2::parameters::GRPMagField* grpmag = 0x0; - if (grpo) { - o2::base::Propagator::initFieldFromGRP(grpo); - // Fetch magnetic field from ccdb for current collision - d_bz = grpo->getNominalL3Field(); - LOG(info) << "Retrieved GRP for run " << runNumber << " with magnetic field of " << d_bz << " kZG"; - } else { - grpmag = ccdb->getForRun(grpmagPath, runNumber); - if (!grpmag) { - LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for run " << runNumber; - } - o2::base::Propagator::initFieldFromGRP(grpmag); - // Fetch magnetic field from ccdb for current collision - d_bz = std::lround(5.f * grpmag->getL3Current() / 30000.f); - LOG(info) << "Retrieved GRP for run " << runNumber << " with magnetic field of " << d_bz << " kZG"; - } - - // if TOF Nsigma desired - if (doNSigmas) { - nSigmaCalibObjects = ccdb->getForRun(nSigmaPath, runNumber); - if (nSigmaCalibObjects) { - LOGF(info, "loaded TList with this many objects: %i", nSigmaCalibObjects->GetEntries()); - - hMeanPosXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosXiPi")); - hMeanPosXiPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosXiPr")); - hMeanNegXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegXiPi")); - hMeanNegXiPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegXiPr")); - hMeanBachXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanBachXiPi")); - hMeanPosOmPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosOmPi")); - hMeanPosOmPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanPosOmPr")); - hMeanNegOmPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegOmPi")); - hMeanNegOmPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanNegOmPr")); - hMeanBachOmKa = reinterpret_cast(nSigmaCalibObjects->FindObject("hMeanBachOmKa")); - - hSigmaPosXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaPosXiPi")); - hSigmaPosXiPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaPosXiPr")); - hSigmaNegXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaNegXiPi")); - hSigmaNegXiPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaNegXiPr")); - hSigmaBachXiPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaBachXiPi")); - hSigmaPosOmPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaPosOmPi")); - hSigmaPosOmPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaPosOmPr")); - hSigmaNegOmPi = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaNegOmPi")); - hSigmaNegOmPr = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaNegOmPr")); - hSigmaBachOmKa = reinterpret_cast(nSigmaCalibObjects->FindObject("hSigmaBachOmKa")); - - if (!hMeanPosXiPi || !hMeanPosXiPr || !hMeanNegXiPi || !hMeanNegXiPr || !hMeanBachXiPi) - LOG(info) << "Problems finding xi mean histograms!"; - if (!hMeanPosOmPi || !hMeanPosOmPr || !hMeanNegOmPi || !hMeanNegOmPr || !hMeanBachOmKa) - LOG(info) << "Problems finding omega sigma histograms!"; - if (!hSigmaPosXiPi || !hSigmaPosXiPr || !hSigmaNegXiPi || !hSigmaNegXiPr || !hSigmaBachXiPi) - LOG(info) << "Problems finding xi sigma histograms!"; - if (!hSigmaPosOmPi || !hSigmaPosOmPr || !hSigmaNegOmPi || !hSigmaNegOmPr || !hSigmaBachOmKa) - LOG(info) << "Problems finding omega sigma histograms!"; - } - } - mRunNumber = runNumber; - } - - float velocity(float lMomentum, float lMass) - { - // Momentum p and mass m -> returns speed in centimeters per picosecond - // Useful for TOF calculations - float lA = (lMomentum / lMass) * (lMomentum / lMass); - return 0.0299792458 * TMath::Sqrt(lA / (1 + lA)); - } - - template - void processCascadeCandidate(TCollision const& collision, TCascade const& cascade, TTrack const& pTra, TTrack const& nTra, TTrack const& bTra) - { - // initialize from positions and momenta as needed - o2::track::TrackPar posTrack = o2::track::TrackPar({cascade.xlambda(), cascade.ylambda(), cascade.zlambda()}, {cascade.pxpos(), cascade.pypos(), cascade.pzpos()}, +1); - o2::track::TrackPar negTrack = o2::track::TrackPar({cascade.xlambda(), cascade.ylambda(), cascade.zlambda()}, {cascade.pxneg(), cascade.pyneg(), cascade.pzneg()}, -1); - o2::track::TrackPar bachTrack = o2::track::TrackPar({cascade.x(), cascade.y(), cascade.z()}, {cascade.pxbach(), cascade.pybach(), cascade.pzbach()}, cascade.sign()); - o2::track::TrackPar cascTrack = o2::track::TrackPar({cascade.x(), cascade.y(), cascade.z()}, {cascade.px(), cascade.py(), cascade.pz()}, cascade.sign()); - - // start calculation: calculate velocities - float velocityPositivePr = velocity(posTrack.getP(), o2::constants::physics::MassProton); - float velocityPositivePi = velocity(posTrack.getP(), o2::constants::physics::MassPionCharged); - float velocityNegativePr = velocity(negTrack.getP(), o2::constants::physics::MassProton); - float velocityNegativePi = velocity(negTrack.getP(), o2::constants::physics::MassPionCharged); - float velocityBachelorPi = velocity(bachTrack.getP(), o2::constants::physics::MassPionCharged); - float velocityBachelorKa = velocity(bachTrack.getP(), o2::constants::physics::MassKaonCharged); - float velocityXi = velocity(cascTrack.getP(), o2::constants::physics::MassXiMinus); - float velocityOm = velocity(cascTrack.getP(), o2::constants::physics::MassOmegaMinus); - float velocityLa = velocity(std::hypot(cascade.pxlambda(), cascade.pylambda(), cascade.pzlambda()), o2::constants::physics::MassLambda); - - // calculate daughter length to TOF intercept - float lengthPositive = findInterceptLength(posTrack, d_bz); // FIXME: tofPosition ok? adjust? - float lengthNegative = findInterceptLength(negTrack, d_bz); // FIXME: tofPosition ok? adjust? - float lengthBachelor = findInterceptLength(bachTrack, d_bz); // FIXME: tofPosition ok? adjust? - - // calculate mother lengths - float lengthV0 = std::hypot(cascade.xlambda() - cascade.x(), cascade.ylambda() - cascade.y(), cascade.zlambda() - cascade.z()); - float lengthCascade = -1e+6; - const o2::math_utils::Point3D collVtx{collision.posX(), collision.posY(), collision.posZ()}; - bool successPropag = o2::base::Propagator::Instance()->propagateToDCA(collVtx, cascTrack, d_bz, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrNONE); - float d = -1.0f, d3d = 0.0f; - float linearToPV = std::hypot(cascade.x() - collision.posX(), cascade.y() - collision.posY(), cascade.z() - collision.posZ()); - if (successPropag) { - std::array cascCloseToPVPosition; - cascTrack.getXYZGlo(cascCloseToPVPosition); - o2::math_utils::CircleXYf_t trcCircleCascade; - float sna, csa; - cascTrack.getCircleParams(d_bz, trcCircleCascade, sna, csa); - - // calculate 2D distance between two points - d = std::hypot(cascade.x() - cascCloseToPVPosition[0], cascade.y() - cascCloseToPVPosition[1]); - d3d = std::hypot(cascade.x() - cascCloseToPVPosition[0], cascade.y() - cascCloseToPVPosition[1], cascade.z() - cascCloseToPVPosition[2]); // cross-check variable - float sinThetaOverTwo = d / (2.0f * trcCircleCascade.rC); - lengthCascade = 2.0f * trcCircleCascade.rC * TMath::ASin(sinThetaOverTwo); - lengthCascade *= sqrt(1.0f + cascTrack.getTgl() * cascTrack.getTgl()); - } - - if (!successPropag) { - lengthCascade = linearToPV; // if propagation failed, use linear estimate (optional: actually do not define?) - } - - // lambda, xi and omega flight time is always defined - float lambdaFlight = lengthV0 / velocityLa; - float xiFlight = lengthCascade / velocityXi; - float omFlight = lengthCascade / velocityOm; - float posFlightPi = lengthPositive / velocityPositivePi; - float posFlightPr = lengthPositive / velocityPositivePr; - float negFlightPi = lengthNegative / velocityNegativePi; - float negFlightPr = lengthNegative / velocityNegativePr; - float bachFlightPi = lengthBachelor / velocityBachelorPi; - float bachFlightKa = lengthBachelor / velocityBachelorKa; - - // initialize delta-times (actual PID variables) - float posDeltaTimeAsXiPi = -1e+6, posDeltaTimeAsXiPr = -1e+6; - float negDeltaTimeAsXiPi = -1e+6, negDeltaTimeAsXiPr = -1e+6; - float bachDeltaTimeAsXiPi = -1e+6; - float posDeltaTimeAsOmPi = -1e+6, posDeltaTimeAsOmPr = -1e+6; - float negDeltaTimeAsOmPi = -1e+6, negDeltaTimeAsOmPr = -1e+6; - float bachDeltaTimeAsOmKa = -1e+6; - - if (pTra.hasTOF()) { - posDeltaTimeAsXiPi = (pTra.tofSignal() - pTra.tofEvTime()) - (xiFlight + lambdaFlight + posFlightPi); - posDeltaTimeAsXiPr = (pTra.tofSignal() - pTra.tofEvTime()) - (xiFlight + lambdaFlight + posFlightPr); - posDeltaTimeAsOmPi = (pTra.tofSignal() - pTra.tofEvTime()) - (omFlight + lambdaFlight + posFlightPi); - posDeltaTimeAsOmPr = (pTra.tofSignal() - pTra.tofEvTime()) - (omFlight + lambdaFlight + posFlightPr); - } - if (nTra.hasTOF()) { - negDeltaTimeAsXiPi = (nTra.tofSignal() - nTra.tofEvTime()) - (xiFlight + lambdaFlight + negFlightPi); - negDeltaTimeAsXiPr = (nTra.tofSignal() - nTra.tofEvTime()) - (xiFlight + lambdaFlight + negFlightPr); - negDeltaTimeAsOmPi = (nTra.tofSignal() - nTra.tofEvTime()) - (omFlight + lambdaFlight + negFlightPi); - negDeltaTimeAsOmPr = (nTra.tofSignal() - nTra.tofEvTime()) - (omFlight + lambdaFlight + negFlightPr); - } - if (bTra.hasTOF()) { - bachDeltaTimeAsXiPi = (bTra.tofSignal() - bTra.tofEvTime()) - (xiFlight + bachFlightPi); - bachDeltaTimeAsOmKa = (bTra.tofSignal() - bTra.tofEvTime()) - (omFlight + bachFlightKa); - } - - casctofpids( - posDeltaTimeAsXiPi, posDeltaTimeAsXiPr, negDeltaTimeAsXiPi, negDeltaTimeAsXiPr, bachDeltaTimeAsXiPi, - posDeltaTimeAsOmPi, posDeltaTimeAsOmPr, negDeltaTimeAsOmPi, negDeltaTimeAsOmPr, bachDeltaTimeAsOmKa); - - float nSigmaXiLaPr = -1e+6; - float nSigmaXiLaPi = -1e+6; - float nSigmaXiPi = -1e+6; - float nSigmaOmLaPr = -1e+6; - float nSigmaOmLaPi = -1e+6; - float nSigmaOmKa = -1e+6; - - // go for Nsigma values if requested - if (doNSigmas) { - // Xi hypothesis ________________________ - if (cascade.sign() < 0) { // XiMinus - if (posDeltaTimeAsXiPr > -1e+5) // proton from Lambda from XiMinus has signal - nSigmaXiLaPr = (posDeltaTimeAsXiPr - hMeanPosXiPr->Interpolate(cascade.pt())) / hSigmaPosXiPr->Interpolate(cascade.pt()); - if (negDeltaTimeAsXiPi > -1e+5) // pion from Lambda from XiMinus has signal - nSigmaXiLaPi = (negDeltaTimeAsXiPi - hMeanNegXiPi->Interpolate(cascade.pt())) / hSigmaNegXiPi->Interpolate(cascade.pt()); - if (bachDeltaTimeAsXiPi > -1e+5) // pion from XiMinus has signal - nSigmaXiPi = (bachDeltaTimeAsXiPi - hMeanBachXiPi->Interpolate(cascade.pt())) / hSigmaBachXiPi->Interpolate(cascade.pt()); - if (posDeltaTimeAsOmPr > -1e+5) // proton from Lambda from OmegaMinus has signal - nSigmaOmLaPr = (posDeltaTimeAsOmPr - hMeanPosOmPr->Interpolate(cascade.pt())) / hSigmaPosOmPr->Interpolate(cascade.pt()); - if (negDeltaTimeAsOmPi > -1e+5) // pion from Lambda from OmegaMinus has signal - nSigmaOmLaPi = (negDeltaTimeAsOmPi - hMeanNegOmPi->Interpolate(cascade.pt())) / hSigmaNegOmPi->Interpolate(cascade.pt()); - if (bachDeltaTimeAsOmKa > -1e+5) // kaon from OmegaMinus has signal - nSigmaOmKa = (bachDeltaTimeAsOmKa - hMeanBachOmKa->Interpolate(cascade.pt())) / hSigmaBachOmKa->Interpolate(cascade.pt()); - } else { - if (posDeltaTimeAsXiPi > -1e+5) // proton from Lambda from XiMinus has signal - nSigmaXiLaPi = (posDeltaTimeAsXiPi - hMeanPosXiPi->Interpolate(cascade.pt())) / hSigmaPosXiPi->Interpolate(cascade.pt()); - if (negDeltaTimeAsXiPr > -1e+5) // pion from Lambda from XiMinus has signal - nSigmaXiLaPr = (negDeltaTimeAsXiPr - hMeanNegXiPr->Interpolate(cascade.pt())) / hSigmaNegXiPr->Interpolate(cascade.pt()); - if (bachDeltaTimeAsXiPi > -1e+5) // pion from XiMinus has signal - nSigmaXiPi = (bachDeltaTimeAsXiPi - hMeanBachXiPi->Interpolate(cascade.pt())) / hSigmaBachXiPi->Interpolate(cascade.pt()); - if (posDeltaTimeAsOmPi > -1e+5) // proton from Lambda from OmegaMinus has signal - nSigmaOmLaPi = (posDeltaTimeAsOmPi - hMeanPosOmPi->Interpolate(cascade.pt())) / hSigmaPosOmPi->Interpolate(cascade.pt()); - if (negDeltaTimeAsOmPr > -1e+5) // pion from Lambda from OmegaMinus has signal - nSigmaOmLaPr = (negDeltaTimeAsOmPr - hMeanNegOmPr->Interpolate(cascade.pt())) / hSigmaNegOmPr->Interpolate(cascade.pt()); - if (bachDeltaTimeAsOmKa > -1e+5) // kaon from OmegaMinus has signal - nSigmaOmKa = (bachDeltaTimeAsOmKa - hMeanBachOmKa->Interpolate(cascade.pt())) / hSigmaBachOmKa->Interpolate(cascade.pt()); - } - casctofnsigmas(nSigmaXiLaPi, nSigmaXiLaPr, nSigmaXiPi, nSigmaOmLaPi, nSigmaOmLaPr, nSigmaOmKa); - } - - if (doQA) { - // fill QA histograms for cross-checking - histos.fill(HIST("hArcDebug"), cascade.pt(), lengthCascade - d3d); // for debugging purposes - - if (cascade.dcaV0daughters() < qaV0DCADau && cascade.dcacascdaughters() < qaCascDCADau && cascade.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) > qaV0CosPA && cascade.casccosPA(collision.posX(), collision.posY(), collision.posZ()) > qaCascCosPA) { - if (cascade.sign() < 0) { - if (std::abs(cascade.mXi() - 1.32171) < qaMassWindow && fabs(pTra.tpcNSigmaPr()) < qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < qaTPCNSigma && fabs(bTra.tpcNSigmaPi()) < qaTPCNSigma) { - histos.fill(HIST("h2dposDeltaTimeAsXiPr"), cascade.pt(), cascade.eta(), posDeltaTimeAsXiPr); - histos.fill(HIST("h2dnegDeltaTimeAsXiPi"), cascade.pt(), cascade.eta(), negDeltaTimeAsXiPi); - histos.fill(HIST("h2dbachDeltaTimeAsXiPi"), cascade.pt(), cascade.eta(), bachDeltaTimeAsXiPi); - if (doQANSigma) { - histos.fill(HIST("h2dNSigmaXiLaPi"), cascade.pt(), nSigmaXiLaPi); - histos.fill(HIST("h2dNSigmaXiLaPr"), cascade.pt(), nSigmaXiLaPr); - histos.fill(HIST("h2dNSigmaXiPi"), cascade.pt(), nSigmaXiPi); - } - } - if (std::abs(cascade.mOmega() - 1.67245) < qaMassWindow && fabs(pTra.tpcNSigmaPr()) < qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < qaTPCNSigma && fabs(bTra.tpcNSigmaKa()) < qaTPCNSigma) { - histos.fill(HIST("h2dposDeltaTimeAsOmPr"), cascade.pt(), cascade.eta(), posDeltaTimeAsOmPr); - histos.fill(HIST("h2dnegDeltaTimeAsOmPi"), cascade.pt(), cascade.eta(), negDeltaTimeAsOmPi); - histos.fill(HIST("h2dbachDeltaTimeAsOmKa"), cascade.pt(), cascade.eta(), bachDeltaTimeAsOmKa); - if (doQANSigma) { - histos.fill(HIST("h2dNSigmaOmLaPi"), cascade.pt(), nSigmaOmLaPi); - histos.fill(HIST("h2dNSigmaOmLaPr"), cascade.pt(), nSigmaOmLaPr); - histos.fill(HIST("h2dNSigmaOmKa"), cascade.pt(), nSigmaOmKa); - } - } - } else { - if (std::abs(cascade.mXi() - 1.32171) < qaMassWindow && fabs(pTra.tpcNSigmaPi()) < qaTPCNSigma && fabs(nTra.tpcNSigmaPr()) < qaTPCNSigma && fabs(bTra.tpcNSigmaPi()) < qaTPCNSigma) { - histos.fill(HIST("h2dposDeltaTimeAsXiPi"), cascade.pt(), cascade.eta(), posDeltaTimeAsXiPi); - histos.fill(HIST("h2dnegDeltaTimeAsXiPr"), cascade.pt(), cascade.eta(), negDeltaTimeAsXiPr); - histos.fill(HIST("h2dbachDeltaTimeAsXiPi"), cascade.pt(), cascade.eta(), bachDeltaTimeAsXiPi); - if (doQANSigma) { - histos.fill(HIST("h2dNSigmaXiLaPi"), cascade.pt(), nSigmaXiLaPi); - histos.fill(HIST("h2dNSigmaXiLaPr"), cascade.pt(), nSigmaXiLaPr); - histos.fill(HIST("h2dNSigmaXiPi"), cascade.pt(), nSigmaXiPi); - } - } - if (std::abs(cascade.mOmega() - 1.67245) < qaMassWindow && fabs(pTra.tpcNSigmaPi()) < qaTPCNSigma && fabs(nTra.tpcNSigmaPr()) < qaTPCNSigma && fabs(bTra.tpcNSigmaKa()) < qaTPCNSigma) { - histos.fill(HIST("h2dposDeltaTimeAsOmPi"), cascade.pt(), cascade.eta(), posDeltaTimeAsOmPi); - histos.fill(HIST("h2dnegDeltaTimeAsOmPr"), cascade.pt(), cascade.eta(), negDeltaTimeAsOmPr); - histos.fill(HIST("h2dbachDeltaTimeAsOmKa"), cascade.pt(), cascade.eta(), bachDeltaTimeAsOmKa); - if (doQANSigma) { - histos.fill(HIST("h2dNSigmaOmLaPi"), cascade.pt(), nSigmaOmLaPi); - histos.fill(HIST("h2dNSigmaOmLaPr"), cascade.pt(), nSigmaOmLaPr); - histos.fill(HIST("h2dNSigmaOmKa"), cascade.pt(), nSigmaOmKa); - } - } - } - } - } - } - - void processStandardData(aod::Collisions const& collisions, CascOriginalDatas const& Cascades, TracksWithAllExtras const&, aod::BCsWithTimestamps const& /*bcs*/) - { - // Fire up CCDB with first collision in record. If no collisions, bypass - if (useCustomRunNumber || collisions.size() < 1) { - initCCDB(manualRunNumber); - } else { - auto collision = collisions.begin(); - auto bc = collision.bc_as(); - initCCDB(bc.runNumber()); - } - - for (const auto& collision : collisions) { - // Do analysis with collision-grouped V0s, retain full collision information - const uint64_t collIdx = collision.globalIndex(); - auto CascTable_thisCollision = Cascades.sliceBy(perCollisionOriginal, collIdx); - // cascade table sliced - for (auto const& cascade : CascTable_thisCollision) { - // de-reference interlinks by hand for derived data - auto pTra = cascade.posTrack_as(); - auto nTra = cascade.negTrack_as(); - auto bTra = cascade.bachelor_as(); - - processCascadeCandidate(collision, cascade, pTra, nTra, bTra); - } - } - } - - void processDerivedData(soa::Join const& collisions, CascDerivedDatas const& Cascades, dauTracks const&) - { - // Fire up CCDB with first collision in record. If no collisions, bypass - if (useCustomRunNumber || collisions.size() < 1) { - initCCDB(manualRunNumber); - } else { - auto collision = collisions.begin(); - initCCDB(collision.runNumber()); - } - - for (const auto& collision : collisions) { - // Do analysis with collision-grouped V0s, retain full collision information - const uint64_t collIdx = collision.globalIndex(); - auto CascTable_thisCollision = Cascades.sliceBy(perCollisionDerived, collIdx); - // cascade table sliced - for (auto const& cascade : CascTable_thisCollision) { - // de-reference interlinks by hand for derived data - auto pTra = cascade.posTrackExtra_as(); - auto nTra = cascade.negTrackExtra_as(); - auto bTra = cascade.bachTrackExtra_as(); - - processCascadeCandidate(collision, cascade, pTra, nTra, bTra); - } - } - } - - PROCESS_SWITCH(cascadepid, processStandardData, "Process standard data", true); - PROCESS_SWITCH(cascadepid, processDerivedData, "Process derived data", false); -}; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; -}