From d9cb7710df235368caedf5d185dfe8475a9275e7 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Tue, 3 Feb 2026 15:15:46 +0100 Subject: [PATCH 01/28] PWGLF: update strangenesstofpid.cxx to use primary-TOF calibration --- .../Strangeness/strangenesstofpid.cxx | 74 ++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index 7689468d6bc..1de4905a65b 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -89,6 +89,7 @@ struct strangenesstofpid { Produces casctofnsigmas; // cascades: table with Nsigmas Service ccdb; + Service mTOFResponse; // mean vertex position to be used if no collision associated o2::dataformats::MeanVertexObject* mVtx = nullptr; @@ -421,6 +422,9 @@ struct strangenesstofpid { ccdb->setLocalObjectValidityChecking(); ccdb->setFatalWhenNull(false); + LOGF(info, "intializing TOFResponse"); + mTOFResponse->initSetup(ccdb, initContext); + // per event histos.add("hCandidateCounter", "hCandidateCounter", kTH1F, {{500, -0.5f, 499.5f}}); @@ -679,15 +683,20 @@ struct strangenesstofpid { struct v0TofInfo { // holds processed information regarding TOF for V0s float timeK0Short = o2::aod::v0data::kNoTOFValue; float timeLambda = o2::aod::v0data::kNoTOFValue; + float timePhoton = o2::aod::v0data::kNoTOFValue; float timePositivePr = o2::aod::v0data::kNoTOFValue; float timePositivePi = o2::aod::v0data::kNoTOFValue; + float timePositiveEl = o2::aod::v0data::kNoTOFValue; float timeNegativePr = o2::aod::v0data::kNoTOFValue; float timeNegativePi = o2::aod::v0data::kNoTOFValue; + float timeNegativeEl = o2::aod::v0data::kNoTOFValue; float timeAsPrimaryPositivePr = o2::aod::v0data::kNoTOFValue; float timeAsPrimaryPositivePi = o2::aod::v0data::kNoTOFValue; + float timeAsPrimaryPositiveEl = o2::aod::v0data::kNoTOFValue; float timeAsPrimaryNegativePr = o2::aod::v0data::kNoTOFValue; float timeAsPrimaryNegativePi = o2::aod::v0data::kNoTOFValue; + float timeAsPrimaryNegativeEl = o2::aod::v0data::kNoTOFValue; float deltaTimePositiveLambdaPi = o2::aod::v0data::kNoTOFValue; float deltaTimeNegativeLambdaPi = o2::aod::v0data::kNoTOFValue; @@ -695,6 +704,8 @@ struct strangenesstofpid { float deltaTimeNegativeLambdaPr = o2::aod::v0data::kNoTOFValue; float deltaTimePositiveK0ShortPi = o2::aod::v0data::kNoTOFValue; float deltaTimeNegativeK0ShortPi = o2::aod::v0data::kNoTOFValue; + float deltaTimePositivePhotonEl = o2::aod::v0data::kNoTOFValue; + float deltaTimeNegativePhotonEl = o2::aod::v0data::kNoTOFValue; float nSigmaPositiveLambdaPi = o2::aod::v0data::kNoTOFValue; float nSigmaPositiveLambdaPr = o2::aod::v0data::kNoTOFValue; @@ -702,15 +713,19 @@ struct strangenesstofpid { float nSigmaNegativeLambdaPr = o2::aod::v0data::kNoTOFValue; float nSigmaPositiveK0ShortPi = o2::aod::v0data::kNoTOFValue; float nSigmaNegativeK0ShortPi = o2::aod::v0data::kNoTOFValue; + float nSigmaPositivePhotonEl = o2::aod::v0data::kNoTOFValue; + float nSigmaNegativePhotonEl = o2::aod::v0data::kNoTOFValue; // extra auxiliary variables float deltaDecayTimeLambda = o2::aod::v0data::kNoTOFValue; float deltaDecayTimeAntiLambda = o2::aod::v0data::kNoTOFValue; float deltaDecayTimeK0Short = o2::aod::v0data::kNoTOFValue; + float deltaDecayTimePhoton = o2::aod::v0data::kNoTOFValue; float betaLambda = o2::aod::v0data::kNoTOFValue; float betaAntiLambda = o2::aod::v0data::kNoTOFValue; float betaK0Short = o2::aod::v0data::kNoTOFValue; + float betaPhoton = 1.f; }; // structs to hold information @@ -752,9 +767,11 @@ struct strangenesstofpid { float tofExpMom = 0.0f; float tofSignal = 0.0f; float tofEvTime = 0.0f; + float tofEvTimeErr = 0.0f; float length = 0.0f; // save TPC PID here for completeness too + float tpcNSigmaEl = 0.0f; float tpcNSigmaPi = 0.0f; float tpcNSigmaKa = 0.0f; float tpcNSigmaPr = 0.0f; @@ -850,6 +867,20 @@ struct strangenesstofpid { v0tof.nSigmaPositiveK0ShortPi = (v0tof.deltaTimePositiveK0ShortPi - hMeanPosK0Pi->Interpolate(v0.p())) / hSigmaPosK0Pi->Interpolate(v0.p()); } + v0tof.nSigmaPositiveLambdaPi = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeLambda, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + v0tof.nSigmaPositiveLambdaPr = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeLambda, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + v0tof.nSigmaPositiveK0ShortPi = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeK0Short, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + + // use nSigma from O2Physics/Common/Core/PID/PIDTOFParamService.h + // static float nSigma(const float tofSignal, + // const float tofExpMom, + // const float length, + // const float momentum, + // const float eta, + // const float tofEvTime, + // const float tofEvTimeErr, + // const o2::pid::tof::TOFResoParamsV3& params = parameters); + // do QA histograms (calibration / QC) if (doQA) { if (passesQAcuts) { @@ -928,6 +959,10 @@ struct strangenesstofpid { v0tof.nSigmaNegativeK0ShortPi = (v0tof.deltaTimeNegativeK0ShortPi - hMeanNegK0Pi->Interpolate(v0.p())) / hSigmaNegK0Pi->Interpolate(v0.p()); } + v0tof.nSigmaNegativeLambdaPi = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeLambda, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + v0tof.nSigmaNegativeLambdaPr = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeLambda, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + v0tof.nSigmaNegativeK0ShortPi = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeK0Short, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + // do QA histograms (calibration / QC) if (doQA) { if (passesQAcuts) { @@ -1128,6 +1163,14 @@ struct strangenesstofpid { } } + if (cascade.sign() < 0) { + casctof.nSigmaXiLaPr = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + casctof.nSigmaOmLaPr = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + } else { + casctof.nSigmaXiLaPi = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + casctof.nSigmaOmLaPi = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + } + // do QA histograms (calibration / QC) if (doQA) { if (passesQAcuts) { @@ -1220,6 +1263,14 @@ struct strangenesstofpid { } } + if (cascade.sign() < 0) { + casctof.nSigmaXiLaPi = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + casctof.nSigmaOmLaPi = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + } else { + casctof.nSigmaXiLaPr = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + casctof.nSigmaOmLaPr = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + } + // do QA histograms (calibration / QC) if (doQA) { if (passesQAcuts) { @@ -1310,6 +1361,14 @@ struct strangenesstofpid { } } + if (cascade.sign() < 0) { + casctof.nSigmaXiPi = mTOFResponse->nSigma(bTof.tofSignal - xiFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); + casctof.nSigmaOmKa = mTOFResponse->nSigma(bTof.tofSignal - omFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); + } else { + casctof.nSigmaXiPi = mTOFResponse->nSigma(bTof.tofSignal - xiFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); + casctof.nSigmaOmKa = mTOFResponse->nSigma(bTof.tofSignal - omFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); + } + // do QA histograms (calibration / QC) if (doQA) { if (passesQAcuts) { @@ -1354,7 +1413,7 @@ struct strangenesstofpid { return casctof; } - void processStandardData(aod::BCs const& bcs, aod::Collisions const& collisions, V0OriginalDatas const& V0s, CascOriginalDatas const& cascades, TracksWithAllExtras const& tracks, aod::BCsWithTimestamps const& /*bcs*/) + void processStandardData(/*aod::BCs const& bcs,*/ aod::Collisions const& collisions, V0OriginalDatas const& V0s, CascOriginalDatas const& cascades, TracksWithAllExtras const& tracks, aod::BCsWithTimestamps const& bcs) { // Fire up CCDB with first collision in record. If no collisions, bypass if (useCustomRunNumber || collisions.size() < 1) { @@ -1365,6 +1424,8 @@ struct strangenesstofpid { initCCDB(bc.runNumber()); } + mTOFResponse->processSetup(bcs.iteratorAt(0)); + //________________________________________________________________________ // estimate event times (only necessary for original data) std::vector collisionEventTime(collisions.size(), 0.0); @@ -1418,6 +1479,7 @@ struct strangenesstofpid { pTof.hasTOF = pTra.hasTOF(); pTof.tofExpMom = pTra.tofExpMom(); pTof.tofEvTime = reassociateTracks ? collisionEventTime[V0.collisionId()] : pTra.tofEvTime(); + pTof.tofEvTimeErr = reassociateTracks ? collisionEventTime[V0.collisionId()] : pTra.tofEvTimeErr(); pTof.tofSignal = pTra.tofSignal() + (doBCshift ? deltaTimePos : 0.0f); pTof.length = pTra.length(); pTof.tpcNSigmaPi = pTra.tpcNSigmaPi(); @@ -1429,6 +1491,7 @@ struct strangenesstofpid { nTof.hasTOF = nTra.hasTOF(); nTof.tofExpMom = nTra.tofExpMom(); nTof.tofEvTime = reassociateTracks ? collisionEventTime[V0.collisionId()] : nTra.tofEvTime(); + nTof.tofEvTimeErr = reassociateTracks ? collisionEventTime[V0.collisionId()] : nTra.tofEvTimeErr(); nTof.tofSignal = nTra.tofSignal() + (doBCshift ? deltaTimeNeg : 0.0f); nTof.length = nTra.length(); nTof.tpcNSigmaPi = nTra.tpcNSigmaPi(); @@ -1514,6 +1577,7 @@ struct strangenesstofpid { pTof.hasTOF = pTra.hasTOF(); pTof.tofExpMom = pTra.tofExpMom(); pTof.tofEvTime = reassociateTracks ? collisionEventTime[cascade.collisionId()] : pTra.tofEvTime(); + pTof.tofEvTimeErr = reassociateTracks ? collisionEventTime[cascade.collisionId()] : pTra.tofEvTimeErr(); pTof.tofSignal = pTra.tofSignal() + (doBCshift ? deltaTimePos : 0.0f); pTof.length = pTra.length(); pTof.tpcNSigmaPi = pTra.tpcNSigmaPi(); @@ -1525,6 +1589,7 @@ struct strangenesstofpid { nTof.hasTOF = nTra.hasTOF(); nTof.tofExpMom = nTra.tofExpMom(); nTof.tofEvTime = reassociateTracks ? collisionEventTime[cascade.collisionId()] : nTra.tofEvTime(); + nTof.tofEvTimeErr = reassociateTracks ? collisionEventTime[cascade.collisionId()] : nTra.tofEvTimeErr(); nTof.tofSignal = nTra.tofSignal() + (doBCshift ? deltaTimeNeg : 0.0f); nTof.length = nTra.length(); nTof.tpcNSigmaPi = nTra.tpcNSigmaPi(); @@ -1536,6 +1601,7 @@ struct strangenesstofpid { bTof.hasTOF = bTra.hasTOF(); bTof.tofExpMom = bTra.tofExpMom(); bTof.tofEvTime = reassociateTracks ? collisionEventTime[cascade.collisionId()] : bTra.tofEvTime(); + bTof.tofEvTimeErr = reassociateTracks ? collisionEventTime[cascade.collisionId()] : bTra.tofEvTimeErr(); bTof.tofSignal = bTra.tofSignal() + (doBCshift ? deltaTimeBach : 0.0f); bTof.length = bTra.length(); bTof.tpcNSigmaPi = bTra.tpcNSigmaPi(); @@ -1639,6 +1705,7 @@ struct strangenesstofpid { pTof.collisionId = pTofExt.straCollisionId(); pTof.tofExpMom = pTofExt.tofExpMom(); pTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTime(); + // pTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTimeErr(); pTof.tofSignal = pTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f); pTof.length = pTofExt.length(); } @@ -1664,6 +1731,7 @@ struct strangenesstofpid { nTof.collisionId = nTofExt.straCollisionId(); nTof.tofExpMom = nTofExt.tofExpMom(); nTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTime(); + // nTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTimeErr(); nTof.tofSignal = nTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f); nTof.length = nTofExt.length(); } @@ -1731,6 +1799,7 @@ struct strangenesstofpid { pTof.collisionId = pTofExt.straCollisionId(); pTof.tofExpMom = pTofExt.tofExpMom(); pTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTime(); + // pTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTimeErr(); pTof.tofSignal = pTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f); pTof.length = pTofExt.length(); } @@ -1755,6 +1824,7 @@ struct strangenesstofpid { nTof.collisionId = nTofExt.straCollisionId(); nTof.tofExpMom = nTofExt.tofExpMom(); nTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTime(); + // nTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTimeErr(); nTof.tofSignal = nTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f); nTof.length = nTofExt.length(); } @@ -1779,6 +1849,7 @@ struct strangenesstofpid { bTof.collisionId = bTofExt.straCollisionId(); bTof.tofExpMom = bTofExt.tofExpMom(); bTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : bTofExt.tofEvTime(); + // bTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : bTofExt.tofEvTimeErr(); bTof.tofSignal = bTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f); bTof.length = bTofExt.length(); } @@ -1808,6 +1879,7 @@ struct strangenesstofpid { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { + o2::pid::tof::TOFResponseImpl::metadataInfo.initMetadata(cfgc); return WorkflowSpec{ adaptAnalysisTask(cfgc)}; } From 6a6f713ffb21887926c5f69816fc926b26dae0c1 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Wed, 4 Feb 2026 01:23:39 +0100 Subject: [PATCH 02/28] Add TOFEvTimeErr column and update DauTrackTOFPIDs Added TOFEvTimeErr column and updated table version. --- PWGLF/DataModel/LFStrangenessPIDTables.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/PWGLF/DataModel/LFStrangenessPIDTables.h b/PWGLF/DataModel/LFStrangenessPIDTables.h index a5ada65c32c..780e2fd256d 100644 --- a/PWGLF/DataModel/LFStrangenessPIDTables.h +++ b/PWGLF/DataModel/LFStrangenessPIDTables.h @@ -112,6 +112,7 @@ DECLARE_SOA_INDEX_COLUMN(DauTrackExtra, dauTrackExtra); //! point to daughter th DECLARE_SOA_INDEX_COLUMN(StraCollision, straCollision); //! point to collision associated with this track (not the V0/Casc) DECLARE_SOA_COLUMN(TOFSignal, tofSignal, float); //! track TOF signal DECLARE_SOA_COLUMN(TOFEvTime, tofEvTime, float); //! event time +DECLARE_SOA_COLUMN(TOFEvTimeErr, tofEvTimeErr, float); //! event time error for TOF DECLARE_SOA_COLUMN(Length, length, float); //! track length (to assigned PV) DECLARE_SOA_COLUMN(TOFExpMom, tofExpMom, float); //! tof Exp Mom (to assigned PV) @@ -171,7 +172,17 @@ DECLARE_SOA_TABLE_VERSIONED(DauTrackTOFPIDs_001, "AOD", "DAUTRACKTOFPID", 1, // dautrack::TOFExpTimeKa, dautrack::TOFExpTimePr); -using DauTrackTOFPIDs = DauTrackTOFPIDs_001; // second gen: with collision Id, with TOFExpMom +DECLARE_SOA_TABLE_VERSIONED(DauTrackTOFPIDs_002, "AOD", "DAUTRACKTOFPID", 2, // raw table (for posterior TOF calculation) + o2::soa::Index<>, + dautrack::StraCollisionId, dautrack::DauTrackExtraId, + dautrack::TOFSignal, dautrack::TOFEvTime, dautrack::TOFEvTimeErr, + dautrack::Length, dautrack::TOFExpMom, + dautrack::TOFExpTimeEl, + dautrack::TOFExpTimePi, + dautrack::TOFExpTimeKa, + dautrack::TOFExpTimePr); + +using DauTrackTOFPIDs = DauTrackTOFPIDs_002; // second gen: with collision Id, with TOFExpMom namespace v0data { From f94d50b4fc90552781ff003bef9a5a1d9ad33819 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Wed, 4 Feb 2026 01:24:51 +0100 Subject: [PATCH 03/28] Update DauTrackTOFPID in stradautrackstofpidconverter task --- .../Strangeness/Converters/stradautrackstofpidconverter.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx index 4642ec95bb5..8509f93c560 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx +++ b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx @@ -45,7 +45,7 @@ struct stradautrackstofpidconverter { lTOFEvTimes[casc.bachTrackExtraId()] = casc.bachTOFEventTime(); } for (unsigned int ii = 0; ii < dauTracks.size(); ii++) { - dautracktofpids(-1, -1, lTOFSignals[ii], lTOFEvTimes[ii], lLengths[ii], 0.0f); + dautracktofpids(-1, -1, lTOFSignals[ii], lTOFEvTimes[ii], 999.0f /*dummy event time error for TOF*/, lLengths[ii], 0.0f); } } }; From fb06b586246c86a5df4cfbf0337724464309bd3e Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Wed, 4 Feb 2026 01:26:05 +0100 Subject: [PATCH 04/28] Add stradautrackstofpidconverter3 --- PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt index 83dfdaa3a36..9c10f29778e 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt +++ b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt @@ -29,6 +29,11 @@ o2physics_add_dpl_workflow(stradautrackstofpidconverter2 PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(stradautrackstofpidconverter3 + SOURCES stradautrackstofpidconverter3.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(stradautracksextraconverter SOURCES stradautracksextraconverter.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore From a61065d39c58648a1e737198f757a9e29b45b98e Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Wed, 4 Feb 2026 01:26:47 +0100 Subject: [PATCH 05/28] Add stradautrackstofpidconverter3 --- .../stradautrackstofpidconverter3.cxx | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx diff --git a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx new file mode 100644 index 00000000000..8cc54950a9d --- /dev/null +++ b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx @@ -0,0 +1,45 @@ +// 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. +#include "PWGLF/DataModel/LFStrangenessPIDTables.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" + +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +using namespace o2; +using namespace o2::framework; + +// converts DauTrackTOFPIDs_001 to _002 +struct stradautrackstofpidconverter3 { + Produces dautracktofpids; + + void process(aod::DauTrackTOFPIDs_001 const& dauTracks) + { + // create new TOFPIDs + for (const auto& dauTrack : dauTracks) { + dautracktofpids( + -1, + -1, + dauTrack.tofSignal(), + dauTrack.tofEvTime(), + 999.0f, /*dummy event time error for TOF*/ + dauTrack.length(), + 0.0f); + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From 0e57826be5b5b37bd7829c4230a74e2b1b31f6d1 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Wed, 4 Feb 2026 01:27:49 +0100 Subject: [PATCH 06/28] Add event time error in dauTrackTOFPIDs filling --- PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index a68b06b4b79..0228f93a01b 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -837,7 +837,7 @@ struct strangederivedbuilder { aod::dautrack::packing::packInInt8(tr.tpcNSigmaPr())); // populate daughter-level TOF information if (tr.hasTOF()) { - products.dauTrackTOFPIDs(tr.collisionId(), products.dauTrackExtras.lastIndex(), tr.tofSignal(), tr.tofEvTime(), tr.length(), tr.tofExpMom()); + products.dauTrackTOFPIDs(tr.collisionId(), products.dauTrackExtras.lastIndex(), tr.tofSignal(), tr.tofEvTime(), tr.tofEvTimeErr(), tr.length(), tr.tofExpMom()); } } else { // populate with empty fully-compatible Nsigmas if no corresponding table available From 866c30d1f7637563d7bec37b9c88dcc20b40d184 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Wed, 4 Feb 2026 14:54:00 +0100 Subject: [PATCH 07/28] PWGLF: add photon part in strangenesstofpid.cxx --- .../Strangeness/strangenesstofpid.cxx | 39 ++++++++++++++----- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index 1de4905a65b..74f0be90ba8 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -70,7 +70,7 @@ using std::array; // For original data loops using V0OriginalDatas = soa::Join; using CascOriginalDatas = soa::Join; -using TracksWithAllExtras = soa::Join; +using TracksWithAllExtras = soa::Join; // For derived data analysis using dauTracks = soa::Join; @@ -530,6 +530,8 @@ struct strangenesstofpid { histos.add("h2dNSigmaNegativeLambdaPr", "h2dNSigmaNegativeLambdaPr", {HistType::kTH2F, {axes.axisP, axes.axisNSigma}}); histos.add("h2dNSigmaPositiveK0ShortPi", "h2dNSigmaPositiveK0ShortPi", {HistType::kTH2F, {axes.axisP, axes.axisNSigma}}); histos.add("h2dNSigmaNegativeK0ShortPi", "h2dNSigmaNegativeK0ShortPi", {HistType::kTH2F, {axes.axisP, axes.axisNSigma}}); + histos.add("h2dNSigmaPositivePhotonEl", "h2dNSigmaPositivePhotonEl", {HistType::kTH2F, {axes.axisP, axes.axisNSigma}}); + histos.add("h2dNSigmaNegativePhotonEl", "h2dNSigmaNegativePhotonEl", {HistType::kTH2F, {axes.axisP, axes.axisNSigma}}); } if (calculateCascades.value > 0) { @@ -725,7 +727,7 @@ struct strangenesstofpid { float betaLambda = o2::aod::v0data::kNoTOFValue; float betaAntiLambda = o2::aod::v0data::kNoTOFValue; float betaK0Short = o2::aod::v0data::kNoTOFValue; - float betaPhoton = 1.f; + float betaPhoton = o2::aod::v0data::kNoTOFValue; }; // structs to hold information @@ -798,8 +800,10 @@ struct strangenesstofpid { float lengthV0 = std::hypot(v0.x() - collision.posX(), v0.y() - collision.posY(), v0.z() - collision.posZ()); float velocityK0Short = velocity(v0.p(), o2::constants::physics::MassKaonNeutral); float velocityLambda = velocity(v0.p(), o2::constants::physics::MassLambda); - v0tof.timeK0Short = lengthV0 / velocityK0Short; // in picoseconds - v0tof.timeLambda = lengthV0 / velocityLambda; // in picoseconds + float velocityPhoton = TMath::C() * 1e-12 * 1e+2; // cm/ps + v0tof.timeK0Short = lengthV0 / velocityK0Short; // in picoseconds + v0tof.timeLambda = lengthV0 / velocityLambda; // in picoseconds + v0tof.timePhoton = lengthV0 / velocityPhoton; // in picoseconds //_____________________________________________________________________________________________ // define simple checks @@ -813,6 +817,9 @@ struct strangenesstofpid { bool k0ShortCandidate = std::abs(v0.mK0Short() - o2::constants::physics::MassKaonNeutral) < v0Group.qaMassWindow && std::abs(pTof.tpcNSigmaPi) < v0Group.qaTPCNSigma && std::abs(nTof.tpcNSigmaPi) < v0Group.qaTPCNSigma; + bool photonCandidate = std::abs(v0.mGamma() - o2::constants::physics::MassPhoton) < v0Group.qaMassWindow && + std::abs(pTof.tpcNSigmaEl) < v0Group.qaTPCNSigma && + std::abs(nTof.tpcNSigmaEl) < v0Group.qaTPCNSigma; bool pValidTOF = rejectUndefinedTof.value ? static_cast(std::fabs(pTof.tofSignal) > o2::aod::v0data::kEpsilon) : true; bool nValidTOF = rejectUndefinedTof.value ? static_cast(std::fabs(nTof.tofSignal) > o2::aod::v0data::kEpsilon) : true; @@ -867,6 +874,7 @@ struct strangenesstofpid { v0tof.nSigmaPositiveK0ShortPi = (v0tof.deltaTimePositiveK0ShortPi - hMeanPosK0Pi->Interpolate(v0.p())) / hSigmaPosK0Pi->Interpolate(v0.p()); } + v0tof.nSigmaPositivePhotonEl = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timePhoton, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); v0tof.nSigmaPositiveLambdaPi = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeLambda, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); v0tof.nSigmaPositiveLambdaPr = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeLambda, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); v0tof.nSigmaPositiveK0ShortPi = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeK0Short, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); @@ -908,6 +916,11 @@ struct strangenesstofpid { histos.fill(HIST("h2dNSigmaPositiveK0ShortPi"), v0.pt(), v0tof.nSigmaPositiveK0ShortPi); } } + if (photonCandidate) { + if (doQANSigma && std::fabs(v0tof.nSigmaPositivePhotonEl - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon) { + histos.fill(HIST("h2dNSigmaPositivePhotonEl"), v0.pt(), v0tof.nSigmaPositivePhotonEl); + } + } } } } @@ -959,6 +972,7 @@ struct strangenesstofpid { v0tof.nSigmaNegativeK0ShortPi = (v0tof.deltaTimeNegativeK0ShortPi - hMeanNegK0Pi->Interpolate(v0.p())) / hSigmaNegK0Pi->Interpolate(v0.p()); } + v0tof.nSigmaNegativePhotonEl = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timePhoton, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); v0tof.nSigmaNegativeLambdaPi = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeLambda, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); v0tof.nSigmaNegativeLambdaPr = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeLambda, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); v0tof.nSigmaNegativeK0ShortPi = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeK0Short, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); @@ -990,6 +1004,11 @@ struct strangenesstofpid { histos.fill(HIST("h2dNSigmaNegativeK0ShortPi"), v0.pt(), v0tof.nSigmaNegativeK0ShortPi); } } + if (photonCandidate) { + if (doQANSigma && std::fabs(v0tof.nSigmaNegativePhotonEl - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon) { + histos.fill(HIST("h2dNSigmaNegativePhotonEl"), v0.pt(), v0tof.nSigmaNegativePhotonEl); + } + } } } } @@ -1482,6 +1501,7 @@ struct strangenesstofpid { pTof.tofEvTimeErr = reassociateTracks ? collisionEventTime[V0.collisionId()] : pTra.tofEvTimeErr(); pTof.tofSignal = pTra.tofSignal() + (doBCshift ? deltaTimePos : 0.0f); pTof.length = pTra.length(); + pTof.tpcNSigmaEl = pTra.tpcNSigmaEl(); pTof.tpcNSigmaPi = pTra.tpcNSigmaPi(); pTof.tpcNSigmaPr = pTra.tpcNSigmaPr(); @@ -1494,6 +1514,7 @@ struct strangenesstofpid { nTof.tofEvTimeErr = reassociateTracks ? collisionEventTime[V0.collisionId()] : nTra.tofEvTimeErr(); nTof.tofSignal = nTra.tofSignal() + (doBCshift ? deltaTimeNeg : 0.0f); nTof.length = nTra.length(); + nTof.tpcNSigmaEl = nTra.tpcNSigmaEl(); nTof.tpcNSigmaPi = nTra.tpcNSigmaPi(); nTof.tpcNSigmaPr = nTra.tpcNSigmaPr(); @@ -1705,7 +1726,7 @@ struct strangenesstofpid { pTof.collisionId = pTofExt.straCollisionId(); pTof.tofExpMom = pTofExt.tofExpMom(); pTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTime(); - // pTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTimeErr(); + pTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTimeErr(); pTof.tofSignal = pTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f); pTof.length = pTofExt.length(); } @@ -1731,7 +1752,7 @@ struct strangenesstofpid { nTof.collisionId = nTofExt.straCollisionId(); nTof.tofExpMom = nTofExt.tofExpMom(); nTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTime(); - // nTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTimeErr(); + nTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTimeErr(); nTof.tofSignal = nTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f); nTof.length = nTofExt.length(); } @@ -1799,7 +1820,7 @@ struct strangenesstofpid { pTof.collisionId = pTofExt.straCollisionId(); pTof.tofExpMom = pTofExt.tofExpMom(); pTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTime(); - // pTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTimeErr(); + pTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTimeErr(); pTof.tofSignal = pTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f); pTof.length = pTofExt.length(); } @@ -1824,7 +1845,7 @@ struct strangenesstofpid { nTof.collisionId = nTofExt.straCollisionId(); nTof.tofExpMom = nTofExt.tofExpMom(); nTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTime(); - // nTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTimeErr(); + nTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTimeErr(); nTof.tofSignal = nTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f); nTof.length = nTofExt.length(); } @@ -1849,7 +1870,7 @@ struct strangenesstofpid { bTof.collisionId = bTofExt.straCollisionId(); bTof.tofExpMom = bTofExt.tofExpMom(); bTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : bTofExt.tofEvTime(); - // bTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : bTofExt.tofEvTimeErr(); + bTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : bTofExt.tofEvTimeErr(); bTof.tofSignal = bTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f); bTof.length = bTofExt.length(); } From 1dc83338ed2a49d150bb4037e60832baac271bf3 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Thu, 5 Feb 2026 17:51:38 +0100 Subject: [PATCH 08/28] use evTime and evTimeErr from primary-TOF task and add wrong hypothesis --- PWGLF/DataModel/LFStrangenessPIDTables.h | 69 ++- .../Strangeness/strangenesstofpid.cxx | 399 +++++++++--------- 2 files changed, 269 insertions(+), 199 deletions(-) diff --git a/PWGLF/DataModel/LFStrangenessPIDTables.h b/PWGLF/DataModel/LFStrangenessPIDTables.h index 780e2fd256d..927dba1c454 100644 --- a/PWGLF/DataModel/LFStrangenessPIDTables.h +++ b/PWGLF/DataModel/LFStrangenessPIDTables.h @@ -180,7 +180,7 @@ DECLARE_SOA_TABLE_VERSIONED(DauTrackTOFPIDs_002, "AOD", "DAUTRACKTOFPID", 2, // dautrack::TOFExpTimeEl, dautrack::TOFExpTimePi, dautrack::TOFExpTimeKa, - dautrack::TOFExpTimePr); + dautrack::TOFExpTimePr); using DauTrackTOFPIDs = DauTrackTOFPIDs_002; // second gen: with collision Id, with TOFExpMom @@ -222,6 +222,34 @@ 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 +// for wrong hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaElPosFromPhoton, tofNSigmaElPosFromPhoton, float); //! n sigma of positive track from photon conversion under electron hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaElNegFromPhoton, tofNSigmaElNegFromPhoton, float); //! n sigma of negative track from photon conversion under electron hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaPiPosFromPhoton, tofNSigmaPiPosFromPhoton, float); //! n sigma of positive track from photon conversion under pion hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaPiNegFromPhoton, tofNSigmaPiNegFromPhoton, float); //! n sigma of negative track from photon conversion under pion hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaKaPosFromPhoton, tofNSigmaKaPosFromPhoton, float); //! n sigma of positive track from photon conversion under kaon hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaKaNegFromPhoton, tofNSigmaKaNegFromPhoton, float); //! n sigma of negative track from photon conversion under kaon hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaPrPosFromPhoton, tofNSigmaPrPosFromPhoton, float); //! n sigma of positive track from photon conversion under proton hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaPrNegFromPhoton, tofNSigmaPrNegFromPhoton, float); //! n sigma of negative track from photon conversion under proton hypothesis + +DECLARE_SOA_COLUMN(TOFNSigmaElPosFromK0S, tofNSigmaElPosFromK0S, float); //! n sigma of positive track from K0S under electron hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaElNegFromK0S, tofNSigmaElNegFromK0S, float); //! n sigma of negative track from K0S under electron hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaPiPosFromK0S, tofNSigmaPiPosFromK0S, float); //! n sigma of positive track from K0S under pion hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaPiNegFromK0S, tofNSigmaPiNegFromK0S, float); //! n sigma of negative track from K0S under pion hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaKaPosFromK0S, tofNSigmaKaPosFromK0S, float); //! n sigma of positive track from K0S under kaon hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaKaNegFromK0S, tofNSigmaKaNegFromK0S, float); //! n sigma of negative track from K0S under kaon hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaPrPosFromK0S, tofNSigmaPrPosFromK0S, float); //! n sigma of positive track from K0S under proton hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaPrNegFromK0S, tofNSigmaPrNegFromK0S, float); //! n sigma of negative track from K0S under proton hypothesis + +DECLARE_SOA_COLUMN(TOFNSigmaElPosFromLambda, tofNSigmaElPosFromLambda, float); //! n sigma of positive track from Lambda under electron hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaElNegFromLambda, tofNSigmaElNegFromLambda, float); //! n sigma of negative track from Lambda under electron hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaPiPosFromLambda, tofNSigmaPiPosFromLambda, float); //! n sigma of positive track from Lambda under pion hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaPiNegFromLambda, tofNSigmaPiNegFromLambda, float); //! n sigma of negative track from Lambda under pion hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaKaPosFromLambda, tofNSigmaKaPosFromLambda, float); //! n sigma of positive track from Lambda under kaon hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaKaNegFromLambda, tofNSigmaKaNegFromLambda, float); //! n sigma of negative track from Lambda under kaon hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaPrPosFromLambda, tofNSigmaPrPosFromLambda, float); //! n sigma of positive track from Lambda under proton hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaPrNegFromLambda, tofNSigmaPrNegFromLambda, float); //! n sigma of negative track from Lambda under proton hypothesis + // dynamics to replace hasTOF (note: that condition does not match track hasTOF!) // note: only single hypothesis check necessary; other hypotheses will always be valid DECLARE_SOA_DYNAMIC_COLUMN(PositiveHasTOF, positiveHasTOF, //! positive daughter TOF calculation valid @@ -328,6 +356,16 @@ DECLARE_SOA_TABLE(V0TOFNSigmas, "AOD", "V0TOFNSIGMA", // processed NSigma table v0data::TofAntiLambdaCompatibility, v0data::TofK0ShortCompatibility); +DECLARE_SOA_TABLE(V0TOFNSigmasAll, "AOD", "V0TOFNSIGMAALL", // processed NSigma table (for analysis) including wrong hypothesis + v0data::TOFNSigmaElPosFromPhoton, v0data::TOFNSigmaElPosFromK0S, v0data::TOFNSigmaElPosFromLambda, + v0data::TOFNSigmaElNegFromPhoton, v0data::TOFNSigmaElNegFromK0S, v0data::TOFNSigmaElNegFromLambda, + v0data::TOFNSigmaPiPosFromPhoton, v0data::TOFNSigmaPiPosFromK0S, v0data::TOFNSigmaPiPosFromLambda, + v0data::TOFNSigmaPiNegFromPhoton, v0data::TOFNSigmaPiNegFromK0S, v0data::TOFNSigmaPiNegFromLambda, + v0data::TOFNSigmaKaPosFromPhoton, v0data::TOFNSigmaKaPosFromK0S, v0data::TOFNSigmaKaPosFromLambda, + v0data::TOFNSigmaKaNegFromPhoton, v0data::TOFNSigmaKaNegFromK0S, v0data::TOFNSigmaKaNegFromLambda, + v0data::TOFNSigmaPrPosFromPhoton, v0data::TOFNSigmaPrPosFromK0S, v0data::TOFNSigmaPrPosFromLambda, + v0data::TOFNSigmaPrNegFromPhoton, v0data::TOFNSigmaPrNegFromK0S, v0data::TOFNSigmaPrNegFromLambda); + namespace cascdata { // define constants for NSigma operation @@ -365,6 +403,27 @@ DECLARE_SOA_COLUMN(TOFNSigmaOmLaPi, tofNSigmaOmLaPi, float); //! meson track NSi 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 +// for wrong hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaElFromLambdaFromXi, tofNSigmaElFromLambdaFromXi, float); //! nigma of positive track from Lambda from Xi under electron hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaElFromXi, tofNSigmaElFromXi, float); //! nigma of bachelor track from Xi under electron hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaElFromLambdaFromOmega, tofNSigmaElFromLambdaFromOmega, float); //! nigma of positive track from Lambda from Omega under electron hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaElFromOmega, tofNSigmaElFromOmega, float); //! nigma of bachelor track from Omega under electron hypothesis + +DECLARE_SOA_COLUMN(TOFNSigmaPiFromLambdaFromXi, tofNSigmaPiFromLambdaFromXi, float); //! nigma of positive track from Lambda from Xi under pion hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaPiFromXi, tofNSigmaPiFromXi, float); //! nigma of bachelor track from Xi under pion hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaPiFromLambdaFromOmega, tofNSigmaPiFromLambdaFromOmega, float); //! nigma of positive track from Lambda from Omega under pion hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaPiFromOmega, tofNSigmaPiFromOmega, float); //! nigma of bachelor track from Omega under pion hypothesis + +DECLARE_SOA_COLUMN(TOFNSigmaKaFromLambdaFromXi, tofNSigmaKaFromLambdaFromXi, float); //! nigma of positive track from Lambda from Xi under kaon hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaKaFromXi, tofNSigmaKaFromXi, float); //! nigma of bachelor track from Xi under kaon hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaKaFromLambdaFromOmega, tofNSigmaKaFromLambdaFromOmega, float); //! nigma of positive track from Lambda from Omega under kaon hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaKaFromOmega, tofNSigmaKaFromOmega, float); //! nigma of bachelor track from Omega under kaon hypothesis + +DECLARE_SOA_COLUMN(TOFNSigmaPrFromLambdaFromXi, tofNSigmaPrFromLambdaFromXi, float); //! nigma of positive track from Lambda from Xi under proton hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaPrFromXi, tofNSigmaPrFromXi, float); //! nigma of bachelor track from Xi under proton hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaPrFromLambdaFromOmega, tofNSigmaPrFromLambdaFromOmega, float); //! nigma of positive track from Lambda from Omega under proton hypothesis +DECLARE_SOA_COLUMN(TOFNSigmaPrFromOmega, tofNSigmaPrFromOmega, float); //! nigma of bachelor track from Omega under proton hypothesis + // dynamics to replace hasTOF (note: that condition does not match track hasTOF!) // note: only single hypothesis check necessary; other hypotheses will always be valid DECLARE_SOA_DYNAMIC_COLUMN(PositiveHasTOF, positiveHasTOF, //! positive daughter TOF calculation valid @@ -440,6 +499,7 @@ DECLARE_SOA_TABLE(CascTOFPIDs, "AOD", "CASCTOFPID", // processed information for cascdata::PosTOFDeltaTOmPi, cascdata::PosTOFDeltaTOmPr, cascdata::NegTOFDeltaTOmPi, cascdata::NegTOFDeltaTOmPr, cascdata::BachTOFDeltaTOmKa); + DECLARE_SOA_TABLE(CascTOFNSigmas, "AOD", "CascTOFNSigmas", // Nsigmas for cascades cascdata::TOFNSigmaXiLaPi, cascdata::TOFNSigmaXiLaPr, cascdata::TOFNSigmaXiPi, cascdata::TOFNSigmaOmLaPi, cascdata::TOFNSigmaOmLaPr, cascdata::TOFNSigmaOmKa, @@ -448,6 +508,13 @@ DECLARE_SOA_TABLE(CascTOFNSigmas, "AOD", "CascTOFNSigmas", // Nsigmas for cascad cascdata::BachelorHasTOF, cascdata::TofXiCompatibility, cascdata::TofOmegaCompatibility); + +DECLARE_SOA_TABLE(CascTOFNSigmasAll, "AOD", "CascTOFNSigmasAll", // Nsigmas for cascades including wrong hypothesis + cascdata::TOFNSigmaElFromLambdaFromXi, cascdata::TOFNSigmaElFromXi, cascdata::TOFNSigmaElFromLambdaFromOmega, cascdata::TOFNSigmaElFromOmega, + cascdata::TOFNSigmaPiFromLambdaFromXi, cascdata::TOFNSigmaPiFromXi, cascdata::TOFNSigmaPiFromLambdaFromOmega, cascdata::TOFNSigmaPiFromOmega, + cascdata::TOFNSigmaKaFromLambdaFromXi, cascdata::TOFNSigmaKaFromXi, cascdata::TOFNSigmaKaFromLambdaFromOmega, cascdata::TOFNSigmaKaFromOmega, + cascdata::TOFNSigmaPrFromLambdaFromXi, cascdata::TOFNSigmaPrFromXi, cascdata::TOFNSigmaPrFromLambdaFromOmega, cascdata::TOFNSigmaPrFromOmega); + } // namespace o2::aod #endif // PWGLF_DATAMODEL_LFSTRANGENESSPIDTABLES_H_ diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index 74f0be90ba8..e27a333e67e 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -88,6 +88,9 @@ struct strangenesstofpid { Produces casctofpids; // cascades: table with base info Produces casctofnsigmas; // cascades: table with Nsigmas + Produces v0tofnsigmasall; // table with nsigmas including wrong hypothesis + Produces casctofnsigmasall; // cascades: table with Nsigmas including wrong hypothesis + Service ccdb; Service mTOFResponse; @@ -107,6 +110,9 @@ struct strangenesstofpid { Configurable doBCshift{"doBCshift", true, "if true, perform time shift for collisions in different BCs when reassigning"}; Configurable rejectUndefinedTof{"rejectUndefinedTof", true, "if true, reject tracks with TOF signal 0.000f for safety"}; + Configurable calculateV0sNSigmaAll{"calculateV0sNSigmaAll", -1, "calculate all V0-related TOF n sigma(0: no, 1: yes, -1: auto)"}; + Configurable calculateCascadesNSigmaAll{"calculateCascadesNSigmaAll", -1, "calculate all cascade-related TOF n sigma(0: no, 1: yes, -1: auto)"}; + // auxiliary / debug tables as desired Configurable calculateV0TOFPIDs{"calculateV0TOFPIDs", -1, "calculate V0TOFPIDs table (0: no, 1: yes, -1: auto)"}; Configurable calculateV0TOFBetas{"calculateV0TOFBetas", -1, "calculate V0TOFBetas table (0: no, 1: yes, -1: auto)"}; @@ -150,7 +156,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 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"}; } ccdbConfigurations; @@ -183,26 +188,6 @@ struct strangenesstofpid { ConfigurableAxis axisTimeLong{"axisTimeLong", {3000, -1500000.0f, 1500000.0f}, "time (ps)"}; } axes; // aggregate axes fo simplicity of navigation in HY - // for n-sigma calibration - bool nSigmaCalibLoaded; - TList* nSigmaCalibObjects = nullptr; - TH1 *hMeanPosLaPi = nullptr, *hSigmaPosLaPi = nullptr; - TH1 *hMeanPosLaPr = nullptr, *hSigmaPosLaPr = nullptr; - TH1 *hMeanNegLaPi = nullptr, *hSigmaNegLaPi = nullptr; - TH1 *hMeanNegLaPr = nullptr, *hSigmaNegLaPr = nullptr; - TH1 *hMeanPosK0Pi = nullptr, *hSigmaPosK0Pi = nullptr; - TH1 *hMeanNegK0Pi = nullptr, *hSigmaNegK0Pi = nullptr; - TH1 *hMeanPosXiPi = nullptr, *hSigmaPosXiPi = nullptr; - TH1 *hMeanPosXiPr = nullptr, *hSigmaPosXiPr = nullptr; - TH1 *hMeanNegXiPi = nullptr, *hSigmaNegXiPi = nullptr; - TH1 *hMeanNegXiPr = nullptr, *hSigmaNegXiPr = nullptr; - TH1 *hMeanBachXiPi = nullptr, *hSigmaBachXiPi = nullptr; - TH1 *hMeanPosOmPi = nullptr, *hSigmaPosOmPi = nullptr; - TH1 *hMeanPosOmPr = nullptr, *hSigmaPosOmPr = nullptr; - TH1 *hMeanNegOmPi = nullptr, *hSigmaNegOmPi = nullptr; - TH1 *hMeanNegOmPr = nullptr, *hSigmaNegOmPr = nullptr; - TH1 *hMeanBachOmKa = nullptr, *hSigmaBachOmKa = nullptr; - int mRunNumber; float d_bz; float maxSnp; // max sine phi for propagation @@ -395,22 +380,20 @@ struct strangenesstofpid { } } - nSigmaCalibLoaded = false; - nSigmaCalibObjects = nullptr; - - // for n-sigma calibration - hMeanPosLaPi = nullptr; - hSigmaPosLaPi = nullptr; - hMeanPosLaPr = nullptr; - hSigmaPosLaPr = nullptr; - hMeanNegLaPi = nullptr; - hSigmaNegLaPi = nullptr; - hMeanNegLaPr = nullptr; - hSigmaNegLaPr = nullptr; - hMeanPosK0Pi = nullptr; - hSigmaNegK0Pi = nullptr; - hMeanNegK0Pi = nullptr; - hSigmaNegK0Pi = nullptr; + if (calculateV0sNSigmaAll.value < 0) { + // check if TOF information is required, enable if so + calculateV0sNSigmaAll.value = isTableRequiredInWorkflow(initContext, "V0TOFNSigmasAll"); + if (calculateV0sNSigmaAll.value > 0) { + LOGF(info, "Strangeness TOF PID: all V0 TOF PID calculations enabled automatically"); + } + } + if (calculateCascadesNSigmaAll.value < 0) { + // check if TOF information is required, enable if so + calculateCascadesNSigmaAll.value = isTableRequiredInWorkflow(initContext, "CascTOFNSigmasAll"); + if (calculateCascadesNSigmaAll.value > 0) { + LOGF(info, "Strangeness TOF PID: all Cascade TOF PID calculations enabled automatically"); + } + } mRunNumber = 0; d_bz = 0; @@ -587,80 +570,6 @@ struct strangenesstofpid { LOG(info) << "Retrieved GRP for run " << runNumber << " with magnetic field of " << d_bz << " kZG"; } - // if TOF Nsigma desired - if (doNSigmas) { - nSigmaCalibObjects = ccdb->getForRun(ccdbConfigurations.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")); - 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!"; - } - } - } - // if (calculationMethod.value > 0 && !lut) { // // setMatLUT only after magfield has been initalized // // (setMatLUT has implicit and problematic init field call if not) @@ -718,6 +627,25 @@ struct strangenesstofpid { float nSigmaPositivePhotonEl = o2::aod::v0data::kNoTOFValue; float nSigmaNegativePhotonEl = o2::aod::v0data::kNoTOFValue; + // n sigma with wrong hypothesis + float nSigmaPositiveLambdaEl = o2::aod::v0data::kNoTOFValue; + float nSigmaPositiveLambdaKa = o2::aod::v0data::kNoTOFValue; + float nSigmaPositiveK0ShortEl = o2::aod::v0data::kNoTOFValue; + float nSigmaPositiveK0ShortKa = o2::aod::v0data::kNoTOFValue; + float nSigmaPositiveK0ShortPr = o2::aod::v0data::kNoTOFValue; + float nSigmaPositivePhotonPi = o2::aod::v0data::kNoTOFValue; + float nSigmaPositivePhotonKa = o2::aod::v0data::kNoTOFValue; + float nSigmaPositivePhotonPr = o2::aod::v0data::kNoTOFValue; + + float nSigmaNegativeLambdaEl = o2::aod::v0data::kNoTOFValue; + float nSigmaNegativeLambdaKa = o2::aod::v0data::kNoTOFValue; + float nSigmaNegativeK0ShortEl = o2::aod::v0data::kNoTOFValue; + float nSigmaNegativeK0ShortKa = o2::aod::v0data::kNoTOFValue; + float nSigmaNegativeK0ShortPr = o2::aod::v0data::kNoTOFValue; + float nSigmaNegativePhotonPi = o2::aod::v0data::kNoTOFValue; + float nSigmaNegativePhotonKa = o2::aod::v0data::kNoTOFValue; + float nSigmaNegativePhotonPr = o2::aod::v0data::kNoTOFValue; + // extra auxiliary variables float deltaDecayTimeLambda = o2::aod::v0data::kNoTOFValue; float deltaDecayTimeAntiLambda = o2::aod::v0data::kNoTOFValue; @@ -759,6 +687,18 @@ struct strangenesstofpid { float nSigmaOmLaPr = o2::aod::cascdata::kNoTOFValue; float nSigmaOmLaPi = o2::aod::cascdata::kNoTOFValue; float nSigmaOmKa = o2::aod::cascdata::kNoTOFValue; + + // n sigma with wrong hypothesis + float nSigmaXiLaEl = o2::aod::cascdata::kNoTOFValue; + float nSigmaXiLaKa = o2::aod::cascdata::kNoTOFValue; + float nSigmaXiEl = o2::aod::cascdata::kNoTOFValue; + float nSigmaXiKa = o2::aod::cascdata::kNoTOFValue; + float nSigmaXiPr = o2::aod::cascdata::kNoTOFValue; + float nSigmaOmLaEl = o2::aod::cascdata::kNoTOFValue; + float nSigmaOmLaKa = o2::aod::cascdata::kNoTOFValue; + float nSigmaOmEl = o2::aod::cascdata::kNoTOFValue; + float nSigmaOmPi = o2::aod::cascdata::kNoTOFValue; + float nSigmaOmPr = o2::aod::cascdata::kNoTOFValue; }; struct trackTofInfo { // holds input track info @@ -787,8 +727,8 @@ struct strangenesstofpid { template v0TofInfo calculateTofInfoV0(TCollisions const& collisions, int const& collisionId, TV0 const& v0, TTOFInfo const& pTof, TTOFInfo const& nTof) { - v0TofInfo v0tof; // return this struct - auto collision = collisions.rawIteratorAt(collisionId); + v0TofInfo v0tof; // return this struct + auto collision = collisions.rawIteratorAt(collisionId); // collisionId must be collisionId of V0. //_____________________________________________________________________________________________ // daughter tracks: initialize from V0 position and momenta @@ -829,7 +769,7 @@ struct strangenesstofpid { float velocityPositivePr, velocityPositivePi, lengthPositive; velocityPositivePr = velocityPositivePi = lengthPositive = o2::aod::v0data::kNoTOFValue; - if (pTof.hasTOF && pTof.tofEvTime > -1e+5 && pValidTOF) { + if (pTof.hasTOF && mapCollisionTime.find(collisionId) != mapCollisionTime.end() && pValidTOF) { // method 0: legacy standalone without use of primary particle TOF if (calculationMethod.value == 0) { velocityPositivePr = velocity(posTrack.getP(), o2::constants::physics::MassProton); @@ -867,27 +807,21 @@ struct strangenesstofpid { v0tof.deltaTimePositiveLambdaPi = (pTof.tofSignal - pTof.tofEvTime) - (v0tof.timeLambda + v0tof.timePositivePi); v0tof.deltaTimePositiveK0ShortPi = (pTof.tofSignal - pTof.tofEvTime) - (v0tof.timeK0Short + v0tof.timePositivePi); - // de facto nsigma - if (nSigmaCalibLoaded) { - v0tof.nSigmaPositiveLambdaPi = (v0tof.deltaTimePositiveLambdaPi - hMeanPosLaPi->Interpolate(v0.p())) / hSigmaPosLaPi->Interpolate(v0.p()); - v0tof.nSigmaPositiveLambdaPr = (v0tof.deltaTimePositiveLambdaPr - hMeanPosLaPr->Interpolate(v0.p())) / hSigmaPosLaPr->Interpolate(v0.p()); - v0tof.nSigmaPositiveK0ShortPi = (v0tof.deltaTimePositiveK0ShortPi - hMeanPosK0Pi->Interpolate(v0.p())) / hSigmaPosK0Pi->Interpolate(v0.p()); - } - + // use nSigma function from O2Physics/Common/Core/PID/PIDTOFParamService.h v0tof.nSigmaPositivePhotonEl = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timePhoton, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); v0tof.nSigmaPositiveLambdaPi = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeLambda, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); v0tof.nSigmaPositiveLambdaPr = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeLambda, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); v0tof.nSigmaPositiveK0ShortPi = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeK0Short, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - // use nSigma from O2Physics/Common/Core/PID/PIDTOFParamService.h - // static float nSigma(const float tofSignal, - // const float tofExpMom, - // const float length, - // const float momentum, - // const float eta, - // const float tofEvTime, - // const float tofEvTimeErr, - // const o2::pid::tof::TOFResoParamsV3& params = parameters); + // with wrong hypothesis + v0tof.nSigmaPositivePhotonPi = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timePhoton, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + v0tof.nSigmaPositivePhotonKa = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timePhoton, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + v0tof.nSigmaPositivePhotonPr = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timePhoton, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + v0tof.nSigmaPositiveLambdaEl = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeLambda, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + v0tof.nSigmaPositiveLambdaKa = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeLambda, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + v0tof.nSigmaPositiveK0ShortEl = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeK0Short, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + v0tof.nSigmaPositiveK0ShortKa = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeK0Short, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + v0tof.nSigmaPositiveK0ShortPr = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeK0Short, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); // do QA histograms (calibration / QC) if (doQA) { @@ -927,7 +861,7 @@ struct strangenesstofpid { } float velocityNegativePr, velocityNegativePi, lengthNegative; velocityNegativePr = velocityNegativePi = lengthNegative = o2::aod::v0data::kNoTOFValue; - if (nTof.hasTOF && nTof.tofEvTime > -1e+5 && nValidTOF) { + if (nTof.hasTOF && mapCollisionTime.find(collisionId) != mapCollisionTime.end() && nValidTOF) { // method 0: legacy standalone without use of primary particle TOF if (calculationMethod.value == 0) { velocityNegativePr = velocity(negTrack.getP(), o2::constants::physics::MassProton); @@ -965,18 +899,21 @@ struct strangenesstofpid { v0tof.deltaTimeNegativeLambdaPi = (nTof.tofSignal - nTof.tofEvTime) - (v0tof.timeLambda + v0tof.timeNegativePi); v0tof.deltaTimeNegativeK0ShortPi = (nTof.tofSignal - nTof.tofEvTime) - (v0tof.timeK0Short + v0tof.timeNegativePi); - // de facto nsigma - if (nSigmaCalibLoaded) { - v0tof.nSigmaNegativeLambdaPi = (v0tof.deltaTimeNegativeLambdaPi - hMeanNegLaPi->Interpolate(v0.p())) / hSigmaNegLaPi->Interpolate(v0.p()); - v0tof.nSigmaNegativeLambdaPr = (v0tof.deltaTimeNegativeLambdaPr - hMeanNegLaPr->Interpolate(v0.p())) / hSigmaNegLaPr->Interpolate(v0.p()); - v0tof.nSigmaNegativeK0ShortPi = (v0tof.deltaTimeNegativeK0ShortPi - hMeanNegK0Pi->Interpolate(v0.p())) / hSigmaNegK0Pi->Interpolate(v0.p()); - } - v0tof.nSigmaNegativePhotonEl = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timePhoton, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); v0tof.nSigmaNegativeLambdaPi = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeLambda, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); v0tof.nSigmaNegativeLambdaPr = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeLambda, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); v0tof.nSigmaNegativeK0ShortPi = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeK0Short, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + // with wrong hypothesis + v0tof.nSigmaNegativePhotonPi = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timePhoton, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + v0tof.nSigmaNegativePhotonKa = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timePhoton, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + v0tof.nSigmaNegativePhotonPr = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timePhoton, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + v0tof.nSigmaNegativeLambdaEl = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeLambda, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + v0tof.nSigmaNegativeLambdaKa = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeLambda, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + v0tof.nSigmaNegativeK0ShortEl = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeK0Short, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + v0tof.nSigmaNegativeK0ShortKa = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeK0Short, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + v0tof.nSigmaNegativeK0ShortPr = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeK0Short, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + // do QA histograms (calibration / QC) if (doQA) { if (passesQAcuts) { @@ -1054,8 +991,8 @@ struct strangenesstofpid { template cascTofInfo calculateTofInfoCascade(TCollisions const& collisions, int const& collisionId, TCascade const& cascade, TTOFInfo const& pTof, TTOFInfo const& nTof, TTOFInfo const& bTof) { - cascTofInfo casctof; // return this struct - auto collision = collisions.rawIteratorAt(collisionId); + cascTofInfo casctof; // return this struct + auto collision = collisions.rawIteratorAt(collisionId); // collisionId must be collisionId of cascade. //_____________________________________________________________________________________________ // daughter tracks: initialize from V0 position and momenta @@ -1131,7 +1068,7 @@ struct strangenesstofpid { //_____________________________________________________________________________________________ // Actual calculation - if (pTof.hasTOF && pTof.tofEvTime > -1e+5 && pValidTOF) { + if (pTof.hasTOF && mapCollisionTime.find(collisionId) != mapCollisionTime.end() && pValidTOF) { float velocityPositivePr, velocityPositivePi, lengthPositive; velocityPositivePr = velocityPositivePi = lengthPositive = o2::aod::v0data::kNoTOFValue; if (calculationMethod.value == 0) { @@ -1171,23 +1108,30 @@ struct strangenesstofpid { casctof.posDeltaTimeAsOmPi = (pTof.tofSignal - pTof.tofEvTime) - (omFlight + lambdaFlight + casctof.posFlightPi); casctof.posDeltaTimeAsOmPr = (pTof.tofSignal - pTof.tofEvTime) - (omFlight + lambdaFlight + casctof.posFlightPr); - // de facto nsigma - if (nSigmaCalibLoaded) { - if (cascade.sign() < 0) { - casctof.nSigmaXiLaPr = (casctof.posDeltaTimeAsXiPr - hMeanPosXiPr->Interpolate(cascade.p())) / hSigmaPosXiPr->Interpolate(cascade.p()); - casctof.nSigmaOmLaPr = (casctof.posDeltaTimeAsOmPr - hMeanPosOmPr->Interpolate(cascade.p())) / hSigmaPosOmPr->Interpolate(cascade.p()); - } else { - casctof.nSigmaXiLaPi = (casctof.posDeltaTimeAsXiPi - hMeanPosXiPi->Interpolate(cascade.p())) / hSigmaPosXiPi->Interpolate(cascade.p()); - casctof.nSigmaOmLaPi = (casctof.posDeltaTimeAsOmPi - hMeanPosOmPi->Interpolate(cascade.p())) / hSigmaPosOmPi->Interpolate(cascade.p()); - } - } - if (cascade.sign() < 0) { casctof.nSigmaXiLaPr = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); casctof.nSigmaOmLaPr = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + + // wrong hypothesis + casctof.nSigmaXiLaEl = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + casctof.nSigmaXiLaKa = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + casctof.nSigmaXiLaPi = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + + casctof.nSigmaOmLaEl = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + casctof.nSigmaOmLaKa = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + casctof.nSigmaOmLaPi = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); } else { casctof.nSigmaXiLaPi = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); casctof.nSigmaOmLaPi = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + + // wrong hypothesis + casctof.nSigmaXiLaEl = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + casctof.nSigmaXiLaKa = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + casctof.nSigmaXiLaPr = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + + casctof.nSigmaOmLaEl = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + casctof.nSigmaOmLaKa = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + casctof.nSigmaOmLaPr = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); } // do QA histograms (calibration / QC) @@ -1230,7 +1174,7 @@ struct strangenesstofpid { } } // end positive - if (nTof.hasTOF && nTof.tofEvTime > -1e+5 && nValidTOF) { + if (nTof.hasTOF && mapCollisionTime.find(collisionId) != mapCollisionTime.end() && nValidTOF) { float velocityNegativePr, velocityNegativePi, lengthNegative; velocityNegativePr = velocityNegativePi = lengthNegative = o2::aod::v0data::kNoTOFValue; // method 0: legacy standalone without use of primary particle TOF @@ -1271,23 +1215,30 @@ struct strangenesstofpid { casctof.negDeltaTimeAsOmPi = (nTof.tofSignal - nTof.tofEvTime) - (omFlight + lambdaFlight + casctof.negFlightPi); casctof.negDeltaTimeAsOmPr = (nTof.tofSignal - nTof.tofEvTime) - (omFlight + lambdaFlight + casctof.negFlightPr); - // de facto nsigma - if (nSigmaCalibLoaded) { - if (cascade.sign() < 0) { - casctof.nSigmaXiLaPi = (casctof.negDeltaTimeAsXiPi - hMeanNegXiPi->Interpolate(cascade.p())) / hSigmaNegXiPi->Interpolate(cascade.p()); - casctof.nSigmaOmLaPi = (casctof.negDeltaTimeAsOmPi - hMeanNegOmPi->Interpolate(cascade.p())) / hSigmaNegOmPi->Interpolate(cascade.p()); - } else { - casctof.nSigmaXiLaPr = (casctof.negDeltaTimeAsXiPr - hMeanNegXiPr->Interpolate(cascade.p())) / hSigmaNegXiPr->Interpolate(cascade.p()); - casctof.nSigmaOmLaPr = (casctof.negDeltaTimeAsOmPr - hMeanNegOmPr->Interpolate(cascade.p())) / hSigmaNegOmPr->Interpolate(cascade.p()); - } - } - if (cascade.sign() < 0) { casctof.nSigmaXiLaPi = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); casctof.nSigmaOmLaPi = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + + // wrogn hypothesis + casctof.nSigmaXiLaEl = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + casctof.nSigmaXiLaKa = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + casctof.nSigmaXiLaPr = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + + casctof.nSigmaOmLaEl = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + casctof.nSigmaOmLaKa = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + casctof.nSigmaOmLaPr = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); } else { casctof.nSigmaXiLaPr = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); casctof.nSigmaOmLaPr = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + + // wrogn hypothesis + casctof.nSigmaXiLaEl = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + casctof.nSigmaXiLaKa = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + casctof.nSigmaXiLaPi = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + + casctof.nSigmaOmLaEl = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + casctof.nSigmaOmLaKa = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + casctof.nSigmaOmLaPi = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); } // do QA histograms (calibration / QC) @@ -1330,7 +1281,7 @@ struct strangenesstofpid { } } // end negative - if (bTof.hasTOF && bTof.tofEvTime > -1e+5 && bValidTOF) { + if (bTof.hasTOF && mapCollisionTime.find(collisionId) != mapCollisionTime.end() && bValidTOF) { float velocityBachelorKa, velocityBachelorPi, lengthBachelor; velocityBachelorKa = velocityBachelorPi = lengthBachelor = o2::aod::v0data::kNoTOFValue; // method 0: legacy standalone without use of primary particle TOF @@ -1369,23 +1320,30 @@ struct strangenesstofpid { casctof.bachDeltaTimeAsXiPi = (bTof.tofSignal - bTof.tofEvTime) - (xiFlight + casctof.bachFlightPi); casctof.bachDeltaTimeAsOmKa = (bTof.tofSignal - bTof.tofEvTime) - (omFlight + casctof.bachFlightKa); - // de facto nsigma - if (nSigmaCalibLoaded) { - if (cascade.sign() < 0) { - casctof.nSigmaXiPi = (casctof.bachDeltaTimeAsXiPi - hMeanBachXiPi->Interpolate(cascade.p())) / hSigmaBachXiPi->Interpolate(cascade.p()); - casctof.nSigmaOmKa = (casctof.bachDeltaTimeAsOmKa - hMeanBachOmKa->Interpolate(cascade.p())) / hSigmaBachOmKa->Interpolate(cascade.p()); - } else { - casctof.nSigmaXiPi = (casctof.bachDeltaTimeAsXiPi - hMeanBachXiPi->Interpolate(cascade.p())) / hSigmaBachXiPi->Interpolate(cascade.p()); - casctof.nSigmaOmKa = (casctof.bachDeltaTimeAsOmKa - hMeanBachOmKa->Interpolate(cascade.p())) / hSigmaBachOmKa->Interpolate(cascade.p()); - } - } - if (cascade.sign() < 0) { casctof.nSigmaXiPi = mTOFResponse->nSigma(bTof.tofSignal - xiFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); casctof.nSigmaOmKa = mTOFResponse->nSigma(bTof.tofSignal - omFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); + + // wrong hypothesis + casctof.nSigmaXiEl = mTOFResponse->nSigma(bTof.tofSignal - xiFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); + casctof.nSigmaXiKa = mTOFResponse->nSigma(bTof.tofSignal - xiFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); + casctof.nSigmaXiPr = mTOFResponse->nSigma(bTof.tofSignal - xiFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); + + casctof.nSigmaOmEl = mTOFResponse->nSigma(bTof.tofSignal - omFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); + casctof.nSigmaOmPi = mTOFResponse->nSigma(bTof.tofSignal - omFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); + casctof.nSigmaOmPr = mTOFResponse->nSigma(bTof.tofSignal - omFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); } else { - casctof.nSigmaXiPi = mTOFResponse->nSigma(bTof.tofSignal - xiFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); - casctof.nSigmaOmKa = mTOFResponse->nSigma(bTof.tofSignal - omFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); + casctof.nSigmaXiPi = mTOFResponse->nSigma(bTof.tofSignal - xiFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); + casctof.nSigmaOmKa = mTOFResponse->nSigma(bTof.tofSignal - omFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); + + // wrong hypothesis + casctof.nSigmaXiEl = mTOFResponse->nSigma(bTof.tofSignal - xiFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); + casctof.nSigmaXiKa = mTOFResponse->nSigma(bTof.tofSignal - xiFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); + casctof.nSigmaXiPr = mTOFResponse->nSigma(bTof.tofSignal - xiFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); + + casctof.nSigmaOmEl = mTOFResponse->nSigma(bTof.tofSignal - omFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); + casctof.nSigmaOmPi = mTOFResponse->nSigma(bTof.tofSignal - omFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); + casctof.nSigmaOmPr = mTOFResponse->nSigma(bTof.tofSignal - omFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); } // do QA histograms (calibration / QC) @@ -1432,6 +1390,9 @@ struct strangenesstofpid { return casctof; } + std::unordered_map mapCollisionTime; + std::unordered_map mapCollisionTimeError; + void processStandardData(/*aod::BCs const& bcs,*/ aod::Collisions const& collisions, V0OriginalDatas const& V0s, CascOriginalDatas const& cascades, TracksWithAllExtras const& tracks, aod::BCsWithTimestamps const& bcs) { // Fire up CCDB with first collision in record. If no collisions, bypass @@ -1445,9 +1406,18 @@ struct strangenesstofpid { mTOFResponse->processSetup(bcs.iteratorAt(0)); + for (const auto& track : tracks) { + if (mapCollisionTime.find(track.collisionId()) == mapCollisionTime.end()) { + // LOGF(info, "track.collisionId() = %d, track.tofEvTime() = %f, track.tofEvTimeErr() = %f", track.collisionId(), track.tofEvTime(), track.tofEvTimeErr()); + mapCollisionTime[track.collisionId()] = track.tofEvTime(); + mapCollisionTimeError[track.collisionId()] = track.tofEvTimeErr(); + } + } + //________________________________________________________________________ // estimate event times (only necessary for original data) std::vector collisionEventTime(collisions.size(), 0.0); + std::vector collisionEventTimeError(collisions.size(), 0.0); std::vector collisionNtracks(collisions.size(), 0); for (const auto& track : tracks) { if (track.hasTOF() && track.has_collision()) { @@ -1497,9 +1467,10 @@ struct strangenesstofpid { pTof.hasTPC = pTra.hasTPC(); pTof.hasTOF = pTra.hasTOF(); pTof.tofExpMom = pTra.tofExpMom(); - pTof.tofEvTime = reassociateTracks ? collisionEventTime[V0.collisionId()] : pTra.tofEvTime(); - pTof.tofEvTimeErr = reassociateTracks ? collisionEventTime[V0.collisionId()] : pTra.tofEvTimeErr(); - pTof.tofSignal = pTra.tofSignal() + (doBCshift ? deltaTimePos : 0.0f); + pTof.tofEvTime = reassociateTracks ? mapCollisionTime[V0.collisionId()] : pTra.tofEvTime(); + pTof.tofEvTimeErr = reassociateTracks ? mapCollisionTimeError[V0.collisionId()] : pTra.tofEvTimeErr(); + // pTof.tofSignal = pTra.tofSignal() + (doBCshift ? deltaTimePos : 0.0f); + pTof.tofSignal = doBCshift && pTra.has_collision() ? pTra.tofSignalInAnotherBC(pTra.collision().bc_as().globalBC(), V0.collision().bc_as().globalBC()) : pTra.tofSignal(); pTof.length = pTra.length(); pTof.tpcNSigmaEl = pTra.tpcNSigmaEl(); pTof.tpcNSigmaPi = pTra.tpcNSigmaPi(); @@ -1510,9 +1481,10 @@ struct strangenesstofpid { nTof.hasTPC = nTra.hasTPC(); nTof.hasTOF = nTra.hasTOF(); nTof.tofExpMom = nTra.tofExpMom(); - nTof.tofEvTime = reassociateTracks ? collisionEventTime[V0.collisionId()] : nTra.tofEvTime(); - nTof.tofEvTimeErr = reassociateTracks ? collisionEventTime[V0.collisionId()] : nTra.tofEvTimeErr(); - nTof.tofSignal = nTra.tofSignal() + (doBCshift ? deltaTimeNeg : 0.0f); + nTof.tofEvTime = reassociateTracks ? mapCollisionTime[V0.collisionId()] : nTra.tofEvTime(); + nTof.tofEvTimeErr = reassociateTracks ? mapCollisionTimeError[V0.collisionId()] : nTra.tofEvTimeErr(); + // nTof.tofSignal = nTra.tofSignal() + (doBCshift ? deltaTimeNeg : 0.0f); + nTof.tofSignal = doBCshift && nTra.has_collision() ? nTra.tofSignalInAnotherBC(nTra.collision().bc_as().globalBC(), V0.collision().bc_as().globalBC()) : nTra.tofSignal(); nTof.length = nTra.length(); nTof.tpcNSigmaEl = nTra.tpcNSigmaEl(); nTof.tpcNSigmaPi = nTra.tpcNSigmaPi(); @@ -1535,6 +1507,18 @@ struct strangenesstofpid { v0tof.nSigmaPositiveLambdaPr, v0tof.nSigmaNegativeLambdaPi, v0tof.nSigmaNegativeLambdaPr, v0tof.nSigmaPositiveLambdaPi, v0tof.nSigmaPositiveK0ShortPi, v0tof.nSigmaNegativeK0ShortPi); + + if (calculateV0sNSigmaAll.value > 0) { + v0tofnsigmasall( + v0tof.nSigmaPositivePhotonEl, v0tof.nSigmaPositiveK0ShortEl, v0tof.nSigmaPositiveLambdaEl, + v0tof.nSigmaNegativePhotonEl, v0tof.nSigmaNegativeK0ShortEl, v0tof.nSigmaNegativeLambdaEl, + v0tof.nSigmaPositivePhotonPi, v0tof.nSigmaPositiveK0ShortPi, v0tof.nSigmaPositiveLambdaPi, + v0tof.nSigmaNegativePhotonPi, v0tof.nSigmaNegativeK0ShortPi, v0tof.nSigmaNegativeLambdaPi, + v0tof.nSigmaPositivePhotonKa, v0tof.nSigmaPositiveK0ShortEl, v0tof.nSigmaPositiveLambdaEl, + v0tof.nSigmaNegativePhotonKa, v0tof.nSigmaNegativeK0ShortEl, v0tof.nSigmaNegativeLambdaEl, + v0tof.nSigmaPositivePhotonPr, v0tof.nSigmaPositiveK0ShortPr, v0tof.nSigmaPositiveLambdaPr, + v0tof.nSigmaNegativePhotonPr, v0tof.nSigmaNegativeK0ShortPr, v0tof.nSigmaNegativeLambdaPr); + } } if (calculateV0TOFPIDs.value) { v0tofpid(v0tof.deltaTimePositiveLambdaPi, v0tof.deltaTimePositiveLambdaPr, @@ -1597,9 +1581,10 @@ struct strangenesstofpid { pTof.hasTPC = pTra.hasTPC(); pTof.hasTOF = pTra.hasTOF(); pTof.tofExpMom = pTra.tofExpMom(); - pTof.tofEvTime = reassociateTracks ? collisionEventTime[cascade.collisionId()] : pTra.tofEvTime(); - pTof.tofEvTimeErr = reassociateTracks ? collisionEventTime[cascade.collisionId()] : pTra.tofEvTimeErr(); - pTof.tofSignal = pTra.tofSignal() + (doBCshift ? deltaTimePos : 0.0f); + pTof.tofEvTime = reassociateTracks ? mapCollisionTime[cascade.collisionId()] : pTra.tofEvTime(); + pTof.tofEvTimeErr = reassociateTracks ? mapCollisionTimeError[cascade.collisionId()] : pTra.tofEvTimeErr(); + // pTof.tofSignal = pTra.tofSignal() + (doBCshift ? deltaTimePos : 0.0f); + pTof.tofSignal = doBCshift && pTra.has_collision() ? pTra.tofSignalInAnotherBC(pTra.collision().bc_as().globalBC(), cascade.collision().bc_as().globalBC()) : pTra.tofSignal(); pTof.length = pTra.length(); pTof.tpcNSigmaPi = pTra.tpcNSigmaPi(); pTof.tpcNSigmaPr = pTra.tpcNSigmaPr(); @@ -1609,9 +1594,10 @@ struct strangenesstofpid { nTof.hasTPC = nTra.hasTPC(); nTof.hasTOF = nTra.hasTOF(); nTof.tofExpMom = nTra.tofExpMom(); - nTof.tofEvTime = reassociateTracks ? collisionEventTime[cascade.collisionId()] : nTra.tofEvTime(); - nTof.tofEvTimeErr = reassociateTracks ? collisionEventTime[cascade.collisionId()] : nTra.tofEvTimeErr(); - nTof.tofSignal = nTra.tofSignal() + (doBCshift ? deltaTimeNeg : 0.0f); + nTof.tofEvTime = reassociateTracks ? mapCollisionTime[cascade.collisionId()] : nTra.tofEvTime(); + nTof.tofEvTimeErr = reassociateTracks ? mapCollisionTimeError[cascade.collisionId()] : nTra.tofEvTimeErr(); + // nTof.tofSignal = nTra.tofSignal() + (doBCshift ? deltaTimeNeg : 0.0f); + nTof.tofSignal = doBCshift && nTra.has_collision() ? nTra.tofSignalInAnotherBC(nTra.collision().bc_as().globalBC(), cascade.collision().bc_as().globalBC()) : nTra.tofSignal(); nTof.length = nTra.length(); nTof.tpcNSigmaPi = nTra.tpcNSigmaPi(); nTof.tpcNSigmaPr = nTra.tpcNSigmaPr(); @@ -1621,9 +1607,10 @@ struct strangenesstofpid { bTof.hasTPC = bTra.hasTPC(); bTof.hasTOF = bTra.hasTOF(); bTof.tofExpMom = bTra.tofExpMom(); - bTof.tofEvTime = reassociateTracks ? collisionEventTime[cascade.collisionId()] : bTra.tofEvTime(); - bTof.tofEvTimeErr = reassociateTracks ? collisionEventTime[cascade.collisionId()] : bTra.tofEvTimeErr(); - bTof.tofSignal = bTra.tofSignal() + (doBCshift ? deltaTimeBach : 0.0f); + bTof.tofEvTime = reassociateTracks ? mapCollisionTime[cascade.collisionId()] : bTra.tofEvTime(); + bTof.tofEvTimeErr = reassociateTracks ? mapCollisionTimeError[cascade.collisionId()] : bTra.tofEvTimeErr(); + // bTof.tofSignal = bTra.tofSignal() + (doBCshift ? deltaTimeBach : 0.0f); + bTof.tofSignal = doBCshift && bTra.has_collision() ? bTra.tofSignalInAnotherBC(bTra.collision().bc_as().globalBC(), cascade.collision().bc_as().globalBC()) : bTra.tofSignal(); bTof.length = bTra.length(); bTof.tpcNSigmaPi = bTra.tpcNSigmaPi(); bTof.tpcNSigmaKa = bTra.tpcNSigmaKa(); @@ -1644,6 +1631,14 @@ struct strangenesstofpid { casctofnsigmas( casctof.nSigmaXiLaPi, casctof.nSigmaXiLaPr, casctof.nSigmaXiPi, casctof.nSigmaOmLaPi, casctof.nSigmaOmLaPr, casctof.nSigmaOmKa); + + if (calculateCascadesNSigmaAll.value > 0) { + casctofnsigmasall( + casctof.nSigmaXiLaEl, casctof.nSigmaXiEl, casctof.nSigmaOmLaEl, casctof.nSigmaOmEl, + casctof.nSigmaXiLaPi, casctof.nSigmaXiPi, casctof.nSigmaOmLaPi, casctof.nSigmaOmPi, + casctof.nSigmaXiLaKa, casctof.nSigmaXiKa, casctof.nSigmaOmLaKa, casctof.nSigmaOmKa, + casctof.nSigmaXiLaPr, casctof.nSigmaXiPr, casctof.nSigmaOmLaPr, casctof.nSigmaOmPr); + } } if (calculateCascTOFPIDs.value) { casctofpids( @@ -1654,6 +1649,9 @@ struct strangenesstofpid { } } } + + mapCollisionTime.clear(); + mapCollisionTimeError.clear(); } void processDerivedData(soa::Join const& collisions, V0DerivedDatas const& V0s, CascDerivedDatas const& cascades, dauTracks const& dauTrackTable, aod::DauTrackTOFPIDs const& dauTrackTOFPIDs) @@ -1726,7 +1724,8 @@ struct strangenesstofpid { pTof.collisionId = pTofExt.straCollisionId(); pTof.tofExpMom = pTofExt.tofExpMom(); pTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTime(); - pTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTimeErr(); + // pTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTimeErr(); + pTof.tofEvTimeErr = pTofExt.tofEvTimeErr(); pTof.tofSignal = pTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f); pTof.length = pTofExt.length(); } @@ -1752,7 +1751,8 @@ struct strangenesstofpid { nTof.collisionId = nTofExt.straCollisionId(); nTof.tofExpMom = nTofExt.tofExpMom(); nTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTime(); - nTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTimeErr(); + // nTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTimeErr(); + nTof.tofEvTimeErr = nTofExt.tofEvTimeErr(); nTof.tofSignal = nTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f); nTof.length = nTofExt.length(); } @@ -1820,7 +1820,8 @@ struct strangenesstofpid { pTof.collisionId = pTofExt.straCollisionId(); pTof.tofExpMom = pTofExt.tofExpMom(); pTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTime(); - pTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTimeErr(); + // pTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTimeErr(); + pTof.tofEvTimeErr = pTofExt.tofEvTimeErr(); pTof.tofSignal = pTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f); pTof.length = pTofExt.length(); } @@ -1845,7 +1846,8 @@ struct strangenesstofpid { nTof.collisionId = nTofExt.straCollisionId(); nTof.tofExpMom = nTofExt.tofExpMom(); nTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTime(); - nTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTimeErr(); + // nTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTimeErr(); + nTof.tofEvTimeErr = nTofExt.tofEvTimeErr(); nTof.tofSignal = nTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f); nTof.length = nTofExt.length(); } @@ -1870,7 +1872,8 @@ struct strangenesstofpid { bTof.collisionId = bTofExt.straCollisionId(); bTof.tofExpMom = bTofExt.tofExpMom(); bTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : bTofExt.tofEvTime(); - bTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : bTofExt.tofEvTimeErr(); + // bTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : bTofExt.tofEvTimeErr(); + bTof.tofEvTimeErr = bTofExt.tofEvTimeErr(); bTof.tofSignal = bTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f); bTof.length = bTofExt.length(); } From 6d5c565b0b63793b0bf832eb2853aecc28200112 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Tue, 17 Feb 2026 23:01:38 +0100 Subject: [PATCH 09/28] Fill TOF event time error in StraEvTimes --- PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index 0228f93a01b..7af0c225b3e 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -593,21 +593,26 @@ struct strangederivedbuilder { void populateEventTimes(coll const& collisions, TTracks const& tracks) { std::vector collisionEventTime(collisions.size(), 0.0); + std::vector collisionEventTimeErr(collisions.size(), 0.0); std::vector collisionNtracks(collisions.size(), 0); for (const auto& track : tracks) { if (track.hasTOF() && track.collisionId() >= 0) { collisionEventTime[track.collisionId()] += track.tofEvTime(); + // Take the average of the error instead of propagating the error as all event time error from tracks are fully correlated + collisionEventTimeErr[track.collisionId()] += track.tofEvTimeErr(); collisionNtracks[track.collisionId()]++; } } for (const auto& collision : collisions) { if (collisionNtracks[collision.globalIndex()] > 0) { collisionEventTime[collision.globalIndex()] /= static_cast(collisionNtracks[collision.globalIndex()]); + collisionEventTimeErr[collision.globalIndex()] /= static_cast(collisionNtracks[collision.globalIndex()]); } else { collisionEventTime[collision.globalIndex()] = -1e+6; // undefined + collisionEventTimeErr[collision.globalIndex()] = -1e+6; // undefined } histos.fill(HIST("h2dCollisionTimesVsNTracks"), collisionNtracks[collision.globalIndex()], collisionEventTime[collision.globalIndex()]); - products.straEvTimes(collisionEventTime[collision.globalIndex()]); + products.straEvTimes(collisionEventTime[collision.globalIndex()], collisionEventTimeErr[collision.globalIndex()]); } } From 6bf7d2476b234b4376819b691efc27e10afffb56 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Tue, 17 Feb 2026 23:02:54 +0100 Subject: [PATCH 10/28] Add TOF event time error in StraEvTimes --- PWGLF/DataModel/LFStrangenessTables.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index bc7fd7d3aaa..659ca124b01 100644 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -313,11 +313,14 @@ DECLARE_SOA_TABLE_VERSIONED(StraStamps_001, "AOD", "STRASTAMPS", 1, //! informat bc::RunNumber, timestamp::Timestamp, bc::GlobalBC); DECLARE_SOA_TABLE(StraEvTimes, "AOD", "STRAEVTIMES", //! event time (FT0, TOF) stracollision::EventTime); +DECLARE_SOA_TABLE_VERSIONED(StraEvTimes_001, "AOD", "STRAEVTIMES", 1, //! event time (FT0, TOF) + stracollision::EventTime, stracollision::EventTimeErr); using StraRawCents = StraRawCents_004; using StraCents = StraCents_001; using StraEvSels = StraEvSels_005; using StraStamps = StraStamps_001; +using StraEvTimes = StraEvTimes_001; using StraCollision = StraCollisions::iterator; using StraCent = StraCents_001::iterator; From 4145910365a6d505f0d26ab2d2d348892da032f3 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Tue, 17 Feb 2026 23:04:18 +0100 Subject: [PATCH 11/28] Change StraEvTimes type to StraEvTimes_000 --- .../Strangeness/Converters/stradautrackstofpidconverter2.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter2.cxx b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter2.cxx index 371c5c133d3..e447908e558 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter2.cxx +++ b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter2.cxx @@ -21,7 +21,7 @@ using namespace o2::framework; // converts DauTrackTOFPIDs_000 to _001 struct stradautrackstofpidconverter2 { Produces dautracktofpids; - Produces straEvTimes; + Produces straEvTimes; void process(aod::StraCollisions const& collisions, soa::Join const& dauTracks, soa::Join const& v0s) { From bdd17c431f0706d3c362eb50f54b045b8cf9d4b6 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Tue, 17 Feb 2026 23:05:43 +0100 Subject: [PATCH 12/28] Update converter --- .../Converters/stradautrackstofpidconverter3.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx index 8cc54950a9d..e753005f124 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx +++ b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx @@ -18,11 +18,12 @@ using namespace o2; using namespace o2::framework; -// converts DauTrackTOFPIDs_001 to _002 +// converts DauTrackTOFPIDs_002 to _003 struct stradautrackstofpidconverter3 { Produces dautracktofpids; + Produces straEvTimes; - void process(aod::DauTrackTOFPIDs_001 const& dauTracks) + void process(aod::DauTrackTOFPIDs_001 const& dauTracks, aod::StraEvTimes_000 const& straEvTimes_000) { // create new TOFPIDs for (const auto& dauTrack : dauTracks) { @@ -35,6 +36,9 @@ struct stradautrackstofpidconverter3 { dauTrack.length(), 0.0f); } + for (const auto& value : straEvTimes_000) { + straEvTimes(value.eventTime(), 1e+6f /*dummy event time error for TOF*/); + } } }; From 2738a9692d74b67a72f3ef9cb952edac37f83dc2 Mon Sep 17 00:00:00 2001 From: romainschotter Date: Fri, 27 Feb 2026 22:33:46 +0100 Subject: [PATCH 13/28] Update data model --- Common/Tasks/propagatorQa.cxx | 9 +++++++-- PWGLF/DataModel/LFStrangenessTables.h | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Common/Tasks/propagatorQa.cxx b/Common/Tasks/propagatorQa.cxx index dcdd50b87ce..9d31c32c76e 100644 --- a/Common/Tasks/propagatorQa.cxx +++ b/Common/Tasks/propagatorQa.cxx @@ -36,6 +36,7 @@ #include #include #include +#include "Common/DataModel/CollisionAssociationTables.h" #include #include @@ -216,7 +217,7 @@ struct propagatorQa { } } - void processMC(aod::Collision const& collision, aod::V0s const& V0s, aod::Cascades const& cascades, soa::Join const& tracks, aod::BCsWithTimestamps const&, aod::McParticles const&) + void processMC(aod::Collision const& collision, aod::V0s const& V0s, aod::Cascades const& cascades, soa::Join const& tracks, aod::BCsWithTimestamps const&, aod::McParticles const&) { /* check the previous run number */ auto bc = collision.bc_as(); @@ -224,6 +225,8 @@ struct propagatorQa { std::array dcaInfo; for (const auto& track : tracks) { + //if (track.compatibleCollIds().size() != 0) + // continue; if (track.tpcNClsFound() < minTPCClustersRequired) continue; @@ -336,7 +339,7 @@ struct propagatorQa { } PROCESS_SWITCH(propagatorQa, processMC, "process MC", true); - void processData(aod::Collision const& collision, aod::V0s const& V0s, aod::Cascades const& cascades, soa::Join const& tracks, aod::BCsWithTimestamps const&) + void processData(aod::Collision const& collision, aod::V0s const& V0s, aod::Cascades const& cascades, soa::Join const& tracks, aod::BCsWithTimestamps const&) { /* check the previous run number */ auto bc = collision.bc_as(); @@ -344,6 +347,8 @@ struct propagatorQa { std::array dcaInfo; for (const auto& track : tracks) { + //if (track.compatibleCollIds().size() != 0) + // continue; if (track.tpcNClsFound() < minTPCClustersRequired) continue; diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index 659ca124b01..a895fdc002a 100644 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -66,6 +66,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZNC, energyCommonZNC, //! get the total s // event time DECLARE_SOA_COLUMN(EventTime, eventTime, float); //! event time (FT0, TOF) for TOF PID (stored once per event) +// event time error +DECLARE_SOA_COLUMN(EventTimeErr, eventTimeErr, float); //! event time (FT0, TOF) for TOF PID (stored once per event) } // namespace stracollision //______________________________________________________ @@ -311,7 +313,7 @@ DECLARE_SOA_TABLE(StraStamps_000, "AOD", "STRASTAMPS", //! information for ID-in bc::RunNumber, timestamp::Timestamp); DECLARE_SOA_TABLE_VERSIONED(StraStamps_001, "AOD", "STRASTAMPS", 1, //! information for ID-ing mag field if needed bc::RunNumber, timestamp::Timestamp, bc::GlobalBC); -DECLARE_SOA_TABLE(StraEvTimes, "AOD", "STRAEVTIMES", //! event time (FT0, TOF) +DECLARE_SOA_TABLE(StraEvTimes_000, "AOD", "STRAEVTIMES", //! event time (FT0, TOF) stracollision::EventTime); DECLARE_SOA_TABLE_VERSIONED(StraEvTimes_001, "AOD", "STRAEVTIMES", 1, //! event time (FT0, TOF) stracollision::EventTime, stracollision::EventTimeErr); From 22b489346d2b66871ee66fabf7aebb6faa66015a Mon Sep 17 00:00:00 2001 From: romainschotter Date: Fri, 22 May 2026 15:14:29 +0200 Subject: [PATCH 14/28] Add TOF NSigma from TOF PID framework --- Common/Core/PID/PIDTOFParamService.cxx | 7 +- Common/Core/PID/PIDTOFParamService.h | 6 +- PWGLF/DataModel/LFStrangenessPIDTables.h | 13 +- PWGLF/DataModel/LFStrangenessTables.h | 20 +- .../Strangeness/Converters/CMakeLists.txt | 10 - .../stradautrackstofpidconverter.cxx | 18 +- .../stradautrackstofpidconverter3.cxx | 4 +- .../Strangeness/strangederivedbuilder.cxx | 48 +- .../Strangeness/strangenesstofpid.cxx | 414 ++++++++++++++---- 9 files changed, 379 insertions(+), 161 deletions(-) diff --git a/Common/Core/PID/PIDTOFParamService.cxx b/Common/Core/PID/PIDTOFParamService.cxx index 29fe01360fe..733cfd6ff7f 100644 --- a/Common/Core/PID/PIDTOFParamService.cxx +++ b/Common/Core/PID/PIDTOFParamService.cxx @@ -38,6 +38,7 @@ void o2::pid::tof::TOFResponseImpl::inheritFromBaseTask(o2::framework::InitConte if (mIsInit) { LOG(fatal) << "TOFResponseImpl already initialized, cannot re-initialize"; } + LOG(info) << "couccou"; getCfg(initContext, "ccdb-url", mUrl, task); getCfg(initContext, "ccdb-path-grplhcif", mPathGrpLhcIf, task); getCfg(initContext, "ccdb-timestamp", mTimestamp, task); @@ -53,10 +54,12 @@ void o2::pid::tof::TOFResponseImpl::inheritFromBaseTask(o2::framework::InitConte getCfg(initContext, "enableTimeDependentResponse", mEnableTimeDependentResponse, task); getCfg(initContext, "collisionSystem", mCollisionSystem, task); getCfg(initContext, "autoSetProcessFunctions", mAutoSetProcessFunctions, task); + LOG(info) << "couccou1"; } void o2::pid::tof::TOFResponseImpl::initSetup(o2::ccdb::BasicCCDBManager* ccdb, - o2::framework::InitContext& initContext) + o2::framework::InitContext& initContext, + const std::string task) { if (mIsInit) { LOG(fatal) << "TOFResponseImpl already initialized, cannot re-initialize"; @@ -65,7 +68,7 @@ void o2::pid::tof::TOFResponseImpl::initSetup(o2::ccdb::BasicCCDBManager* ccdb, if (!ccdb) { LOG(fatal) << "CCDB manager is not set, cannot initialize TOFResponseImpl"; } - inheritFromBaseTask(initContext); // Gets the configuration parameters from the base task (tof-signal) + inheritFromBaseTask(initContext, task); // Gets the configuration parameters from the base task (tof-signal) mCcdb = ccdb; // Set the CCDB manager mCcdb->setURL(mUrl); mCcdb->setTimestamp(mTimestamp); diff --git a/Common/Core/PID/PIDTOFParamService.h b/Common/Core/PID/PIDTOFParamService.h index 73b6a4e0c93..f662844721f 100644 --- a/Common/Core/PID/PIDTOFParamService.h +++ b/Common/Core/PID/PIDTOFParamService.h @@ -47,14 +47,14 @@ struct TOFResponseImpl { /// \note This function should be called in the init function of each task that uses the TOF response /// \note The parameters are loaded from the CCDB and stored in the static variable `parameters` /// \note The metadata information is also initialized in this function - void initSetup(o2::ccdb::BasicCCDBManager* ccdb, o2::framework::InitContext& initContext); + void initSetup(o2::ccdb::BasicCCDBManager* ccdb, o2::framework::InitContext& initContext, const std::string task = "tof-signal"); /// Initialize the TOF response parameters in the init function of each task /// \param ccdb Service pointer to the CCDB manager template - void initSetup(T ccdb, o2::framework::InitContext& initContext) + void initSetup(T ccdb, o2::framework::InitContext& initContext, const std::string task = "tof-signal") { - initSetup(ccdb.operator->(), initContext); + initSetup(ccdb.operator->(), initContext, task); } /// Initialize the TOF response parameters in the process function of each task, should be called only at least once per run diff --git a/PWGLF/DataModel/LFStrangenessPIDTables.h b/PWGLF/DataModel/LFStrangenessPIDTables.h index 927dba1c454..f1c7b8907b8 100644 --- a/PWGLF/DataModel/LFStrangenessPIDTables.h +++ b/PWGLF/DataModel/LFStrangenessPIDTables.h @@ -180,7 +180,7 @@ DECLARE_SOA_TABLE_VERSIONED(DauTrackTOFPIDs_002, "AOD", "DAUTRACKTOFPID", 2, // dautrack::TOFExpTimeEl, dautrack::TOFExpTimePi, dautrack::TOFExpTimeKa, - dautrack::TOFExpTimePr); + dautrack::TOFExpTimePr); using DauTrackTOFPIDs = DauTrackTOFPIDs_002; // second gen: with collision Id, with TOFExpMom @@ -198,8 +198,8 @@ DECLARE_SOA_COLUMN(PosTOFSignal, posTOFSignal, float); //! positive trac DECLARE_SOA_COLUMN(NegTOFSignal, negTOFSignal, float); //! negative track signal DECLARE_SOA_COLUMN(PosTOFEventTime, posTOFEventTime, float); //! positive track event time DECLARE_SOA_COLUMN(NegTOFEventTime, negTOFEventTime, float); //! negative track event time -DECLARE_SOA_COLUMN(PosTOFLength, posTOFLength, float); //! positive track length, recalculated -DECLARE_SOA_COLUMN(NegTOFLength, negTOFLength, float); //! negative track length, recalculated +DECLARE_SOA_COLUMN(PosTOFLength, posTOFLength, float); //! positive track length, recalculated +DECLARE_SOA_COLUMN(NegTOFLength, negTOFLength, float); //! negative track length, recalculated // delta-times DECLARE_SOA_COLUMN(PosTOFDeltaTLaPi, posTOFDeltaTLaPi, float); //! positive track TOFDeltaT from pion <- lambda expectation @@ -221,7 +221,7 @@ DECLARE_SOA_COLUMN(TOFNSigmaALaPr, tofNSigmaALaPr, float); //! negative DECLARE_SOA_COLUMN(TOFNSigmaALaPi, tofNSigmaALaPi, float); //! positive track NSigma from pion <- antilambda expectation 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 - + // for wrong hypothesis DECLARE_SOA_COLUMN(TOFNSigmaElPosFromPhoton, tofNSigmaElPosFromPhoton, float); //! n sigma of positive track from photon conversion under electron hypothesis DECLARE_SOA_COLUMN(TOFNSigmaElNegFromPhoton, tofNSigmaElNegFromPhoton, float); //! n sigma of negative track from photon conversion under electron hypothesis @@ -369,7 +369,7 @@ DECLARE_SOA_TABLE(V0TOFNSigmasAll, "AOD", "V0TOFNSIGMAALL", // processed NSigma namespace cascdata { // define constants for NSigma operation -const float kNoTOFValue = -1e+6; +constexpr float kNoTOFValue = -1e+6; const float kEpsilon = 1e-4; // lengths as stored in the AO2D for TOF calculations @@ -499,7 +499,6 @@ DECLARE_SOA_TABLE(CascTOFPIDs, "AOD", "CASCTOFPID", // processed information for cascdata::PosTOFDeltaTOmPi, cascdata::PosTOFDeltaTOmPr, cascdata::NegTOFDeltaTOmPi, cascdata::NegTOFDeltaTOmPr, cascdata::BachTOFDeltaTOmKa); - DECLARE_SOA_TABLE(CascTOFNSigmas, "AOD", "CascTOFNSigmas", // Nsigmas for cascades cascdata::TOFNSigmaXiLaPi, cascdata::TOFNSigmaXiLaPr, cascdata::TOFNSigmaXiPi, cascdata::TOFNSigmaOmLaPi, cascdata::TOFNSigmaOmLaPr, cascdata::TOFNSigmaOmKa, @@ -508,13 +507,11 @@ DECLARE_SOA_TABLE(CascTOFNSigmas, "AOD", "CascTOFNSigmas", // Nsigmas for cascad cascdata::BachelorHasTOF, cascdata::TofXiCompatibility, cascdata::TofOmegaCompatibility); - DECLARE_SOA_TABLE(CascTOFNSigmasAll, "AOD", "CascTOFNSigmasAll", // Nsigmas for cascades including wrong hypothesis cascdata::TOFNSigmaElFromLambdaFromXi, cascdata::TOFNSigmaElFromXi, cascdata::TOFNSigmaElFromLambdaFromOmega, cascdata::TOFNSigmaElFromOmega, cascdata::TOFNSigmaPiFromLambdaFromXi, cascdata::TOFNSigmaPiFromXi, cascdata::TOFNSigmaPiFromLambdaFromOmega, cascdata::TOFNSigmaPiFromOmega, cascdata::TOFNSigmaKaFromLambdaFromXi, cascdata::TOFNSigmaKaFromXi, cascdata::TOFNSigmaKaFromLambdaFromOmega, cascdata::TOFNSigmaKaFromOmega, cascdata::TOFNSigmaPrFromLambdaFromXi, cascdata::TOFNSigmaPrFromXi, cascdata::TOFNSigmaPrFromLambdaFromOmega, cascdata::TOFNSigmaPrFromOmega); - } // namespace o2::aod #endif // PWGLF_DATAMODEL_LFSTRANGENESSPIDTABLES_H_ diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index bb17f96f717..a1cce49a343 100644 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -66,7 +66,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZNC, energyCommonZNC, //! get the total s // event time DECLARE_SOA_COLUMN(EventTime, eventTime, float); //! event time (FT0, TOF) for TOF PID (stored once per event) -// event time error +// event time DECLARE_SOA_COLUMN(EventTimeErr, eventTimeErr, float); //! event time (FT0, TOF) for TOF PID (stored once per event) } // namespace stracollision @@ -281,15 +281,15 @@ DECLARE_SOA_TABLE_VERSIONED(StraEvSels_005, "AOD", "STRAEVSELS", 5, //! // stracollision::EnergyCommonZNC, stracollision::IsUPC); -DECLARE_SOA_TABLE(StraEvSelExtras, "AOD", "STRAEVSELEXTRAS", //! debug information - udzdc::TimeZNA, // UPC info: re-assigned ZN-A time, in case of SG event, from the most active bc - udzdc::TimeZNC, // UPC info: re-assigned ZN-C time, in case of SG event, from the most active bc - udcollision::TimeFDDA, // Average A-side time (ns) - udcollision::TimeFDDC, // Average C-side time (ns) - udcollision::TimeFV0A, // Average A-side time (ns) - udcollision::TimeFT0A, // Average A-side time (ns) - udcollision::TimeFT0C, // Average C-side time (ns) - udcollision::TriggerMaskFT0); // 8 trigger bits: OrA, OrC, Semi-central, Central, Vertex, IsActiveA, IsActiveC, IsFlangeEvent +DECLARE_SOA_TABLE(StraEvSelExtras, "AOD", "STRAEVSELEXTRAS", //! debug information + udzdc::TimeZNA, // UPC info: re-assigned ZN-A time, in case of SG event, from the most active bc + udzdc::TimeZNC, // UPC info: re-assigned ZN-C time, in case of SG event, from the most active bc + udcollision::TimeFDDA, // Average A-side time (ns) + udcollision::TimeFDDC, // Average C-side time (ns) + udcollision::TimeFV0A, // Average A-side time (ns) + udcollision::TimeFT0A, // Average A-side time (ns) + udcollision::TimeFT0C, // Average C-side time (ns) + udcollision::TriggerMaskFT0); // 8 trigger bits: OrA, OrC, Semi-central, Central, Vertex, IsActiveA, IsActiveC, IsFlangeEvent DECLARE_SOA_TABLE(StraEvSelsRun2, "AOD", "STRAEVSELSRUN2", //! debug information evsel::Sel8, evsel::Sel7, evsel::Selection, //! event selection: sel8 diff --git a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt index 2c2ff72974f..8f7af7bb63e 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt +++ b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt @@ -9,11 +9,6 @@ # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. -o2physics_add_dpl_workflow(stradautracksconverter - SOURCES stradautracksconverter.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(stradautrackstpcpidconverter SOURCES stradautrackstpcpidconverter.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore @@ -32,11 +27,6 @@ o2physics_add_dpl_workflow(stradautrackstofpidconverter2 o2physics_add_dpl_workflow(stradautrackstofpidconverter3 SOURCES stradautrackstofpidconverter3.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(stradautracksextraconverter - SOURCES stradautracksextraconverter.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(stradautracksextraconverter2 diff --git a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx index 8509f93c560..668a47a060e 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx +++ b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx @@ -24,8 +24,16 @@ struct stradautrackstofpidconverter { void process(soa::Join const& v0s, soa::Join const& cascs, aod::DauTrackExtras const& dauTracks) { // prepare arrays with the relevant information - std::vector lLengths(dauTracks.size(), 1.e+6), lTOFSignals(dauTracks.size(), -1e+3f), lTOFEvTimes(dauTracks.size(), -1e+3f); - for (const auto& v0 : v0s) { + std::vector lLengths, lTOFSignals, lTOFEvTimes; + lLengths.reserve(dauTracks.size()); + lTOFSignals.reserve(dauTracks.size()); + lTOFEvTimes.reserve(dauTracks.size()); + for (int ii = 0; ii < dauTracks.size(); ii++) { + lLengths[ii] = 1e+6; + lTOFSignals[ii] = -1e+3f; + lTOFEvTimes[ii] = -1e+3f; + } + for (auto& v0 : v0s) { lLengths[v0.posTrackExtraId()] = v0.posTOFLengthToPV(); lTOFSignals[v0.posTrackExtraId()] = v0.posTOFSignal(); lTOFEvTimes[v0.posTrackExtraId()] = v0.posTOFEventTime(); @@ -33,7 +41,7 @@ struct stradautrackstofpidconverter { lTOFSignals[v0.negTrackExtraId()] = v0.negTOFSignal(); lTOFEvTimes[v0.negTrackExtraId()] = v0.negTOFEventTime(); } - for (const auto& casc : cascs) { + for (auto& casc : cascs) { lLengths[casc.posTrackExtraId()] = casc.posTOFLengthToPV(); lTOFSignals[casc.posTrackExtraId()] = casc.posTOFSignal(); lTOFEvTimes[casc.posTrackExtraId()] = casc.posTOFEventTime(); @@ -44,7 +52,7 @@ struct stradautrackstofpidconverter { lTOFSignals[casc.bachTrackExtraId()] = casc.bachTOFSignal(); lTOFEvTimes[casc.bachTrackExtraId()] = casc.bachTOFEventTime(); } - for (unsigned int ii = 0; ii < dauTracks.size(); ii++) { + for (int ii = 0; ii < dauTracks.size(); ii++) { dautracktofpids(-1, -1, lTOFSignals[ii], lTOFEvTimes[ii], 999.0f /*dummy event time error for TOF*/, lLengths[ii], 0.0f); } } @@ -54,4 +62,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ adaptAnalysisTask(cfgc)}; -} +} \ No newline at end of file diff --git a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx index e753005f124..0e71bc4a41d 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx +++ b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx @@ -18,7 +18,7 @@ using namespace o2; using namespace o2::framework; -// converts DauTrackTOFPIDs_002 to _003 +// converts DauTrackTOFPIDs_001 to _002 struct stradautrackstofpidconverter3 { Produces dautracktofpids; Produces straEvTimes; @@ -37,7 +37,7 @@ struct stradautrackstofpidconverter3 { 0.0f); } for (const auto& value : straEvTimes_000) { - straEvTimes(value.eventTime(), 1e+6f /*dummy event time error for TOF*/); + straEvTimes(value.eventTime(), 999.0f /*dummy event time error for TOF*/); } } }; diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index 2de17023656..ce06cb3efd1 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -78,21 +78,21 @@ struct strangederivedbuilder { struct : ProducesGroup { //__________________________________________________ // fundamental building blocks of derived data - Produces strangeColl; // characterises collisions - Produces strangeCollLabels; // characterises collisions - Produces strangeMCColl; // characterises collisions / MC - Produces strangeMCMults; // characterises collisions / MC mults - Produces strangeCents; // characterises collisions / centrality in Run 3 - Produces strangeCentsRun2; // characterises collisions / centrality in Run 2 - Produces strangeEvSels; // characterises collisions / centrality / sel8 selection in Run 3 - Produces strangeEvSelExtras; // extra event selection variables in Run 3 - Produces strangeEvSelsRun2; // characterises collisions / centrality / sel8 selection in Run 2 - Produces strangeStamps; // provides timestamps, run numbers - Produces straEvTimes; // provides event times (FT0, TOF) - Produces v0collref; // references collisions from V0s - Produces casccollref; // references collisions from cascades - Produces kfcasccollref; // references collisions from KF cascades - Produces tracasccollref; // references collisions from tracked cascades + Produces strangeColl; // characterises collisions + Produces strangeCollLabels; // characterises collisions + Produces strangeMCColl; // characterises collisions / MC + Produces strangeMCMults; // characterises collisions / MC mults + Produces strangeCents; // characterises collisions / centrality in Run 3 + Produces strangeCentsRun2; // characterises collisions / centrality in Run 2 + Produces strangeEvSels; // characterises collisions / centrality / sel8 selection in Run 3 + Produces strangeEvSelExtras; // extra event selection variables in Run 3 + Produces strangeEvSelsRun2; // characterises collisions / centrality / sel8 selection in Run 2 + Produces strangeStamps; // provides timestamps, run numbers + Produces straEvTimes; // provides event times (FT0, TOF) + Produces v0collref; // references collisions from V0s + Produces casccollref; // references collisions from cascades + Produces kfcasccollref; // references collisions from KF cascades + Produces tracasccollref; // references collisions from tracked cascades //__________________________________________________ // track extra references @@ -586,9 +586,9 @@ struct strangederivedbuilder { collision.flags(), collision.alias_raw(), collision.rct_raw()); - products.strangeEvSelExtras(timeZNA, timeZNC, // ZDC info - timeFDDA, timeFDDC, // FDD info - timeFV0A, // FV0A info + products.strangeEvSelExtras(timeZNA, timeZNC, // ZDC info + timeFDDA, timeFDDC, // FDD info + timeFV0A, // FV0A info timeFT0A, timeFT0C, ft0TriggerMask); // FT0 info } else { // We are in Run 2 products.strangeCentsRun2(collision.centRun2V0M(), collision.centRun2V0A(), @@ -655,7 +655,7 @@ struct strangederivedbuilder { if (track.hasTOF() && track.collisionId() >= 0) { collisionEventTime[track.collisionId()] += track.tofEvTime(); // Take the average of the error instead of propagating the error as all event time error from tracks are fully correlated - collisionEventTimeErr[track.collisionId()] += track.tofEvTimeErr(); + collisionEventTimeErr[track.collisionId()] += track.tofEvTimeErr(); collisionNtracks[track.collisionId()]++; } } @@ -665,7 +665,7 @@ struct strangederivedbuilder { collisionEventTimeErr[collision.globalIndex()] /= static_cast(collisionNtracks[collision.globalIndex()]); } else { collisionEventTime[collision.globalIndex()] = -1e+6; // undefined - collisionEventTimeErr[collision.globalIndex()] = -1e+6; // undefined + collisionEventTimeErr[collision.globalIndex()] = -1e-6; // undefined } histos.fill(HIST("h2dCollisionTimesVsNTracks"), collisionNtracks[collision.globalIndex()], collisionEventTime[collision.globalIndex()]); products.straEvTimes(collisionEventTime[collision.globalIndex()], collisionEventTimeErr[collision.globalIndex()]); @@ -712,23 +712,23 @@ struct strangederivedbuilder { } } - void processCollisionsRun3(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&) + void processCollisionsRun3(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&) { populateCollisionTables(collisions, collisions, V0s, Cascades, KFCascades, TraCascades, bcs); } - void processCollisionsRun3WithUD(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&, UDCollisionsFull const& udCollisions) + void processCollisionsRun3WithUD(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&, UDCollisionsFull const& udCollisions) { populateCollisionTables(collisions, udCollisions, V0s, Cascades, KFCascades, TraCascades, bcs); } - void processCollisionsRun3WithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) + void processCollisionsRun3WithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) { populateMCCollisionTable(mcCollisions, mcParticles); populateCollisionTables(collisions, collisions, V0s, Cascades, KFCascades, TraCascades, bcs); } - void processCollisionsRun3WithUDWithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&, UDCollisionsFull const& udCollisions, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) + void processCollisionsRun3WithUDWithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&, UDCollisionsFull const& udCollisions, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) { populateMCCollisionTable(mcCollisions, mcParticles); populateCollisionTables(collisions, udCollisions, V0s, Cascades, KFCascades, TraCascades, bcs); diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index e27a333e67e..aae65dd3832 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -106,6 +106,7 @@ struct strangenesstofpid { Configurable calculationMethod{"calculationMethod", 0, "algorithm for TOF calculation. 0: fast analytical withouot eloss, 1: O2 Propagator + trackLTIntegral (slow), 2: both methods and do comparison studies (slow)"}; 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)"}; + Configurable useNsigmaCalibStrTOF{"useNsigmaCalibStrTOF", false, "if true, use manual strangeness TOF PID calibration"}; Configurable reassociateTracks{"reassociateTracks", true, "if true, reassociate tracks to the collision the V0 or cascade belongs to. Relevant especially at high IR"}; Configurable doBCshift{"doBCshift", true, "if true, perform time shift for collisions in different BCs when reassigning"}; Configurable rejectUndefinedTof{"rejectUndefinedTof", true, "if true, reject tracks with TOF signal 0.000f for safety"}; @@ -156,6 +157,7 @@ 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 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"}; } ccdbConfigurations; @@ -187,6 +189,26 @@ struct strangenesstofpid { // very broad time axis ConfigurableAxis axisTimeLong{"axisTimeLong", {3000, -1500000.0f, 1500000.0f}, "time (ps)"}; } axes; // aggregate axes fo simplicity of navigation in HY + + // for n-sigma calibration + bool nSigmaCalibLoaded; + TList* nSigmaCalibObjects = nullptr; + TH1 *hMeanPosLaPi = nullptr, *hSigmaPosLaPi = nullptr; + TH1 *hMeanPosLaPr = nullptr, *hSigmaPosLaPr = nullptr; + TH1 *hMeanNegLaPi = nullptr, *hSigmaNegLaPi = nullptr; + TH1 *hMeanNegLaPr = nullptr, *hSigmaNegLaPr = nullptr; + TH1 *hMeanPosK0Pi = nullptr, *hSigmaPosK0Pi = nullptr; + TH1 *hMeanNegK0Pi = nullptr, *hSigmaNegK0Pi = nullptr; + TH1 *hMeanPosXiPi = nullptr, *hSigmaPosXiPi = nullptr; + TH1 *hMeanPosXiPr = nullptr, *hSigmaPosXiPr = nullptr; + TH1 *hMeanNegXiPi = nullptr, *hSigmaNegXiPi = nullptr; + TH1 *hMeanNegXiPr = nullptr, *hSigmaNegXiPr = nullptr; + TH1 *hMeanBachXiPi = nullptr, *hSigmaBachXiPi = nullptr; + TH1 *hMeanPosOmPi = nullptr, *hSigmaPosOmPi = nullptr; + TH1 *hMeanPosOmPr = nullptr, *hSigmaPosOmPr = nullptr; + TH1 *hMeanNegOmPi = nullptr, *hSigmaNegOmPi = nullptr; + TH1 *hMeanNegOmPr = nullptr, *hSigmaNegOmPr = nullptr; + TH1 *hMeanBachOmKa = nullptr, *hSigmaBachOmKa = nullptr; int mRunNumber; float d_bz; @@ -580,6 +602,82 @@ struct strangenesstofpid { // LOG(info) << "Material look-up table loaded!"; // } mRunNumber = runNumber; + + // if TOF Nsigma desired + if (useNsigmaCalibStrTOF) { + if (doNSigmas) { + nSigmaCalibObjects = ccdb->getForRun(ccdbConfigurations.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")); + 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!"; + } + } + } + } } float velocity(float lMomentum, float lMass) @@ -766,15 +864,17 @@ struct strangenesstofpid { //_____________________________________________________________________________________________ // Actual calculation - float velocityPositivePr, velocityPositivePi, lengthPositive; - velocityPositivePr = velocityPositivePi = lengthPositive = o2::aod::v0data::kNoTOFValue; + float velocityPositiveEl, velocityPositivePr, velocityPositivePi, lengthPositive; + velocityPositiveEl = velocityPositivePr = velocityPositivePi = lengthPositive = o2::aod::v0data::kNoTOFValue; if (pTof.hasTOF && mapCollisionTime.find(collisionId) != mapCollisionTime.end() && pValidTOF) { // method 0: legacy standalone without use of primary particle TOF if (calculationMethod.value == 0) { + velocityPositiveEl = velocity(posTrack.getP(), o2::constants::physics::MassElectron); velocityPositivePr = velocity(posTrack.getP(), o2::constants::physics::MassProton); velocityPositivePi = velocity(posTrack.getP(), o2::constants::physics::MassPionCharged); lengthPositive = findInterceptLength(posTrack, d_bz); + v0tof.timePositiveEl = lengthPositive / velocityPositiveEl; v0tof.timePositivePr = lengthPositive / velocityPositivePr; v0tof.timePositivePi = lengthPositive / velocityPositivePi; } @@ -793,35 +893,57 @@ struct strangenesstofpid { } if (successPropag) { lengthPositive = pTof.length - ltIntegral.getL(); + v0tof.timePositiveEl = o2::framework::pid::tof::MassToExpTime(pTof.tofExpMom, lengthPositive, o2::constants::physics::MassElectron * o2::constants::physics::MassElectron); v0tof.timePositivePr = o2::framework::pid::tof::MassToExpTime(pTof.tofExpMom, lengthPositive, o2::constants::physics::MassProton * o2::constants::physics::MassProton); v0tof.timePositivePi = o2::framework::pid::tof::MassToExpTime(pTof.tofExpMom, lengthPositive, o2::constants::physics::MassPionCharged * o2::constants::physics::MassPionCharged); // as primary + v0tof.timeAsPrimaryPositiveEl = o2::framework::pid::tof::MassToExpTime(pTof.tofExpMom, pTof.length, o2::constants::physics::MassElectron * o2::constants::physics::MassElectron); v0tof.timeAsPrimaryPositivePr = o2::framework::pid::tof::MassToExpTime(pTof.tofExpMom, pTof.length, o2::constants::physics::MassProton * o2::constants::physics::MassProton); v0tof.timeAsPrimaryPositivePi = o2::framework::pid::tof::MassToExpTime(pTof.tofExpMom, pTof.length, o2::constants::physics::MassPionCharged * o2::constants::physics::MassPionCharged); } } } if (lengthPositive > 0.0f) { - v0tof.deltaTimePositiveLambdaPr = (pTof.tofSignal - pTof.tofEvTime) - (v0tof.timeLambda + v0tof.timePositivePr); + v0tof.deltaTimePositivePhotonEl = (pTof.tofSignal - pTof.tofEvTime) - (v0tof.timePhoton + v0tof.timePositiveEl); + v0tof.deltaTimePositiveLambdaPr = (pTof.tofSignal - pTof.tofEvTime) - (v0tof.timeLambda + v0tof.timePositivePr); v0tof.deltaTimePositiveLambdaPi = (pTof.tofSignal - pTof.tofEvTime) - (v0tof.timeLambda + v0tof.timePositivePi); v0tof.deltaTimePositiveK0ShortPi = (pTof.tofSignal - pTof.tofEvTime) - (v0tof.timeK0Short + v0tof.timePositivePi); - // use nSigma function from O2Physics/Common/Core/PID/PIDTOFParamService.h - v0tof.nSigmaPositivePhotonEl = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timePhoton, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - v0tof.nSigmaPositiveLambdaPi = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeLambda, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - v0tof.nSigmaPositiveLambdaPr = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeLambda, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - v0tof.nSigmaPositiveK0ShortPi = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeK0Short, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - - // with wrong hypothesis - v0tof.nSigmaPositivePhotonPi = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timePhoton, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - v0tof.nSigmaPositivePhotonKa = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timePhoton, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - v0tof.nSigmaPositivePhotonPr = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timePhoton, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - v0tof.nSigmaPositiveLambdaEl = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeLambda, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - v0tof.nSigmaPositiveLambdaKa = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeLambda, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - v0tof.nSigmaPositiveK0ShortEl = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeK0Short, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - v0tof.nSigmaPositiveK0ShortKa = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeK0Short, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - v0tof.nSigmaPositiveK0ShortPr = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeK0Short, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + if (useNsigmaCalibStrTOF) { + // de facto nsigma + if (nSigmaCalibLoaded) { + v0tof.nSigmaPositivePhotonEl = -999.; + v0tof.nSigmaPositiveLambdaPi = (v0tof.deltaTimePositiveLambdaPi - hMeanPosLaPi->Interpolate(v0.p())) / hSigmaPosLaPi->Interpolate(v0.p()); + v0tof.nSigmaPositiveLambdaPr = (v0tof.deltaTimePositiveLambdaPr - hMeanPosLaPr->Interpolate(v0.p())) / hSigmaPosLaPr->Interpolate(v0.p()); + v0tof.nSigmaPositiveK0ShortPi = (v0tof.deltaTimePositiveK0ShortPi - hMeanPosK0Pi->Interpolate(v0.p())) / hSigmaPosK0Pi->Interpolate(v0.p()); + // with wrong hypothesis + v0tof.nSigmaPositivePhotonPi = -999.; + v0tof.nSigmaPositivePhotonKa = -999.; + v0tof.nSigmaPositivePhotonPr = -999.; + v0tof.nSigmaPositiveLambdaEl = -999.; + v0tof.nSigmaPositiveLambdaKa = -999.; + v0tof.nSigmaPositiveK0ShortEl = -999.; + v0tof.nSigmaPositiveK0ShortKa = -999.; + v0tof.nSigmaPositiveK0ShortPr = -999.; + } + } else { + // use nSigma function from O2Physics/Common/Core/PID/PIDTOFParamService.h + v0tof.nSigmaPositivePhotonEl = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timePhoton, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + v0tof.nSigmaPositiveLambdaPi = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeLambda, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + v0tof.nSigmaPositiveLambdaPr = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeLambda, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + v0tof.nSigmaPositiveK0ShortPi = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeK0Short, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + + // with wrong hypothesis + v0tof.nSigmaPositivePhotonPi = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timePhoton, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + v0tof.nSigmaPositivePhotonKa = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timePhoton, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + v0tof.nSigmaPositivePhotonPr = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timePhoton, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + v0tof.nSigmaPositiveLambdaEl = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeLambda, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + v0tof.nSigmaPositiveLambdaKa = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeLambda, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + v0tof.nSigmaPositiveK0ShortEl = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeK0Short, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + v0tof.nSigmaPositiveK0ShortKa = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeK0Short, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + v0tof.nSigmaPositiveK0ShortPr = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeK0Short, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + } // do QA histograms (calibration / QC) if (doQA) { @@ -859,14 +981,16 @@ struct strangenesstofpid { } } } - float velocityNegativePr, velocityNegativePi, lengthNegative; - velocityNegativePr = velocityNegativePi = lengthNegative = o2::aod::v0data::kNoTOFValue; + float velocityNegativeEl, velocityNegativePr, velocityNegativePi, lengthNegative; + velocityNegativeEl = velocityNegativePr = velocityNegativePi = lengthNegative = o2::aod::v0data::kNoTOFValue; if (nTof.hasTOF && mapCollisionTime.find(collisionId) != mapCollisionTime.end() && nValidTOF) { // method 0: legacy standalone without use of primary particle TOF if (calculationMethod.value == 0) { + velocityNegativeEl = velocity(negTrack.getP(), o2::constants::physics::MassElectron); velocityNegativePr = velocity(negTrack.getP(), o2::constants::physics::MassProton); velocityNegativePi = velocity(negTrack.getP(), o2::constants::physics::MassPionCharged); lengthNegative = findInterceptLength(negTrack, d_bz); + v0tof.timeNegativeEl = lengthNegative / velocityNegativeEl; v0tof.timeNegativePr = lengthNegative / velocityNegativePr; v0tof.timeNegativePi = lengthNegative / velocityNegativePi; } @@ -885,34 +1009,57 @@ struct strangenesstofpid { } if (successPropag) { lengthNegative = nTof.length - ltIntegral.getL(); + v0tof.timeNegativeEl = o2::framework::pid::tof::MassToExpTime(nTof.tofExpMom, lengthNegative, o2::constants::physics::MassElectron * o2::constants::physics::MassElectron); v0tof.timeNegativePr = o2::framework::pid::tof::MassToExpTime(nTof.tofExpMom, lengthNegative, o2::constants::physics::MassProton * o2::constants::physics::MassProton); v0tof.timeNegativePi = o2::framework::pid::tof::MassToExpTime(nTof.tofExpMom, lengthNegative, o2::constants::physics::MassPionCharged * o2::constants::physics::MassPionCharged); // as primary + v0tof.timeAsPrimaryNegativeEl = o2::framework::pid::tof::MassToExpTime(nTof.tofExpMom, nTof.length, o2::constants::physics::MassElectron * o2::constants::physics::MassElectron); v0tof.timeAsPrimaryNegativePr = o2::framework::pid::tof::MassToExpTime(nTof.tofExpMom, nTof.length, o2::constants::physics::MassProton * o2::constants::physics::MassProton); v0tof.timeAsPrimaryNegativePi = o2::framework::pid::tof::MassToExpTime(nTof.tofExpMom, nTof.length, o2::constants::physics::MassPionCharged * o2::constants::physics::MassPionCharged); } } } if (lengthNegative > 0.0f) { + v0tof.deltaTimeNegativePhotonEl = (nTof.tofSignal - nTof.tofEvTime) - (v0tof.timePhoton + v0tof.timeNegativeEl); v0tof.deltaTimeNegativeLambdaPr = (nTof.tofSignal - nTof.tofEvTime) - (v0tof.timeLambda + v0tof.timeNegativePr); v0tof.deltaTimeNegativeLambdaPi = (nTof.tofSignal - nTof.tofEvTime) - (v0tof.timeLambda + v0tof.timeNegativePi); v0tof.deltaTimeNegativeK0ShortPi = (nTof.tofSignal - nTof.tofEvTime) - (v0tof.timeK0Short + v0tof.timeNegativePi); - v0tof.nSigmaNegativePhotonEl = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timePhoton, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - v0tof.nSigmaNegativeLambdaPi = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeLambda, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - v0tof.nSigmaNegativeLambdaPr = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeLambda, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - v0tof.nSigmaNegativeK0ShortPi = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeK0Short, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - - // with wrong hypothesis - v0tof.nSigmaNegativePhotonPi = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timePhoton, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - v0tof.nSigmaNegativePhotonKa = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timePhoton, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - v0tof.nSigmaNegativePhotonPr = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timePhoton, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - v0tof.nSigmaNegativeLambdaEl = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeLambda, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - v0tof.nSigmaNegativeLambdaKa = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeLambda, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - v0tof.nSigmaNegativeK0ShortEl = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeK0Short, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - v0tof.nSigmaNegativeK0ShortKa = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeK0Short, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - v0tof.nSigmaNegativeK0ShortPr = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeK0Short, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + if (useNsigmaCalibStrTOF) { + // de facto nsigma + if (nSigmaCalibLoaded) { + v0tof.nSigmaNegativePhotonEl = -999.; + v0tof.nSigmaNegativeLambdaPi = (v0tof.deltaTimeNegativeLambdaPi - hMeanNegLaPi->Interpolate(v0.p())) / hSigmaNegLaPi->Interpolate(v0.p()); + v0tof.nSigmaNegativeLambdaPr = (v0tof.deltaTimeNegativeLambdaPr - hMeanNegLaPr->Interpolate(v0.p())) / hSigmaNegLaPr->Interpolate(v0.p()); + v0tof.nSigmaNegativeK0ShortPi = (v0tof.deltaTimeNegativeK0ShortPi - hMeanNegK0Pi->Interpolate(v0.p())) / hSigmaNegK0Pi->Interpolate(v0.p()); + // with wrong hypothesis + v0tof.nSigmaNegativePhotonPi = -999.; + v0tof.nSigmaNegativePhotonKa = -999.; + v0tof.nSigmaNegativePhotonPr = -999.; + v0tof.nSigmaNegativeLambdaEl = -999.; + v0tof.nSigmaNegativeLambdaKa = -999.; + v0tof.nSigmaNegativeK0ShortEl = -999.; + v0tof.nSigmaNegativeK0ShortKa = -999.; + v0tof.nSigmaNegativeK0ShortPr = -999.; + } + } else { + // use nSigma function from O2Physics/Common/Core/PID/PIDTOFParamService.h + v0tof.nSigmaNegativePhotonEl = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timePhoton, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + v0tof.nSigmaNegativeLambdaPi = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeLambda, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + v0tof.nSigmaNegativeLambdaPr = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeLambda, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + v0tof.nSigmaNegativeK0ShortPi = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeK0Short, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + + // with wrong hypothesis + v0tof.nSigmaNegativePhotonPi = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timePhoton, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + v0tof.nSigmaNegativePhotonKa = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timePhoton, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + v0tof.nSigmaNegativePhotonPr = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timePhoton, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + v0tof.nSigmaNegativeLambdaEl = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeLambda, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + v0tof.nSigmaNegativeLambdaKa = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeLambda, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + v0tof.nSigmaNegativeK0ShortEl = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeK0Short, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + v0tof.nSigmaNegativeK0ShortKa = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeK0Short, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + v0tof.nSigmaNegativeK0ShortPr = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeK0Short, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + } // do QA histograms (calibration / QC) if (doQA) { @@ -969,16 +1116,19 @@ struct strangenesstofpid { // calculation of delta-decay-time (no reliance on event time) if (nTof.hasTOF && pTof.hasTOF > 0) { // does not depend on event time + v0tof.deltaDecayTimePhoton = (pTof.tofSignal - v0tof.timePositiveEl) - (nTof.tofSignal - v0tof.timeNegativeEl); v0tof.deltaDecayTimeLambda = (pTof.tofSignal - v0tof.timePositivePr) - (nTof.tofSignal - v0tof.timeNegativePi); v0tof.deltaDecayTimeAntiLambda = (pTof.tofSignal - v0tof.timePositivePi) - (nTof.tofSignal - v0tof.timeNegativePr); v0tof.deltaDecayTimeK0Short = (pTof.tofSignal - v0tof.timePositivePi) - (nTof.tofSignal - v0tof.timeNegativePi); float evTimeMean = 0.5f * (pTof.tofEvTime + nTof.tofEvTime); + float decayTimePhoton = 0.5f * ((pTof.tofSignal - v0tof.timePositiveEl) + (nTof.tofSignal - v0tof.timeNegativeEl)) - evTimeMean; float decayTimeLambda = 0.5f * ((pTof.tofSignal - v0tof.timePositivePr) + (nTof.tofSignal - v0tof.timeNegativePi)) - evTimeMean; float decayTimeAntiLambda = 0.5f * ((pTof.tofSignal - v0tof.timePositivePi) + (nTof.tofSignal - v0tof.timeNegativePr)) - evTimeMean; float decayTimeK0Short = 0.5f * ((pTof.tofSignal - v0tof.timePositivePi) + (nTof.tofSignal - v0tof.timeNegativePi)) - evTimeMean; constexpr float lightSpeed = 0.0299792458; // in cm/ps + v0tof.betaPhoton = (lengthV0 / decayTimePhoton) / lightSpeed; v0tof.betaLambda = (lengthV0 / decayTimeLambda) / lightSpeed; v0tof.betaAntiLambda = (lengthV0 / decayTimeAntiLambda) / lightSpeed; v0tof.betaK0Short = (lengthV0 / decayTimeK0Short) / lightSpeed; @@ -1109,29 +1259,59 @@ struct strangenesstofpid { casctof.posDeltaTimeAsOmPr = (pTof.tofSignal - pTof.tofEvTime) - (omFlight + lambdaFlight + casctof.posFlightPr); if (cascade.sign() < 0) { - casctof.nSigmaXiLaPr = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - casctof.nSigmaOmLaPr = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - - // wrong hypothesis - casctof.nSigmaXiLaEl = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - casctof.nSigmaXiLaKa = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - casctof.nSigmaXiLaPi = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - - casctof.nSigmaOmLaEl = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - casctof.nSigmaOmLaKa = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - casctof.nSigmaOmLaPi = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + if (useNsigmaCalibStrTOF) { + if (nSigmaCalibLoaded) { + casctof.nSigmaXiLaPr = (casctof.posDeltaTimeAsXiPr - hMeanPosXiPr->Interpolate(cascade.p())) / hSigmaPosXiPr->Interpolate(cascade.p()); + casctof.nSigmaOmLaPr = (casctof.posDeltaTimeAsOmPr - hMeanPosOmPr->Interpolate(cascade.p())) / hSigmaPosOmPr->Interpolate(cascade.p()); + // wrong hypothesis + casctof.nSigmaXiLaEl = -999.; + casctof.nSigmaXiLaKa = -999.; + casctof.nSigmaXiLaPi = -999.; + + casctof.nSigmaOmLaEl = -999.; + casctof.nSigmaOmLaKa = -999.; + casctof.nSigmaOmLaPi = -999.; + } + } else { + casctof.nSigmaXiLaPr = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + casctof.nSigmaOmLaPr = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + + // wrong hypothesis + casctof.nSigmaXiLaEl = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + casctof.nSigmaXiLaKa = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + casctof.nSigmaXiLaPi = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + + casctof.nSigmaOmLaEl = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + casctof.nSigmaOmLaKa = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + casctof.nSigmaOmLaPi = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + } } else { - casctof.nSigmaXiLaPi = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - casctof.nSigmaOmLaPi = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - - // wrong hypothesis - casctof.nSigmaXiLaEl = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - casctof.nSigmaXiLaKa = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - casctof.nSigmaXiLaPr = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - - casctof.nSigmaOmLaEl = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - casctof.nSigmaOmLaKa = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - casctof.nSigmaOmLaPr = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + if (useNsigmaCalibStrTOF) { + if (nSigmaCalibLoaded) { + casctof.nSigmaXiLaPi = (casctof.posDeltaTimeAsXiPi - hMeanPosXiPi->Interpolate(cascade.p())) / hSigmaPosXiPi->Interpolate(cascade.p()); + casctof.nSigmaOmLaPi = (casctof.posDeltaTimeAsOmPi - hMeanPosOmPi->Interpolate(cascade.p())) / hSigmaPosOmPi->Interpolate(cascade.p()); + // wrong hypothesis + casctof.nSigmaXiLaEl = -999.; + casctof.nSigmaXiLaKa = -999.; + casctof.nSigmaXiLaPi = -999.; + + casctof.nSigmaOmLaEl = -999.; + casctof.nSigmaOmLaKa = -999.; + casctof.nSigmaOmLaPi = -999.; + } + } else { + casctof.nSigmaXiLaPi = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + casctof.nSigmaOmLaPi = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + + // wrong hypothesis + casctof.nSigmaXiLaEl = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + casctof.nSigmaXiLaKa = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + casctof.nSigmaXiLaPr = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + + casctof.nSigmaOmLaEl = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + casctof.nSigmaOmLaKa = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + casctof.nSigmaOmLaPr = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); + } } // do QA histograms (calibration / QC) @@ -1216,29 +1396,59 @@ struct strangenesstofpid { casctof.negDeltaTimeAsOmPr = (nTof.tofSignal - nTof.tofEvTime) - (omFlight + lambdaFlight + casctof.negFlightPr); if (cascade.sign() < 0) { - casctof.nSigmaXiLaPi = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - casctof.nSigmaOmLaPi = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - - // wrogn hypothesis - casctof.nSigmaXiLaEl = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - casctof.nSigmaXiLaKa = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - casctof.nSigmaXiLaPr = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - - casctof.nSigmaOmLaEl = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - casctof.nSigmaOmLaKa = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - casctof.nSigmaOmLaPr = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + if (useNsigmaCalibStrTOF) { + if (nSigmaCalibLoaded) { + casctof.nSigmaXiLaPi = (casctof.negDeltaTimeAsXiPi - hMeanNegXiPi->Interpolate(cascade.p())) / hSigmaNegXiPi->Interpolate(cascade.p()); + casctof.nSigmaOmLaPi = (casctof.negDeltaTimeAsOmPi - hMeanNegOmPi->Interpolate(cascade.p())) / hSigmaNegOmPi->Interpolate(cascade.p()); + // wrong hypothesis + casctof.nSigmaXiLaEl = -999.; + casctof.nSigmaXiLaKa = -999.; + casctof.nSigmaXiLaPi = -999.; + + casctof.nSigmaOmLaEl = -999.; + casctof.nSigmaOmLaKa = -999.; + casctof.nSigmaOmLaPi = -999.; + } + } else { + casctof.nSigmaXiLaPi = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + casctof.nSigmaOmLaPi = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + + // wrogn hypothesis + casctof.nSigmaXiLaEl = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + casctof.nSigmaXiLaKa = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + casctof.nSigmaXiLaPr = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + + casctof.nSigmaOmLaEl = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + casctof.nSigmaOmLaKa = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + casctof.nSigmaOmLaPr = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + } } else { - casctof.nSigmaXiLaPr = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - casctof.nSigmaOmLaPr = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - - // wrogn hypothesis - casctof.nSigmaXiLaEl = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - casctof.nSigmaXiLaKa = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - casctof.nSigmaXiLaPi = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - - casctof.nSigmaOmLaEl = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - casctof.nSigmaOmLaKa = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - casctof.nSigmaOmLaPi = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + if (useNsigmaCalibStrTOF) { + if (nSigmaCalibLoaded) { + casctof.nSigmaXiLaPr = (casctof.negDeltaTimeAsXiPr - hMeanNegXiPr->Interpolate(cascade.p())) / hSigmaNegXiPr->Interpolate(cascade.p()); + casctof.nSigmaOmLaPr = (casctof.negDeltaTimeAsOmPr - hMeanNegOmPr->Interpolate(cascade.p())) / hSigmaNegOmPr->Interpolate(cascade.p()); + // wrong hypothesis + casctof.nSigmaXiLaEl = -999.; + casctof.nSigmaXiLaKa = -999.; + casctof.nSigmaXiLaPi = -999.; + + casctof.nSigmaOmLaEl = -999.; + casctof.nSigmaOmLaKa = -999.; + casctof.nSigmaOmLaPi = -999.; + } + } else { + casctof.nSigmaXiLaPr = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + casctof.nSigmaOmLaPr = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + + // wrong hypothesis + casctof.nSigmaXiLaEl = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + casctof.nSigmaXiLaKa = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + casctof.nSigmaXiLaPi = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + + casctof.nSigmaOmLaEl = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + casctof.nSigmaOmLaKa = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + casctof.nSigmaOmLaPi = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + } } // do QA histograms (calibration / QC) @@ -1320,19 +1530,21 @@ struct strangenesstofpid { casctof.bachDeltaTimeAsXiPi = (bTof.tofSignal - bTof.tofEvTime) - (xiFlight + casctof.bachFlightPi); casctof.bachDeltaTimeAsOmKa = (bTof.tofSignal - bTof.tofEvTime) - (omFlight + casctof.bachFlightKa); - if (cascade.sign() < 0) { - casctof.nSigmaXiPi = mTOFResponse->nSigma(bTof.tofSignal - xiFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); - casctof.nSigmaOmKa = mTOFResponse->nSigma(bTof.tofSignal - omFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); - - // wrong hypothesis - casctof.nSigmaXiEl = mTOFResponse->nSigma(bTof.tofSignal - xiFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); - casctof.nSigmaXiKa = mTOFResponse->nSigma(bTof.tofSignal - xiFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); - casctof.nSigmaXiPr = mTOFResponse->nSigma(bTof.tofSignal - xiFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); - - casctof.nSigmaOmEl = mTOFResponse->nSigma(bTof.tofSignal - omFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); - casctof.nSigmaOmPi = mTOFResponse->nSigma(bTof.tofSignal - omFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); - casctof.nSigmaOmPr = mTOFResponse->nSigma(bTof.tofSignal - omFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); - } else { + if (useNsigmaCalibStrTOF) { + if (nSigmaCalibLoaded) { + casctof.nSigmaXiPi = (casctof.bachDeltaTimeAsXiPi - hMeanBachXiPi->Interpolate(cascade.p())) / hSigmaBachXiPi->Interpolate(cascade.p()); + casctof.nSigmaOmKa = (casctof.bachDeltaTimeAsOmKa - hMeanBachOmKa->Interpolate(cascade.p())) / hSigmaBachOmKa->Interpolate(cascade.p()); + + // wrong hypothesis + casctof.nSigmaXiEl = -999.; + casctof.nSigmaXiKa = -999.; + casctof.nSigmaXiPr = -999.; + + casctof.nSigmaOmEl = -999.; + casctof.nSigmaOmPi = -999.; + casctof.nSigmaOmPr = -999.; + } + } else { casctof.nSigmaXiPi = mTOFResponse->nSigma(bTof.tofSignal - xiFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); casctof.nSigmaOmKa = mTOFResponse->nSigma(bTof.tofSignal - omFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); @@ -1417,19 +1629,23 @@ struct strangenesstofpid { //________________________________________________________________________ // estimate event times (only necessary for original data) std::vector collisionEventTime(collisions.size(), 0.0); - std::vector collisionEventTimeError(collisions.size(), 0.0); + std::vector collisionEventTimeErr(collisions.size(), 0.0); std::vector collisionNtracks(collisions.size(), 0); for (const auto& track : tracks) { - if (track.hasTOF() && track.has_collision()) { + if (track.hasTOF() && track.collisionId() >= 0) { collisionEventTime[track.collisionId()] += track.tofEvTime(); + // Take the average of the error instead of propagating the error as all event time error from tracks are fully correlated + collisionEventTimeErr[track.collisionId()] += track.tofEvTimeErr(); collisionNtracks[track.collisionId()]++; } } for (const auto& collision : collisions) { if (collisionNtracks[collision.globalIndex()] > 0) { collisionEventTime[collision.globalIndex()] /= static_cast(collisionNtracks[collision.globalIndex()]); + collisionEventTimeErr[collision.globalIndex()] /= static_cast(collisionNtracks[collision.globalIndex()]); } else { collisionEventTime[collision.globalIndex()] = -1e+6; // undefined + collisionEventTimeErr[collision.globalIndex()] = -1e+6; // undefined } histos.fill(HIST("hCollisionTimes"), collisionEventTime[collision.globalIndex()]); } @@ -1467,8 +1683,10 @@ struct strangenesstofpid { pTof.hasTPC = pTra.hasTPC(); pTof.hasTOF = pTra.hasTOF(); pTof.tofExpMom = pTra.tofExpMom(); - pTof.tofEvTime = reassociateTracks ? mapCollisionTime[V0.collisionId()] : pTra.tofEvTime(); - pTof.tofEvTimeErr = reassociateTracks ? mapCollisionTimeError[V0.collisionId()] : pTra.tofEvTimeErr(); + // pTof.tofEvTime = reassociateTracks ? mapCollisionTime[V0.collisionId()] : pTra.tofEvTime(); + // pTof.tofEvTimeErr = reassociateTracks ? mapCollisionTimeError[V0.collisionId()] : pTra.tofEvTimeErr(); + pTof.tofEvTime = reassociateTracks ? collisionEventTime[V0.collisionId()] : pTra.tofEvTime(); + pTof.tofEvTimeErr = reassociateTracks ? collisionEventTimeErr[V0.collisionId()] : pTra.tofEvTimeErr(); // pTof.tofSignal = pTra.tofSignal() + (doBCshift ? deltaTimePos : 0.0f); pTof.tofSignal = doBCshift && pTra.has_collision() ? pTra.tofSignalInAnotherBC(pTra.collision().bc_as().globalBC(), V0.collision().bc_as().globalBC()) : pTra.tofSignal(); pTof.length = pTra.length(); @@ -1481,8 +1699,10 @@ struct strangenesstofpid { nTof.hasTPC = nTra.hasTPC(); nTof.hasTOF = nTra.hasTOF(); nTof.tofExpMom = nTra.tofExpMom(); - nTof.tofEvTime = reassociateTracks ? mapCollisionTime[V0.collisionId()] : nTra.tofEvTime(); - nTof.tofEvTimeErr = reassociateTracks ? mapCollisionTimeError[V0.collisionId()] : nTra.tofEvTimeErr(); + // nTof.tofEvTime = reassociateTracks ? mapCollisionTime[V0.collisionId()] : nTra.tofEvTime(); + // nTof.tofEvTimeErr = reassociateTracks ? mapCollisionTimeError[V0.collisionId()] : nTra.tofEvTimeErr(); + nTof.tofEvTime = reassociateTracks ? collisionEventTime[V0.collisionId()] : nTra.tofEvTime(); + nTof.tofEvTimeErr = reassociateTracks ? collisionEventTimeErr[V0.collisionId()] : nTra.tofEvTimeErr(); // nTof.tofSignal = nTra.tofSignal() + (doBCshift ? deltaTimeNeg : 0.0f); nTof.tofSignal = doBCshift && nTra.has_collision() ? nTra.tofSignalInAnotherBC(nTra.collision().bc_as().globalBC(), V0.collision().bc_as().globalBC()) : nTra.tofSignal(); nTof.length = nTra.length(); From 17b493767363f9910187b24be60bec692d5dc2cc Mon Sep 17 00:00:00 2001 From: romainschotter Date: Tue, 26 May 2026 12:49:00 +0200 Subject: [PATCH 15/28] Update --- Common/Core/PID/PIDTOFParamService.cxx | 2 - PWGLF/DataModel/LFStrangenessPIDTables.h | 4 +- PWGLF/DataModel/LFStrangenessTables.h | 16 ++--- .../Strangeness/Converters/CMakeLists.txt | 10 +++ .../stradautrackstofpidconverter.cxx | 10 +-- .../Strangeness/strangenesstofpid.cxx | 63 ++++++++++++------- 6 files changed, 65 insertions(+), 40 deletions(-) diff --git a/Common/Core/PID/PIDTOFParamService.cxx b/Common/Core/PID/PIDTOFParamService.cxx index 733cfd6ff7f..57bc148b883 100644 --- a/Common/Core/PID/PIDTOFParamService.cxx +++ b/Common/Core/PID/PIDTOFParamService.cxx @@ -38,7 +38,6 @@ void o2::pid::tof::TOFResponseImpl::inheritFromBaseTask(o2::framework::InitConte if (mIsInit) { LOG(fatal) << "TOFResponseImpl already initialized, cannot re-initialize"; } - LOG(info) << "couccou"; getCfg(initContext, "ccdb-url", mUrl, task); getCfg(initContext, "ccdb-path-grplhcif", mPathGrpLhcIf, task); getCfg(initContext, "ccdb-timestamp", mTimestamp, task); @@ -54,7 +53,6 @@ void o2::pid::tof::TOFResponseImpl::inheritFromBaseTask(o2::framework::InitConte getCfg(initContext, "enableTimeDependentResponse", mEnableTimeDependentResponse, task); getCfg(initContext, "collisionSystem", mCollisionSystem, task); getCfg(initContext, "autoSetProcessFunctions", mAutoSetProcessFunctions, task); - LOG(info) << "couccou1"; } void o2::pid::tof::TOFResponseImpl::initSetup(o2::ccdb::BasicCCDBManager* ccdb, diff --git a/PWGLF/DataModel/LFStrangenessPIDTables.h b/PWGLF/DataModel/LFStrangenessPIDTables.h index f1c7b8907b8..6fe7203c101 100644 --- a/PWGLF/DataModel/LFStrangenessPIDTables.h +++ b/PWGLF/DataModel/LFStrangenessPIDTables.h @@ -198,8 +198,8 @@ DECLARE_SOA_COLUMN(PosTOFSignal, posTOFSignal, float); //! positive trac DECLARE_SOA_COLUMN(NegTOFSignal, negTOFSignal, float); //! negative track signal DECLARE_SOA_COLUMN(PosTOFEventTime, posTOFEventTime, float); //! positive track event time DECLARE_SOA_COLUMN(NegTOFEventTime, negTOFEventTime, float); //! negative track event time -DECLARE_SOA_COLUMN(PosTOFLength, posTOFLength, float); //! positive track length, recalculated -DECLARE_SOA_COLUMN(NegTOFLength, negTOFLength, float); //! negative track length, recalculated +DECLARE_SOA_COLUMN(PosTOFLength, posTOFLength, float); //! positive track length, recalculated +DECLARE_SOA_COLUMN(NegTOFLength, negTOFLength, float); //! negative track length, recalculated // delta-times DECLARE_SOA_COLUMN(PosTOFDeltaTLaPi, posTOFDeltaTLaPi, float); //! positive track TOFDeltaT from pion <- lambda expectation diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index a1cce49a343..167f169d98d 100644 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -282,14 +282,14 @@ DECLARE_SOA_TABLE_VERSIONED(StraEvSels_005, "AOD", "STRAEVSELS", 5, //! stracollision::IsUPC); DECLARE_SOA_TABLE(StraEvSelExtras, "AOD", "STRAEVSELEXTRAS", //! debug information - udzdc::TimeZNA, // UPC info: re-assigned ZN-A time, in case of SG event, from the most active bc - udzdc::TimeZNC, // UPC info: re-assigned ZN-C time, in case of SG event, from the most active bc - udcollision::TimeFDDA, // Average A-side time (ns) - udcollision::TimeFDDC, // Average C-side time (ns) - udcollision::TimeFV0A, // Average A-side time (ns) - udcollision::TimeFT0A, // Average A-side time (ns) - udcollision::TimeFT0C, // Average C-side time (ns) - udcollision::TriggerMaskFT0); // 8 trigger bits: OrA, OrC, Semi-central, Central, Vertex, IsActiveA, IsActiveC, IsFlangeEvent + udzdc::TimeZNA, // UPC info: re-assigned ZN-A time, in case of SG event, from the most active bc + udzdc::TimeZNC, // UPC info: re-assigned ZN-C time, in case of SG event, from the most active bc + udcollision::TimeFDDA, // Average A-side time (ns) + udcollision::TimeFDDC, // Average C-side time (ns) + udcollision::TimeFV0A, // Average A-side time (ns) + udcollision::TimeFT0A, // Average A-side time (ns) + udcollision::TimeFT0C, // Average C-side time (ns) + udcollision::TriggerMaskFT0); // 8 trigger bits: OrA, OrC, Semi-central, Central, Vertex, IsActiveA, IsActiveC, IsFlangeEvent DECLARE_SOA_TABLE(StraEvSelsRun2, "AOD", "STRAEVSELSRUN2", //! debug information evsel::Sel8, evsel::Sel7, evsel::Selection, //! event selection: sel8 diff --git a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt index 8f7af7bb63e..175a7c852bd 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt +++ b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt @@ -9,6 +9,11 @@ # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. +o2physics_add_dpl_workflow(stradautracksconverter + SOURCES stradautracksconverter.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(stradautrackstpcpidconverter SOURCES stradautrackstpcpidconverter.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore @@ -29,6 +34,11 @@ o2physics_add_dpl_workflow(stradautrackstofpidconverter3 PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(stradautracksextraconverter + SOURCES stradautracksextraconverter.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(stradautracksextraconverter2 SOURCES stradautracksextraconverter2.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore diff --git a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx index 668a47a060e..a5414c03fe3 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx +++ b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx @@ -28,12 +28,12 @@ struct stradautrackstofpidconverter { lLengths.reserve(dauTracks.size()); lTOFSignals.reserve(dauTracks.size()); lTOFEvTimes.reserve(dauTracks.size()); - for (int ii = 0; ii < dauTracks.size(); ii++) { + for (unsigned int ii = 0; ii < dauTracks.size(); ii++) { lLengths[ii] = 1e+6; lTOFSignals[ii] = -1e+3f; lTOFEvTimes[ii] = -1e+3f; } - for (auto& v0 : v0s) { + for (const auto& v0 : v0s) { lLengths[v0.posTrackExtraId()] = v0.posTOFLengthToPV(); lTOFSignals[v0.posTrackExtraId()] = v0.posTOFSignal(); lTOFEvTimes[v0.posTrackExtraId()] = v0.posTOFEventTime(); @@ -41,7 +41,7 @@ struct stradautrackstofpidconverter { lTOFSignals[v0.negTrackExtraId()] = v0.negTOFSignal(); lTOFEvTimes[v0.negTrackExtraId()] = v0.negTOFEventTime(); } - for (auto& casc : cascs) { + for (const auto& casc : cascs) { lLengths[casc.posTrackExtraId()] = casc.posTOFLengthToPV(); lTOFSignals[casc.posTrackExtraId()] = casc.posTOFSignal(); lTOFEvTimes[casc.posTrackExtraId()] = casc.posTOFEventTime(); @@ -52,7 +52,7 @@ struct stradautrackstofpidconverter { lTOFSignals[casc.bachTrackExtraId()] = casc.bachTOFSignal(); lTOFEvTimes[casc.bachTrackExtraId()] = casc.bachTOFEventTime(); } - for (int ii = 0; ii < dauTracks.size(); ii++) { + for (unsigned int ii = 0; ii < dauTracks.size(); ii++) { dautracktofpids(-1, -1, lTOFSignals[ii], lTOFEvTimes[ii], 999.0f /*dummy event time error for TOF*/, lLengths[ii], 0.0f); } } @@ -62,4 +62,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ adaptAnalysisTask(cfgc)}; -} \ No newline at end of file +} diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index aae65dd3832..82e874c8ac0 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -189,7 +189,7 @@ struct strangenesstofpid { // very broad time axis ConfigurableAxis axisTimeLong{"axisTimeLong", {3000, -1500000.0f, 1500000.0f}, "time (ps)"}; } axes; // aggregate axes fo simplicity of navigation in HY - + // for n-sigma calibration bool nSigmaCalibLoaded; TList* nSigmaCalibObjects = nullptr; @@ -417,6 +417,23 @@ struct strangenesstofpid { } } + nSigmaCalibLoaded = false; + nSigmaCalibObjects = nullptr; + + // for n-sigma calibration + hMeanPosLaPi = nullptr; + hSigmaPosLaPi = nullptr; + hMeanPosLaPr = nullptr; + hSigmaPosLaPr = nullptr; + hMeanNegLaPi = nullptr; + hSigmaNegLaPi = nullptr; + hMeanNegLaPr = nullptr; + hSigmaNegLaPr = nullptr; + hMeanPosK0Pi = nullptr; + hSigmaNegK0Pi = nullptr; + hMeanNegK0Pi = nullptr; + hSigmaNegK0Pi = nullptr; + mRunNumber = 0; d_bz = 0; maxSnp = 0.85f; // could be changed later @@ -867,7 +884,7 @@ struct strangenesstofpid { float velocityPositiveEl, velocityPositivePr, velocityPositivePi, lengthPositive; velocityPositiveEl = velocityPositivePr = velocityPositivePi = lengthPositive = o2::aod::v0data::kNoTOFValue; - if (pTof.hasTOF && mapCollisionTime.find(collisionId) != mapCollisionTime.end() && pValidTOF) { + if (pTof.hasTOF && pTof.tofEvTime > -1e+5 && pValidTOF) { // method 0: legacy standalone without use of primary particle TOF if (calculationMethod.value == 0) { velocityPositiveEl = velocity(posTrack.getP(), o2::constants::physics::MassElectron); @@ -983,7 +1000,7 @@ struct strangenesstofpid { } float velocityNegativeEl, velocityNegativePr, velocityNegativePi, lengthNegative; velocityNegativeEl = velocityNegativePr = velocityNegativePi = lengthNegative = o2::aod::v0data::kNoTOFValue; - if (nTof.hasTOF && mapCollisionTime.find(collisionId) != mapCollisionTime.end() && nValidTOF) { + if (nTof.hasTOF && nTof.tofEvTime > -1e+5 && nValidTOF) { // method 0: legacy standalone without use of primary particle TOF if (calculationMethod.value == 0) { velocityNegativeEl = velocity(negTrack.getP(), o2::constants::physics::MassElectron); @@ -1115,7 +1132,7 @@ struct strangenesstofpid { // } // calculation of delta-decay-time (no reliance on event time) - if (nTof.hasTOF && pTof.hasTOF > 0) { // does not depend on event time + if (nTof.hasTOF && pTof.hasTOF) { // does not depend on event time v0tof.deltaDecayTimePhoton = (pTof.tofSignal - v0tof.timePositiveEl) - (nTof.tofSignal - v0tof.timeNegativeEl); v0tof.deltaDecayTimeLambda = (pTof.tofSignal - v0tof.timePositivePr) - (nTof.tofSignal - v0tof.timeNegativePi); v0tof.deltaDecayTimeAntiLambda = (pTof.tofSignal - v0tof.timePositivePi) - (nTof.tofSignal - v0tof.timeNegativePr); @@ -1218,7 +1235,7 @@ struct strangenesstofpid { //_____________________________________________________________________________________________ // Actual calculation - if (pTof.hasTOF && mapCollisionTime.find(collisionId) != mapCollisionTime.end() && pValidTOF) { + if (pTof.hasTOF && pTof.tofEvTime > -1e+5 && pValidTOF) { float velocityPositivePr, velocityPositivePi, lengthPositive; velocityPositivePr = velocityPositivePi = lengthPositive = o2::aod::v0data::kNoTOFValue; if (calculationMethod.value == 0) { @@ -1354,7 +1371,7 @@ struct strangenesstofpid { } } // end positive - if (nTof.hasTOF && mapCollisionTime.find(collisionId) != mapCollisionTime.end() && nValidTOF) { + if (nTof.hasTOF && nTof.tofEvTime > -1e+5 && nValidTOF) { float velocityNegativePr, velocityNegativePi, lengthNegative; velocityNegativePr = velocityNegativePi = lengthNegative = o2::aod::v0data::kNoTOFValue; // method 0: legacy standalone without use of primary particle TOF @@ -1491,7 +1508,7 @@ struct strangenesstofpid { } } // end negative - if (bTof.hasTOF && mapCollisionTime.find(collisionId) != mapCollisionTime.end() && bValidTOF) { + if (bTof.hasTOF && bTof.tofEvTime > -1e+5 && bValidTOF) { float velocityBachelorKa, velocityBachelorPi, lengthBachelor; velocityBachelorKa = velocityBachelorPi = lengthBachelor = o2::aod::v0data::kNoTOFValue; // method 0: legacy standalone without use of primary particle TOF @@ -1801,8 +1818,8 @@ struct strangenesstofpid { pTof.hasTPC = pTra.hasTPC(); pTof.hasTOF = pTra.hasTOF(); pTof.tofExpMom = pTra.tofExpMom(); - pTof.tofEvTime = reassociateTracks ? mapCollisionTime[cascade.collisionId()] : pTra.tofEvTime(); - pTof.tofEvTimeErr = reassociateTracks ? mapCollisionTimeError[cascade.collisionId()] : pTra.tofEvTimeErr(); + pTof.tofEvTime = reassociateTracks ? collisionEventTime[cascade.collisionId()] : pTra.tofEvTime(); + pTof.tofEvTimeErr = reassociateTracks ? collisionEventTimeErr[cascade.collisionId()] : pTra.tofEvTimeErr(); // pTof.tofSignal = pTra.tofSignal() + (doBCshift ? deltaTimePos : 0.0f); pTof.tofSignal = doBCshift && pTra.has_collision() ? pTra.tofSignalInAnotherBC(pTra.collision().bc_as().globalBC(), cascade.collision().bc_as().globalBC()) : pTra.tofSignal(); pTof.length = pTra.length(); @@ -1814,8 +1831,8 @@ struct strangenesstofpid { nTof.hasTPC = nTra.hasTPC(); nTof.hasTOF = nTra.hasTOF(); nTof.tofExpMom = nTra.tofExpMom(); - nTof.tofEvTime = reassociateTracks ? mapCollisionTime[cascade.collisionId()] : nTra.tofEvTime(); - nTof.tofEvTimeErr = reassociateTracks ? mapCollisionTimeError[cascade.collisionId()] : nTra.tofEvTimeErr(); + nTof.tofEvTime = reassociateTracks ? collisionEventTime[cascade.collisionId()] : nTra.tofEvTime(); + nTof.tofEvTimeErr = reassociateTracks ? collisionEventTimeErr[cascade.collisionId()] : nTra.tofEvTimeErr(); // nTof.tofSignal = nTra.tofSignal() + (doBCshift ? deltaTimeNeg : 0.0f); nTof.tofSignal = doBCshift && nTra.has_collision() ? nTra.tofSignalInAnotherBC(nTra.collision().bc_as().globalBC(), cascade.collision().bc_as().globalBC()) : nTra.tofSignal(); nTof.length = nTra.length(); @@ -1827,8 +1844,8 @@ struct strangenesstofpid { bTof.hasTPC = bTra.hasTPC(); bTof.hasTOF = bTra.hasTOF(); bTof.tofExpMom = bTra.tofExpMom(); - bTof.tofEvTime = reassociateTracks ? mapCollisionTime[cascade.collisionId()] : bTra.tofEvTime(); - bTof.tofEvTimeErr = reassociateTracks ? mapCollisionTimeError[cascade.collisionId()] : bTra.tofEvTimeErr(); + bTof.tofEvTime = reassociateTracks ? collisionEventTime[cascade.collisionId()] : bTra.tofEvTime(); + bTof.tofEvTimeErr = reassociateTracks ? collisionEventTimeErr[cascade.collisionId()] : bTra.tofEvTimeErr(); // bTof.tofSignal = bTra.tofSignal() + (doBCshift ? deltaTimeBach : 0.0f); bTof.tofSignal = doBCshift && bTra.has_collision() ? bTra.tofSignalInAnotherBC(bTra.collision().bc_as().globalBC(), cascade.collision().bc_as().globalBC()) : bTra.tofSignal(); bTof.length = bTra.length(); @@ -1944,8 +1961,8 @@ struct strangenesstofpid { pTof.collisionId = pTofExt.straCollisionId(); pTof.tofExpMom = pTofExt.tofExpMom(); pTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTime(); - // pTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTimeErr(); - pTof.tofEvTimeErr = pTofExt.tofEvTimeErr(); + pTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTimeErr() : pTofExt.tofEvTimeErr(); + // pTof.tofEvTimeErr = pTofExt.tofEvTimeErr(); pTof.tofSignal = pTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f); pTof.length = pTofExt.length(); } @@ -1971,8 +1988,8 @@ struct strangenesstofpid { nTof.collisionId = nTofExt.straCollisionId(); nTof.tofExpMom = nTofExt.tofExpMom(); nTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTime(); - // nTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTimeErr(); - nTof.tofEvTimeErr = nTofExt.tofEvTimeErr(); + nTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTimeErr() : nTofExt.tofEvTimeErr(); + // nTof.tofEvTimeErr = nTofExt.tofEvTimeErr(); nTof.tofSignal = nTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f); nTof.length = nTofExt.length(); } @@ -2040,8 +2057,8 @@ struct strangenesstofpid { pTof.collisionId = pTofExt.straCollisionId(); pTof.tofExpMom = pTofExt.tofExpMom(); pTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTime(); - // pTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTimeErr(); - pTof.tofEvTimeErr = pTofExt.tofEvTimeErr(); + pTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTimeErr() : pTofExt.tofEvTimeErr(); + // pTof.tofEvTimeErr = pTofExt.tofEvTimeErr(); pTof.tofSignal = pTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f); pTof.length = pTofExt.length(); } @@ -2066,8 +2083,8 @@ struct strangenesstofpid { nTof.collisionId = nTofExt.straCollisionId(); nTof.tofExpMom = nTofExt.tofExpMom(); nTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTime(); - // nTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTimeErr(); - nTof.tofEvTimeErr = nTofExt.tofEvTimeErr(); + nTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTimeErr(); + // nTof.tofEvTimeErr = nTofExt.tofEvTimeErr(); nTof.tofSignal = nTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f); nTof.length = nTofExt.length(); } @@ -2092,8 +2109,8 @@ struct strangenesstofpid { bTof.collisionId = bTofExt.straCollisionId(); bTof.tofExpMom = bTofExt.tofExpMom(); bTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : bTofExt.tofEvTime(); - // bTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : bTofExt.tofEvTimeErr(); - bTof.tofEvTimeErr = bTofExt.tofEvTimeErr(); + bTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTimeErr() : bTofExt.tofEvTimeErr(); + // bTof.tofEvTimeErr = bTofExt.tofEvTimeErr(); bTof.tofSignal = bTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f); bTof.length = bTofExt.length(); } From b7e93169df25a320b58ef53bb6f43fe2eddd9166 Mon Sep 17 00:00:00 2001 From: romainschotter Date: Tue, 26 May 2026 12:55:54 +0200 Subject: [PATCH 16/28] Update --- .../stradautrackstofpidconverter.cxx | 10 +----- .../Strangeness/strangederivedbuilder.cxx | 36 +++++++++---------- .../Strangeness/strangenesstofpid.cxx | 2 +- 3 files changed, 20 insertions(+), 28 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx index a5414c03fe3..8509f93c560 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx +++ b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx @@ -24,15 +24,7 @@ struct stradautrackstofpidconverter { void process(soa::Join const& v0s, soa::Join const& cascs, aod::DauTrackExtras const& dauTracks) { // prepare arrays with the relevant information - std::vector lLengths, lTOFSignals, lTOFEvTimes; - lLengths.reserve(dauTracks.size()); - lTOFSignals.reserve(dauTracks.size()); - lTOFEvTimes.reserve(dauTracks.size()); - for (unsigned int ii = 0; ii < dauTracks.size(); ii++) { - lLengths[ii] = 1e+6; - lTOFSignals[ii] = -1e+3f; - lTOFEvTimes[ii] = -1e+3f; - } + std::vector lLengths(dauTracks.size(), 1.e+6), lTOFSignals(dauTracks.size(), -1e+3f), lTOFEvTimes(dauTracks.size(), -1e+3f); for (const auto& v0 : v0s) { lLengths[v0.posTrackExtraId()] = v0.posTOFLengthToPV(); lTOFSignals[v0.posTrackExtraId()] = v0.posTOFSignal(); diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index ce06cb3efd1..e965aafe1c6 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -78,21 +78,21 @@ struct strangederivedbuilder { struct : ProducesGroup { //__________________________________________________ // fundamental building blocks of derived data - Produces strangeColl; // characterises collisions - Produces strangeCollLabels; // characterises collisions - Produces strangeMCColl; // characterises collisions / MC - Produces strangeMCMults; // characterises collisions / MC mults - Produces strangeCents; // characterises collisions / centrality in Run 3 - Produces strangeCentsRun2; // characterises collisions / centrality in Run 2 - Produces strangeEvSels; // characterises collisions / centrality / sel8 selection in Run 3 - Produces strangeEvSelExtras; // extra event selection variables in Run 3 - Produces strangeEvSelsRun2; // characterises collisions / centrality / sel8 selection in Run 2 - Produces strangeStamps; // provides timestamps, run numbers - Produces straEvTimes; // provides event times (FT0, TOF) - Produces v0collref; // references collisions from V0s - Produces casccollref; // references collisions from cascades - Produces kfcasccollref; // references collisions from KF cascades - Produces tracasccollref; // references collisions from tracked cascades + Produces strangeColl; // characterises collisions + Produces strangeCollLabels; // characterises collisions + Produces strangeMCColl; // characterises collisions / MC + Produces strangeMCMults; // characterises collisions / MC mults + Produces strangeCents; // characterises collisions / centrality in Run 3 + Produces strangeCentsRun2; // characterises collisions / centrality in Run 2 + Produces strangeEvSels; // characterises collisions / centrality / sel8 selection in Run 3 + Produces strangeEvSelExtras; // extra event selection variables in Run 3 + Produces strangeEvSelsRun2; // characterises collisions / centrality / sel8 selection in Run 2 + Produces strangeStamps; // provides timestamps, run numbers + Produces straEvTimes; // provides event times (FT0, TOF) + Produces v0collref; // references collisions from V0s + Produces casccollref; // references collisions from cascades + Produces kfcasccollref; // references collisions from KF cascades + Produces tracasccollref; // references collisions from tracked cascades //__________________________________________________ // track extra references @@ -586,9 +586,9 @@ struct strangederivedbuilder { collision.flags(), collision.alias_raw(), collision.rct_raw()); - products.strangeEvSelExtras(timeZNA, timeZNC, // ZDC info - timeFDDA, timeFDDC, // FDD info - timeFV0A, // FV0A info + products.strangeEvSelExtras(timeZNA, timeZNC, // ZDC info + timeFDDA, timeFDDC, // FDD info + timeFV0A, // FV0A info timeFT0A, timeFT0C, ft0TriggerMask); // FT0 info } else { // We are in Run 2 products.strangeCentsRun2(collision.centRun2V0M(), collision.centRun2V0A(), diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index 82e874c8ac0..e87a9a4bcd2 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -106,7 +106,7 @@ struct strangenesstofpid { Configurable calculationMethod{"calculationMethod", 0, "algorithm for TOF calculation. 0: fast analytical withouot eloss, 1: O2 Propagator + trackLTIntegral (slow), 2: both methods and do comparison studies (slow)"}; 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)"}; - Configurable useNsigmaCalibStrTOF{"useNsigmaCalibStrTOF", false, "if true, use manual strangeness TOF PID calibration"}; + Configurable useNsigmaCalibStrTOF{"useNsigmaCalibStrTOF", true, "if true, use manual strangeness TOF PID calibration"}; Configurable reassociateTracks{"reassociateTracks", true, "if true, reassociate tracks to the collision the V0 or cascade belongs to. Relevant especially at high IR"}; Configurable doBCshift{"doBCshift", true, "if true, perform time shift for collisions in different BCs when reassigning"}; Configurable rejectUndefinedTof{"rejectUndefinedTof", true, "if true, reject tracks with TOF signal 0.000f for safety"}; From c9ed006fc3506ad99f9dbe1a6a1caed5d903028e Mon Sep 17 00:00:00 2001 From: romainschotter Date: Tue, 26 May 2026 13:03:44 +0200 Subject: [PATCH 17/28] Remove propagatorQa changes --- Common/Tasks/propagatorQa.cxx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Common/Tasks/propagatorQa.cxx b/Common/Tasks/propagatorQa.cxx index 9d31c32c76e..dcdd50b87ce 100644 --- a/Common/Tasks/propagatorQa.cxx +++ b/Common/Tasks/propagatorQa.cxx @@ -36,7 +36,6 @@ #include #include #include -#include "Common/DataModel/CollisionAssociationTables.h" #include #include @@ -217,7 +216,7 @@ struct propagatorQa { } } - void processMC(aod::Collision const& collision, aod::V0s const& V0s, aod::Cascades const& cascades, soa::Join const& tracks, aod::BCsWithTimestamps const&, aod::McParticles const&) + void processMC(aod::Collision const& collision, aod::V0s const& V0s, aod::Cascades const& cascades, soa::Join const& tracks, aod::BCsWithTimestamps const&, aod::McParticles const&) { /* check the previous run number */ auto bc = collision.bc_as(); @@ -225,8 +224,6 @@ struct propagatorQa { std::array dcaInfo; for (const auto& track : tracks) { - //if (track.compatibleCollIds().size() != 0) - // continue; if (track.tpcNClsFound() < minTPCClustersRequired) continue; @@ -339,7 +336,7 @@ struct propagatorQa { } PROCESS_SWITCH(propagatorQa, processMC, "process MC", true); - void processData(aod::Collision const& collision, aod::V0s const& V0s, aod::Cascades const& cascades, soa::Join const& tracks, aod::BCsWithTimestamps const&) + void processData(aod::Collision const& collision, aod::V0s const& V0s, aod::Cascades const& cascades, soa::Join const& tracks, aod::BCsWithTimestamps const&) { /* check the previous run number */ auto bc = collision.bc_as(); @@ -347,8 +344,6 @@ struct propagatorQa { std::array dcaInfo; for (const auto& track : tracks) { - //if (track.compatibleCollIds().size() != 0) - // continue; if (track.tpcNClsFound() < minTPCClustersRequired) continue; From 62b69d2ee85b5c317de8c65be5b9aaee0ac34c58 Mon Sep 17 00:00:00 2001 From: romainschotter Date: Tue, 26 May 2026 18:27:50 +0200 Subject: [PATCH 18/28] Add missing changes --- .../Strangeness/strangenesstofpid.cxx | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index e87a9a4bcd2..5f5c7c10bc7 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -152,13 +152,28 @@ struct strangenesstofpid { // CCDB options struct : ConfigurableGroup { - std::string prefix = "ccdb"; + // std::string prefix = "ccdb"; 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 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"}; + // necessary for TOFResponse + Configurable grpLhcIfPath{"ccdb-path-grplhcif", "GLO/Config/GRPLHCIF", "Path on the CCDB for the GRPLHCIF object"}; + Configurable timestamp{"ccdb-timestamp", -1, "timestamp of the object"}; + Configurable timeShiftCCDBPathPos{"timeShiftCCDBPathPos", "Analysis/PID/TOFOffsetPos", "Path of the TOF time shift vs eta for pos. tracks. If empty none is taken"}; + Configurable timeShiftCCDBPathNeg{"timeShiftCCDBPathNeg", "Analysis/PID/TOFOffsetNeg", "Path of the TOF time shift vs eta for neg. tracks. If empty none is taken"}; + Configurable timeShiftCCDBPathPosMC{"timeShiftCCDBPathPosMC", "", "Path of the TOF time shift for MC vs eta for pos. tracks. If empty none is taken"}; + Configurable timeShiftCCDBPathNegMC{"timeShiftCCDBPathNegMC", "", "Path of the TOF time shift for MC vs eta for neg. tracks. If empty none is taken"}; + Configurable paramFileName{"paramFileName", "", "Path to the parametrization object. If empty the parametrization is not taken from file"}; + Configurable parametrizationPath{"parametrizationPath", "TOF/Calib/Params", "Path of the TOF parametrization on the CCDB or in the file, if the paramFileName is not empty"}; + Configurable reconstructionPass{"reconstructionPass", "metadata", {"Apass to use when fetching the calibration tables. Empty (default) does not check for any pass. Use `metadata` to fetch it from the AO2D metadata. Otherwise it will override the metadata."}}; + Configurable reconstructionPassDefault{"reconstructionPassDefault", "unanchored", {"Default pass to get if the standard one is not found"}}; + Configurable fatalOnPassNotAvailable{"fatalOnPassNotAvailable", false, "Flag to throw a fatal if the pass is not available in the retrieved CCDB object"}; + Configurable enableTimeDependentResponse{"enableTimeDependentResponse", true, "Flag to use the collision timestamp to fetch the PID Response"}; + Configurable collisionSystem{"collisionSystem", -1, "Collision system: -1 (autoset), 0 (pp), 1 (PbPb), 2 (XeXe), 3 (pPb)"}; + Configurable autoSetProcessFunctions{"autoSetProcessFunctions", true, "Flag to autodetect the process functions to use"}; } ccdbConfigurations; // manual @@ -445,7 +460,8 @@ struct strangenesstofpid { ccdb->setFatalWhenNull(false); LOGF(info, "intializing TOFResponse"); - mTOFResponse->initSetup(ccdb, initContext); + std::string taskName = initContext.services().get().name; + mTOFResponse->initSetup(ccdb, initContext, taskName); // per event histos.add("hCandidateCounter", "hCandidateCounter", kTH1F, {{500, -0.5f, 499.5f}}); @@ -467,6 +483,7 @@ struct strangenesstofpid { histos.add("h2dTOFSignalCascadeBachelor", "h2dTOFSignalCascadeBachelor", kTH2F, {axes.axisTimeLong, axes.axisBCshift}); histos.add("hCollisionTimes", "hCollisionTimes", kTH1F, {{2000, -1000.0f, 1000.0f}}); + histos.add("hCollisionTimesError", "hCollisionTimesError", kTH1F, {{2000, -1000.0f, 1000.0f}}); // measured vs expected total time QA if (doQA) { @@ -1897,12 +1914,12 @@ struct strangenesstofpid { for (const auto& collision : collisions) { histos.fill(HIST("hCollisionTimes"), collision.eventTime()); + histos.fill(HIST("hCollisionTimesError"), collision.eventTimeErr()); } // auto-determine if using old format if (dauTrackTOFPIDs.size() != 0) { - auto firstTOFPID = dauTrackTOFPIDs.rawIteratorAt(0); - isNewTOFFormat = firstTOFPID.straCollisionId() < 0 ? false : true; + isNewTOFFormat = dauTrackTable.size() == dauTrackTOFPIDs.size() ? false : true; } if (!isNewTOFFormat && calculationMethod.value > 0) { From 92fa3b6a059cae4be683a5579bc626ae714e6e68 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 26 May 2026 16:30:04 +0000 Subject: [PATCH 19/28] Please consider the following formatting changes --- PWGLF/DataModel/LFStrangenessPIDTables.h | 8 +- PWGLF/DataModel/LFStrangenessTables.h | 18 +-- .../stradautrackstofpidconverter3.cxx | 10 +- .../Strangeness/strangederivedbuilder.cxx | 16 +-- .../Strangeness/strangenesstofpid.cxx | 108 +++++++++--------- 5 files changed, 80 insertions(+), 80 deletions(-) diff --git a/PWGLF/DataModel/LFStrangenessPIDTables.h b/PWGLF/DataModel/LFStrangenessPIDTables.h index 6fe7203c101..ab27d484a47 100644 --- a/PWGLF/DataModel/LFStrangenessPIDTables.h +++ b/PWGLF/DataModel/LFStrangenessPIDTables.h @@ -180,7 +180,7 @@ DECLARE_SOA_TABLE_VERSIONED(DauTrackTOFPIDs_002, "AOD", "DAUTRACKTOFPID", 2, // dautrack::TOFExpTimeEl, dautrack::TOFExpTimePi, dautrack::TOFExpTimeKa, - dautrack::TOFExpTimePr); + dautrack::TOFExpTimePr); using DauTrackTOFPIDs = DauTrackTOFPIDs_002; // second gen: with collision Id, with TOFExpMom @@ -198,8 +198,8 @@ DECLARE_SOA_COLUMN(PosTOFSignal, posTOFSignal, float); //! positive trac DECLARE_SOA_COLUMN(NegTOFSignal, negTOFSignal, float); //! negative track signal DECLARE_SOA_COLUMN(PosTOFEventTime, posTOFEventTime, float); //! positive track event time DECLARE_SOA_COLUMN(NegTOFEventTime, negTOFEventTime, float); //! negative track event time -DECLARE_SOA_COLUMN(PosTOFLength, posTOFLength, float); //! positive track length, recalculated -DECLARE_SOA_COLUMN(NegTOFLength, negTOFLength, float); //! negative track length, recalculated +DECLARE_SOA_COLUMN(PosTOFLength, posTOFLength, float); //! positive track length, recalculated +DECLARE_SOA_COLUMN(NegTOFLength, negTOFLength, float); //! negative track length, recalculated // delta-times DECLARE_SOA_COLUMN(PosTOFDeltaTLaPi, posTOFDeltaTLaPi, float); //! positive track TOFDeltaT from pion <- lambda expectation @@ -221,7 +221,7 @@ DECLARE_SOA_COLUMN(TOFNSigmaALaPr, tofNSigmaALaPr, float); //! negative DECLARE_SOA_COLUMN(TOFNSigmaALaPi, tofNSigmaALaPi, float); //! positive track NSigma from pion <- antilambda expectation 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 - + // for wrong hypothesis DECLARE_SOA_COLUMN(TOFNSigmaElPosFromPhoton, tofNSigmaElPosFromPhoton, float); //! n sigma of positive track from photon conversion under electron hypothesis DECLARE_SOA_COLUMN(TOFNSigmaElNegFromPhoton, tofNSigmaElNegFromPhoton, float); //! n sigma of negative track from photon conversion under electron hypothesis diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index 167f169d98d..ace373f80aa 100644 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -281,15 +281,15 @@ DECLARE_SOA_TABLE_VERSIONED(StraEvSels_005, "AOD", "STRAEVSELS", 5, //! // stracollision::EnergyCommonZNC, stracollision::IsUPC); -DECLARE_SOA_TABLE(StraEvSelExtras, "AOD", "STRAEVSELEXTRAS", //! debug information - udzdc::TimeZNA, // UPC info: re-assigned ZN-A time, in case of SG event, from the most active bc - udzdc::TimeZNC, // UPC info: re-assigned ZN-C time, in case of SG event, from the most active bc - udcollision::TimeFDDA, // Average A-side time (ns) - udcollision::TimeFDDC, // Average C-side time (ns) - udcollision::TimeFV0A, // Average A-side time (ns) - udcollision::TimeFT0A, // Average A-side time (ns) - udcollision::TimeFT0C, // Average C-side time (ns) - udcollision::TriggerMaskFT0); // 8 trigger bits: OrA, OrC, Semi-central, Central, Vertex, IsActiveA, IsActiveC, IsFlangeEvent +DECLARE_SOA_TABLE(StraEvSelExtras, "AOD", "STRAEVSELEXTRAS", //! debug information + udzdc::TimeZNA, // UPC info: re-assigned ZN-A time, in case of SG event, from the most active bc + udzdc::TimeZNC, // UPC info: re-assigned ZN-C time, in case of SG event, from the most active bc + udcollision::TimeFDDA, // Average A-side time (ns) + udcollision::TimeFDDC, // Average C-side time (ns) + udcollision::TimeFV0A, // Average A-side time (ns) + udcollision::TimeFT0A, // Average A-side time (ns) + udcollision::TimeFT0C, // Average C-side time (ns) + udcollision::TriggerMaskFT0); // 8 trigger bits: OrA, OrC, Semi-central, Central, Vertex, IsActiveA, IsActiveC, IsFlangeEvent DECLARE_SOA_TABLE(StraEvSelsRun2, "AOD", "STRAEVSELSRUN2", //! debug information evsel::Sel8, evsel::Sel7, evsel::Selection, //! event selection: sel8 diff --git a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx index 0e71bc4a41d..af1164712b1 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx +++ b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx @@ -28,12 +28,12 @@ struct stradautrackstofpidconverter3 { // create new TOFPIDs for (const auto& dauTrack : dauTracks) { dautracktofpids( - -1, - -1, - dauTrack.tofSignal(), - dauTrack.tofEvTime(), + -1, + -1, + dauTrack.tofSignal(), + dauTrack.tofEvTime(), 999.0f, /*dummy event time error for TOF*/ - dauTrack.length(), + dauTrack.length(), 0.0f); } for (const auto& value : straEvTimes_000) { diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index e965aafe1c6..16e54c29de4 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -586,9 +586,9 @@ struct strangederivedbuilder { collision.flags(), collision.alias_raw(), collision.rct_raw()); - products.strangeEvSelExtras(timeZNA, timeZNC, // ZDC info - timeFDDA, timeFDDC, // FDD info - timeFV0A, // FV0A info + products.strangeEvSelExtras(timeZNA, timeZNC, // ZDC info + timeFDDA, timeFDDC, // FDD info + timeFV0A, // FV0A info timeFT0A, timeFT0C, ft0TriggerMask); // FT0 info } else { // We are in Run 2 products.strangeCentsRun2(collision.centRun2V0M(), collision.centRun2V0A(), @@ -655,7 +655,7 @@ struct strangederivedbuilder { if (track.hasTOF() && track.collisionId() >= 0) { collisionEventTime[track.collisionId()] += track.tofEvTime(); // Take the average of the error instead of propagating the error as all event time error from tracks are fully correlated - collisionEventTimeErr[track.collisionId()] += track.tofEvTimeErr(); + collisionEventTimeErr[track.collisionId()] += track.tofEvTimeErr(); collisionNtracks[track.collisionId()]++; } } @@ -712,23 +712,23 @@ struct strangederivedbuilder { } } - void processCollisionsRun3(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&) + void processCollisionsRun3(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&) { populateCollisionTables(collisions, collisions, V0s, Cascades, KFCascades, TraCascades, bcs); } - void processCollisionsRun3WithUD(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&, UDCollisionsFull const& udCollisions) + void processCollisionsRun3WithUD(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&, UDCollisionsFull const& udCollisions) { populateCollisionTables(collisions, udCollisions, V0s, Cascades, KFCascades, TraCascades, bcs); } - void processCollisionsRun3WithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) + void processCollisionsRun3WithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) { populateMCCollisionTable(mcCollisions, mcParticles); populateCollisionTables(collisions, collisions, V0s, Cascades, KFCascades, TraCascades, bcs); } - void processCollisionsRun3WithUDWithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&, UDCollisionsFull const& udCollisions, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) + void processCollisionsRun3WithUDWithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&, UDCollisionsFull const& udCollisions, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) { populateMCCollisionTable(mcCollisions, mcParticles); populateCollisionTables(collisions, udCollisions, V0s, Cascades, KFCascades, TraCascades, bcs); diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index 5f5c7c10bc7..61928fd79c0 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -708,7 +708,7 @@ struct strangenesstofpid { LOG(info) << "Problems finding xi sigma histograms!"; if (!hSigmaPosOmPi || !hSigmaPosOmPr || !hSigmaNegOmPi || !hSigmaNegOmPr || !hSigmaBachOmKa) LOG(info) << "Problems finding omega sigma histograms!"; - } + } } } } @@ -904,11 +904,11 @@ struct strangenesstofpid { if (pTof.hasTOF && pTof.tofEvTime > -1e+5 && pValidTOF) { // method 0: legacy standalone without use of primary particle TOF if (calculationMethod.value == 0) { - velocityPositiveEl = velocity(posTrack.getP(), o2::constants::physics::MassElectron); + velocityPositiveEl = velocity(posTrack.getP(), o2::constants::physics::MassElectron); velocityPositivePr = velocity(posTrack.getP(), o2::constants::physics::MassProton); velocityPositivePi = velocity(posTrack.getP(), o2::constants::physics::MassPionCharged); lengthPositive = findInterceptLength(posTrack, d_bz); - v0tof.timePositiveEl = lengthPositive / velocityPositiveEl; + v0tof.timePositiveEl = lengthPositive / velocityPositiveEl; v0tof.timePositivePr = lengthPositive / velocityPositivePr; v0tof.timePositivePi = lengthPositive / velocityPositivePi; } @@ -927,31 +927,31 @@ struct strangenesstofpid { } if (successPropag) { lengthPositive = pTof.length - ltIntegral.getL(); - v0tof.timePositiveEl = o2::framework::pid::tof::MassToExpTime(pTof.tofExpMom, lengthPositive, o2::constants::physics::MassElectron * o2::constants::physics::MassElectron); + v0tof.timePositiveEl = o2::framework::pid::tof::MassToExpTime(pTof.tofExpMom, lengthPositive, o2::constants::physics::MassElectron * o2::constants::physics::MassElectron); v0tof.timePositivePr = o2::framework::pid::tof::MassToExpTime(pTof.tofExpMom, lengthPositive, o2::constants::physics::MassProton * o2::constants::physics::MassProton); v0tof.timePositivePi = o2::framework::pid::tof::MassToExpTime(pTof.tofExpMom, lengthPositive, o2::constants::physics::MassPionCharged * o2::constants::physics::MassPionCharged); // as primary - v0tof.timeAsPrimaryPositiveEl = o2::framework::pid::tof::MassToExpTime(pTof.tofExpMom, pTof.length, o2::constants::physics::MassElectron * o2::constants::physics::MassElectron); + v0tof.timeAsPrimaryPositiveEl = o2::framework::pid::tof::MassToExpTime(pTof.tofExpMom, pTof.length, o2::constants::physics::MassElectron * o2::constants::physics::MassElectron); v0tof.timeAsPrimaryPositivePr = o2::framework::pid::tof::MassToExpTime(pTof.tofExpMom, pTof.length, o2::constants::physics::MassProton * o2::constants::physics::MassProton); v0tof.timeAsPrimaryPositivePi = o2::framework::pid::tof::MassToExpTime(pTof.tofExpMom, pTof.length, o2::constants::physics::MassPionCharged * o2::constants::physics::MassPionCharged); } } } if (lengthPositive > 0.0f) { - v0tof.deltaTimePositivePhotonEl = (pTof.tofSignal - pTof.tofEvTime) - (v0tof.timePhoton + v0tof.timePositiveEl); - v0tof.deltaTimePositiveLambdaPr = (pTof.tofSignal - pTof.tofEvTime) - (v0tof.timeLambda + v0tof.timePositivePr); + v0tof.deltaTimePositivePhotonEl = (pTof.tofSignal - pTof.tofEvTime) - (v0tof.timePhoton + v0tof.timePositiveEl); + v0tof.deltaTimePositiveLambdaPr = (pTof.tofSignal - pTof.tofEvTime) - (v0tof.timeLambda + v0tof.timePositivePr); v0tof.deltaTimePositiveLambdaPi = (pTof.tofSignal - pTof.tofEvTime) - (v0tof.timeLambda + v0tof.timePositivePi); v0tof.deltaTimePositiveK0ShortPi = (pTof.tofSignal - pTof.tofEvTime) - (v0tof.timeK0Short + v0tof.timePositivePi); - if (useNsigmaCalibStrTOF) { + if (useNsigmaCalibStrTOF) { // de facto nsigma if (nSigmaCalibLoaded) { v0tof.nSigmaPositivePhotonEl = -999.; v0tof.nSigmaPositiveLambdaPi = (v0tof.deltaTimePositiveLambdaPi - hMeanPosLaPi->Interpolate(v0.p())) / hSigmaPosLaPi->Interpolate(v0.p()); v0tof.nSigmaPositiveLambdaPr = (v0tof.deltaTimePositiveLambdaPr - hMeanPosLaPr->Interpolate(v0.p())) / hSigmaPosLaPr->Interpolate(v0.p()); v0tof.nSigmaPositiveK0ShortPi = (v0tof.deltaTimePositiveK0ShortPi - hMeanPosK0Pi->Interpolate(v0.p())) / hSigmaPosK0Pi->Interpolate(v0.p()); - // with wrong hypothesis + // with wrong hypothesis v0tof.nSigmaPositivePhotonPi = -999.; v0tof.nSigmaPositivePhotonKa = -999.; v0tof.nSigmaPositivePhotonPr = -999.; @@ -961,7 +961,7 @@ struct strangenesstofpid { v0tof.nSigmaPositiveK0ShortKa = -999.; v0tof.nSigmaPositiveK0ShortPr = -999.; } - } else { + } else { // use nSigma function from O2Physics/Common/Core/PID/PIDTOFParamService.h v0tof.nSigmaPositivePhotonEl = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timePhoton, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); v0tof.nSigmaPositiveLambdaPi = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeLambda, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); @@ -977,7 +977,7 @@ struct strangenesstofpid { v0tof.nSigmaPositiveK0ShortEl = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeK0Short, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); v0tof.nSigmaPositiveK0ShortKa = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeK0Short, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); v0tof.nSigmaPositiveK0ShortPr = mTOFResponse->nSigma(pTof.tofSignal - v0tof.timeK0Short, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - } + } // do QA histograms (calibration / QC) if (doQA) { @@ -1020,11 +1020,11 @@ struct strangenesstofpid { if (nTof.hasTOF && nTof.tofEvTime > -1e+5 && nValidTOF) { // method 0: legacy standalone without use of primary particle TOF if (calculationMethod.value == 0) { - velocityNegativeEl = velocity(negTrack.getP(), o2::constants::physics::MassElectron); + velocityNegativeEl = velocity(negTrack.getP(), o2::constants::physics::MassElectron); velocityNegativePr = velocity(negTrack.getP(), o2::constants::physics::MassProton); velocityNegativePi = velocity(negTrack.getP(), o2::constants::physics::MassPionCharged); lengthNegative = findInterceptLength(negTrack, d_bz); - v0tof.timeNegativeEl = lengthNegative / velocityNegativeEl; + v0tof.timeNegativeEl = lengthNegative / velocityNegativeEl; v0tof.timeNegativePr = lengthNegative / velocityNegativePr; v0tof.timeNegativePi = lengthNegative / velocityNegativePi; } @@ -1043,24 +1043,24 @@ struct strangenesstofpid { } if (successPropag) { lengthNegative = nTof.length - ltIntegral.getL(); - v0tof.timeNegativeEl = o2::framework::pid::tof::MassToExpTime(nTof.tofExpMom, lengthNegative, o2::constants::physics::MassElectron * o2::constants::physics::MassElectron); + v0tof.timeNegativeEl = o2::framework::pid::tof::MassToExpTime(nTof.tofExpMom, lengthNegative, o2::constants::physics::MassElectron * o2::constants::physics::MassElectron); v0tof.timeNegativePr = o2::framework::pid::tof::MassToExpTime(nTof.tofExpMom, lengthNegative, o2::constants::physics::MassProton * o2::constants::physics::MassProton); v0tof.timeNegativePi = o2::framework::pid::tof::MassToExpTime(nTof.tofExpMom, lengthNegative, o2::constants::physics::MassPionCharged * o2::constants::physics::MassPionCharged); // as primary - v0tof.timeAsPrimaryNegativeEl = o2::framework::pid::tof::MassToExpTime(nTof.tofExpMom, nTof.length, o2::constants::physics::MassElectron * o2::constants::physics::MassElectron); + v0tof.timeAsPrimaryNegativeEl = o2::framework::pid::tof::MassToExpTime(nTof.tofExpMom, nTof.length, o2::constants::physics::MassElectron * o2::constants::physics::MassElectron); v0tof.timeAsPrimaryNegativePr = o2::framework::pid::tof::MassToExpTime(nTof.tofExpMom, nTof.length, o2::constants::physics::MassProton * o2::constants::physics::MassProton); v0tof.timeAsPrimaryNegativePi = o2::framework::pid::tof::MassToExpTime(nTof.tofExpMom, nTof.length, o2::constants::physics::MassPionCharged * o2::constants::physics::MassPionCharged); } } } if (lengthNegative > 0.0f) { - v0tof.deltaTimeNegativePhotonEl = (nTof.tofSignal - nTof.tofEvTime) - (v0tof.timePhoton + v0tof.timeNegativeEl); + v0tof.deltaTimeNegativePhotonEl = (nTof.tofSignal - nTof.tofEvTime) - (v0tof.timePhoton + v0tof.timeNegativeEl); v0tof.deltaTimeNegativeLambdaPr = (nTof.tofSignal - nTof.tofEvTime) - (v0tof.timeLambda + v0tof.timeNegativePr); v0tof.deltaTimeNegativeLambdaPi = (nTof.tofSignal - nTof.tofEvTime) - (v0tof.timeLambda + v0tof.timeNegativePi); v0tof.deltaTimeNegativeK0ShortPi = (nTof.tofSignal - nTof.tofEvTime) - (v0tof.timeK0Short + v0tof.timeNegativePi); - if (useNsigmaCalibStrTOF) { + if (useNsigmaCalibStrTOF) { // de facto nsigma if (nSigmaCalibLoaded) { v0tof.nSigmaNegativePhotonEl = -999.; @@ -1079,7 +1079,7 @@ struct strangenesstofpid { } } else { // use nSigma function from O2Physics/Common/Core/PID/PIDTOFParamService.h - v0tof.nSigmaNegativePhotonEl = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timePhoton, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); + v0tof.nSigmaNegativePhotonEl = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timePhoton, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); v0tof.nSigmaNegativeLambdaPi = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeLambda, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); v0tof.nSigmaNegativeLambdaPr = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeLambda, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); v0tof.nSigmaNegativeK0ShortPi = mTOFResponse->nSigma(nTof.tofSignal - v0tof.timeK0Short, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); @@ -1150,19 +1150,19 @@ struct strangenesstofpid { // calculation of delta-decay-time (no reliance on event time) if (nTof.hasTOF && pTof.hasTOF) { // does not depend on event time - v0tof.deltaDecayTimePhoton = (pTof.tofSignal - v0tof.timePositiveEl) - (nTof.tofSignal - v0tof.timeNegativeEl); + v0tof.deltaDecayTimePhoton = (pTof.tofSignal - v0tof.timePositiveEl) - (nTof.tofSignal - v0tof.timeNegativeEl); v0tof.deltaDecayTimeLambda = (pTof.tofSignal - v0tof.timePositivePr) - (nTof.tofSignal - v0tof.timeNegativePi); v0tof.deltaDecayTimeAntiLambda = (pTof.tofSignal - v0tof.timePositivePi) - (nTof.tofSignal - v0tof.timeNegativePr); v0tof.deltaDecayTimeK0Short = (pTof.tofSignal - v0tof.timePositivePi) - (nTof.tofSignal - v0tof.timeNegativePi); float evTimeMean = 0.5f * (pTof.tofEvTime + nTof.tofEvTime); - float decayTimePhoton = 0.5f * ((pTof.tofSignal - v0tof.timePositiveEl) + (nTof.tofSignal - v0tof.timeNegativeEl)) - evTimeMean; + float decayTimePhoton = 0.5f * ((pTof.tofSignal - v0tof.timePositiveEl) + (nTof.tofSignal - v0tof.timeNegativeEl)) - evTimeMean; float decayTimeLambda = 0.5f * ((pTof.tofSignal - v0tof.timePositivePr) + (nTof.tofSignal - v0tof.timeNegativePi)) - evTimeMean; float decayTimeAntiLambda = 0.5f * ((pTof.tofSignal - v0tof.timePositivePi) + (nTof.tofSignal - v0tof.timeNegativePr)) - evTimeMean; float decayTimeK0Short = 0.5f * ((pTof.tofSignal - v0tof.timePositivePi) + (nTof.tofSignal - v0tof.timeNegativePi)) - evTimeMean; constexpr float lightSpeed = 0.0299792458; // in cm/ps - v0tof.betaPhoton = (lengthV0 / decayTimePhoton) / lightSpeed; + v0tof.betaPhoton = (lengthV0 / decayTimePhoton) / lightSpeed; v0tof.betaLambda = (lengthV0 / decayTimeLambda) / lightSpeed; v0tof.betaAntiLambda = (lengthV0 / decayTimeAntiLambda) / lightSpeed; v0tof.betaK0Short = (lengthV0 / decayTimeK0Short) / lightSpeed; @@ -1293,11 +1293,11 @@ struct strangenesstofpid { casctof.posDeltaTimeAsOmPr = (pTof.tofSignal - pTof.tofEvTime) - (omFlight + lambdaFlight + casctof.posFlightPr); if (cascade.sign() < 0) { - if (useNsigmaCalibStrTOF) { - if (nSigmaCalibLoaded) { - casctof.nSigmaXiLaPr = (casctof.posDeltaTimeAsXiPr - hMeanPosXiPr->Interpolate(cascade.p())) / hSigmaPosXiPr->Interpolate(cascade.p()); + if (useNsigmaCalibStrTOF) { + if (nSigmaCalibLoaded) { + casctof.nSigmaXiLaPr = (casctof.posDeltaTimeAsXiPr - hMeanPosXiPr->Interpolate(cascade.p())) / hSigmaPosXiPr->Interpolate(cascade.p()); casctof.nSigmaOmLaPr = (casctof.posDeltaTimeAsOmPr - hMeanPosOmPr->Interpolate(cascade.p())) / hSigmaPosOmPr->Interpolate(cascade.p()); - // wrong hypothesis + // wrong hypothesis casctof.nSigmaXiLaEl = -999.; casctof.nSigmaXiLaKa = -999.; casctof.nSigmaXiLaPi = -999.; @@ -1305,8 +1305,8 @@ struct strangenesstofpid { casctof.nSigmaOmLaEl = -999.; casctof.nSigmaOmLaKa = -999.; casctof.nSigmaOmLaPi = -999.; - } - } else { + } + } else { casctof.nSigmaXiLaPr = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); casctof.nSigmaOmLaPr = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); @@ -1318,11 +1318,11 @@ struct strangenesstofpid { casctof.nSigmaOmLaEl = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); casctof.nSigmaOmLaKa = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); casctof.nSigmaOmLaPi = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - } + } } else { - if (useNsigmaCalibStrTOF) { - if (nSigmaCalibLoaded) { - casctof.nSigmaXiLaPi = (casctof.posDeltaTimeAsXiPi - hMeanPosXiPi->Interpolate(cascade.p())) / hSigmaPosXiPi->Interpolate(cascade.p()); + if (useNsigmaCalibStrTOF) { + if (nSigmaCalibLoaded) { + casctof.nSigmaXiLaPi = (casctof.posDeltaTimeAsXiPi - hMeanPosXiPi->Interpolate(cascade.p())) / hSigmaPosXiPi->Interpolate(cascade.p()); casctof.nSigmaOmLaPi = (casctof.posDeltaTimeAsOmPi - hMeanPosOmPi->Interpolate(cascade.p())) / hSigmaPosOmPi->Interpolate(cascade.p()); // wrong hypothesis casctof.nSigmaXiLaEl = -999.; @@ -1332,8 +1332,8 @@ struct strangenesstofpid { casctof.nSigmaOmLaEl = -999.; casctof.nSigmaOmLaKa = -999.; casctof.nSigmaOmLaPi = -999.; - } - } else { + } + } else { casctof.nSigmaXiLaPi = mTOFResponse->nSigma(pTof.tofSignal - xiFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); casctof.nSigmaOmLaPi = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); @@ -1345,7 +1345,7 @@ struct strangenesstofpid { casctof.nSigmaOmLaEl = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); casctof.nSigmaOmLaKa = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); casctof.nSigmaOmLaPr = mTOFResponse->nSigma(pTof.tofSignal - omFlight - lambdaFlight, pTof.tofExpMom, lengthPositive, posTrack.getP(), posTrack.getEta(), pTof.tofEvTime, pTof.tofEvTimeErr); - } + } } // do QA histograms (calibration / QC) @@ -1430,11 +1430,11 @@ struct strangenesstofpid { casctof.negDeltaTimeAsOmPr = (nTof.tofSignal - nTof.tofEvTime) - (omFlight + lambdaFlight + casctof.negFlightPr); if (cascade.sign() < 0) { - if (useNsigmaCalibStrTOF) { - if (nSigmaCalibLoaded) { - casctof.nSigmaXiLaPi = (casctof.negDeltaTimeAsXiPi - hMeanNegXiPi->Interpolate(cascade.p())) / hSigmaNegXiPi->Interpolate(cascade.p()); + if (useNsigmaCalibStrTOF) { + if (nSigmaCalibLoaded) { + casctof.nSigmaXiLaPi = (casctof.negDeltaTimeAsXiPi - hMeanNegXiPi->Interpolate(cascade.p())) / hSigmaNegXiPi->Interpolate(cascade.p()); casctof.nSigmaOmLaPi = (casctof.negDeltaTimeAsOmPi - hMeanNegOmPi->Interpolate(cascade.p())) / hSigmaNegOmPi->Interpolate(cascade.p()); - // wrong hypothesis + // wrong hypothesis casctof.nSigmaXiLaEl = -999.; casctof.nSigmaXiLaKa = -999.; casctof.nSigmaXiLaPi = -999.; @@ -1442,8 +1442,8 @@ struct strangenesstofpid { casctof.nSigmaOmLaEl = -999.; casctof.nSigmaOmLaKa = -999.; casctof.nSigmaOmLaPi = -999.; - } - } else { + } + } else { casctof.nSigmaXiLaPi = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); casctof.nSigmaOmLaPi = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); @@ -1455,13 +1455,13 @@ struct strangenesstofpid { casctof.nSigmaOmLaEl = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); casctof.nSigmaOmLaKa = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); casctof.nSigmaOmLaPr = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - } + } } else { if (useNsigmaCalibStrTOF) { - if (nSigmaCalibLoaded) { - casctof.nSigmaXiLaPr = (casctof.negDeltaTimeAsXiPr - hMeanNegXiPr->Interpolate(cascade.p())) / hSigmaNegXiPr->Interpolate(cascade.p()); + if (nSigmaCalibLoaded) { + casctof.nSigmaXiLaPr = (casctof.negDeltaTimeAsXiPr - hMeanNegXiPr->Interpolate(cascade.p())) / hSigmaNegXiPr->Interpolate(cascade.p()); casctof.nSigmaOmLaPr = (casctof.negDeltaTimeAsOmPr - hMeanNegOmPr->Interpolate(cascade.p())) / hSigmaNegOmPr->Interpolate(cascade.p()); - // wrong hypothesis + // wrong hypothesis casctof.nSigmaXiLaEl = -999.; casctof.nSigmaXiLaKa = -999.; casctof.nSigmaXiLaPi = -999.; @@ -1469,8 +1469,8 @@ struct strangenesstofpid { casctof.nSigmaOmLaEl = -999.; casctof.nSigmaOmLaKa = -999.; casctof.nSigmaOmLaPi = -999.; - } - } else { + } + } else { casctof.nSigmaXiLaPr = mTOFResponse->nSigma(nTof.tofSignal - xiFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); casctof.nSigmaOmLaPr = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); @@ -1482,7 +1482,7 @@ struct strangenesstofpid { casctof.nSigmaOmLaEl = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); casctof.nSigmaOmLaKa = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); casctof.nSigmaOmLaPi = mTOFResponse->nSigma(nTof.tofSignal - omFlight - lambdaFlight, nTof.tofExpMom, lengthNegative, negTrack.getP(), negTrack.getEta(), nTof.tofEvTime, nTof.tofEvTimeErr); - } + } } // do QA histograms (calibration / QC) @@ -1564,9 +1564,9 @@ struct strangenesstofpid { casctof.bachDeltaTimeAsXiPi = (bTof.tofSignal - bTof.tofEvTime) - (xiFlight + casctof.bachFlightPi); casctof.bachDeltaTimeAsOmKa = (bTof.tofSignal - bTof.tofEvTime) - (omFlight + casctof.bachFlightKa); - if (useNsigmaCalibStrTOF) { - if (nSigmaCalibLoaded) { - casctof.nSigmaXiPi = (casctof.bachDeltaTimeAsXiPi - hMeanBachXiPi->Interpolate(cascade.p())) / hSigmaBachXiPi->Interpolate(cascade.p()); + if (useNsigmaCalibStrTOF) { + if (nSigmaCalibLoaded) { + casctof.nSigmaXiPi = (casctof.bachDeltaTimeAsXiPi - hMeanBachXiPi->Interpolate(cascade.p())) / hSigmaBachXiPi->Interpolate(cascade.p()); casctof.nSigmaOmKa = (casctof.bachDeltaTimeAsOmKa - hMeanBachOmKa->Interpolate(cascade.p())) / hSigmaBachOmKa->Interpolate(cascade.p()); // wrong hypothesis @@ -1577,8 +1577,8 @@ struct strangenesstofpid { casctof.nSigmaOmEl = -999.; casctof.nSigmaOmPi = -999.; casctof.nSigmaOmPr = -999.; - } - } else { + } + } else { casctof.nSigmaXiPi = mTOFResponse->nSigma(bTof.tofSignal - xiFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); casctof.nSigmaOmKa = mTOFResponse->nSigma(bTof.tofSignal - omFlight, bTof.tofExpMom, lengthBachelor, bachTrack.getP(), bachTrack.getEta(), bTof.tofEvTime, bTof.tofEvTimeErr); @@ -1719,7 +1719,7 @@ struct strangenesstofpid { pTof.tofExpMom = pTra.tofExpMom(); // pTof.tofEvTime = reassociateTracks ? mapCollisionTime[V0.collisionId()] : pTra.tofEvTime(); // pTof.tofEvTimeErr = reassociateTracks ? mapCollisionTimeError[V0.collisionId()] : pTra.tofEvTimeErr(); - pTof.tofEvTime = reassociateTracks ? collisionEventTime[V0.collisionId()] : pTra.tofEvTime(); + pTof.tofEvTime = reassociateTracks ? collisionEventTime[V0.collisionId()] : pTra.tofEvTime(); pTof.tofEvTimeErr = reassociateTracks ? collisionEventTimeErr[V0.collisionId()] : pTra.tofEvTimeErr(); // pTof.tofSignal = pTra.tofSignal() + (doBCshift ? deltaTimePos : 0.0f); pTof.tofSignal = doBCshift && pTra.has_collision() ? pTra.tofSignalInAnotherBC(pTra.collision().bc_as().globalBC(), V0.collision().bc_as().globalBC()) : pTra.tofSignal(); @@ -1735,7 +1735,7 @@ struct strangenesstofpid { nTof.tofExpMom = nTra.tofExpMom(); // nTof.tofEvTime = reassociateTracks ? mapCollisionTime[V0.collisionId()] : nTra.tofEvTime(); // nTof.tofEvTimeErr = reassociateTracks ? mapCollisionTimeError[V0.collisionId()] : nTra.tofEvTimeErr(); - nTof.tofEvTime = reassociateTracks ? collisionEventTime[V0.collisionId()] : nTra.tofEvTime(); + nTof.tofEvTime = reassociateTracks ? collisionEventTime[V0.collisionId()] : nTra.tofEvTime(); nTof.tofEvTimeErr = reassociateTracks ? collisionEventTimeErr[V0.collisionId()] : nTra.tofEvTimeErr(); // nTof.tofSignal = nTra.tofSignal() + (doBCshift ? deltaTimeNeg : 0.0f); nTof.tofSignal = doBCshift && nTra.has_collision() ? nTra.tofSignalInAnotherBC(nTra.collision().bc_as().globalBC(), V0.collision().bc_as().globalBC()) : nTra.tofSignal(); From a97b6b6d997a59a92b0ad2812f428e59caf1ffbd Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Tue, 26 May 2026 22:41:41 +0200 Subject: [PATCH 20/28] Fix O2Linter errors in strangederivedbuilder --- .../Strangeness/strangederivedbuilder.cxx | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index 16e54c29de4..8dfb96c7661 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -9,11 +9,15 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. // +/// \file strangederivedbuilder.cxx +/// \brief this task provides general links between collisions and strange objects reconstructed in various ways. +/// It is meant to help with providing auxiliary information when dealing with derived data. +/// +/// \author David Dobrigkeit Chinellato , Austrian Academy of Sciences & MBI +/// \author Romain Schotter , Austrian Academy of Sciences & MBI +// //__________________________________________________ -// this task provides general links between collisions -// and strange objects reconstructed in various ways. -// It is meant to help with providing auxiliary information -// when dealing with derived data. +// #include "PWGLF/DataModel/EPCalibrationTables.h" #include "PWGLF/DataModel/LFParticleIdentification.h" @@ -1031,8 +1035,8 @@ struct strangederivedbuilder { void processPureSimulation(aod::McParticles const& mcParticles) { - for (auto& mcp : mcParticles) { - if (TMath::Abs(mcp.y()) < 0.5) { + for (auto const& mcp : mcParticles) { + if (std::abs(mcp.y()) < 0.5) { static_for<0, nSpecies - 1>([&](auto i) { constexpr int index = i.value; if (mcp.pdgCode() == particlePDGCodes[index] && bitcheck(enabledBits, index)) { @@ -1049,7 +1053,7 @@ struct strangederivedbuilder { // identify best-of collision int biggestNContribs = -1; float bestCentrality = 100.5; - for (auto& collision : collisions) { + for (auto const& collision : collisions) { if (biggestNContribs < collision.numContrib()) { biggestNContribs = collision.numContrib(); bestCentrality = collision.centFT0C(); @@ -1061,8 +1065,8 @@ struct strangederivedbuilder { } histos.fill(HIST("h2dNVerticesVsCentrality"), bestCentrality, collisions.size()); - for (auto& mcp : mcParticles) { - if (TMath::Abs(mcp.y()) < 0.5 && mcp.isPhysicalPrimary()) { + for (auto const& mcp : mcParticles) { + if (std::abs(mcp.y()) < 0.5 && mcp.isPhysicalPrimary()) { static_for<0, nSpecies - 1>([&](auto i) { constexpr int index = i.value; if (mcp.pdgCode() == particlePDGCodes[index] && bitcheck(enabledBits, index)) { @@ -1085,29 +1089,29 @@ struct strangederivedbuilder { std::fill(genOmegaPlus.begin(), genOmegaPlus.end(), 0); // this process function also checks if a given collision was reconstructed and checks explicitly for splitting, etc - for (auto& mcCollision : mcCollisions) { + for (auto const& mcCollision : mcCollisions) { const uint64_t mcCollIndex = mcCollision.globalIndex(); // use one of the generated histograms as the bin finder auto hBinFinder = histos.get(HIST("h2dGeneratedK0Short")); auto mcParticles = mcParticlesEntireTable.sliceBy(mcParticlePerMcCollision, mcCollIndex); - for (auto& mcp : mcParticles) { - if (TMath::Abs(mcp.y()) < 0.5 && mcp.isPhysicalPrimary()) { + for (auto const& mcp : mcParticles) { + if (std::abs(mcp.y()) < 0.5 && mcp.isPhysicalPrimary()) { auto binNumber = hBinFinder->FindBin(mcCollision.bestCollisionCentFT0C(), mcp.pt()); // caution: pack - if (mcp.pdgCode() == 310) + if (mcp.pdgCode() == PDG_t::kK0Short) genK0Short[binNumber]++; - if (mcp.pdgCode() == 3122) + if (mcp.pdgCode() == PDG_t::kLambda0) genLambda[binNumber]++; - if (mcp.pdgCode() == -3122) + if (mcp.pdgCode() == PDG_t::kLambda0Bar) genAntiLambda[binNumber]++; - if (mcp.pdgCode() == 3312) + if (mcp.pdgCode() == PDG_t::kXiMinus) genXiMinus[binNumber]++; - if (mcp.pdgCode() == -3312) + if (mcp.pdgCode() == PDG_t::kXiPlusBar) genXiPlus[binNumber]++; - if (mcp.pdgCode() == 3334) + if (mcp.pdgCode() == PDG_t::kOmegaMinus) genOmegaMinus[binNumber]++; - if (mcp.pdgCode() == -3334) + if (mcp.pdgCode() == PDG_t::kOmegaPlusBar) genOmegaPlus[binNumber]++; } } From 7f36ffe61aaff259f8181c113300dc6ae04d3779 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Tue, 26 May 2026 22:44:04 +0200 Subject: [PATCH 21/28] Fix O2Linter errors in strangenesstofpidconverter3 --- .../Converters/stradautrackstofpidconverter3.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx index af1164712b1..e7438a5ec13 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx +++ b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx @@ -8,6 +8,13 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +// +/// \file stradautrackstofpidconverter3.cxx.cxx +/// \brief Converts DauTrackTOFPID_001 and StraEvTimes_000 into DauTrackTOFPID_002 and StraEvTimes_001 +/// +/// \author David Dobrigkeit Chinellato , Austrian Academy of Sciences & MBI +/// \author Romain Schotter , Austrian Academy of Sciences & MBI + #include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" From b5af3c657f2fc7fc2d1c0160953229c30080d39b Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Tue, 26 May 2026 22:46:46 +0200 Subject: [PATCH 22/28] Fix O2Linter error in stradautracktofpidconverter2 --- .../Converters/stradautrackstofpidconverter2.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter2.cxx b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter2.cxx index e447908e558..9c954af1581 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter2.cxx +++ b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter2.cxx @@ -8,6 +8,16 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +// +/// \file stradautrackstofpidconverter2.cxx +/// \brief Converts DauTrackTOFPIDs_000 into DauTrackTOFPID_001 and StraEvTimes_000 +/// +/// \author David Dobrigkeit Chinellato , Austrian Academy of Sciences & MBI +/// \author Romain Schotter , Austrian Academy of Sciences & MBI +// + +#include + #include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" From 537bd4513dc52b4b1e84bd5663e6138ea547bb9c Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Tue, 26 May 2026 22:48:44 +0200 Subject: [PATCH 23/28] Fix O2Linter errors in stradautracktofpidconverter --- .../Converters/stradautrackstofpidconverter.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx index 8509f93c560..08680c9d449 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx +++ b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx @@ -8,6 +8,16 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +// +/// \file stradautrackstofpidconverter.cxx +/// \brief Produces DauTrackTOFPIDs from V0TOFs and CascTOFs table +/// +/// \author David Dobrigkeit Chinellato , Austrian Academy of Sciences & MBI +/// \author Romain Schotter , Austrian Academy of Sciences & MBI +// + +#include + #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" @@ -17,7 +27,6 @@ using namespace o2; using namespace o2::framework; -// Converts V0 version 001 to 002 struct stradautrackstofpidconverter { Produces dautracktofpids; From d6ad5af9fe2489fe68cb8fce63f903c973a0d6ea Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Tue, 26 May 2026 22:56:14 +0200 Subject: [PATCH 24/28] Fix O2Linter errors in strangenesstofpid --- PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index 61928fd79c0..a9c7b709f8c 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -13,6 +13,7 @@ // Strangeness TOF PID // *+-+*+-+*+-+*+-+*+-+*+-+* // +/// \file strangenesstofpid.cxx /// \author Nicolò Jacazio /// \author David Dobrigkeit Chinellato /// \since 11/05/2023 @@ -58,6 +59,7 @@ #include #include #include +#include #include #include #include @@ -307,7 +309,7 @@ struct strangenesstofpid { cosAngle1 /= modulus1; sinAngle1 /= modulus1; length1 = trcCircle.rC * TMath::ACos(cosAngle1); - length1 *= sqrt(1.0f + track.getTgl() * track.getTgl()); + length1 *= std::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); @@ -315,7 +317,7 @@ struct strangenesstofpid { cosAngle2 /= modulus2; sinAngle2 /= modulus2; length2 = trcCircle.rC * TMath::ACos(cosAngle2); - length2 *= sqrt(1.0f + track.getTgl() * track.getTgl()); + length2 *= std::sqrt(1.0f + track.getTgl() * track.getTgl()); // rotate transverse momentum vector such that it is at intercepts float angle1 = TMath::ACos(cosAngle1); @@ -598,7 +600,7 @@ struct strangenesstofpid { if (propagationConfiguration.d_bz_input > -990) { d_bz = propagationConfiguration.d_bz_input; o2::parameters::GRPMagField grpmag; - if (fabs(d_bz) > 1e-5) { + if (std::fabs(d_bz) > 1e-5) { grpmag.setL3Current(30000.f / (d_bz / 5.0f)); } o2::base::Propagator::initFieldFromGRP(&grpmag); @@ -1210,7 +1212,7 @@ struct strangenesstofpid { // 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()); + lengthCascade *= std::sqrt(1.0f + cascTrack.getTgl() * cascTrack.getTgl()); } if (!successPropag) { From c8a693a9854a7f7e0abb15b71bf2383ed2c3a6c9 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Tue, 26 May 2026 23:00:50 +0200 Subject: [PATCH 25/28] Fix O2Linter error in strangederivedbuilder --- PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index 4d0d4be4aa0..d5bf82c9cc1 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -485,7 +485,7 @@ struct strangederivedbuilder { if constexpr (requires { udCollIterator.gapSide(); }) { // check if this table is the expected one auto udCollision = udCollisions.sliceBy(udCollisionsPerCollision, collIdx); if (udCollision.size() == 1) { // check that the slicing provide a unique UD collision - for (auto& udColl : udCollision) { + for (const auto& udColl : udCollision) { gapSide = udColl.gapSide(); totalFT0AmplitudeA = udColl.totalFT0AmplitudeA(); totalFT0AmplitudeC = udColl.totalFT0AmplitudeC(); From 9540c0855c2b896a69661389387619edc2d8aa0b Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Tue, 26 May 2026 23:01:42 +0200 Subject: [PATCH 26/28] Fix O2Linter errors in stradautracktofpidconverter3 --- .../Strangeness/Converters/stradautrackstofpidconverter3.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx index e7438a5ec13..c03cbead81e 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx +++ b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter3.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. // -/// \file stradautrackstofpidconverter3.cxx.cxx +/// \file stradautrackstofpidconverter3.cxx /// \brief Converts DauTrackTOFPID_001 and StraEvTimes_000 into DauTrackTOFPID_002 and StraEvTimes_001 /// /// \author David Dobrigkeit Chinellato , Austrian Academy of Sciences & MBI From 7daa0566c3fb70fc1e62836e29718615c7bfc488 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 26 May 2026 21:02:19 +0000 Subject: [PATCH 27/28] Please consider the following formatting changes --- .../Converters/stradautrackstofpidconverter.cxx | 7 +++---- .../Converters/stradautrackstofpidconverter2.cxx | 2 -- PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx | 4 ++-- PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx index b2c5ac5530c..ad87c6d16cd 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx +++ b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx @@ -16,13 +16,12 @@ /// \author Romain Schotter , Austrian Academy of Sciences & MBI // -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" #include #include #include diff --git a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter2.cxx b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter2.cxx index 3c1d109f844..de6dde54201 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter2.cxx +++ b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter2.cxx @@ -16,8 +16,6 @@ /// \author Romain Schotter , Austrian Academy of Sciences & MBI // -#include - #include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index d5bf82c9cc1..1878aaa9135 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -10,14 +10,14 @@ // or submit itself to any jurisdiction. // /// \file strangederivedbuilder.cxx -/// \brief this task provides general links between collisions and strange objects reconstructed in various ways. +/// \brief this task provides general links between collisions and strange objects reconstructed in various ways. /// It is meant to help with providing auxiliary information when dealing with derived data. /// /// \author David Dobrigkeit Chinellato , Austrian Academy of Sciences & MBI /// \author Romain Schotter , Austrian Academy of Sciences & MBI // //__________________________________________________ -// +// #include "PWGLF/DataModel/EPCalibrationTables.h" #include "PWGLF/DataModel/LFStrangenessPIDTables.h" diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index 45a33c73269..2fe9a61f399 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -66,8 +66,8 @@ #include #include #include -#include #include +#include #include using namespace o2; From 41bf946d915d0f066e69804ee5a849e75de005b1 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Tue, 26 May 2026 23:09:18 +0200 Subject: [PATCH 28/28] Remove unncessary headers --- .../Strangeness/Converters/stradautrackstofpidconverter.cxx | 3 --- 1 file changed, 3 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx index ad87c6d16cd..a3cabe45b2d 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx +++ b/PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx @@ -19,9 +19,6 @@ #include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" #include #include #include