From 75ab60d86488eb45f99f69cc08ecadd338c7993b Mon Sep 17 00:00:00 2001 From: romainschotter Date: Tue, 13 Feb 2024 00:02:46 +0100 Subject: [PATCH 01/24] Megalinter again --- PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index 1fea89cd342..5e978fc4667 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include From aa8663877bef5c71d6b6f7c0023efdd49953df5a Mon Sep 17 00:00:00 2001 From: romainschotter Date: Tue, 13 Feb 2024 00:50:24 +0100 Subject: [PATCH 02/24] Megalinter again v2 --- PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index 5e978fc4667..1fea89cd342 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -26,7 +26,6 @@ #include #include #include -#include #include #include From 1c3b73a67d0822d7306d1d9535107cfff994855f Mon Sep 17 00:00:00 2001 From: romainschotter Date: Thu, 7 Mar 2024 17:13:11 +0100 Subject: [PATCH 03/24] Add TOF selections + fix generated candidates loop --- .../derivedlambdakzeroanalysis.cxx | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index 1fea89cd342..7b7fdc8bdf0 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -112,6 +112,10 @@ struct derivedlambdakzeroanalysis { Configurable qaMinPt{"qaMinPt", 0.0f, "minimum pT for QA plots"}; Configurable qaMaxPt{"qaMaxPt", 1000.0f, "maximum pT for QA plots"}; Configurable qaCentrality{"qaCentrality", false, "qa centrality flag: check base raw values"}; + + // PID (TOF) + Configurable maxDeltaTimeProton{"maxDeltaTimeProton", 1e+9, "check maximum allowed time"}; + Configurable maxDeltaTimePion{"maxDeltaTimePion", 1e+9, "check maximum allowed time"}; // PID (TOF) Configurable maxDeltaTimeProton{"maxDeltaTimeProton", 1e+9, "check maximum allowed time"}; @@ -565,6 +569,22 @@ struct derivedlambdakzeroanalysis { bitset(bitMap, selTPCPIDNegativePion); if (fabs(negTrackExtra.tpcNSigmaPr()) < TpcPidNsigmaCut) bitset(bitMap, selTPCPIDNegativeProton); + + // TOF PID + // Positive track + if (fabs(v0.posTOFDeltaTLaPr()) < maxDeltaTimeProton) + bitset(bitMap, selTOFDeltaTPositiveProtonLambda); + if (fabs(v0.posTOFDeltaTLaPi()) < maxDeltaTimePion) + bitset(bitMap, selTOFDeltaTPositivePionLambda); + if (fabs(v0.posTOFDeltaTK0Pi()) < maxDeltaTimePion) + bitset(bitMap, selTOFDeltaTPositivePionK0Short); + // Negative track + if (fabs(v0.negTOFDeltaTLaPr()) < maxDeltaTimeProton) + bitset(bitMap, selTOFDeltaTNegativeProtonLambda); + if (fabs(v0.negTOFDeltaTLaPi()) < maxDeltaTimePion) + bitset(bitMap, selTOFDeltaTNegativePionLambda); + if (fabs(v0.negTOFDeltaTK0Pi()) < maxDeltaTimePion) + bitset(bitMap, selTOFDeltaTNegativePionK0Short); // TOF PID in DeltaT // Positive track From bbbc5c0c40c321b283531c241a3fb509419535d9 Mon Sep 17 00:00:00 2001 From: romainschotter Date: Thu, 7 Mar 2024 17:48:16 +0100 Subject: [PATCH 04/24] Fix whitespaces --- PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index 7b7fdc8bdf0..ae854ac3964 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -112,7 +112,7 @@ struct derivedlambdakzeroanalysis { Configurable qaMinPt{"qaMinPt", 0.0f, "minimum pT for QA plots"}; Configurable qaMaxPt{"qaMaxPt", 1000.0f, "maximum pT for QA plots"}; Configurable qaCentrality{"qaCentrality", false, "qa centrality flag: check base raw values"}; - + // PID (TOF) Configurable maxDeltaTimeProton{"maxDeltaTimeProton", 1e+9, "check maximum allowed time"}; Configurable maxDeltaTimePion{"maxDeltaTimePion", 1e+9, "check maximum allowed time"}; @@ -569,7 +569,7 @@ struct derivedlambdakzeroanalysis { bitset(bitMap, selTPCPIDNegativePion); if (fabs(negTrackExtra.tpcNSigmaPr()) < TpcPidNsigmaCut) bitset(bitMap, selTPCPIDNegativeProton); - + // TOF PID // Positive track if (fabs(v0.posTOFDeltaTLaPr()) < maxDeltaTimeProton) From cba413841ea04667eca0478c187d36be8623bfee Mon Sep 17 00:00:00 2001 From: romainschotter Date: Tue, 12 Mar 2024 23:45:25 +0100 Subject: [PATCH 05/24] Add boolean to enable/disable TPC QA plots + add centralityVsNch QA plot --- PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index ae854ac3964..593b09fc310 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -117,10 +117,6 @@ struct derivedlambdakzeroanalysis { Configurable maxDeltaTimeProton{"maxDeltaTimeProton", 1e+9, "check maximum allowed time"}; Configurable maxDeltaTimePion{"maxDeltaTimePion", 1e+9, "check maximum allowed time"}; - // PID (TOF) - Configurable maxDeltaTimeProton{"maxDeltaTimeProton", 1e+9, "check maximum allowed time"}; - Configurable maxDeltaTimePion{"maxDeltaTimePion", 1e+9, "check maximum allowed time"}; - // for MC Configurable doMCAssociation{"doMCAssociation", true, "if MC, do MC association"}; Configurable doCollisionAssociationQA{"doCollisionAssociationQA", true, "check collision association"}; @@ -1056,8 +1052,6 @@ struct derivedlambdakzeroanalysis { histos.fill(HIST("hEventCentrality"), centrality); - histos.fill(HIST("hCentralityVsNch"), centrality, collision.multNTracksPVeta1()); - // __________________________________________ // perform main analysis for (auto& v0 : fullV0s) { @@ -1110,8 +1104,6 @@ struct derivedlambdakzeroanalysis { histos.fill(HIST("hEventCentrality"), centrality); - histos.fill(HIST("hCentralityVsNch"), centrality, collision.multNTracksPVeta1()); - // __________________________________________ // perform main analysis for (auto& v0 : fullV0s) { From 0c51b3b756d47c3cb7c1261bb8458eaa40793e95 Mon Sep 17 00:00:00 2001 From: romainschotter Date: Tue, 12 Mar 2024 23:50:36 +0100 Subject: [PATCH 06/24] Fix clang and whitespaces --- PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index 593b09fc310..7880ca8c93e 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -1051,6 +1051,8 @@ struct derivedlambdakzeroanalysis { } histos.fill(HIST("hEventCentrality"), centrality); + + histos.fill(HIST("hCentralityVsNch"), centrality, collision.multNTracksPVeta1()); // __________________________________________ // perform main analysis @@ -1103,6 +1105,8 @@ struct derivedlambdakzeroanalysis { } histos.fill(HIST("hEventCentrality"), centrality); + + histos.fill(HIST("hCentralityVsNch"), centrality, collision.multNTracksPVeta1()); // __________________________________________ // perform main analysis From 9cc5ecc0777de51c79825911ec9d04f6cec6183c Mon Sep 17 00:00:00 2001 From: romainschotter Date: Mon, 18 Mar 2024 12:15:40 +0100 Subject: [PATCH 07/24] Formatting changes --- PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index 7880ca8c93e..baac1e8f0dc 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -1050,8 +1050,7 @@ struct derivedlambdakzeroanalysis { centrality = hRawCentrality->GetBinContent(hRawCentrality->FindBin(collision.multFT0C())); } - histos.fill(HIST("hEventCentrality"), centrality); - + histos.fill(HIST("hEventCentrality"), centrality); histos.fill(HIST("hCentralityVsNch"), centrality, collision.multNTracksPVeta1()); // __________________________________________ @@ -1105,7 +1104,6 @@ struct derivedlambdakzeroanalysis { } histos.fill(HIST("hEventCentrality"), centrality); - histos.fill(HIST("hCentralityVsNch"), centrality, collision.multNTracksPVeta1()); // __________________________________________ From 681436ceef8ad20b3c7523a71a50259db9f8434e Mon Sep 17 00:00:00 2001 From: romainschotter Date: Mon, 18 Mar 2024 13:20:55 +0100 Subject: [PATCH 08/24] Please consider the following formatting changes --- PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index baac1e8f0dc..521f72d7420 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -1051,6 +1051,7 @@ struct derivedlambdakzeroanalysis { } histos.fill(HIST("hEventCentrality"), centrality); + histos.fill(HIST("hCentralityVsNch"), centrality, collision.multNTracksPVeta1()); // __________________________________________ @@ -1104,6 +1105,7 @@ struct derivedlambdakzeroanalysis { } histos.fill(HIST("hEventCentrality"), centrality); + histos.fill(HIST("hCentralityVsNch"), centrality, collision.multNTracksPVeta1()); // __________________________________________ From bfc942ec4a6b0b20bd18324ffb5d12e1a96ead81 Mon Sep 17 00:00:00 2001 From: romainschotter Date: Mon, 18 Mar 2024 13:28:40 +0100 Subject: [PATCH 09/24] Please consider the following formatting changes --- PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index 521f72d7420..1f899a3f869 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -1050,8 +1050,8 @@ struct derivedlambdakzeroanalysis { centrality = hRawCentrality->GetBinContent(hRawCentrality->FindBin(collision.multFT0C())); } - histos.fill(HIST("hEventCentrality"), centrality); - + histos.fill(HIST("hEventCentrality"), centrality); + histos.fill(HIST("hCentralityVsNch"), centrality, collision.multNTracksPVeta1()); // __________________________________________ From 9409325acd8765281da2e118b178c30100b300ba Mon Sep 17 00:00:00 2001 From: romainschotter Date: Tue, 26 Mar 2024 18:14:22 +0100 Subject: [PATCH 10/24] Remove duplicates --- .../Strangeness/derivedlambdakzeroanalysis.cxx | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index 1f899a3f869..1fea89cd342 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -566,22 +566,6 @@ struct derivedlambdakzeroanalysis { if (fabs(negTrackExtra.tpcNSigmaPr()) < TpcPidNsigmaCut) bitset(bitMap, selTPCPIDNegativeProton); - // TOF PID - // Positive track - if (fabs(v0.posTOFDeltaTLaPr()) < maxDeltaTimeProton) - bitset(bitMap, selTOFDeltaTPositiveProtonLambda); - if (fabs(v0.posTOFDeltaTLaPi()) < maxDeltaTimePion) - bitset(bitMap, selTOFDeltaTPositivePionLambda); - if (fabs(v0.posTOFDeltaTK0Pi()) < maxDeltaTimePion) - bitset(bitMap, selTOFDeltaTPositivePionK0Short); - // Negative track - if (fabs(v0.negTOFDeltaTLaPr()) < maxDeltaTimeProton) - bitset(bitMap, selTOFDeltaTNegativeProtonLambda); - if (fabs(v0.negTOFDeltaTLaPi()) < maxDeltaTimePion) - bitset(bitMap, selTOFDeltaTNegativePionLambda); - if (fabs(v0.negTOFDeltaTK0Pi()) < maxDeltaTimePion) - bitset(bitMap, selTOFDeltaTNegativePionK0Short); - // TOF PID in DeltaT // Positive track if (fabs(v0.posTOFDeltaTLaPr()) < maxDeltaTimeProton) From ecd83d9f869d5a0efb996a2d36643f77a72ff735 Mon Sep 17 00:00:00 2001 From: romainschotter Date: Mon, 8 Apr 2024 10:34:12 +0200 Subject: [PATCH 11/24] Add detector/ITS cluster map QA plots with both pos. and neg. info --- .../derivedlambdakzeroanalysis.cxx | 99 ------------------- 1 file changed, 99 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index 1fea89cd342..6f3c7e9ab22 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -653,105 +653,6 @@ struct derivedlambdakzeroanalysis { return (bitmap & mask) == mask; } - uint computeITSclusBitmap(uint8_t itsClusMap) - // Focus on the 12 dominant ITS cluster configurations - { - uint bitMap = 0; - - if (verifyMask(itsClusMap, ((uint8_t(1) << 0) | (uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5) | (uint8_t(1) << 6)))) { - // ITS : IB OB - // ITS : L0 L1 L2 L3 L4 L5 L6 - // ITS : x x x x x x x - bitMap = 12; - } else if (verifyMask(itsClusMap, ((uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5) | (uint8_t(1) << 6)))) { - // ITS : IB OB - // ITS : L0 L1 L2 L3 L4 L5 L6 - // ITS : x x x x x x - bitMap = 11; - } else if (verifyMask(itsClusMap, ((uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5) | (uint8_t(1) << 6)))) { - // ITS : IB OB - // ITS : L0 L1 L2 L3 L4 L5 L6 - // ITS : x x x x x - bitMap = 10; - } else if (verifyMask(itsClusMap, ((uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5) | (uint8_t(1) << 6)))) { - // ITS : IB OB - // ITS : L0 L1 L2 L3 L4 L5 L6 - // ITS : x x x x - bitMap = 9; - } else if (verifyMask(itsClusMap, ((uint8_t(1) << 4) | (uint8_t(1) << 5) | (uint8_t(1) << 6)))) { - // ITS : IB OB - // ITS : L0 L1 L2 L3 L4 L5 L6 - // ITS : x x x - bitMap = 8; - } else if (verifyMask(itsClusMap, ((uint8_t(1) << 5) | (uint8_t(1) << 6)))) { - // ITS : IB OB - // ITS : L0 L1 L2 L3 L4 L5 L6 - // ITS : x x - bitMap = 7; - } else if (verifyMask(itsClusMap, ((uint8_t(1) << 0) | (uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5)))) { - // ITS : IB OB - // ITS : L0 L1 L2 L3 L4 L5 L6 - // ITS : x x x x x x - bitMap = 6; - } else if (verifyMask(itsClusMap, ((uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5)))) { - // ITS : IB OB - // ITS : L0 L1 L2 L3 L4 L5 L6 - // ITS : x x x x x - bitMap = 5; - } else if (verifyMask(itsClusMap, ((uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5)))) { - // ITS : IB OB - // ITS : L0 L1 L2 L3 L4 L5 L6 - // ITS : x x x x - bitMap = 4; - } else if (verifyMask(itsClusMap, ((uint8_t(1) << 0) | (uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4)))) { - // ITS : IB OB - // ITS : L0 L1 L2 L3 L4 L5 L6 - // ITS : x x x x x - bitMap = 3; - } else if (verifyMask(itsClusMap, ((uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4)))) { - // ITS : IB OB - // ITS : L0 L1 L2 L3 L4 L5 L6 - // ITS : x x x x - bitMap = 2; - } else if (verifyMask(itsClusMap, ((uint8_t(1) << 0) | (uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3)))) { - // ITS : IB OB - // ITS : L0 L1 L2 L3 L4 L5 L6 - // ITS : x x x x - bitMap = 1; - } else { - // ITS : other configurations - bitMap = 0; - } - - return bitMap; - } - - uint computeDetBitmap(uint8_t detMap) - // Focus on the 4 dominant track configurations : - // ITS-TPC - // ITS-TPC-TRD - // ITS-TPC-TOF - // ITS-TPC-TRD-TOF - { - uint bitMap = 0; - - if (verifyMask(detMap, (o2::aod::track::ITS | o2::aod::track::TPC | o2::aod::track::TRD | o2::aod::track::TOF))) { - // ITS-TPC-TRD-TOF - bitMap = 3; - } else if (verifyMask(detMap, (o2::aod::track::ITS | o2::aod::track::TPC | o2::aod::track::TOF))) { - // ITS-TPC-TOF - bitMap = 2; - } else if (verifyMask(detMap, (o2::aod::track::ITS | o2::aod::track::TPC | o2::aod::track::TRD))) { - // ITS-TPC-TRD - bitMap = 1; - } else if (verifyMask(detMap, (o2::aod::track::ITS | o2::aod::track::TPC))) { - // ITS-TPC - bitMap = 0; - } - - return bitMap; - } - template void analyseCandidate(TV0 v0, float pt, float centrality, uint64_t selMap) // precalculate this information so that a check is one mask operation, not many From 1f3b04281c1dfc79d64c52cf40e5e13ce5b1f590 Mon Sep 17 00:00:00 2001 From: romainschotter Date: Mon, 8 Apr 2024 10:40:45 +0200 Subject: [PATCH 12/24] Fix whitespaces --- .../derivedlambdakzeroanalysis.cxx | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index 6f3c7e9ab22..386017aa895 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -653,6 +653,123 @@ struct derivedlambdakzeroanalysis { return (bitmap & mask) == mask; } +<<<<<<< HEAD +======= + uint computeITSclusBitmap(uint8_t itsClusMap) + //Focus on the 12 dominant ITS cluster configurations + { + uint bitMap = 0; + + if(verifyMask(itsClusMap, ((uint8_t(1) << 0) | (uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5) | (uint8_t(1) << 6)))) { + // ITS : IB OB + // ITS : L0 L1 L2 L3 L4 L5 L6 + // ITS : x x x x x x x + bitMap = 12; + } + else if (verifyMask(itsClusMap, ((uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5) | (uint8_t(1) << 6)))) { + // ITS : IB OB + // ITS : L0 L1 L2 L3 L4 L5 L6 + // ITS : x x x x x x + bitMap = 11; + } + else if (verifyMask(itsClusMap, ((uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5) | (uint8_t(1) << 6)))) { + // ITS : IB OB + // ITS : L0 L1 L2 L3 L4 L5 L6 + // ITS : x x x x x + bitMap = 10; + } + else if (verifyMask(itsClusMap, ((uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5) | (uint8_t(1) << 6)))) { + // ITS : IB OB + // ITS : L0 L1 L2 L3 L4 L5 L6 + // ITS : x x x x + bitMap = 9; + } + else if (verifyMask(itsClusMap, ((uint8_t(1) << 4) | (uint8_t(1) << 5) | (uint8_t(1) << 6)))) { + // ITS : IB OB + // ITS : L0 L1 L2 L3 L4 L5 L6 + // ITS : x x x + bitMap = 8; + } + else if (verifyMask(itsClusMap, ((uint8_t(1) << 5) | (uint8_t(1) << 6)))) { + // ITS : IB OB + // ITS : L0 L1 L2 L3 L4 L5 L6 + // ITS : x x + bitMap = 7; + } + else if (verifyMask(itsClusMap, ((uint8_t(1) << 0) | (uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5)))) { + // ITS : IB OB + // ITS : L0 L1 L2 L3 L4 L5 L6 + // ITS : x x x x x x + bitMap = 6; + } + else if (verifyMask(itsClusMap, ((uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5)))) { + // ITS : IB OB + // ITS : L0 L1 L2 L3 L4 L5 L6 + // ITS : x x x x x + bitMap = 5; + } + else if (verifyMask(itsClusMap, ((uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5)))) { + // ITS : IB OB + // ITS : L0 L1 L2 L3 L4 L5 L6 + // ITS : x x x x + bitMap = 4; + } + else if (verifyMask(itsClusMap, ((uint8_t(1) << 0) | (uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4)))) { + // ITS : IB OB + // ITS : L0 L1 L2 L3 L4 L5 L6 + // ITS : x x x x x + bitMap = 3; + } + else if (verifyMask(itsClusMap, ((uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4)))) { + // ITS : IB OB + // ITS : L0 L1 L2 L3 L4 L5 L6 + // ITS : x x x x + bitMap = 2; + } + else if (verifyMask(itsClusMap, ((uint8_t(1) << 0) | (uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3)))) { + // ITS : IB OB + // ITS : L0 L1 L2 L3 L4 L5 L6 + // ITS : x x x x + bitMap = 1; + } + else { + // ITS : other configurations + bitMap = 0; + } + + return bitMap; + } + + uint computeDetBitmap(uint8_t detMap) + //Focus on the 4 dominant track configurations : + // ITS-TPC + // ITS-TPC-TRD + // ITS-TPC-TOF + // ITS-TPC-TRD-TOF + { + uint bitMap = 0; + + if (verifyMask(detMap, (o2::aod::track::ITS | o2::aod::track::TPC | o2::aod::track::TRD | o2::aod::track::TOF))) { + // ITS-TPC-TRD-TOF + bitMap = 3; + } + else if (verifyMask(detMap, (o2::aod::track::ITS | o2::aod::track::TPC | o2::aod::track::TOF))) { + // ITS-TPC-TOF + bitMap = 2; + } + else if (verifyMask(detMap, (o2::aod::track::ITS | o2::aod::track::TPC | o2::aod::track::TRD))) { + // ITS-TPC-TRD + bitMap = 1; + } + else if (verifyMask(detMap, (o2::aod::track::ITS | o2::aod::track::TPC))) { + // ITS-TPC + bitMap = 0; + } + + return bitMap; + } + +>>>>>>> c085615c (Fix whitespaces) template void analyseCandidate(TV0 v0, float pt, float centrality, uint64_t selMap) // precalculate this information so that a check is one mask operation, not many From ec0c9fa03deaa02ea2514585b1f0ddc47f05941b Mon Sep 17 00:00:00 2001 From: romainschotter Date: Mon, 8 Apr 2024 10:43:52 +0200 Subject: [PATCH 13/24] Please consider the following formatting changes --- .../derivedlambdakzeroanalysis.cxx | 56 +++++++------------ 1 file changed, 21 insertions(+), 35 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index 386017aa895..21c2f9f7c29 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -656,77 +656,66 @@ struct derivedlambdakzeroanalysis { <<<<<<< HEAD ======= uint computeITSclusBitmap(uint8_t itsClusMap) - //Focus on the 12 dominant ITS cluster configurations + // Focus on the 12 dominant ITS cluster configurations { uint bitMap = 0; - if(verifyMask(itsClusMap, ((uint8_t(1) << 0) | (uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5) | (uint8_t(1) << 6)))) { + if (verifyMask(itsClusMap, ((uint8_t(1) << 0) | (uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5) | (uint8_t(1) << 6)))) { // ITS : IB OB // ITS : L0 L1 L2 L3 L4 L5 L6 // ITS : x x x x x x x bitMap = 12; - } - else if (verifyMask(itsClusMap, ((uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5) | (uint8_t(1) << 6)))) { + } else if (verifyMask(itsClusMap, ((uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5) | (uint8_t(1) << 6)))) { // ITS : IB OB // ITS : L0 L1 L2 L3 L4 L5 L6 // ITS : x x x x x x bitMap = 11; - } - else if (verifyMask(itsClusMap, ((uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5) | (uint8_t(1) << 6)))) { + } else if (verifyMask(itsClusMap, ((uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5) | (uint8_t(1) << 6)))) { // ITS : IB OB // ITS : L0 L1 L2 L3 L4 L5 L6 // ITS : x x x x x bitMap = 10; - } - else if (verifyMask(itsClusMap, ((uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5) | (uint8_t(1) << 6)))) { + } else if (verifyMask(itsClusMap, ((uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5) | (uint8_t(1) << 6)))) { // ITS : IB OB // ITS : L0 L1 L2 L3 L4 L5 L6 // ITS : x x x x bitMap = 9; - } - else if (verifyMask(itsClusMap, ((uint8_t(1) << 4) | (uint8_t(1) << 5) | (uint8_t(1) << 6)))) { + } else if (verifyMask(itsClusMap, ((uint8_t(1) << 4) | (uint8_t(1) << 5) | (uint8_t(1) << 6)))) { // ITS : IB OB // ITS : L0 L1 L2 L3 L4 L5 L6 // ITS : x x x bitMap = 8; - } - else if (verifyMask(itsClusMap, ((uint8_t(1) << 5) | (uint8_t(1) << 6)))) { + } else if (verifyMask(itsClusMap, ((uint8_t(1) << 5) | (uint8_t(1) << 6)))) { // ITS : IB OB // ITS : L0 L1 L2 L3 L4 L5 L6 // ITS : x x bitMap = 7; - } - else if (verifyMask(itsClusMap, ((uint8_t(1) << 0) | (uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5)))) { + } else if (verifyMask(itsClusMap, ((uint8_t(1) << 0) | (uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5)))) { // ITS : IB OB // ITS : L0 L1 L2 L3 L4 L5 L6 // ITS : x x x x x x bitMap = 6; - } - else if (verifyMask(itsClusMap, ((uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5)))) { + } else if (verifyMask(itsClusMap, ((uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5)))) { // ITS : IB OB // ITS : L0 L1 L2 L3 L4 L5 L6 // ITS : x x x x x bitMap = 5; - } - else if (verifyMask(itsClusMap, ((uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5)))) { + } else if (verifyMask(itsClusMap, ((uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4) | (uint8_t(1) << 5)))) { // ITS : IB OB // ITS : L0 L1 L2 L3 L4 L5 L6 // ITS : x x x x bitMap = 4; - } - else if (verifyMask(itsClusMap, ((uint8_t(1) << 0) | (uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4)))) { + } else if (verifyMask(itsClusMap, ((uint8_t(1) << 0) | (uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4)))) { // ITS : IB OB // ITS : L0 L1 L2 L3 L4 L5 L6 // ITS : x x x x x bitMap = 3; - } - else if (verifyMask(itsClusMap, ((uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4)))) { + } else if (verifyMask(itsClusMap, ((uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3) | (uint8_t(1) << 4)))) { // ITS : IB OB // ITS : L0 L1 L2 L3 L4 L5 L6 // ITS : x x x x bitMap = 2; - } - else if (verifyMask(itsClusMap, ((uint8_t(1) << 0) | (uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3)))) { + } else if (verifyMask(itsClusMap, ((uint8_t(1) << 0) | (uint8_t(1) << 1) | (uint8_t(1) << 2) | (uint8_t(1) << 3)))) { // ITS : IB OB // ITS : L0 L1 L2 L3 L4 L5 L6 // ITS : x x x x @@ -741,27 +730,24 @@ struct derivedlambdakzeroanalysis { } uint computeDetBitmap(uint8_t detMap) - //Focus on the 4 dominant track configurations : - // ITS-TPC - // ITS-TPC-TRD - // ITS-TPC-TOF - // ITS-TPC-TRD-TOF + // Focus on the 4 dominant track configurations : + // ITS-TPC + // ITS-TPC-TRD + // ITS-TPC-TOF + // ITS-TPC-TRD-TOF { uint bitMap = 0; if (verifyMask(detMap, (o2::aod::track::ITS | o2::aod::track::TPC | o2::aod::track::TRD | o2::aod::track::TOF))) { // ITS-TPC-TRD-TOF bitMap = 3; - } - else if (verifyMask(detMap, (o2::aod::track::ITS | o2::aod::track::TPC | o2::aod::track::TOF))) { + } else if (verifyMask(detMap, (o2::aod::track::ITS | o2::aod::track::TPC | o2::aod::track::TOF))) { // ITS-TPC-TOF bitMap = 2; - } - else if (verifyMask(detMap, (o2::aod::track::ITS | o2::aod::track::TPC | o2::aod::track::TRD))) { + } else if (verifyMask(detMap, (o2::aod::track::ITS | o2::aod::track::TPC | o2::aod::track::TRD))) { // ITS-TPC-TRD bitMap = 1; - } - else if (verifyMask(detMap, (o2::aod::track::ITS | o2::aod::track::TPC))) { + } else if (verifyMask(detMap, (o2::aod::track::ITS | o2::aod::track::TPC))) { // ITS-TPC bitMap = 0; } From 71cfb2b04d39227299318d445e9d78346b82ef04 Mon Sep 17 00:00:00 2001 From: romainschotter Date: Mon, 8 Apr 2024 10:45:21 +0200 Subject: [PATCH 14/24] Please consider the following formatting changes --- PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index 21c2f9f7c29..a63c23ffc01 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -720,8 +720,7 @@ struct derivedlambdakzeroanalysis { // ITS : L0 L1 L2 L3 L4 L5 L6 // ITS : x x x x bitMap = 1; - } - else { + } else { // ITS : other configurations bitMap = 0; } From 131aa3718fb12c7760a09989bfc96c6d252a4fff Mon Sep 17 00:00:00 2001 From: romainschotter Date: Fri, 19 Apr 2024 20:08:28 +0200 Subject: [PATCH 15/24] Add particle MC ID into the derived data + add one extra bin for det. config. --- PWGLF/DataModel/LFStrangenessTables.h | 19 +++- .../Strangeness/lambdakzeromcbuilder.cxx | 2 +- .../Strangeness/strangederivedbuilder.cxx | 59 ++++++++---- .../converters/strarawcentsconverter.cxx | 93 +++++++++++++++++++ .../derivedlambdakzeroanalysis.cxx | 14 ++- 5 files changed, 158 insertions(+), 29 deletions(-) create mode 100644 PWGLF/TableProducer/converters/strarawcentsconverter.cxx diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index f1fde733c72..4d79fd41f99 100755 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -94,6 +94,10 @@ DECLARE_SOA_COLUMN(ITSClusterSizes, itsClusterSizes, uint32_t); //! ITS cluster DECLARE_SOA_COLUMN(TPCClusters, tpcClusters, uint8_t); //! N TPC clusters DECLARE_SOA_COLUMN(TPCCrossedRows, tpcCrossedRows, uint8_t); //! N TPC clusters +//______________________________________________________ +// Daughter track MC information +DECLARE_SOA_COLUMN(ParticleMCId, particleMCId, int); //! particle MC Id + //______________________________________________________ // for extras: replicated here to ensure ease of manipulating the ITS information // directly from the V0 extras table in simple ways for derived data as well @@ -138,6 +142,9 @@ DECLARE_SOA_TABLE(DauTrackExtras, "AOD", "DAUTRACKEXTRA", //! detector propertie dautrack::HasTRD, dautrack::HasTOF); +DECLARE_SOA_TABLE(DauTrackMCIds, "AOD", "DAUTRACKMCID", // index table when using AO2Ds + dautrack::ParticleMCId); + using DauTrackExtra = DauTrackExtras::iterator; namespace motherParticle @@ -232,6 +239,7 @@ DECLARE_SOA_COLUMN(KFV0Chi2, kfV0Chi2, float); //! //______________________________________________________ // REGULAR COLUMNS FOR V0MCCORES +DECLARE_SOA_COLUMN(ParticleIdMC, particleIdMC, int); //! V0 Particle ID DECLARE_SOA_COLUMN(PDGCode, pdgCode, int); //! V0 PDG Code DECLARE_SOA_COLUMN(PDGCodeMother, pdgCodeMother, int); //! V0 mother PDG code (for feeddown) DECLARE_SOA_COLUMN(PDGCodePositive, pdgCodePositive, int); //! V0 positive prong PDG code @@ -551,13 +559,21 @@ DECLARE_SOA_EXTENDED_TABLE_USER(V0fCCores, StoredV0fCCores, "V0FCCOREEXT", DECLARE_SOA_TABLE_FULL(V0fCCovs, "V0fCCovs", "AOD", "V0FCCOVS", //! V0 covariance matrices v0data::PositionCovMat, v0data::MomentumCovMat, o2::soa::Marker<2>); -DECLARE_SOA_TABLE(V0MCCores, "AOD", "V0MCCORE", //! MC properties of the V0 for posterior analysis +DECLARE_SOA_TABLE(V0MCCores_000, "AOD", "V0MCCORE", //! MC properties of the V0 for posterior analysis v0data::PDGCode, v0data::PDGCodeMother, v0data::PDGCodePositive, v0data::PDGCodeNegative, v0data::IsPhysicalPrimary, v0data::XMC, v0data::YMC, v0data::ZMC, v0data::PxPosMC, v0data::PyPosMC, v0data::PzPosMC, v0data::PxNegMC, v0data::PyNegMC, v0data::PzNegMC); +DECLARE_SOA_TABLE_VERSIONED(V0MCCores_001, "AOD", "V0MCCORE", 1, //! debug information + v0data::ParticleIdMC, //! MC properties of the V0 for posterior analysis + v0data::PDGCode, v0data::PDGCodeMother, + v0data::PDGCodePositive, v0data::PDGCodeNegative, + v0data::IsPhysicalPrimary, v0data::XMC, v0data::YMC, v0data::ZMC, + v0data::PxPosMC, v0data::PyPosMC, v0data::PzPosMC, + v0data::PxNegMC, v0data::PyNegMC, v0data::PzNegMC); + DECLARE_SOA_TABLE(V0MCCollRefs, "AOD", "V0MCCOLLREF", //! refers MC candidate back to proper MC Collision o2::soa::Index<>, v0data::StraMCCollisionId, o2::soa::Marker<2>); @@ -568,6 +584,7 @@ DECLARE_SOA_TABLE(GeAntiLambda, "AOD", "GeAntiLambda", v0data::GeneratedAntiLamb DECLARE_SOA_TABLE(V0MCMothers, "AOD", "V0MCMOTHER", //! optional table for MC mothers o2::soa::Index<>, v0data::MotherMCPartId); +using V0MCCores = V0MCCores_001; using V0Index = V0Indices::iterator; using V0Core = V0Cores::iterator; using V0TrackX = V0TrackXs::iterator; diff --git a/PWGLF/TableProducer/Strangeness/lambdakzeromcbuilder.cxx b/PWGLF/TableProducer/Strangeness/lambdakzeromcbuilder.cxx index d646920547f..2df904a6274 100644 --- a/PWGLF/TableProducer/Strangeness/lambdakzeromcbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/lambdakzeromcbuilder.cxx @@ -104,7 +104,7 @@ struct lambdakzeromcbuilder { lLabel, lMotherLabel); if (populateV0MCCores) { v0mccores( - pdgCode, pdgCodeMother, pdgCodePositive, pdgCodeNegative, + lLabel, pdgCode, pdgCodeMother, pdgCodePositive, pdgCodeNegative, isPhysicalPrimary, xmc, ymc, zmc, pxposmc, pyposmc, pzposmc, pxnegmc, pynegmc, pznegmc); diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index 41a3cf46936..b39deabd264 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -86,6 +86,7 @@ struct strangederivedbuilder { //__________________________________________________ // track extra references Produces dauTrackExtras; // daughter track detector properties + Produces dauTrackMCIds; // daughter track MC Particle ID Produces dauTrackTPCPIDs; // daughter track TPC PID Produces dauTrackTOFPIDs; // daughter track TOF PID Produces v0Extras; // references DauTracks from V0s @@ -456,15 +457,16 @@ struct strangederivedbuilder { // done! } - void processTrackExtras(aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, TracksWithExtra const& tracksExtra, aod::V0s const&) + template + void fillTrackExtras(V0Datas const& V0s, CascDatas const& Cascades, KFCascDatas const& KFCascades, TraCascDatas const& TraCascades, tracksWithExtra const& tracksExtra) { std::vector trackMap(tracksExtra.size(), -1); // index -1: not used //__________________________________________________ // mark tracks that belong to V0s for (auto const& v0 : V0s) { - auto const& posTrack = v0.posTrack_as(); - auto const& negTrack = v0.negTrack_as(); + auto const& posTrack = v0.template posTrack_as(); + auto const& negTrack = v0.template negTrack_as(); trackMap[posTrack.globalIndex()] = 0; trackMap[negTrack.globalIndex()] = 0; } @@ -472,9 +474,9 @@ struct strangederivedbuilder { //__________________________________________________ // index tracks that belong to CascDatas for (auto const& casc : Cascades) { - auto bachTrack = casc.bachelor_as(); - auto posTrack = casc.posTrack_as(); - auto negTrack = casc.negTrack_as(); + auto bachTrack = casc.template bachelor_as(); + auto posTrack = casc.template posTrack_as(); + auto negTrack = casc.template negTrack_as(); trackMap[posTrack.globalIndex()] = 0; trackMap[negTrack.globalIndex()] = 0; trackMap[bachTrack.globalIndex()] = 0; @@ -482,9 +484,9 @@ struct strangederivedbuilder { //__________________________________________________ // index tracks that belong to KFCascDatas for (auto const& casc : KFCascades) { - auto bachTrack = casc.bachelor_as(); - auto posTrack = casc.posTrack_as(); - auto negTrack = casc.negTrack_as(); + auto bachTrack = casc.template bachelor_as(); + auto posTrack = casc.template posTrack_as(); + auto negTrack = casc.template negTrack_as(); trackMap[posTrack.globalIndex()] = 0; trackMap[negTrack.globalIndex()] = 0; trackMap[bachTrack.globalIndex()] = 0; @@ -492,10 +494,10 @@ struct strangederivedbuilder { //__________________________________________________ // index tracks that belong to TraCascDatas for (auto const& casc : TraCascades) { - auto bachTrack = casc.bachelor_as(); - auto posTrack = casc.posTrack_as(); - auto negTrack = casc.negTrack_as(); - auto strangeTrack = casc.strangeTrack_as(); + auto bachTrack = casc.template bachelor_as(); + auto posTrack = casc.template posTrack_as(); + auto negTrack = casc.template negTrack_as(); + auto strangeTrack = casc.template strangeTrack_as(); trackMap[posTrack.globalIndex()] = 0; trackMap[negTrack.globalIndex()] = 0; trackMap[bachTrack.globalIndex()] = 0; @@ -513,17 +515,17 @@ struct strangederivedbuilder { //__________________________________________________ // populate track references for (auto const& v0 : V0s) { - auto const& posTrack = v0.posTrack_as(); - auto const& negTrack = v0.negTrack_as(); + auto const& posTrack = v0.template posTrack_as(); + auto const& negTrack = v0.template negTrack_as(); v0Extras(trackMap[posTrack.globalIndex()], trackMap[negTrack.globalIndex()]); // joinable with V0Datas } //__________________________________________________ // populate track references for (auto const& casc : Cascades) { - auto bachTrack = casc.bachelor_as(); - auto posTrack = casc.posTrack_as(); - auto negTrack = casc.negTrack_as(); + auto bachTrack = casc.template bachelor_as(); + auto posTrack = casc.template posTrack_as(); + auto negTrack = casc.template negTrack_as(); cascExtras(trackMap[posTrack.globalIndex()], trackMap[negTrack.globalIndex()], trackMap[bachTrack.globalIndex()]); // joinable with CascDatas @@ -531,7 +533,7 @@ struct strangederivedbuilder { //__________________________________________________ // populate track references for (auto const& casc : TraCascades) { - auto strangeTrack = casc.strangeTrack_as(); + auto strangeTrack = casc.template strangeTrack_as(); straTrackExtras(trackMap[strangeTrack.globalIndex()]); // joinable with TraCascDatas } //__________________________________________________ @@ -541,6 +543,12 @@ struct strangederivedbuilder { dauTrackExtras(tr.detectorMap(), tr.itsClusterSizes(), tr.tpcNClsFound(), tr.tpcNClsCrossedRows()); + // if the table has MC info + if constexpr ( requires {tr.mcParticle();} ) { + // do your thing with the mcParticleIds only in case the table has the MC info + dauTrackMCIds( tr.mcParticleId() ); // joinable with dauTrackExtras + } + // round if requested if (roundNSigmaVariables) { dauTrackTPCPIDs(tr.tpcSignal(), @@ -562,6 +570,18 @@ struct strangederivedbuilder { // done! } + void processTrackExtras(aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& tracksExtra, aod::V0s const&) + { + fillTrackExtras(V0s, Cascades, KFCascades, TraCascades, tracksExtra); + // done! + } + + void processTrackExtrasMC(aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& tracksExtra, aod::V0s const&) + { + fillTrackExtras(V0s, Cascades, KFCascades, TraCascades, tracksExtra); + // done! + } + void processStrangeMothers(soa::Join const& V0s, soa::Join const& Cascades, aod::McParticles const& mcParticles) { std::vector motherReference(mcParticles.size(), -1); // index -1: not used / no reference @@ -764,6 +784,7 @@ struct strangederivedbuilder { PROCESS_SWITCH(strangederivedbuilder, processCollisionsMC, "Produce collisions (V0s + casc)", false); PROCESS_SWITCH(strangederivedbuilder, processTrackExtrasV0sOnly, "Produce track extra information (V0s only)", true); PROCESS_SWITCH(strangederivedbuilder, processTrackExtras, "Produce track extra information (V0s + casc)", true); + PROCESS_SWITCH(strangederivedbuilder, processTrackExtrasMC, "Produce track extra information (V0s + casc)", false); PROCESS_SWITCH(strangederivedbuilder, processStrangeMothers, "Produce tables with mother info for V0s + casc", true); PROCESS_SWITCH(strangederivedbuilder, processCascadeInterlinkTracked, "Produce tables interconnecting cascades", false); PROCESS_SWITCH(strangederivedbuilder, processCascadeInterlinkKF, "Produce tables interconnecting cascades", false); diff --git a/PWGLF/TableProducer/converters/strarawcentsconverter.cxx b/PWGLF/TableProducer/converters/strarawcentsconverter.cxx new file mode 100644 index 00000000000..e33956176a9 --- /dev/null +++ b/PWGLF/TableProducer/converters/strarawcentsconverter.cxx @@ -0,0 +1,93 @@ +// 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 "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" + +using namespace o2; +using namespace o2::framework; + +// Converts V0 version 001 to 002 +struct strarawcentsconverter { + Produces v0MCCores_001; + Produces straRawCents_001; + Produces straRawCents_003; + + void process000to001(aod::StraRawCents_000 const& straRawCents_000, aod::V0MCCores_000 const& v0MCCores_000) + { + for (auto& values : straRawCents_000) { + straRawCents_001(values.multFT0A(), values.multFT0C(), values.multFV0A(), values.multNTracksPVeta1(), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); + } + for (auto& values : v0MCCores_000) { + v0MCCores_001(0, + values.pdgCode(), + values.pdgCodeMother(), + values.pdgCodePositive(), + values.pdgCodeNegative(), + values.isPhysicalPrimary(), + values.xMC(), + values.yMC(), + values.zMC(), + values.pxPosMC(), + values.pyPosMC(), + values.pzPosMC(), + values.pxNegMC(), + values.pyNegMC(), + values.pzNegMC()); + } + } + void process002to003(aod::StraRawCents_002 const& straRawCents_002, aod::V0MCCores_000 const& v0MCCores_000) + { + for (auto& values : straRawCents_002) { + straRawCents_003(values.multFT0A(), + values.multFT0C(), + values.multFT0A(), + values.multNTracksPVeta1(), + 0, 0, + values.multNTracksITSTPC(), + values.multAllTracksTPCOnly(), + values.multAllTracksITSTPC(), + values.multZNA(), + values.multZNC(), + values.multZEM1(), + values.multZEM2(), + values.multZPA(), + values.multZPC()); + } + for (auto& values : v0MCCores_000) { + v0MCCores_001(0, + values.pdgCode(), + values.pdgCodeMother(), + values.pdgCodePositive(), + values.pdgCodeNegative(), + values.isPhysicalPrimary(), + values.xMC(), + values.yMC(), + values.zMC(), + values.pxPosMC(), + values.pyPosMC(), + values.pzPosMC(), + values.pxNegMC(), + values.pyNegMC(), + values.pzNegMC()); + } + } + + PROCESS_SWITCH(strarawcentsconverter, process000to001, "from raw 000 to 001", false); + PROCESS_SWITCH(strarawcentsconverter, process002to003, "from raw 002 to 003", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index a63c23ffc01..c0d97c1ad01 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -152,7 +152,7 @@ struct derivedlambdakzeroanalysis { ConfigurableAxis axisITScluMap{"axisITSMap", {128, -0.5f, 127.5f}, "ITS Cluster map"}; ConfigurableAxis axisDetMap{"axisDetMap", {16, -0.5f, 15.5f}, "Detector use map"}; ConfigurableAxis axisITScluMapCoarse{"axisITScluMapCoarse", {13, -0.5f, 12.5f}, "ITS Coarse cluster map"}; - ConfigurableAxis axisDetMapCoarse{"axisDetMapCoarse", {4, -0.5f, 3.5f}, "Detector Coarse user map"}; + ConfigurableAxis axisDetMapCoarse{"axisDetMapCoarse", {5, -0.5f, 4.5f}, "Detector Coarse user map"}; // MC coll assoc QA axis ConfigurableAxis axisMonteCarloNch{"axisMonteCarloNch", {300, 0.0f, 3000.0f}, "N_{ch} MC"}; @@ -653,8 +653,6 @@ struct derivedlambdakzeroanalysis { return (bitmap & mask) == mask; } -<<<<<<< HEAD -======= uint computeITSclusBitmap(uint8_t itsClusMap) // Focus on the 12 dominant ITS cluster configurations { @@ -730,6 +728,7 @@ struct derivedlambdakzeroanalysis { uint computeDetBitmap(uint8_t detMap) // Focus on the 4 dominant track configurations : + // Others // ITS-TPC // ITS-TPC-TRD // ITS-TPC-TOF @@ -739,22 +738,21 @@ struct derivedlambdakzeroanalysis { if (verifyMask(detMap, (o2::aod::track::ITS | o2::aod::track::TPC | o2::aod::track::TRD | o2::aod::track::TOF))) { // ITS-TPC-TRD-TOF - bitMap = 3; + bitMap = 4; } else if (verifyMask(detMap, (o2::aod::track::ITS | o2::aod::track::TPC | o2::aod::track::TOF))) { // ITS-TPC-TOF - bitMap = 2; + bitMap = 3; } else if (verifyMask(detMap, (o2::aod::track::ITS | o2::aod::track::TPC | o2::aod::track::TRD))) { // ITS-TPC-TRD - bitMap = 1; + bitMap = 2; } else if (verifyMask(detMap, (o2::aod::track::ITS | o2::aod::track::TPC))) { // ITS-TPC - bitMap = 0; + bitMap = 1; } return bitMap; } ->>>>>>> c085615c (Fix whitespaces) template void analyseCandidate(TV0 v0, float pt, float centrality, uint64_t selMap) // precalculate this information so that a check is one mask operation, not many From e157dd3d14fe3a2f527de5d50a10162f6d685f20 Mon Sep 17 00:00:00 2001 From: romainschotter Date: Wed, 24 Apr 2024 00:09:40 +0200 Subject: [PATCH 16/24] Add ITS chi2/Ncls info in derived data + add extra event selections to analysis task --- PWGLF/DataModel/LFStrangenessTables.h | 17 ++++++++- .../Strangeness/strangederivedbuilder.cxx | 6 ++- .../converters/strarawcentsconverter.cxx | 31 +++++++++++++++- .../derivedlambdakzeroanalysis.cxx | 37 +++++++++++++++++++ 4 files changed, 86 insertions(+), 5 deletions(-) diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index 4d79fd41f99..427a65ffa6f 100755 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -89,6 +89,7 @@ namespace dautrack { //______________________________________________________ // Daughter track declarations for derived data analysis +DECLARE_SOA_COLUMN(ITSChi2PerNcl, itsChi2PerNcl, float); //! ITS chi2 per N cluster DECLARE_SOA_COLUMN(DetectorMap, detectorMap, uint8_t); //! detector map for reference (see DetectorMapEnum) DECLARE_SOA_COLUMN(ITSClusterSizes, itsClusterSizes, uint32_t); //! ITS cluster sizes per layer DECLARE_SOA_COLUMN(TPCClusters, tpcClusters, uint8_t); //! N TPC clusters @@ -130,7 +131,20 @@ DECLARE_SOA_DYNAMIC_COLUMN(HasTOF, hasTOF, //! Flag to check if track has a TOF [](uint8_t detectorMap) -> bool { return detectorMap & o2::aod::track::TOF; }); } // namespace dautrack -DECLARE_SOA_TABLE(DauTrackExtras, "AOD", "DAUTRACKEXTRA", //! detector properties of decay daughters +DECLARE_SOA_TABLE(DauTrackExtras_000, "AOD", "DAUTRACKEXTRA", //! detector properties of decay daughters + dautrack::DetectorMap, dautrack::ITSClusterSizes, + dautrack::TPCClusters, dautrack::TPCCrossedRows, + + // Dynamic columns for manipulating information + dautrack::ITSClusterMap, + dautrack::ITSNCls, + dautrack::HasITS, + dautrack::HasTPC, + dautrack::HasTRD, + dautrack::HasTOF); + +DECLARE_SOA_TABLE_VERSIONED(DauTrackExtras_001, "AOD", "DAUTRACKEXTRA", 1, //! detector properties of decay daughters + dautrack::ITSChi2PerNcl, dautrack::DetectorMap, dautrack::ITSClusterSizes, dautrack::TPCClusters, dautrack::TPCCrossedRows, @@ -145,6 +159,7 @@ DECLARE_SOA_TABLE(DauTrackExtras, "AOD", "DAUTRACKEXTRA", //! detector propertie DECLARE_SOA_TABLE(DauTrackMCIds, "AOD", "DAUTRACKMCID", // index table when using AO2Ds dautrack::ParticleMCId); +using DauTrackExtras = DauTrackExtras_001; using DauTrackExtra = DauTrackExtras::iterator; namespace motherParticle diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index b39deabd264..c70a730e461 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -450,7 +450,8 @@ struct strangederivedbuilder { // circle back and populate actual DauTrackExtra table for (auto const& tr : tracksExtra) { if (trackMap[tr.globalIndex()] >= 0) { - dauTrackExtras(tr.detectorMap(), tr.itsClusterSizes(), + dauTrackExtras(tr.itsChi2NCl(), + tr.detectorMap(), tr.itsClusterSizes(), tr.tpcNClsFound(), tr.tpcNClsCrossedRows()); } } @@ -540,7 +541,8 @@ struct strangederivedbuilder { // circle back and populate actual DauTrackExtra table for (auto const& tr : tracksExtra) { if (trackMap[tr.globalIndex()] >= 0) { - dauTrackExtras(tr.detectorMap(), tr.itsClusterSizes(), + dauTrackExtras(tr.itsChi2NCl(), + tr.detectorMap(), tr.itsClusterSizes(), tr.tpcNClsFound(), tr.tpcNClsCrossedRows()); // if the table has MC info diff --git a/PWGLF/TableProducer/converters/strarawcentsconverter.cxx b/PWGLF/TableProducer/converters/strarawcentsconverter.cxx index e33956176a9..4ad445db3f3 100644 --- a/PWGLF/TableProducer/converters/strarawcentsconverter.cxx +++ b/PWGLF/TableProducer/converters/strarawcentsconverter.cxx @@ -18,15 +18,29 @@ using namespace o2::framework; // Converts V0 version 001 to 002 struct strarawcentsconverter { + Produces dauTrackExtras_001; Produces v0MCCores_001; Produces straRawCents_001; Produces straRawCents_003; - void process000to001(aod::StraRawCents_000 const& straRawCents_000, aod::V0MCCores_000 const& v0MCCores_000) + void process000to001(aod::StraRawCents_000 const& straRawCents_000, aod::DauTrackExtras_000 const& dauTrackExtras_000, aod::V0MCCores_000 const& v0MCCores_000) { for (auto& values : straRawCents_000) { straRawCents_001(values.multFT0A(), values.multFT0C(), values.multFV0A(), values.multNTracksPVeta1(), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); } + for (auto& values : dauTrackExtras_000) { + dauTrackExtras_001(0, + values.detectorMap(), + values.itsClusterSizes(), + values.tpcNClsFound(), + values.tpcNClsCrossedRows(), + values.tpcSignal(), + values.tpcNSigmaEl(), + values.tpcNSigmaPi(), + values.tpcNSigmaKa(), + values.tpcNSigmaPr(), + values.tpcNSigmaHe()); + } for (auto& values : v0MCCores_000) { v0MCCores_001(0, values.pdgCode(), @@ -45,7 +59,7 @@ struct strarawcentsconverter { values.pzNegMC()); } } - void process002to003(aod::StraRawCents_002 const& straRawCents_002, aod::V0MCCores_000 const& v0MCCores_000) + void process002to003(aod::StraRawCents_002 const& straRawCents_002, aod::DauTrackExtras_000 const& dauTrackExtras_000, aod::V0MCCores_000 const& v0MCCores_000) { for (auto& values : straRawCents_002) { straRawCents_003(values.multFT0A(), @@ -63,6 +77,19 @@ struct strarawcentsconverter { values.multZPA(), values.multZPC()); } + for (auto& values : dauTrackExtras_000) { + dauTrackExtras_001(0, + values.detectorMap(), + values.itsClusterSizes(), + values.tpcNClsFound(), + values.tpcNClsCrossedRows(), + values.tpcSignal(), + values.tpcNSigmaEl(), + values.tpcNSigmaPi(), + values.tpcNSigmaKa(), + values.tpcNSigmaPr(), + values.tpcNSigmaHe()); + } for (auto& values : v0MCCores_000) { v0MCCores_001(0, values.pdgCode(), diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index c0d97c1ad01..ef8d077f0ec 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -56,6 +56,7 @@ using namespace o2::framework::expressions; using std::array; using dauTracks = soa::Join; +using dauMCTracks = soa::Join; using v0Candidates = soa::Join; using v0MCCandidates = soa::Join; @@ -74,6 +75,12 @@ struct derivedlambdakzeroanalysis { Configurable rejectITSROFBorder{"rejectITSROFBorder", true, "reject events at ITS ROF border"}; Configurable rejectTFBorder{"rejectTFBorder", true, "reject events at TF border"}; + Configurable requireIsVertexITSTPC{"requireIsVertexITSTPC", true, "require events with at least one ITS-TPC track"}; + Configurable requireIsGoodZvtxFT0VsPV{"requireIsGoodZvtxFT0VsPV", true, "require events with PV position along z consistent (within 1 cm) between PV reconstructed using tracks and PV using FT0 A-C time difference"}; + Configurable requireIsVertexTOFmatched{"requireIsVertexTOFmatched", true, "require events with at least one of vertex contributors matched to TOF"}; + Configurable requireIsVertexTRDmatched{"requireIsVertexTRDmatched", true, "require events with at least one of vertex contributors matched to TRD"}; + Configurable rejectSameBunchPileup{"rejectSameBunchPileup", true, "reject collisions in case of pileup with another collision in the same foundBC"}; + // Selection criteria: acceptance Configurable rapidityCut{"rapidityCut", 0.5, "rapidity"}; Configurable daughterEtaCut{"daughterEtaCut", 0.8, "max eta for daughters"}; @@ -294,6 +301,11 @@ struct derivedlambdakzeroanalysis { histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(3, "posZ cut"); histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(4, "kNoITSROFrameBorder"); histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(5, "kNoTimeFrameBorder"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(6, "kIsVertexITSTPC"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(7, "kIsGoodZvtxFT0vsPV"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(8, "kIsVertexTOFmatched"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(9, "kIsVertexTRDmatched"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(10, "kNoSameBunchPileup"); histos.add("hEventCentrality", "hEventCentrality", kTH1F, {{100, 0.0f, +100.0f}}); histos.add("hCentralityVsNch", "hCentralityVsNch", kTH2F, {axisCentrality, {500, 0.0f, +2000.0f}}); @@ -1029,6 +1041,31 @@ struct derivedlambdakzeroanalysis { } histos.fill(HIST("hEventSelection"), 4 /* Not at TF border */); + if (requireIsVertexITSTPC && !collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { + return; + } + histos.fill(HIST("hEventSelection"), 5 /* Contains at least one ITS-TPC track */); + + if (requireIsGoodZvtxFT0VsPV && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { + return; + } + histos.fill(HIST("hEventSelection"), 6 /* PV position consistency check */); + + if (requireIsVertexTOFmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTOFmatched)) { + return; + } + histos.fill(HIST("hEventSelection"), 7 /* PV with at least one contributor matched with TOF */); + + if (requireIsVertexTRDmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTRDmatched)) { + return; + } + histos.fill(HIST("hEventSelection"), 8 /* PV with at least one contributor matched with TRD */); + + if (rejectSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { + return; + } + histos.fill(HIST("hEventSelection"), 9 /* Not at same bunch pile-up */); + float centrality = collision.centFT0C(); if (qaCentrality) { auto hRawCentrality = histos.get(HIST("hRawCentrality")); From e86ed0829261b4d03f1dd50701605f134f62a4b5 Mon Sep 17 00:00:00 2001 From: romainschotter Date: Wed, 24 Apr 2024 00:25:41 +0200 Subject: [PATCH 17/24] Please consider the following whitespace changes --- .../Strangeness/strangederivedbuilder.cxx | 2 +- .../converters/strarawcentsconverter.cxx | 60 +++++++++---------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index c70a730e461..3e858c1c391 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -450,7 +450,7 @@ struct strangederivedbuilder { // circle back and populate actual DauTrackExtra table for (auto const& tr : tracksExtra) { if (trackMap[tr.globalIndex()] >= 0) { - dauTrackExtras(tr.itsChi2NCl(), + dauTrackExtras(tr.itsChi2NCl(), tr.detectorMap(), tr.itsClusterSizes(), tr.tpcNClsFound(), tr.tpcNClsCrossedRows()); } diff --git a/PWGLF/TableProducer/converters/strarawcentsconverter.cxx b/PWGLF/TableProducer/converters/strarawcentsconverter.cxx index 4ad445db3f3..0d24cb14e0e 100644 --- a/PWGLF/TableProducer/converters/strarawcentsconverter.cxx +++ b/PWGLF/TableProducer/converters/strarawcentsconverter.cxx @@ -30,32 +30,32 @@ struct strarawcentsconverter { } for (auto& values : dauTrackExtras_000) { dauTrackExtras_001(0, - values.detectorMap(), + values.detectorMap(), values.itsClusterSizes(), - values.tpcNClsFound(), + values.tpcNClsFound(), values.tpcNClsCrossedRows(), - values.tpcSignal(), + values.tpcSignal(), values.tpcNSigmaEl(), - values.tpcNSigmaPi(), + values.tpcNSigmaPi(), values.tpcNSigmaKa(), - values.tpcNSigmaPr(), + values.tpcNSigmaPr(), values.tpcNSigmaHe()); } for (auto& values : v0MCCores_000) { v0MCCores_001(0, - values.pdgCode(), - values.pdgCodeMother(), - values.pdgCodePositive(), + values.pdgCode(), + values.pdgCodeMother(), + values.pdgCodePositive(), values.pdgCodeNegative(), - values.isPhysicalPrimary(), - values.xMC(), - values.yMC(), + values.isPhysicalPrimary(), + values.xMC(), + values.yMC(), values.zMC(), - values.pxPosMC(), - values.pyPosMC(), + values.pxPosMC(), + values.pyPosMC(), values.pzPosMC(), - values.pxNegMC(), - values.pyNegMC(), + values.pxNegMC(), + values.pyNegMC(), values.pzNegMC()); } } @@ -79,32 +79,32 @@ struct strarawcentsconverter { } for (auto& values : dauTrackExtras_000) { dauTrackExtras_001(0, - values.detectorMap(), + values.detectorMap(), values.itsClusterSizes(), - values.tpcNClsFound(), + values.tpcNClsFound(), values.tpcNClsCrossedRows(), - values.tpcSignal(), + values.tpcSignal(), values.tpcNSigmaEl(), - values.tpcNSigmaPi(), + values.tpcNSigmaPi(), values.tpcNSigmaKa(), - values.tpcNSigmaPr(), + values.tpcNSigmaPr(), values.tpcNSigmaHe()); } for (auto& values : v0MCCores_000) { v0MCCores_001(0, - values.pdgCode(), - values.pdgCodeMother(), - values.pdgCodePositive(), + values.pdgCode(), + values.pdgCodeMother(), + values.pdgCodePositive(), values.pdgCodeNegative(), - values.isPhysicalPrimary(), - values.xMC(), - values.yMC(), + values.isPhysicalPrimary(), + values.xMC(), + values.yMC(), values.zMC(), - values.pxPosMC(), - values.pyPosMC(), + values.pxPosMC(), + values.pyPosMC(), values.pzPosMC(), - values.pxNegMC(), - values.pyNegMC(), + values.pxNegMC(), + values.pyNegMC(), values.pzNegMC()); } } From 65b549563fb2fac007d50bed81bf71480f27a378 Mon Sep 17 00:00:00 2001 From: romainschotter Date: Wed, 24 Apr 2024 00:32:38 +0200 Subject: [PATCH 18/24] Please consider the following formatting changes --- PWGLF/DataModel/LFStrangenessTables.h | 26 ++++++------ .../Strangeness/strangederivedbuilder.cxx | 8 ++-- .../converters/strarawcentsconverter.cxx | 40 +++++++++---------- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index 427a65ffa6f..f1c9fdd7038 100755 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -97,7 +97,7 @@ DECLARE_SOA_COLUMN(TPCCrossedRows, tpcCrossedRows, uint8_t); //! N TPC cluste //______________________________________________________ // Daughter track MC information -DECLARE_SOA_COLUMN(ParticleMCId, particleMCId, int); //! particle MC Id +DECLARE_SOA_COLUMN(ParticleMCId, particleMCId, int); //! particle MC Id //______________________________________________________ // for extras: replicated here to ensure ease of manipulating the ITS information @@ -144,17 +144,17 @@ DECLARE_SOA_TABLE(DauTrackExtras_000, "AOD", "DAUTRACKEXTRA", //! detector prope dautrack::HasTOF); DECLARE_SOA_TABLE_VERSIONED(DauTrackExtras_001, "AOD", "DAUTRACKEXTRA", 1, //! detector properties of decay daughters - dautrack::ITSChi2PerNcl, - dautrack::DetectorMap, dautrack::ITSClusterSizes, - dautrack::TPCClusters, dautrack::TPCCrossedRows, - - // Dynamic columns for manipulating information - dautrack::ITSClusterMap, - dautrack::ITSNCls, - dautrack::HasITS, - dautrack::HasTPC, - dautrack::HasTRD, - dautrack::HasTOF); + dautrack::ITSChi2PerNcl, + dautrack::DetectorMap, dautrack::ITSClusterSizes, + dautrack::TPCClusters, dautrack::TPCCrossedRows, + + // Dynamic columns for manipulating information + dautrack::ITSClusterMap, + dautrack::ITSNCls, + dautrack::HasITS, + dautrack::HasTPC, + dautrack::HasTRD, + dautrack::HasTOF); DECLARE_SOA_TABLE(DauTrackMCIds, "AOD", "DAUTRACKMCID", // index table when using AO2Ds dautrack::ParticleMCId); @@ -582,7 +582,7 @@ DECLARE_SOA_TABLE(V0MCCores_000, "AOD", "V0MCCORE", //! MC properties of the V0 v0data::PxNegMC, v0data::PyNegMC, v0data::PzNegMC); DECLARE_SOA_TABLE_VERSIONED(V0MCCores_001, "AOD", "V0MCCORE", 1, //! debug information - v0data::ParticleIdMC, //! MC properties of the V0 for posterior analysis + v0data::ParticleIdMC, //! MC properties of the V0 for posterior analysis v0data::PDGCode, v0data::PDGCodeMother, v0data::PDGCodePositive, v0data::PDGCodeNegative, v0data::IsPhysicalPrimary, v0data::XMC, v0data::YMC, v0data::ZMC, diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index 3e858c1c391..8ca0bc16808 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -86,7 +86,7 @@ struct strangederivedbuilder { //__________________________________________________ // track extra references Produces dauTrackExtras; // daughter track detector properties - Produces dauTrackMCIds; // daughter track MC Particle ID + Produces dauTrackMCIds; // daughter track MC Particle ID Produces dauTrackTPCPIDs; // daughter track TPC PID Produces dauTrackTOFPIDs; // daughter track TOF PID Produces v0Extras; // references DauTracks from V0s @@ -546,9 +546,9 @@ struct strangederivedbuilder { tr.tpcNClsFound(), tr.tpcNClsCrossedRows()); // if the table has MC info - if constexpr ( requires {tr.mcParticle();} ) { - // do your thing with the mcParticleIds only in case the table has the MC info - dauTrackMCIds( tr.mcParticleId() ); // joinable with dauTrackExtras + if constexpr (requires {tr.mcParticle();}) { + // do your thing with the mcParticleIds only in case the table has the MC info + dauTrackMCIds( tr.mcParticleId() ); // joinable with dauTrackExtras } // round if requested diff --git a/PWGLF/TableProducer/converters/strarawcentsconverter.cxx b/PWGLF/TableProducer/converters/strarawcentsconverter.cxx index 0d24cb14e0e..cd9aaaaef91 100644 --- a/PWGLF/TableProducer/converters/strarawcentsconverter.cxx +++ b/PWGLF/TableProducer/converters/strarawcentsconverter.cxx @@ -30,16 +30,16 @@ struct strarawcentsconverter { } for (auto& values : dauTrackExtras_000) { dauTrackExtras_001(0, - values.detectorMap(), - values.itsClusterSizes(), - values.tpcNClsFound(), - values.tpcNClsCrossedRows(), - values.tpcSignal(), - values.tpcNSigmaEl(), - values.tpcNSigmaPi(), - values.tpcNSigmaKa(), - values.tpcNSigmaPr(), - values.tpcNSigmaHe()); + values.detectorMap(), + values.itsClusterSizes(), + values.tpcNClsFound(), + values.tpcNClsCrossedRows(), + values.tpcSignal(), + values.tpcNSigmaEl(), + values.tpcNSigmaPi(), + values.tpcNSigmaKa(), + values.tpcNSigmaPr(), + values.tpcNSigmaHe()); } for (auto& values : v0MCCores_000) { v0MCCores_001(0, @@ -79,16 +79,16 @@ struct strarawcentsconverter { } for (auto& values : dauTrackExtras_000) { dauTrackExtras_001(0, - values.detectorMap(), - values.itsClusterSizes(), - values.tpcNClsFound(), - values.tpcNClsCrossedRows(), - values.tpcSignal(), - values.tpcNSigmaEl(), - values.tpcNSigmaPi(), - values.tpcNSigmaKa(), - values.tpcNSigmaPr(), - values.tpcNSigmaHe()); + values.detectorMap(), + values.itsClusterSizes(), + values.tpcNClsFound(), + values.tpcNClsCrossedRows(), + values.tpcSignal(), + values.tpcNSigmaEl(), + values.tpcNSigmaPi(), + values.tpcNSigmaKa(), + values.tpcNSigmaPr(), + values.tpcNSigmaHe()); } for (auto& values : v0MCCores_000) { v0MCCores_001(0, From 45eda8e821b6ecdfb7fa62d1fa3b38b6b3791c03 Mon Sep 17 00:00:00 2001 From: romainschotter Date: Wed, 24 Apr 2024 00:37:51 +0200 Subject: [PATCH 19/24] Please consider the following formatting changes --- PWGLF/DataModel/LFStrangenessTables.h | 2 +- PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index f1c9fdd7038..0f76645c93b 100755 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -583,7 +583,7 @@ DECLARE_SOA_TABLE(V0MCCores_000, "AOD", "V0MCCORE", //! MC properties of the V0 DECLARE_SOA_TABLE_VERSIONED(V0MCCores_001, "AOD", "V0MCCORE", 1, //! debug information v0data::ParticleIdMC, //! MC properties of the V0 for posterior analysis - v0data::PDGCode, v0data::PDGCodeMother, + v0data::PDGCode, v0data::PDGCodeMother, v0data::PDGCodePositive, v0data::PDGCodeNegative, v0data::IsPhysicalPrimary, v0data::XMC, v0data::YMC, v0data::ZMC, v0data::PxPosMC, v0data::PyPosMC, v0data::PzPosMC, diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index 8ca0bc16808..5b8b118e8e2 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -546,9 +546,9 @@ struct strangederivedbuilder { tr.tpcNClsFound(), tr.tpcNClsCrossedRows()); // if the table has MC info - if constexpr (requires {tr.mcParticle();}) { + if constexpr (requires { tr.mcParticle(); }) { // do your thing with the mcParticleIds only in case the table has the MC info - dauTrackMCIds( tr.mcParticleId() ); // joinable with dauTrackExtras + dauTrackMCIds(tr.mcParticleId()); // joinable with dauTrackExtras } // round if requested From 8337ae9ed2c594ce73e452be8826fd44cebc7d43 Mon Sep 17 00:00:00 2001 From: romainschotter Date: Wed, 24 Apr 2024 10:31:56 +0200 Subject: [PATCH 20/24] Add new converter task + fix error in filling the dautrackextra tables --- PWGLF/TableProducer/converters/CMakeLists.txt | 10 +++ .../converters/strarawcentsconverter.cxx | 66 +------------------ .../TableProducer/converters/v0sconverter.cxx | 59 +++++++++++++++++ 3 files changed, 71 insertions(+), 64 deletions(-) create mode 100644 PWGLF/TableProducer/converters/v0sconverter.cxx diff --git a/PWGLF/TableProducer/converters/CMakeLists.txt b/PWGLF/TableProducer/converters/CMakeLists.txt index 2621d216230..6eb30009992 100644 --- a/PWGLF/TableProducer/converters/CMakeLists.txt +++ b/PWGLF/TableProducer/converters/CMakeLists.txt @@ -13,3 +13,13 @@ o2physics_add_dpl_workflow(strangederivedconverter SOURCES strangederivedconverter.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(strarawcentsconverter + SOURCES strarawcentsconverter.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(v0sconverter + SOURCES v0sconverter.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) \ No newline at end of file diff --git a/PWGLF/TableProducer/converters/strarawcentsconverter.cxx b/PWGLF/TableProducer/converters/strarawcentsconverter.cxx index cd9aaaaef91..e912c724870 100644 --- a/PWGLF/TableProducer/converters/strarawcentsconverter.cxx +++ b/PWGLF/TableProducer/converters/strarawcentsconverter.cxx @@ -18,48 +18,16 @@ using namespace o2::framework; // Converts V0 version 001 to 002 struct strarawcentsconverter { - Produces dauTrackExtras_001; - Produces v0MCCores_001; Produces straRawCents_001; Produces straRawCents_003; - void process000to001(aod::StraRawCents_000 const& straRawCents_000, aod::DauTrackExtras_000 const& dauTrackExtras_000, aod::V0MCCores_000 const& v0MCCores_000) + void process000to001(aod::StraRawCents_000 const& straRawCents_000) { for (auto& values : straRawCents_000) { straRawCents_001(values.multFT0A(), values.multFT0C(), values.multFV0A(), values.multNTracksPVeta1(), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); } - for (auto& values : dauTrackExtras_000) { - dauTrackExtras_001(0, - values.detectorMap(), - values.itsClusterSizes(), - values.tpcNClsFound(), - values.tpcNClsCrossedRows(), - values.tpcSignal(), - values.tpcNSigmaEl(), - values.tpcNSigmaPi(), - values.tpcNSigmaKa(), - values.tpcNSigmaPr(), - values.tpcNSigmaHe()); - } - for (auto& values : v0MCCores_000) { - v0MCCores_001(0, - values.pdgCode(), - values.pdgCodeMother(), - values.pdgCodePositive(), - values.pdgCodeNegative(), - values.isPhysicalPrimary(), - values.xMC(), - values.yMC(), - values.zMC(), - values.pxPosMC(), - values.pyPosMC(), - values.pzPosMC(), - values.pxNegMC(), - values.pyNegMC(), - values.pzNegMC()); - } } - void process002to003(aod::StraRawCents_002 const& straRawCents_002, aod::DauTrackExtras_000 const& dauTrackExtras_000, aod::V0MCCores_000 const& v0MCCores_000) + void process002to003(aod::StraRawCents_002 const& straRawCents_002) { for (auto& values : straRawCents_002) { straRawCents_003(values.multFT0A(), @@ -77,36 +45,6 @@ struct strarawcentsconverter { values.multZPA(), values.multZPC()); } - for (auto& values : dauTrackExtras_000) { - dauTrackExtras_001(0, - values.detectorMap(), - values.itsClusterSizes(), - values.tpcNClsFound(), - values.tpcNClsCrossedRows(), - values.tpcSignal(), - values.tpcNSigmaEl(), - values.tpcNSigmaPi(), - values.tpcNSigmaKa(), - values.tpcNSigmaPr(), - values.tpcNSigmaHe()); - } - for (auto& values : v0MCCores_000) { - v0MCCores_001(0, - values.pdgCode(), - values.pdgCodeMother(), - values.pdgCodePositive(), - values.pdgCodeNegative(), - values.isPhysicalPrimary(), - values.xMC(), - values.yMC(), - values.zMC(), - values.pxPosMC(), - values.pyPosMC(), - values.pzPosMC(), - values.pxNegMC(), - values.pyNegMC(), - values.pzNegMC()); - } } PROCESS_SWITCH(strarawcentsconverter, process000to001, "from raw 000 to 001", false); diff --git a/PWGLF/TableProducer/converters/v0sconverter.cxx b/PWGLF/TableProducer/converters/v0sconverter.cxx new file mode 100644 index 00000000000..c7d0008f94f --- /dev/null +++ b/PWGLF/TableProducer/converters/v0sconverter.cxx @@ -0,0 +1,59 @@ +// 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 "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" + +using namespace o2; +using namespace o2::framework; + +// Converts V0 version 001 to 002 +struct v0sconverter { + Produces dauTrackExtras_001; + Produces v0MCCores_001; + + void process000to001(aod::DauTrackExtras_000 const& dauTrackExtras_000, aod::V0MCCores_000 const& v0MCCores_000) + { + for (auto& values : dauTrackExtras_000) { + dauTrackExtras_001(0, + values.detectorMap(), + values.itsClusterSizes(), + values.tpcClusters(), + values.tpcCrossedRows()); + } + for (auto& values : v0MCCores_000) { + v0MCCores_001(0, + values.pdgCode(), + values.pdgCodeMother(), + values.pdgCodePositive(), + values.pdgCodeNegative(), + values.isPhysicalPrimary(), + values.xMC(), + values.yMC(), + values.zMC(), + values.pxPosMC(), + values.pyPosMC(), + values.pzPosMC(), + values.pxNegMC(), + values.pyNegMC(), + values.pzNegMC()); + } + } + + PROCESS_SWITCH(v0sconverter, process000to001, "from raw 000 to 001", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From 45a16fc9fbdadcfe4592d404b2659344a1aecf31 Mon Sep 17 00:00:00 2001 From: romainschotter Date: Wed, 24 Apr 2024 14:50:57 +0200 Subject: [PATCH 21/24] Create two separate process functions + rename converter --- .../{v0sconverter.cxx => v0coresconverter.cxx} | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) rename PWGLF/TableProducer/converters/{v0sconverter.cxx => v0coresconverter.cxx} (82%) diff --git a/PWGLF/TableProducer/converters/v0sconverter.cxx b/PWGLF/TableProducer/converters/v0coresconverter.cxx similarity index 82% rename from PWGLF/TableProducer/converters/v0sconverter.cxx rename to PWGLF/TableProducer/converters/v0coresconverter.cxx index c7d0008f94f..4b2ddac4513 100644 --- a/PWGLF/TableProducer/converters/v0sconverter.cxx +++ b/PWGLF/TableProducer/converters/v0coresconverter.cxx @@ -17,11 +17,11 @@ using namespace o2; using namespace o2::framework; // Converts V0 version 001 to 002 -struct v0sconverter { +struct v0coresconverter { Produces dauTrackExtras_001; Produces v0MCCores_001; - void process000to001(aod::DauTrackExtras_000 const& dauTrackExtras_000, aod::V0MCCores_000 const& v0MCCores_000) + void processRecoInfo000to001(aod::DauTrackExtras_000 const& dauTrackExtras_000) { for (auto& values : dauTrackExtras_000) { dauTrackExtras_001(0, @@ -30,6 +30,9 @@ struct v0sconverter { values.tpcClusters(), values.tpcCrossedRows()); } + } + void processMCInfo000to001(aod::V0MCCores_000 const& v0MCCores_000) + { for (auto& values : v0MCCores_000) { v0MCCores_001(0, values.pdgCode(), @@ -49,11 +52,12 @@ struct v0sconverter { } } - PROCESS_SWITCH(v0sconverter, process000to001, "from raw 000 to 001", false); + PROCESS_SWITCH(v0coresconverter, processRecoInfo000to001, "from reco 000 to 001", false); + PROCESS_SWITCH(v0coresconverter, processMCInfo000to001, "from MC 000 to 001", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; } From 31a40b7cfc90dd94f6d0424f39515ea0905e6b3e Mon Sep 17 00:00:00 2001 From: romainschotter Date: Wed, 24 Apr 2024 14:52:37 +0200 Subject: [PATCH 22/24] Forgot to update CMakeLists file --- PWGLF/TableProducer/converters/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/TableProducer/converters/CMakeLists.txt b/PWGLF/TableProducer/converters/CMakeLists.txt index 6eb30009992..4c148acae32 100644 --- a/PWGLF/TableProducer/converters/CMakeLists.txt +++ b/PWGLF/TableProducer/converters/CMakeLists.txt @@ -19,7 +19,7 @@ o2physics_add_dpl_workflow(strarawcentsconverter PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(v0sconverter - SOURCES v0sconverter.cxx +o2physics_add_dpl_workflow(v0coressconverter + SOURCES v0coressconverter.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) \ No newline at end of file From 664776bdcf2e6089fa0f6807755882adb4d00d05 Mon Sep 17 00:00:00 2001 From: romainschotter Date: Wed, 24 Apr 2024 15:15:52 +0200 Subject: [PATCH 23/24] Rename and modify stradautracksconverter task + create a new converter for daughter extra + remove daughter extra info from v0coresconverter task --- .../stradautracksextraconverter.cxx | 40 ++++++++++++ .../stradautrackstofpidconverter.cxx | 65 +++++++++++++++++++ .../converters/v0coresconverter.cxx | 16 +---- 3 files changed, 106 insertions(+), 15 deletions(-) create mode 100644 PWGLF/TableProducer/converters/stradautracksextraconverter.cxx create mode 100644 PWGLF/TableProducer/converters/stradautrackstofpidconverter.cxx diff --git a/PWGLF/TableProducer/converters/stradautracksextraconverter.cxx b/PWGLF/TableProducer/converters/stradautracksextraconverter.cxx new file mode 100644 index 00000000000..ad436f4dfee --- /dev/null +++ b/PWGLF/TableProducer/converters/stradautracksextraconverter.cxx @@ -0,0 +1,40 @@ +// 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 "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/DataModel/LFStrangenessPIDTables.h" + +using namespace o2; +using namespace o2::framework; + +// Converts V0 version 001 to 002 +struct stradautracksextraconverter { + Produces dauTrackExtras_001; + + void process(aod::DauTrackExtras_000 const& dauTrackExtras_000) + { + for (auto& values : dauTrackExtras_000) { + dauTrackExtras_001(0, + values.detectorMap(), + values.itsClusterSizes(), + values.tpcClusters(), + values.tpcCrossedRows()); + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} \ No newline at end of file diff --git a/PWGLF/TableProducer/converters/stradautrackstofpidconverter.cxx b/PWGLF/TableProducer/converters/stradautrackstofpidconverter.cxx new file mode 100644 index 00000000000..8731939ca53 --- /dev/null +++ b/PWGLF/TableProducer/converters/stradautrackstofpidconverter.cxx @@ -0,0 +1,65 @@ +// 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 "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/DataModel/LFStrangenessPIDTables.h" + +using namespace o2; +using namespace o2::framework; + +// Converts V0 version 001 to 002 +struct stradautrackstofpidconverter { + Produces dautracktofpids; + + 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 (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(); + lLengths[v0.negTrackExtraId()] = v0.negTOFLengthToPV(); + lTOFSignals[v0.negTrackExtraId()] = v0.negTOFSignal(); + lTOFEvTimes[v0.negTrackExtraId()] = v0.negTOFEventTime(); + } + for (auto& casc : cascs) { + lLengths[casc.posTrackExtraId()] = casc.posTOFLengthToPV(); + lTOFSignals[casc.posTrackExtraId()] = casc.posTOFSignal(); + lTOFEvTimes[casc.posTrackExtraId()] = casc.posTOFEventTime(); + lLengths[casc.negTrackExtraId()] = casc.negTOFLengthToPV(); + lTOFSignals[casc.negTrackExtraId()] = casc.negTOFSignal(); + lTOFEvTimes[casc.negTrackExtraId()] = casc.negTOFEventTime(); + lLengths[casc.bachTrackExtraId()] = casc.bachTOFLengthToPV(); + lTOFSignals[casc.bachTrackExtraId()] = casc.bachTOFSignal(); + lTOFEvTimes[casc.bachTrackExtraId()] = casc.bachTOFEventTime(); + } + for (int ii = 0; ii < dauTracks.size(); ii++) { + dautracktofpids(lTOFSignals[ii], lTOFEvTimes[ii], lLengths[ii]); + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} \ No newline at end of file diff --git a/PWGLF/TableProducer/converters/v0coresconverter.cxx b/PWGLF/TableProducer/converters/v0coresconverter.cxx index 4b2ddac4513..06fafc1cc1a 100644 --- a/PWGLF/TableProducer/converters/v0coresconverter.cxx +++ b/PWGLF/TableProducer/converters/v0coresconverter.cxx @@ -18,20 +18,9 @@ using namespace o2::framework; // Converts V0 version 001 to 002 struct v0coresconverter { - Produces dauTrackExtras_001; Produces v0MCCores_001; - void processRecoInfo000to001(aod::DauTrackExtras_000 const& dauTrackExtras_000) - { - for (auto& values : dauTrackExtras_000) { - dauTrackExtras_001(0, - values.detectorMap(), - values.itsClusterSizes(), - values.tpcClusters(), - values.tpcCrossedRows()); - } - } - void processMCInfo000to001(aod::V0MCCores_000 const& v0MCCores_000) + void process(aod::V0MCCores_000 const& v0MCCores_000) { for (auto& values : v0MCCores_000) { v0MCCores_001(0, @@ -51,9 +40,6 @@ struct v0coresconverter { values.pzNegMC()); } } - - PROCESS_SWITCH(v0coresconverter, processRecoInfo000to001, "from reco 000 to 001", false); - PROCESS_SWITCH(v0coresconverter, processMCInfo000to001, "from MC 000 to 001", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 281fc44bac6409dbc44decc3542488053102493c Mon Sep 17 00:00:00 2001 From: romainschotter Date: Wed, 24 Apr 2024 15:18:37 +0200 Subject: [PATCH 24/24] Forgot to update CMakeList file --- PWGLF/TableProducer/converters/CMakeLists.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/PWGLF/TableProducer/converters/CMakeLists.txt b/PWGLF/TableProducer/converters/CMakeLists.txt index 4c148acae32..2abb2f6fdbc 100644 --- a/PWGLF/TableProducer/converters/CMakeLists.txt +++ b/PWGLF/TableProducer/converters/CMakeLists.txt @@ -9,8 +9,13 @@ # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. -o2physics_add_dpl_workflow(strangederivedconverter - SOURCES strangederivedconverter.cxx +o2physics_add_dpl_workflow(stradautrackstofpidconverter + SOURCES stradautrackstofpidconverter.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) @@ -19,7 +24,7 @@ o2physics_add_dpl_workflow(strarawcentsconverter PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(v0coressconverter - SOURCES v0coressconverter.cxx +o2physics_add_dpl_workflow(v0coresconverter + SOURCES v0coresconverter.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) \ No newline at end of file