From fc1226be2f8af4d8c203c25727586d15b70eed2e Mon Sep 17 00:00:00 2001 From: jesgum Date: Wed, 22 Jul 2026 15:00:46 +0200 Subject: [PATCH] Add v0 tables to a3 strangeness tof pid --- ALICE3/DataModel/OTFStrangeness.h | 151 +++++++- .../TableProducer/alice3StrangenessTofPid.cxx | 359 ++++++++++++++++-- 2 files changed, 469 insertions(+), 41 deletions(-) diff --git a/ALICE3/DataModel/OTFStrangeness.h b/ALICE3/DataModel/OTFStrangeness.h index 7169410b76d..af8d5f0c14f 100644 --- a/ALICE3/DataModel/OTFStrangeness.h +++ b/ALICE3/DataModel/OTFStrangeness.h @@ -53,8 +53,8 @@ DECLARE_SOA_COLUMN(CascRadius, cascRadius, float); DECLARE_SOA_COLUMN(CascRadiusMC, cascRadiusMC, float); DECLARE_SOA_COLUMN(MLambda, mLambda, float); DECLARE_SOA_COLUMN(MXi, mXi, float); -DECLARE_SOA_COLUMN(DCAXYCascToPV, dcaXYCascToPV, float); -DECLARE_SOA_COLUMN(DCAZCascToPV, dcaZCascToPV, float); +DECLARE_SOA_COLUMN(DcaXYCascToPV, dcaXYCascToPV, float); +DECLARE_SOA_COLUMN(DcaZCascToPV, dcaZCascToPV, float); // strangeness tracking DECLARE_SOA_COLUMN(FindableClusters, findableClusters, int); @@ -77,8 +77,8 @@ DECLARE_SOA_TABLE(UpgradeCascades, "AOD", "UPGRADECASCADES", otfcascade::MXi, otfcascade::FindableClusters, otfcascade::FoundClusters, - otfcascade::DCAXYCascToPV, - otfcascade::DCAZCascToPV); + otfcascade::DcaXYCascToPV, + otfcascade::DcaZCascToPV); using UpgradeCascade = UpgradeCascades::iterator; @@ -484,5 +484,148 @@ DECLARE_SOA_TABLE(V0CandidateCores, "AOD", "V0CANDIDATECORE", candidatev0::PositivePhi); using V0CandidateCore = V0CandidateCores::iterator; + +namespace v0_pid +{ + +// K0S +DECLARE_SOA_COLUMN(NSigmaInnerTofK0SPosPi, nSigmaInnerTofK0SPosPi, float); +DECLARE_SOA_COLUMN(NSigmaInnerTofK0SNegPi, nSigmaInnerTofK0SNegPi, float); +DECLARE_SOA_DYNAMIC_COLUMN(HasInnerTofK0SPosPi, hasInnerTofK0SPosPi, + [](float nSigma) -> bool { return (nSigma > o2::upgrade::pid::NoPidSignalThreshold); }); +DECLARE_SOA_DYNAMIC_COLUMN(HasInnerTofK0SNegPi, hasInnerTofK0SNegPi, + [](float nSigma) -> bool { return (nSigma > o2::upgrade::pid::NoPidSignalThreshold); }); + +DECLARE_SOA_COLUMN(NSigmaOuterTofK0SPosPi, nSigmaOuterTofK0SPosPi, float); +DECLARE_SOA_COLUMN(NSigmaOuterTofK0SNegPi, nSigmaOuterTofK0SNegPi, float); +DECLARE_SOA_DYNAMIC_COLUMN(HasOuterTofK0SPosPi, hasOuterTofK0SPosPi, + [](float nSigma) -> bool { return (nSigma > o2::upgrade::pid::NoPidSignalThreshold); }); +DECLARE_SOA_DYNAMIC_COLUMN(HasOuterTofK0SNegPi, hasOuterTofK0SNegPi, + [](float nSigma) -> bool { return (nSigma > o2::upgrade::pid::NoPidSignalThreshold); }); + +DECLARE_SOA_COLUMN(ExpectedInnerTofK0SPosPi, expectedInnerTofK0SPosPi, float); +DECLARE_SOA_COLUMN(ExpectedInnerTofK0SNegPi, expectedInnerTofK0SNegPi, float); + +DECLARE_SOA_COLUMN(ExpectedOuterTofK0SPosPi, expectedOuterTofK0SPosPi, float); +DECLARE_SOA_COLUMN(ExpectedOuterTofK0SNegPi, expectedOuterTofK0SNegPi, float); + +DECLARE_SOA_COLUMN(MeasuredInnerTofK0SPosPi, measuredInnerTofK0SPosPi, float); +DECLARE_SOA_COLUMN(MeasuredInnerTofK0SNegPi, measuredInnerTofK0SNegPi, float); + +DECLARE_SOA_COLUMN(MeasuredOuterTofK0SPosPi, measuredOuterTofK0SPosPi, float); +DECLARE_SOA_COLUMN(MeasuredOuterTofK0SNegPi, measuredOuterTofK0SNegPi, float); + +// Lambda +DECLARE_SOA_COLUMN(NSigmaInnerTofLambdaPosPr, nSigmaInnerTofLambdaPosPr, float); +DECLARE_SOA_COLUMN(NSigmaInnerTofLambdaPosPi, nSigmaInnerTofLambdaPosPi, float); +DECLARE_SOA_COLUMN(NSigmaInnerTofLambdaNegPr, nSigmaInnerTofLambdaNegPr, float); +DECLARE_SOA_COLUMN(NSigmaInnerTofLambdaNegPi, nSigmaInnerTofLambdaNegPi, float); +DECLARE_SOA_DYNAMIC_COLUMN(HasInnerTofLambdaPosPr, hasInnerTofLambdaPosPr, + [](float nSigma) -> bool { return (nSigma > o2::upgrade::pid::NoPidSignalThreshold); }); +DECLARE_SOA_DYNAMIC_COLUMN(HasInnerTofLambdaPosPi, hasInnerTofLambdaPosPi, + [](float nSigma) -> bool { return (nSigma > o2::upgrade::pid::NoPidSignalThreshold); }); +DECLARE_SOA_DYNAMIC_COLUMN(HasInnerTofLambdaNegPr, hasInnerTofLambdaNegPr, + [](float nSigma) -> bool { return (nSigma > o2::upgrade::pid::NoPidSignalThreshold); }); +DECLARE_SOA_DYNAMIC_COLUMN(HasInnerTofLambdaNegPi, hasInnerTofLambdaNegPi, + [](float nSigma) -> bool { return (nSigma > o2::upgrade::pid::NoPidSignalThreshold); }); + +DECLARE_SOA_COLUMN(NSigmaOuterTofLambdaPosPr, nSigmaOuterTofLambdaPosPr, float); +DECLARE_SOA_COLUMN(NSigmaOuterTofLambdaPosPi, nSigmaOuterTofLambdaPosPi, float); +DECLARE_SOA_COLUMN(NSigmaOuterTofLambdaNegPr, nSigmaOuterTofLambdaNegPr, float); +DECLARE_SOA_COLUMN(NSigmaOuterTofLambdaNegPi, nSigmaOuterTofLambdaNegPi, float); +DECLARE_SOA_DYNAMIC_COLUMN(HasOuterTofLambdaPosPr, hasOuterTofLambdaPosPr, + [](float nSigma) -> bool { return (nSigma > o2::upgrade::pid::NoPidSignalThreshold); }); +DECLARE_SOA_DYNAMIC_COLUMN(HasOuterTofLambdaPosPi, hasOuterTofLambdaPosPi, + [](float nSigma) -> bool { return (nSigma > o2::upgrade::pid::NoPidSignalThreshold); }); +DECLARE_SOA_DYNAMIC_COLUMN(HasOuterTofLambdaNegPr, hasOuterTofLambdaNegPr, + [](float nSigma) -> bool { return (nSigma > o2::upgrade::pid::NoPidSignalThreshold); }); +DECLARE_SOA_DYNAMIC_COLUMN(HasOuterTofLambdaNegPi, hasOuterTofLambdaNegPi, + [](float nSigma) -> bool { return (nSigma > o2::upgrade::pid::NoPidSignalThreshold); }); + +DECLARE_SOA_COLUMN(ExpectedInnerTofLambdaPosPr, expectedInnerTofLambdaPosPr, float); +DECLARE_SOA_COLUMN(ExpectedInnerTofLambdaPosPi, expectedInnerTofLambdaPosPi, float); +DECLARE_SOA_COLUMN(ExpectedInnerTofLambdaNegPr, expectedInnerTofLambdaNegPr, float); +DECLARE_SOA_COLUMN(ExpectedInnerTofLambdaNegPi, expectedInnerTofLambdaNegPi, float); + +DECLARE_SOA_COLUMN(ExpectedOuterTofLambdaPosPr, expectedOuterTofLambdaPosPr, float); +DECLARE_SOA_COLUMN(ExpectedOuterTofLambdaPosPi, expectedOuterTofLambdaPosPi, float); +DECLARE_SOA_COLUMN(ExpectedOuterTofLambdaNegPr, expectedOuterTofLambdaNegPr, float); +DECLARE_SOA_COLUMN(ExpectedOuterTofLambdaNegPi, expectedOuterTofLambdaNegPi, float); + +DECLARE_SOA_COLUMN(MeasuredInnerTofLambdaPosPr, measuredInnerTofLambdaPosPr, float); +DECLARE_SOA_COLUMN(MeasuredInnerTofLambdaPosPi, measuredInnerTofLambdaPosPi, float); +DECLARE_SOA_COLUMN(MeasuredInnerTofLambdaNegPr, measuredInnerTofLambdaNegPr, float); +DECLARE_SOA_COLUMN(MeasuredInnerTofLambdaNegPi, measuredInnerTofLambdaNegPi, float); + +DECLARE_SOA_COLUMN(MeasuredOuterTofLambdaPosPr, measuredOuterTofLambdaPosPr, float); +DECLARE_SOA_COLUMN(MeasuredOuterTofLambdaPosPi, measuredOuterTofLambdaPosPi, float); +DECLARE_SOA_COLUMN(MeasuredOuterTofLambdaNegPr, measuredOuterTofLambdaNegPr, float); +DECLARE_SOA_COLUMN(MeasuredOuterTofLambdaNegPi, measuredOuterTofLambdaNegPi, float); +} // namespace v0_pid + +DECLARE_SOA_TABLE(A3K0SInnerTofPid, "AOD", "A3K0SITOFPID", + v0_pid::NSigmaInnerTofK0SPosPi, + v0_pid::NSigmaInnerTofK0SNegPi, + v0_pid::HasInnerTofK0SPosPi, + v0_pid::HasInnerTofK0SNegPi); + +DECLARE_SOA_TABLE(A3K0SOuterTofPid, "AOD", "A3K0SOTOFPID", + v0_pid::NSigmaOuterTofK0SPosPi, + v0_pid::NSigmaOuterTofK0SNegPi, + v0_pid::HasOuterTofK0SPosPi, + v0_pid::HasOuterTofK0SNegPi); + +DECLARE_SOA_TABLE(A3LambdaInnerTofPid, "AOD", "A3LAITOFPID", + v0_pid::NSigmaInnerTofLambdaPosPr, + v0_pid::NSigmaInnerTofLambdaPosPi, + v0_pid::NSigmaInnerTofLambdaNegPr, + v0_pid::NSigmaInnerTofLambdaNegPi, + v0_pid::HasInnerTofLambdaPosPr, + v0_pid::HasInnerTofLambdaPosPi, + v0_pid::HasInnerTofLambdaNegPr, + v0_pid::HasInnerTofLambdaNegPi); + +DECLARE_SOA_TABLE(A3LambdaOuterTofPid, "AOD", "A3LAOTOFPID", + v0_pid::NSigmaOuterTofLambdaPosPr, + v0_pid::NSigmaOuterTofLambdaPosPi, + v0_pid::NSigmaOuterTofLambdaNegPr, + v0_pid::NSigmaOuterTofLambdaNegPi, + v0_pid::HasOuterTofLambdaPosPr, + v0_pid::HasOuterTofLambdaPosPi, + v0_pid::HasOuterTofLambdaNegPr, + v0_pid::HasOuterTofLambdaNegPi); + +DECLARE_SOA_TABLE(A3K0SExpectedInnerTimes, "AOD", "A3K0SITIMES", + v0_pid::ExpectedInnerTofK0SPosPi, + v0_pid::ExpectedInnerTofK0SNegPi, + v0_pid::MeasuredInnerTofK0SPosPi, + v0_pid::MeasuredInnerTofK0SNegPi); + +DECLARE_SOA_TABLE(A3K0SExpectedOuterTimes, "AOD", "A3K0SOTIMES", + v0_pid::ExpectedOuterTofK0SPosPi, + v0_pid::ExpectedOuterTofK0SNegPi, + v0_pid::MeasuredOuterTofK0SPosPi, + v0_pid::MeasuredOuterTofK0SNegPi); + +DECLARE_SOA_TABLE(A3LambdaExpectedInnerTimes, "AOD", "A3LAITIMES", + v0_pid::ExpectedInnerTofLambdaPosPr, + v0_pid::ExpectedInnerTofLambdaPosPi, + v0_pid::ExpectedInnerTofLambdaNegPr, + v0_pid::ExpectedInnerTofLambdaNegPi, + v0_pid::MeasuredInnerTofLambdaPosPr, + v0_pid::MeasuredInnerTofLambdaPosPi, + v0_pid::MeasuredInnerTofLambdaNegPr, + v0_pid::MeasuredInnerTofLambdaNegPi); + +DECLARE_SOA_TABLE(A3LambdaExpectedOuterTimes, "AOD", "A3LAOTIMES", + v0_pid::ExpectedOuterTofLambdaPosPr, + v0_pid::ExpectedOuterTofLambdaPosPi, + v0_pid::ExpectedOuterTofLambdaNegPr, + v0_pid::ExpectedOuterTofLambdaNegPi, + v0_pid::MeasuredOuterTofLambdaPosPr, + v0_pid::MeasuredOuterTofLambdaPosPi, + v0_pid::MeasuredOuterTofLambdaNegPr, + v0_pid::MeasuredOuterTofLambdaNegPi); + } // namespace o2::aod #endif // ALICE3_DATAMODEL_OTFSTRANGENESS_H_ diff --git a/ALICE3/TableProducer/alice3StrangenessTofPid.cxx b/ALICE3/TableProducer/alice3StrangenessTofPid.cxx index 3c9e5a5c76a..29d3103887e 100644 --- a/ALICE3/TableProducer/alice3StrangenessTofPid.cxx +++ b/ALICE3/TableProducer/alice3StrangenessTofPid.cxx @@ -17,7 +17,6 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "ALICE3/DataModel/OTFStrangeness.h" -#include "ALICE3/DataModel/tracksAlice3.h" #include "ALICE3/Utils/a3StrangenessTofPidHelper.h" #include "Common/Core/TableHelper.h" #include "Common/Core/trackUtilities.h" @@ -45,19 +44,29 @@ using namespace o2::framework; using namespace o2::upgrade::stratofpid; using CascTofResults = StrangenessTofResults; -using Alice3Tracks = soa::Join; +using V0TofResults = StrangenessTofResults; +using Alice3Tracks = soa::Join; +using FullV0Candidates = soa::Join; using FullCascadeCandidates = soa::Join; using Alice3Collision = soa::Join::iterator; struct Alice3StrangenessTofPid { - Produces tableA3XiInnerTofPid; // contains xi strangeness iTOF nsigma - Produces tableA3XiOuterTofPid; // contains xi strangeness oTOF nsigma - Produces tableA3OmegaInnerTofPid; // contains omega strangeness iTOF nsigma - Produces tableA3OmegaOuterTofPid; // contains omega strangeness oTOF nsigma - Produces tableA3XiExpectedInnerTimes; // contains xi strangeness iTOF info - Produces tableA3XiExpectedOuterTimes; // contains xi strangeness oTOF info - Produces tableA3OmegaExpectedInnerTimes; // contains omega strangeness iTOF info - Produces tableA3OmegaExpectedOuterTimes; // contains omega strangeness oTOF info + Produces tableA3K0SInnerTofPid; // contains K0S strangeness iTOF nsigma + Produces tableA3K0SOuterTofPid; // contains K0S strangeness oTOF nsigma + Produces tableA3LambdaInnerTofPid; // contains lambda strangeness iTOF nsigma + Produces tableA3LambdaOuterTofPid; // contains lambda strangeness oTOF nsigma + Produces tableA3K0SExpectedInnerTimes; // contains K0S strangeness iTOF info + Produces tableA3K0SExpectedOuterTimes; // contains K0S strangeness oTOF info + Produces tableA3LambdaExpectedInnerTimes; // contains lambda strangeness iTOF info + Produces tableA3LambdaExpectedOuterTimes; // contains lambda strangeness oTOF info + Produces tableA3XiInnerTofPid; // contains xi strangeness iTOF nsigma + Produces tableA3XiOuterTofPid; // contains xi strangeness oTOF nsigma + Produces tableA3OmegaInnerTofPid; // contains omega strangeness iTOF nsigma + Produces tableA3OmegaOuterTofPid; // contains omega strangeness oTOF nsigma + Produces tableA3XiExpectedInnerTimes; // contains xi strangeness iTOF info + Produces tableA3XiExpectedOuterTimes; // contains xi strangeness oTOF info + Produces tableA3OmegaExpectedInnerTimes; // contains omega strangeness iTOF info + Produces tableA3OmegaExpectedOuterTimes; // contains omega strangeness oTOF info struct : ConfigurableGroup { ConfigurableAxis axisNSigma{"axisNSigma", {200, -10, 10}, "N sigma axis"}; @@ -81,6 +90,14 @@ struct Alice3StrangenessTofPid { std::string prefix = "produce"; // Tables + Configurable tableInnerNSigmaK0S{"tableInnerNSigmaK0S", true, "Produce NSigma tables for K0S candidate"}; + Configurable tableOuterNSigmaK0S{"tableOuterNSigmaK0S", true, "Produce NSigma tables for K0S candidate"}; + Configurable tableInnerExpectedTimesK0S{"tableInnerExpectedTimesK0S", false, "Produce expected and measured times tables for K0S candidate"}; + Configurable tableOuterExpectedTimesK0S{"tableOuterExpectedTimesK0S", false, "Produce expected and measured times tables for K0S candidate"}; + Configurable tableInnerNSigmaLambda{"tableInnerNSigmaLambda", true, "Produce NSigma tables for Lambda candidate"}; + Configurable tableOuterNSigmaLambda{"tableOuterNSigmaLambda", true, "Produce NSigma tables for Lambda candidate"}; + Configurable tableInnerExpectedTimesLambda{"tableInnerExpectedTimesLambda", false, "Produce expected and measured times tables for Lambda candidate"}; + Configurable tableOuterExpectedTimesLambda{"tableOuterExpectedTimesLambda", false, "Produce expected and measured times tables for Lambda candidate"}; Configurable tableInnerNSigmaXi{"tableInnerNSigmaXi", true, "Produce NSigma tables for xi candidate"}; Configurable tableOuterNSigmaXi{"tableOuterNSigmaXi", true, "Produce NSigma tables for xi candidate"}; Configurable tableInnerExpectedTimesXi{"tableInnerExpectedTimesXi", false, "Produce expected and measured times tables for xi candidate"}; @@ -91,18 +108,23 @@ struct Alice3StrangenessTofPid { Configurable tableOuterExpectedTimesOmega{"tableOuterExpectedTimesOmega", false, "Produce expected and measured times tables for omega candidate"}; // Histograms - Configurable histosXi{"histosXi", true, "Produce histograms for xi candidates"}; - Configurable histosAntiXi{"histosAntiXi", true, "Produce histograms for anti xi candidates"}; - Configurable histosOmega{"histosOmega", true, "Produce histograms for omega candidates"}; - Configurable histosAntiOmega{"histosAntiOmega", true, "Produce histograms for anti omega candidates"}; + Configurable histosK0S{"histosK0S", false, "Produce histograms for xi candidates"}; + Configurable histosLambda{"histosLambda", false, "Produce histograms for xi candidates"}; + Configurable histosAntiLambda{"histosAntiLambda", false, "Produce histograms for xi candidates"}; + Configurable histosXi{"histosXi", false, "Produce histograms for xi candidates"}; + Configurable histosAntiXi{"histosAntiXi", false, "Produce histograms for anti xi candidates"}; + Configurable histosOmega{"histosOmega", false, "Produce histograms for omega candidates"}; + Configurable histosAntiOmega{"histosAntiOmega", false, "Produce histograms for anti omega candidates"}; } produce; Configurable magneticField{"magneticField", 20.0f, "Magnetic field (in kilogauss)"}; HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; StrangenessTofPid tofPidCasc; + StrangenessTofPid tofPidV0; Service pdgDB{}; static constexpr float NanoToPico = 1e+3; + static constexpr int ChargeV0 = 0; static constexpr std::array ParentTrackCovMatrix{}; struct TimeOfFlight { @@ -129,8 +151,90 @@ struct Alice3StrangenessTofPid { tofPidCasc.setResolution(tof.iTofResolution, tof.oTofResolution); tofPidCasc.setRadius(tof.iTofRadius, tof.oTofRadius); tofPidCasc.setMagneticField(magneticField); - - // Todo: doProcessV0s + tofPidV0.setResolution(tof.iTofResolution, tof.oTofResolution); + tofPidV0.setRadius(tof.iTofRadius, tof.oTofRadius); + tofPidV0.setMagneticField(magneticField); + + if (doprocessV0s) { + if (produce.histosK0S) { + histos.add("K0S/hInnerArrivalTimeDeltaNeg", "hInnerArrivalTimeDeltaNeg", kTH1D, {{axes.axisTimeDelta}}); + histos.add("K0S/hInnerArrivalTimeDeltaPos", "hInnerArrivalTimeDeltaPos", kTH1D, {{axes.axisTimeDelta}}); + histos.add("K0S/hOuterArrivalTimeDeltaNeg", "hOuterArrivalTimeDeltaNeg", kTH1D, {{axes.axisTimeDelta}}); + histos.add("K0S/hOuterArrivalTimeDeltaPos", "hOuterArrivalTimeDeltaPos", kTH1D, {{axes.axisTimeDelta}}); + + histos.add("K0S/hInnerNSigmaNeg", "hInnerNSigmaNeg", kTH1D, {{axes.axisNSigma}}); + histos.add("K0S/hInnerNSigmaPos", "hInnerNSigmaPos", kTH1D, {{axes.axisNSigma}}); + histos.add("K0S/hOuterNSigmaNeg", "hOuterNSigmaNeg", kTH1D, {{axes.axisNSigma}}); + histos.add("K0S/hOuterNSigmaPos", "hOuterNSigmaPos", kTH1D, {{axes.axisNSigma}}); + + histos.add("K0S/hInnerExpectedArrivalTimeNeg", "hInnerExpectedArrivalTimeNeg", kTH1D, {{axes.axisTime}}); + histos.add("K0S/hInnerExpectedArrivalTimePos", "hInnerExpectedArrivalTimePos", kTH1D, {{axes.axisTime}}); + histos.add("K0S/hOuterExpectedArrivalTimeNeg", "hOuterExpectedArrivalTimeNeg", kTH1D, {{axes.axisTime}}); + histos.add("K0S/hOuterExpectedArrivalTimePos", "hOuterExpectedArrivalTimePos", kTH1D, {{axes.axisTime}}); + + histos.add("K0S/hInnerMeasuredArrivalTimeNeg", "hInnerMeasuredArrivalTimeNeg", kTH1D, {{axes.axisTime}}); + histos.add("K0S/hInnerMeasuredArrivalTimePos", "hInnerMeasuredArrivalTimePos", kTH1D, {{axes.axisTime}}); + histos.add("K0S/hOuterMeasuredArrivalTimeNeg", "hOuterMeasuredArrivalTimeNeg", kTH1D, {{axes.axisTime}}); + histos.add("K0S/hOuterMeasuredArrivalTimePos", "hOuterMeasuredArrivalTimePos", kTH1D, {{axes.axisTime}}); + + histos.add("K0S/hInnerMeasuredVsExpectedArrivalTimeNeg", "hInnerMeasuredVsExpectedArrivalTimeNeg;Measured time (ps);Expected time (ps)", kTH2D, {{axes.axisTime}, {axes.axisTime}}); + histos.add("K0S/hInnerMeasuredVsExpectedArrivalTimePos", "hInnerMeasuredVsExpectedArrivalTimePos;Measured time (ps);Expected time (ps)", kTH2D, {{axes.axisTime}, {axes.axisTime}}); + histos.add("K0S/hOuterMeasuredVsExpectedArrivalTimeNeg", "hOuterMeasuredVsExpectedArrivalTimeNeg;Measured time (ps);Expected time (ps)", kTH2D, {{axes.axisTime}, {axes.axisTime}}); + histos.add("K0S/hOuterMeasuredVsExpectedArrivalTimePos", "hOuterMeasuredVsExpectedArrivalTimePos;Measured time (ps);Expected time (ps)", kTH2D, {{axes.axisTime}, {axes.axisTime}}); + } + if (produce.histosLambda) { + histos.add("Lambda/hInnerArrivalTimeDeltaNeg", "hInnerArrivalTimeDeltaNeg", kTH1D, {{axes.axisTimeDelta}}); + histos.add("Lambda/hInnerArrivalTimeDeltaPos", "hInnerArrivalTimeDeltaPos", kTH1D, {{axes.axisTimeDelta}}); + histos.add("Lambda/hOuterArrivalTimeDeltaNeg", "hOuterArrivalTimeDeltaNeg", kTH1D, {{axes.axisTimeDelta}}); + histos.add("Lambda/hOuterArrivalTimeDeltaPos", "hOuterArrivalTimeDeltaPos", kTH1D, {{axes.axisTimeDelta}}); + + histos.add("Lambda/hInnerNSigmaNeg", "hInnerNSigmaNeg", kTH1D, {{axes.axisNSigma}}); + histos.add("Lambda/hInnerNSigmaPos", "hInnerNSigmaPos", kTH1D, {{axes.axisNSigma}}); + histos.add("Lambda/hOuterNSigmaNeg", "hOuterNSigmaNeg", kTH1D, {{axes.axisNSigma}}); + histos.add("Lambda/hOuterNSigmaPos", "hOuterNSigmaPos", kTH1D, {{axes.axisNSigma}}); + + histos.add("Lambda/hInnerExpectedArrivalTimeNeg", "hInnerExpectedArrivalTimeNeg", kTH1D, {{axes.axisTime}}); + histos.add("Lambda/hInnerExpectedArrivalTimePos", "hInnerExpectedArrivalTimePos", kTH1D, {{axes.axisTime}}); + histos.add("Lambda/hOuterExpectedArrivalTimeNeg", "hOuterExpectedArrivalTimeNeg", kTH1D, {{axes.axisTime}}); + histos.add("Lambda/hOuterExpectedArrivalTimePos", "hOuterExpectedArrivalTimePos", kTH1D, {{axes.axisTime}}); + + histos.add("Lambda/hInnerMeasuredArrivalTimeNeg", "hInnerMeasuredArrivalTimeNeg", kTH1D, {{axes.axisTime}}); + histos.add("Lambda/hInnerMeasuredArrivalTimePos", "hInnerMeasuredArrivalTimePos", kTH1D, {{axes.axisTime}}); + histos.add("Lambda/hOuterMeasuredArrivalTimeNeg", "hOuterMeasuredArrivalTimeNeg", kTH1D, {{axes.axisTime}}); + histos.add("Lambda/hOuterMeasuredArrivalTimePos", "hOuterMeasuredArrivalTimePos", kTH1D, {{axes.axisTime}}); + + histos.add("Lambda/hInnerMeasuredVsExpectedArrivalTimeNeg", "hInnerMeasuredVsExpectedArrivalTimeNeg;Measured time (ps);Expected time (ps)", kTH2D, {{axes.axisTime}, {axes.axisTime}}); + histos.add("Lambda/hInnerMeasuredVsExpectedArrivalTimePos", "hInnerMeasuredVsExpectedArrivalTimePos;Measured time (ps);Expected time (ps)", kTH2D, {{axes.axisTime}, {axes.axisTime}}); + histos.add("Lambda/hOuterMeasuredVsExpectedArrivalTimeNeg", "hOuterMeasuredVsExpectedArrivalTimeNeg;Measured time (ps);Expected time (ps)", kTH2D, {{axes.axisTime}, {axes.axisTime}}); + histos.add("Lambda/hOuterMeasuredVsExpectedArrivalTimePos", "hOuterMeasuredVsExpectedArrivalTimePos;Measured time (ps);Expected time (ps)", kTH2D, {{axes.axisTime}, {axes.axisTime}}); + } + if (produce.histosAntiLambda) { + histos.add("AntiLambda/hInnerArrivalTimeDeltaNeg", "hInnerArrivalTimeDeltaNeg", kTH1D, {{axes.axisTimeDelta}}); + histos.add("AntiLambda/hInnerArrivalTimeDeltaPos", "hInnerArrivalTimeDeltaPos", kTH1D, {{axes.axisTimeDelta}}); + histos.add("AntiLambda/hOuterArrivalTimeDeltaNeg", "hOuterArrivalTimeDeltaNeg", kTH1D, {{axes.axisTimeDelta}}); + histos.add("AntiLambda/hOuterArrivalTimeDeltaPos", "hOuterArrivalTimeDeltaPos", kTH1D, {{axes.axisTimeDelta}}); + + histos.add("AntiLambda/hInnerNSigmaNeg", "hInnerNSigmaNeg", kTH1D, {{axes.axisNSigma}}); + histos.add("AntiLambda/hInnerNSigmaPos", "hInnerNSigmaPos", kTH1D, {{axes.axisNSigma}}); + histos.add("AntiLambda/hOuterNSigmaNeg", "hOuterNSigmaNeg", kTH1D, {{axes.axisNSigma}}); + histos.add("AntiLambda/hOuterNSigmaPos", "hOuterNSigmaPos", kTH1D, {{axes.axisNSigma}}); + + histos.add("AntiLambda/hInnerExpectedArrivalTimeNeg", "hInnerExpectedArrivalTimeNeg", kTH1D, {{axes.axisTime}}); + histos.add("AntiLambda/hInnerExpectedArrivalTimePos", "hInnerExpectedArrivalTimePos", kTH1D, {{axes.axisTime}}); + histos.add("AntiLambda/hOuterExpectedArrivalTimeNeg", "hOuterExpectedArrivalTimeNeg", kTH1D, {{axes.axisTime}}); + histos.add("AntiLambda/hOuterExpectedArrivalTimePos", "hOuterExpectedArrivalTimePos", kTH1D, {{axes.axisTime}}); + + histos.add("AntiLambda/hInnerMeasuredArrivalTimeNeg", "hInnerMeasuredArrivalTimeNeg", kTH1D, {{axes.axisTime}}); + histos.add("AntiLambda/hInnerMeasuredArrivalTimePos", "hInnerMeasuredArrivalTimePos", kTH1D, {{axes.axisTime}}); + histos.add("AntiLambda/hOuterMeasuredArrivalTimeNeg", "hOuterMeasuredArrivalTimeNeg", kTH1D, {{axes.axisTime}}); + histos.add("AntiLambda/hOuterMeasuredArrivalTimePos", "hOuterMeasuredArrivalTimePos", kTH1D, {{axes.axisTime}}); + + histos.add("AntiLambda/hInnerMeasuredVsExpectedArrivalTimeNeg", "hInnerMeasuredVsExpectedArrivalTimeNeg;Measured time (ps);Expected time (ps)", kTH2D, {{axes.axisTime}, {axes.axisTime}}); + histos.add("AntiLambda/hInnerMeasuredVsExpectedArrivalTimePos", "hInnerMeasuredVsExpectedArrivalTimePos;Measured time (ps);Expected time (ps)", kTH2D, {{axes.axisTime}, {axes.axisTime}}); + histos.add("AntiLambda/hOuterMeasuredVsExpectedArrivalTimeNeg", "hOuterMeasuredVsExpectedArrivalTimeNeg;Measured time (ps);Expected time (ps)", kTH2D, {{axes.axisTime}, {axes.axisTime}}); + histos.add("AntiLambda/hOuterMeasuredVsExpectedArrivalTimePos", "hOuterMeasuredVsExpectedArrivalTimePos;Measured time (ps);Expected time (ps)", kTH2D, {{axes.axisTime}, {axes.axisTime}}); + } + } if (doprocessCascades) { if (produce.histosXi) { @@ -284,6 +388,187 @@ struct Alice3StrangenessTofPid { histos.print(); } + void processV0s(Alice3Collision const& collision, FullV0Candidates const& v0Candidates, Alice3Tracks const&, aod::McParticles const&, aod::McCollisions const&) + { + const std::array vtx = {collision.posX(), collision.posY(), collision.posZ()}; + const auto mcCollision = collision.template mcCollision_as(); + for (const auto& v0 : v0Candidates) { + const std::array v0SV = {v0.x(), v0.y(), v0.z()}; + const std::array v0P = {v0.px(), v0.py(), v0.pz()}; + o2::track::TrackParCov trackParCovV0(v0SV, v0P, ParentTrackCovMatrix, ChargeV0); + + const auto posTrack = v0.template posTrack_as(); + const auto posParticle = posTrack.template mcParticle_as(); + o2::track::TrackParCov positive = getTrackParCov(posTrack); + + const auto negTrack = v0.template negTrack_as(); + const auto negParticle = negTrack.template mcParticle_as(); + o2::track::TrackParCov negative = getTrackParCov(negTrack); + + tofPidV0.reset(); + tofPidV0.setTrack(TrackType::Positive, positive, mcCollision.t() + posParticle.vt(), pdgDB->Mass(posParticle.pdgCode())); + tofPidV0.setTrack(TrackType::Negative, negative, mcCollision.t() + negParticle.vt(), pdgDB->Mass(negParticle.pdgCode())); + tofPidV0.setTrack(TrackType::V0, trackParCovV0); // no track time + + V0TofResults straTofResultsK0S{}, straTofResultsLambda{}, straTofResultsAntiLambda{}; + straTofResultsK0S = tofPidV0.findNSigmas(vtx, v0SV); + straTofResultsLambda = tofPidV0.findNSigmas(vtx, v0SV); + straTofResultsAntiLambda = tofPidV0.findNSigmas(vtx, v0SV); + + if (produce.histosK0S) { + if (straTofResultsK0S.pos.hasInnerTof) { + histos.fill(HIST("K0S/hInnerArrivalTimeDeltaPos"), (straTofResultsK0S.pos.measuredTimeInner - straTofResultsK0S.pos.expectedTimeInner) * NanoToPico); + histos.fill(HIST("K0S/hInnerNSigmaPos"), straTofResultsK0S.pos.nSigmaInner); + histos.fill(HIST("K0S/hInnerExpectedArrivalTimePos"), straTofResultsK0S.pos.expectedTimeInner * NanoToPico); + histos.fill(HIST("K0S/hInnerMeasuredArrivalTimePos"), straTofResultsK0S.pos.measuredTimeInner * NanoToPico); + histos.fill(HIST("K0S/hInnerMeasuredVsExpectedArrivalTimePos"), straTofResultsK0S.pos.measuredTimeInner * NanoToPico, straTofResultsK0S.pos.expectedTimeInner * NanoToPico); + } + if (straTofResultsK0S.neg.hasInnerTof) { + histos.fill(HIST("K0S/hInnerArrivalTimeDeltaNeg"), (straTofResultsK0S.neg.measuredTimeInner - straTofResultsK0S.neg.expectedTimeInner) * NanoToPico); + histos.fill(HIST("K0S/hInnerNSigmaNeg"), straTofResultsK0S.neg.nSigmaInner); + histos.fill(HIST("K0S/hInnerExpectedArrivalTimeNeg"), straTofResultsK0S.neg.expectedTimeInner * NanoToPico); + histos.fill(HIST("K0S/hInnerMeasuredArrivalTimeNeg"), straTofResultsK0S.neg.measuredTimeInner * NanoToPico); + histos.fill(HIST("K0S/hInnerMeasuredVsExpectedArrivalTimeNeg"), straTofResultsK0S.neg.measuredTimeInner * NanoToPico, straTofResultsK0S.neg.expectedTimeInner * NanoToPico); + } + if (straTofResultsK0S.pos.hasOuterTof) { + histos.fill(HIST("K0S/hOuterArrivalTimeDeltaPos"), (straTofResultsK0S.pos.measuredTimeOuter - straTofResultsK0S.pos.expectedTimeOuter) * NanoToPico); + histos.fill(HIST("K0S/hOuterNSigmaPos"), straTofResultsK0S.pos.nSigmaOuter); + histos.fill(HIST("K0S/hOuterExpectedArrivalTimePos"), straTofResultsK0S.pos.expectedTimeOuter * NanoToPico); + histos.fill(HIST("K0S/hOuterMeasuredArrivalTimePos"), straTofResultsK0S.pos.measuredTimeOuter * NanoToPico); + histos.fill(HIST("K0S/hOuterMeasuredVsExpectedArrivalTimePos"), straTofResultsK0S.pos.measuredTimeOuter * NanoToPico, straTofResultsK0S.pos.expectedTimeOuter * NanoToPico); + } + if (straTofResultsK0S.neg.hasOuterTof) { + histos.fill(HIST("K0S/hOuterArrivalTimeDeltaNeg"), (straTofResultsK0S.neg.measuredTimeOuter - straTofResultsK0S.neg.expectedTimeOuter) * NanoToPico); + histos.fill(HIST("K0S/hOuterNSigmaNeg"), straTofResultsK0S.neg.nSigmaOuter); + histos.fill(HIST("K0S/hOuterExpectedArrivalTimeNeg"), straTofResultsK0S.neg.expectedTimeOuter * NanoToPico); + histos.fill(HIST("K0S/hOuterMeasuredArrivalTimeNeg"), straTofResultsK0S.neg.measuredTimeOuter * NanoToPico); + histos.fill(HIST("K0S/hOuterMeasuredVsExpectedArrivalTimeNeg"), straTofResultsK0S.neg.measuredTimeOuter * NanoToPico, straTofResultsK0S.neg.expectedTimeOuter * NanoToPico); + } + } + if (produce.histosLambda) { + if (straTofResultsLambda.pos.hasInnerTof) { + histos.fill(HIST("Lambda/hInnerArrivalTimeDeltaPos"), (straTofResultsLambda.pos.measuredTimeInner - straTofResultsLambda.pos.expectedTimeInner) * NanoToPico); + histos.fill(HIST("Lambda/hInnerNSigmaPos"), straTofResultsLambda.pos.nSigmaInner); + histos.fill(HIST("Lambda/hInnerExpectedArrivalTimePos"), straTofResultsLambda.pos.expectedTimeInner * NanoToPico); + histos.fill(HIST("Lambda/hInnerMeasuredArrivalTimePos"), straTofResultsLambda.pos.measuredTimeInner * NanoToPico); + histos.fill(HIST("Lambda/hInnerMeasuredVsExpectedArrivalTimePos"), straTofResultsLambda.pos.measuredTimeInner * NanoToPico, straTofResultsLambda.pos.expectedTimeInner * NanoToPico); + } + if (straTofResultsLambda.neg.hasInnerTof) { + histos.fill(HIST("Lambda/hInnerArrivalTimeDeltaNeg"), (straTofResultsLambda.neg.measuredTimeInner - straTofResultsLambda.neg.expectedTimeInner) * NanoToPico); + histos.fill(HIST("Lambda/hInnerNSigmaNeg"), straTofResultsLambda.neg.nSigmaInner); + histos.fill(HIST("Lambda/hInnerExpectedArrivalTimeNeg"), straTofResultsLambda.neg.expectedTimeInner * NanoToPico); + histos.fill(HIST("Lambda/hInnerMeasuredArrivalTimeNeg"), straTofResultsLambda.neg.measuredTimeInner * NanoToPico); + histos.fill(HIST("Lambda/hInnerMeasuredVsExpectedArrivalTimeNeg"), straTofResultsLambda.neg.measuredTimeInner * NanoToPico, straTofResultsLambda.neg.expectedTimeInner * NanoToPico); + } + if (straTofResultsLambda.pos.hasOuterTof) { + histos.fill(HIST("Lambda/hOuterArrivalTimeDeltaPos"), (straTofResultsLambda.pos.measuredTimeOuter - straTofResultsLambda.pos.expectedTimeOuter) * NanoToPico); + histos.fill(HIST("Lambda/hOuterNSigmaPos"), straTofResultsLambda.pos.nSigmaOuter); + histos.fill(HIST("Lambda/hOuterExpectedArrivalTimePos"), straTofResultsLambda.pos.expectedTimeOuter * NanoToPico); + histos.fill(HIST("Lambda/hOuterMeasuredArrivalTimePos"), straTofResultsLambda.pos.measuredTimeOuter * NanoToPico); + histos.fill(HIST("Lambda/hOuterMeasuredVsExpectedArrivalTimePos"), straTofResultsLambda.pos.measuredTimeOuter * NanoToPico, straTofResultsLambda.pos.expectedTimeOuter * NanoToPico); + } + if (straTofResultsLambda.neg.hasOuterTof) { + histos.fill(HIST("Lambda/hOuterArrivalTimeDeltaNeg"), (straTofResultsLambda.neg.measuredTimeOuter - straTofResultsLambda.neg.expectedTimeOuter) * NanoToPico); + histos.fill(HIST("Lambda/hOuterNSigmaNeg"), straTofResultsLambda.neg.nSigmaOuter); + histos.fill(HIST("Lambda/hOuterExpectedArrivalTimeNeg"), straTofResultsLambda.neg.expectedTimeOuter * NanoToPico); + histos.fill(HIST("Lambda/hOuterMeasuredArrivalTimeNeg"), straTofResultsLambda.neg.measuredTimeOuter * NanoToPico); + histos.fill(HIST("Lambda/hOuterMeasuredVsExpectedArrivalTimeNeg"), straTofResultsLambda.neg.measuredTimeOuter * NanoToPico, straTofResultsLambda.neg.expectedTimeOuter * NanoToPico); + } + } + if (produce.histosAntiLambda) { + if (straTofResultsAntiLambda.pos.hasInnerTof) { + histos.fill(HIST("AntiLambda/hInnerArrivalTimeDeltaPos"), (straTofResultsAntiLambda.pos.measuredTimeInner - straTofResultsAntiLambda.pos.expectedTimeInner) * NanoToPico); + histos.fill(HIST("AntiLambda/hInnerNSigmaPos"), straTofResultsAntiLambda.pos.nSigmaInner); + histos.fill(HIST("AntiLambda/hInnerExpectedArrivalTimePos"), straTofResultsAntiLambda.pos.expectedTimeInner * NanoToPico); + histos.fill(HIST("AntiLambda/hInnerMeasuredArrivalTimePos"), straTofResultsAntiLambda.pos.measuredTimeInner * NanoToPico); + histos.fill(HIST("AntiLambda/hInnerMeasuredVsExpectedArrivalTimePos"), straTofResultsAntiLambda.pos.measuredTimeInner * NanoToPico, straTofResultsAntiLambda.pos.expectedTimeInner * NanoToPico); + } + if (straTofResultsAntiLambda.neg.hasInnerTof) { + histos.fill(HIST("AntiLambda/hInnerArrivalTimeDeltaNeg"), (straTofResultsAntiLambda.neg.measuredTimeInner - straTofResultsAntiLambda.neg.expectedTimeInner) * NanoToPico); + histos.fill(HIST("AntiLambda/hInnerNSigmaNeg"), straTofResultsAntiLambda.neg.nSigmaInner); + histos.fill(HIST("AntiLambda/hInnerExpectedArrivalTimeNeg"), straTofResultsAntiLambda.neg.expectedTimeInner * NanoToPico); + histos.fill(HIST("AntiLambda/hInnerMeasuredArrivalTimeNeg"), straTofResultsAntiLambda.neg.measuredTimeInner * NanoToPico); + histos.fill(HIST("AntiLambda/hInnerMeasuredVsExpectedArrivalTimeNeg"), straTofResultsAntiLambda.neg.measuredTimeInner * NanoToPico, straTofResultsAntiLambda.neg.expectedTimeInner * NanoToPico); + } + if (straTofResultsAntiLambda.pos.hasOuterTof) { + histos.fill(HIST("AntiLambda/hOuterArrivalTimeDeltaPos"), (straTofResultsAntiLambda.pos.measuredTimeOuter - straTofResultsAntiLambda.pos.expectedTimeOuter) * NanoToPico); + histos.fill(HIST("AntiLambda/hOuterNSigmaPos"), straTofResultsAntiLambda.pos.nSigmaOuter); + histos.fill(HIST("AntiLambda/hOuterExpectedArrivalTimePos"), straTofResultsAntiLambda.pos.expectedTimeOuter * NanoToPico); + histos.fill(HIST("AntiLambda/hOuterMeasuredArrivalTimePos"), straTofResultsAntiLambda.pos.measuredTimeOuter * NanoToPico); + histos.fill(HIST("AntiLambda/hOuterMeasuredVsExpectedArrivalTimePos"), straTofResultsAntiLambda.pos.measuredTimeOuter * NanoToPico, straTofResultsAntiLambda.pos.expectedTimeOuter * NanoToPico); + } + if (straTofResultsAntiLambda.neg.hasOuterTof) { + histos.fill(HIST("AntiLambda/hOuterArrivalTimeDeltaNeg"), (straTofResultsAntiLambda.neg.measuredTimeOuter - straTofResultsAntiLambda.neg.expectedTimeOuter) * NanoToPico); + histos.fill(HIST("AntiLambda/hOuterNSigmaNeg"), straTofResultsAntiLambda.neg.nSigmaOuter); + histos.fill(HIST("AntiLambda/hOuterExpectedArrivalTimeNeg"), straTofResultsAntiLambda.neg.expectedTimeOuter * NanoToPico); + histos.fill(HIST("AntiLambda/hOuterMeasuredArrivalTimeNeg"), straTofResultsAntiLambda.neg.measuredTimeOuter * NanoToPico); + histos.fill(HIST("AntiLambda/hOuterMeasuredVsExpectedArrivalTimeNeg"), straTofResultsAntiLambda.neg.measuredTimeOuter * NanoToPico, straTofResultsAntiLambda.neg.expectedTimeOuter * NanoToPico); + } + } + + if (produce.tableInnerNSigmaK0S) { + tableA3K0SInnerTofPid( + (straTofResultsK0S.pos.hasInnerTof) ? straTofResultsK0S.pos.nSigmaInner : o2::upgrade::pid::NoPidSignal, + (straTofResultsK0S.neg.hasInnerTof) ? straTofResultsK0S.neg.nSigmaInner : o2::upgrade::pid::NoPidSignal); + } + if (produce.tableOuterNSigmaK0S) { + tableA3K0SOuterTofPid( + (straTofResultsK0S.pos.hasOuterTof) ? straTofResultsK0S.pos.nSigmaOuter : o2::upgrade::pid::NoPidSignal, + (straTofResultsK0S.neg.hasOuterTof) ? straTofResultsK0S.neg.nSigmaOuter : o2::upgrade::pid::NoPidSignal); + } + if (produce.tableInnerNSigmaLambda) { + tableA3LambdaInnerTofPid( + (straTofResultsLambda.pos.hasInnerTof) ? straTofResultsLambda.pos.nSigmaInner : o2::upgrade::pid::NoPidSignal, + (straTofResultsAntiLambda.pos.hasInnerTof) ? straTofResultsAntiLambda.pos.nSigmaInner : o2::upgrade::pid::NoPidSignal, + (straTofResultsAntiLambda.neg.hasInnerTof) ? straTofResultsAntiLambda.neg.nSigmaInner : o2::upgrade::pid::NoPidSignal, + (straTofResultsLambda.neg.hasInnerTof) ? straTofResultsLambda.neg.nSigmaInner : o2::upgrade::pid::NoPidSignal); + } + if (produce.tableOuterNSigmaLambda) { + tableA3LambdaOuterTofPid( + (straTofResultsLambda.pos.hasOuterTof) ? straTofResultsLambda.pos.nSigmaOuter : o2::upgrade::pid::NoPidSignal, + (straTofResultsAntiLambda.pos.hasOuterTof) ? straTofResultsAntiLambda.pos.nSigmaOuter : o2::upgrade::pid::NoPidSignal, + (straTofResultsAntiLambda.neg.hasOuterTof) ? straTofResultsAntiLambda.neg.nSigmaOuter : o2::upgrade::pid::NoPidSignal, + (straTofResultsLambda.neg.hasOuterTof) ? straTofResultsLambda.neg.nSigmaOuter : o2::upgrade::pid::NoPidSignal); + } + if (produce.tableInnerExpectedTimesK0S) { + tableA3K0SExpectedInnerTimes( + straTofResultsK0S.pos.expectedTimeInner, + straTofResultsK0S.neg.expectedTimeInner, + straTofResultsK0S.pos.measuredTimeInner, + straTofResultsK0S.neg.measuredTimeInner); + } + if (produce.tableOuterExpectedTimesK0S) { + tableA3K0SExpectedOuterTimes( + straTofResultsK0S.pos.expectedTimeOuter, + straTofResultsK0S.neg.expectedTimeOuter, + straTofResultsK0S.pos.measuredTimeOuter, + straTofResultsK0S.neg.measuredTimeOuter); + } + if (produce.tableInnerExpectedTimesLambda) { + tableA3LambdaExpectedInnerTimes( + straTofResultsLambda.pos.expectedTimeInner, + straTofResultsAntiLambda.pos.expectedTimeInner, + straTofResultsAntiLambda.neg.expectedTimeInner, + straTofResultsLambda.neg.expectedTimeInner, + straTofResultsLambda.pos.measuredTimeInner, + straTofResultsAntiLambda.pos.measuredTimeInner, + straTofResultsAntiLambda.neg.measuredTimeInner, + straTofResultsLambda.neg.measuredTimeInner); + } + if (produce.tableOuterExpectedTimesLambda) { + tableA3LambdaExpectedOuterTimes( + straTofResultsLambda.pos.expectedTimeOuter, + straTofResultsAntiLambda.pos.expectedTimeOuter, + straTofResultsAntiLambda.neg.expectedTimeOuter, + straTofResultsLambda.neg.expectedTimeOuter, + straTofResultsLambda.pos.measuredTimeOuter, + straTofResultsAntiLambda.pos.measuredTimeOuter, + straTofResultsAntiLambda.neg.measuredTimeOuter, + straTofResultsLambda.neg.measuredTimeOuter); + } + } + } + void processCascades(Alice3Collision const& collision, FullCascadeCandidates const& cascadeCandidates, Alice3Tracks const&, aod::McParticles const&, aod::McCollisions const&) { const std::array vtx = {collision.posX(), collision.posY(), collision.posZ()}; @@ -292,12 +577,11 @@ struct Alice3StrangenessTofPid { const std::array cascSV = {casc.x(), casc.y(), casc.z()}; const std::array cascP = {casc.px(), casc.py(), casc.pz()}; const int chargeCascade = (casc.sign() > 0) ? 1 : -1; - o2::track::TrackParCov cascade(cascSV, cascP, ParentTrackCovMatrix, chargeCascade); + o2::track::TrackParCov trackParCovCasc(cascSV, cascP, ParentTrackCovMatrix, chargeCascade); const std::array v0SV = {casc.xlambda(), casc.ylambda(), casc.zlambda()}; const std::array v0P = {casc.pxpos() + casc.pxneg(), casc.pypos() + casc.pyneg(), casc.pzpos() + casc.pzneg()}; - static constexpr int ChargeV0 = 0; - o2::track::TrackParCov v0(v0SV, v0P, ParentTrackCovMatrix, ChargeV0); + o2::track::TrackParCov trackParCovV0(v0SV, v0P, ParentTrackCovMatrix, ChargeV0); const auto bachTrack = casc.template bachelor_as(); const auto bachParticle = bachTrack.template mcParticle_as(); @@ -315,8 +599,8 @@ struct Alice3StrangenessTofPid { tofPidCasc.setTrack(TrackType::Positive, positive, mcCollision.t() + posParticle.vt(), pdgDB->Mass(posParticle.pdgCode())); tofPidCasc.setTrack(TrackType::Negative, negative, mcCollision.t() + negParticle.vt(), pdgDB->Mass(negParticle.pdgCode())); tofPidCasc.setTrack(TrackType::Bachelor, bachelor, mcCollision.t() + bachParticle.vt(), pdgDB->Mass(bachParticle.pdgCode())); - tofPidCasc.setTrack(TrackType::V0, v0); // no track time - tofPidCasc.setTrack(TrackType::Cascade, cascade); // no track time + tofPidCasc.setTrack(TrackType::V0, trackParCovV0); // no track time + tofPidCasc.setTrack(TrackType::Cascade, trackParCovCasc); // no track time CascTofResults straTofResultsXi{}, straTofResultsAntiXi{}, straTofResultsOmega{}, straTofResultsAntiOmega{}; straTofResultsXi = tofPidCasc.findNSigmas(vtx, cascSV, v0SV); @@ -505,34 +789,34 @@ struct Alice3StrangenessTofPid { if (produce.tableInnerNSigmaXi) { tableA3XiInnerTofPid( (straTofResultsXi.bach.hasInnerTof) ? straTofResultsXi.bach.nSigmaInner : o2::upgrade::pid::NoPidSignal, - (straTofResultsXi.pos.hasInnerTof) ? straTofResultsXi.bach.nSigmaInner : o2::upgrade::pid::NoPidSignal, - (straTofResultsAntiXi.pos.hasInnerTof) ? straTofResultsAntiXi.bach.nSigmaInner : o2::upgrade::pid::NoPidSignal, - (straTofResultsAntiXi.neg.hasInnerTof) ? straTofResultsAntiXi.bach.nSigmaInner : o2::upgrade::pid::NoPidSignal, - (straTofResultsXi.neg.hasInnerTof) ? straTofResultsXi.bach.nSigmaInner : o2::upgrade::pid::NoPidSignal); + (straTofResultsXi.pos.hasInnerTof) ? straTofResultsXi.pos.nSigmaInner : o2::upgrade::pid::NoPidSignal, + (straTofResultsAntiXi.pos.hasInnerTof) ? straTofResultsAntiXi.pos.nSigmaInner : o2::upgrade::pid::NoPidSignal, + (straTofResultsAntiXi.neg.hasInnerTof) ? straTofResultsAntiXi.neg.nSigmaInner : o2::upgrade::pid::NoPidSignal, + (straTofResultsXi.neg.hasInnerTof) ? straTofResultsXi.neg.nSigmaInner : o2::upgrade::pid::NoPidSignal); } if (produce.tableOuterNSigmaXi) { tableA3XiOuterTofPid( (straTofResultsXi.bach.hasOuterTof) ? straTofResultsXi.bach.nSigmaOuter : o2::upgrade::pid::NoPidSignal, - (straTofResultsXi.pos.hasOuterTof) ? straTofResultsXi.bach.nSigmaOuter : o2::upgrade::pid::NoPidSignal, - (straTofResultsAntiXi.pos.hasOuterTof) ? straTofResultsAntiXi.bach.nSigmaOuter : o2::upgrade::pid::NoPidSignal, - (straTofResultsAntiXi.neg.hasOuterTof) ? straTofResultsAntiXi.bach.nSigmaOuter : o2::upgrade::pid::NoPidSignal, - (straTofResultsXi.neg.hasOuterTof) ? straTofResultsXi.bach.nSigmaOuter : o2::upgrade::pid::NoPidSignal); + (straTofResultsXi.pos.hasOuterTof) ? straTofResultsXi.pos.nSigmaOuter : o2::upgrade::pid::NoPidSignal, + (straTofResultsAntiXi.pos.hasOuterTof) ? straTofResultsAntiXi.pos.nSigmaOuter : o2::upgrade::pid::NoPidSignal, + (straTofResultsAntiXi.neg.hasOuterTof) ? straTofResultsAntiXi.neg.nSigmaOuter : o2::upgrade::pid::NoPidSignal, + (straTofResultsXi.neg.hasOuterTof) ? straTofResultsXi.neg.nSigmaOuter : o2::upgrade::pid::NoPidSignal); } if (produce.tableInnerNSigmaOmega) { tableA3OmegaInnerTofPid( (straTofResultsOmega.bach.hasInnerTof) ? straTofResultsOmega.bach.nSigmaInner : o2::upgrade::pid::NoPidSignal, - (straTofResultsOmega.pos.hasInnerTof) ? straTofResultsOmega.bach.nSigmaInner : o2::upgrade::pid::NoPidSignal, - (straTofResultsAntiOmega.pos.hasInnerTof) ? straTofResultsAntiOmega.bach.nSigmaInner : o2::upgrade::pid::NoPidSignal, - (straTofResultsAntiOmega.neg.hasInnerTof) ? straTofResultsAntiOmega.bach.nSigmaInner : o2::upgrade::pid::NoPidSignal, - (straTofResultsOmega.neg.hasInnerTof) ? straTofResultsOmega.bach.nSigmaInner : o2::upgrade::pid::NoPidSignal); + (straTofResultsOmega.pos.hasInnerTof) ? straTofResultsOmega.pos.nSigmaInner : o2::upgrade::pid::NoPidSignal, + (straTofResultsAntiOmega.pos.hasInnerTof) ? straTofResultsAntiOmega.pos.nSigmaInner : o2::upgrade::pid::NoPidSignal, + (straTofResultsAntiOmega.neg.hasInnerTof) ? straTofResultsAntiOmega.neg.nSigmaInner : o2::upgrade::pid::NoPidSignal, + (straTofResultsOmega.neg.hasInnerTof) ? straTofResultsOmega.neg.nSigmaInner : o2::upgrade::pid::NoPidSignal); } if (produce.tableOuterNSigmaOmega) { tableA3OmegaOuterTofPid( (straTofResultsOmega.bach.hasOuterTof) ? straTofResultsOmega.bach.nSigmaOuter : o2::upgrade::pid::NoPidSignal, - (straTofResultsOmega.pos.hasOuterTof) ? straTofResultsOmega.bach.nSigmaOuter : o2::upgrade::pid::NoPidSignal, - (straTofResultsAntiOmega.pos.hasOuterTof) ? straTofResultsAntiOmega.bach.nSigmaOuter : o2::upgrade::pid::NoPidSignal, - (straTofResultsAntiOmega.neg.hasOuterTof) ? straTofResultsAntiOmega.bach.nSigmaOuter : o2::upgrade::pid::NoPidSignal, - (straTofResultsOmega.neg.hasOuterTof) ? straTofResultsOmega.bach.nSigmaOuter : o2::upgrade::pid::NoPidSignal); + (straTofResultsOmega.pos.hasOuterTof) ? straTofResultsOmega.pos.nSigmaOuter : o2::upgrade::pid::NoPidSignal, + (straTofResultsAntiOmega.pos.hasOuterTof) ? straTofResultsAntiOmega.pos.nSigmaOuter : o2::upgrade::pid::NoPidSignal, + (straTofResultsAntiOmega.neg.hasOuterTof) ? straTofResultsAntiOmega.neg.nSigmaOuter : o2::upgrade::pid::NoPidSignal, + (straTofResultsOmega.neg.hasOuterTof) ? straTofResultsOmega.neg.nSigmaOuter : o2::upgrade::pid::NoPidSignal); } if (produce.tableInnerExpectedTimesXi) { @@ -590,6 +874,7 @@ struct Alice3StrangenessTofPid { } } + PROCESS_SWITCH(Alice3StrangenessTofPid, processV0s, "", true); PROCESS_SWITCH(Alice3StrangenessTofPid, processCascades, "", true); };