From 43c5ec78d45e670c30c22ee5b34bd53d4189886d Mon Sep 17 00:00:00 2001 From: Lucia Anna Tarasovicova Date: Fri, 10 Jan 2025 15:02:30 +0100 Subject: [PATCH 1/2] using template function for assoc hadrons --- PWGLF/DataModel/LFHStrangeCorrelationTables.h | 31 ++- .../Strangeness/hStrangeCorrelationFilter.cxx | 207 ++++++++++++------ .../Tasks/Strangeness/hStrangeCorrelation.cxx | 69 +++--- 3 files changed, 205 insertions(+), 102 deletions(-) diff --git a/PWGLF/DataModel/LFHStrangeCorrelationTables.h b/PWGLF/DataModel/LFHStrangeCorrelationTables.h index 7f7578b3632..62b50667263 100644 --- a/PWGLF/DataModel/LFHStrangeCorrelationTables.h +++ b/PWGLF/DataModel/LFHStrangeCorrelationTables.h @@ -42,21 +42,36 @@ DECLARE_SOA_INDEX_COLUMN_FULL(Track, track, int, Tracks, "_Trigger"); //! DECLARE_SOA_COLUMN(MCOriginalPt, mcOriginalPt, float); // true generated pt } // namespace triggerTracks DECLARE_SOA_TABLE(TriggerTracks, "AOD", "TRIGGERTRACKS", o2::soa::Index<>, triggerTracks::CollisionId, triggerTracks::MCPhysicalPrimary, triggerTracks::TrackId, triggerTracks::MCOriginalPt); +namespace triggerTrackExtras +{ +DECLARE_SOA_COLUMN(Extra, extra, int); // true physical primary flag +} // namespace triggerTrackExtras +DECLARE_SOA_TABLE(TriggerTrackExtras, "AOD", "TRIGGERTRACKEXTRAs", triggerTrackExtras::Extra); /// _________________________________________ /// Table for storing assoc track indices -namespace assocPions -{ -DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! -DECLARE_SOA_INDEX_COLUMN_FULL(Track, track, int, Tracks, "_Assoc"); //! -} // namespace assocPions -DECLARE_SOA_TABLE(AssocPions, "AOD", "ASSOCPIONS", o2::soa::Index<>, assocPions::CollisionId, assocPions::TrackId); - namespace assocHadrons { DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! +DECLARE_SOA_COLUMN(MCPhysicalPrimary, mcPhysicalPrimary, bool); // true physical primary flag DECLARE_SOA_INDEX_COLUMN_FULL(Track, track, int, Tracks, "_Assoc"); //! +DECLARE_SOA_COLUMN(MCOriginalPt, mcOriginalPt, float); // true generated pt } // namespace assocHadrons -DECLARE_SOA_TABLE(AssocHadrons, "AOD", "ASSOCHADRONS", o2::soa::Index<>, assocHadrons::CollisionId, assocHadrons::TrackId); +DECLARE_SOA_TABLE(AssocHadrons, "AOD", "ASSOCHADRONS", o2::soa::Index<>, assocHadrons::CollisionId, assocHadrons::MCPhysicalPrimary, assocHadrons::TrackId, assocHadrons::MCOriginalPt); +/// _________________________________________ +/// Table for storing assoc track PID +namespace assocPID +{ +DECLARE_SOA_COLUMN(NSigmaTPCPi, nSigmaTPCPi, float); +DECLARE_SOA_COLUMN(NSigmaTPCKa, nSigmaTPCKa, float); +DECLARE_SOA_COLUMN(NSigmaTPCPr, nSigmaTPCPr, float); +DECLARE_SOA_COLUMN(NSigmaTPCEl, nSigmaTPCEl, float); +DECLARE_SOA_COLUMN(NSigmaTOFPi, nSigmaTOFPi, float); +DECLARE_SOA_COLUMN(NSigmaTOFKa, nSigmaTOFKa, float); +DECLARE_SOA_COLUMN(NSigmaTOFPr, nSigmaTOFPr, float); +DECLARE_SOA_COLUMN(NSigmaTOFEl, nSigmaTOFEl, float); +} // namespace assocPID +DECLARE_SOA_TABLE(AssocPID, "AOD", "ASSOCPID", assocPID::NSigmaTPCPi, assocPID::NSigmaTPCKa, assocPID::NSigmaTPCPr, assocPID::NSigmaTPCEl, assocPID::NSigmaTOFPi, assocPID::NSigmaTOFKa, assocPID::NSigmaTOFPr, assocPID::NSigmaTOFEl); + /// _________________________________________ /// Table for storing associated V0 indices namespace assocV0s diff --git a/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx b/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx index dc7fe18a66a..7aeea6b71b6 100644 --- a/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx +++ b/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx @@ -63,6 +63,7 @@ struct hstrangecorrelationfilter { // Track quality Configurable minTPCNCrossedRows{"minTPCNCrossedRows", 70, "Minimum TPC crossed rows"}; Configurable triggerRequireITS{"triggerRequireITS", true, "require ITS signal in trigger tracks"}; + Configurable assocRequireITS{"assocRequireITS", true, "require ITS signal in assoc tracks"}; Configurable triggerMaxTPCSharedClusters{"triggerMaxTPCSharedClusters", 200, "maximum number of shared TPC clusters (inclusive)"}; Configurable triggerRequireL0{"triggerRequireL0", false, "require ITS L0 cluster for trigger"}; @@ -136,17 +137,21 @@ struct hstrangecorrelationfilter { using V0LinkedTagged = soa::Join; using CascadesLinkedTagged = soa::Join; + using FullTracks = soa::Join; + using FullTracksMC = soa::Join; using DauTracks = soa::Join; using DauTracksMC = soa::Join; // using IDTracks= soa::Join; // prepared for Bayesian PID - using IDTracks = soa::Join; + using IDTracks = soa::Join; + using IDTracksMC = soa::Join; using V0DatasWithoutTrackX = soa::Join; Produces triggerTrack; - Produces assocPion; + Produces triggerTrackExtra; Produces assocV0; Produces assocCascades; Produces assocHadrons; + Produces assocPID; TF1* fK0Mean = new TF1("fK0Mean", "[0]+[1]*x+[2]*TMath::Exp(-[3]*x)"); TF1* fK0Width = new TF1("fK0Width", "[0]+[1]*x+[2]*TMath::Exp(-[3]*x)"); @@ -222,8 +227,83 @@ struct hstrangecorrelationfilter { return true; } + bool isValidAssocTrack(TTrack assoc) + { + if (assoc.eta() > assocEtaMax || assoc.eta() < assocEtaMin) { + return false; + } + if (assoc.pt() > assocPtCutMax || assoc.pt() < assocPtCutMin) { + return false; + } + if (assoc.tpcNClsCrossedRows() < minTPCNCrossedRows) { + return false; // crossed rows + } + if (!assoc.hasITS() && assocRequireITS) { + return false; // skip, doesn't have ITS signal (skips lots of TPC-only!) + } + + // do this only if information is available + float nSigmaPTCTOF[8] = {-10, -10, -10, -10, -10, -10, -10, -10}; + if constexpr (requires { assoc.tofSignal(); }) { + if (assoc.tofSignal() > 0) { + if (std::sqrt(assoc.tofNSigmaPi() * assoc.tofNSigmaPi() + assoc.tpcNSigmaPi() * assoc.tpcNSigmaPi()) > assocPionNSigmaTPCFOF) + return false; + if (assoc.tofNSigmaPr() < rejectSigma) + return false; + if (assoc.tpcNSigmaPr() < rejectSigma) + return false; + if (assoc.tofNSigmaKa() < rejectSigma) + return false; + if (assoc.tpcNSigmaKa() < rejectSigma) + return false; + nSigmaPTCTOF[4] = assoc.tofNSigmaPi(); + nSigmaPTCTOF[5] = assoc.tofNSigmaKa(); + nSigmaPTCTOF[6] = assoc.tofNSigmaPr(); + nSigmaPTCTOF[7] = assoc.tofNSigmaEl(); + } else { + if (assoc.tpcNSigmaPi() > assocPionNSigmaTPCFOF) + return false; + if (assoc.tpcNSigmaPr() < rejectSigma) + return false; + if (assoc.tpcNSigmaKa() < rejectSigma) + return false; + } + nSigmaPTCTOF[0] = assoc.tpcNSigmaPi(); + nSigmaPTCTOF[1] = assoc.tpcNSigmaKa(); + nSigmaPTCTOF[2] = assoc.tpcNSigmaPr(); + nSigmaPTCTOF[3] = assoc.tpcNSigmaEl(); + } + + bool physicalPrimary = false; + float origPt = -1; + if constexpr (requires { assoc.mcParticle(); }) { + if (assoc.has_mcParticle()) { + auto mcParticle = assoc.mcParticle(); + physicalPrimary = mcParticle.isPhysicalPrimary(); + origPt = mcParticle.pt(); + } + } + + assocHadrons( + track.collisionId(), + physicalPrimary, + track.globalIndex(), + origPt); + assocPID( + nSigmaPTCTOF[0], + nSigmaPTCTOF[1], + nSigmaPTCTOF[2], + nSigmaPTCTOF[3], + nSigmaPTCTOF[4], + nSigmaPTCTOF[5], + nSigmaPTCTOF[6], + nSigmaPTCTOF[7], + nSigmaPTCTOF[8]); + return true; + } + // for real data processing - void processTriggers(soa::Join::iterator const& collision, soa::Filtered const& tracks, aod::BCsWithTimestamps const&) + void processTriggers(soa::Join::iterator const& collision, soa::Filtered const& tracks, aod::BCsWithTimestamps const&) { // Perform basic event selection if (!collision.sel8()) { @@ -252,11 +332,12 @@ struct hstrangecorrelationfilter { false, // if you decide to check real data for primaries, you'll have a hard time track.globalIndex(), 0); + triggerTrackExtra(1); } } // for MC processing - void processTriggersMC(soa::Join::iterator const& collision, soa::Filtered const& tracks, aod::McParticles const&, aod::BCsWithTimestamps const&) + void processTriggersMC(soa::Join::iterator const& collision, soa::Filtered const& tracks, aod::McParticles const&, aod::BCsWithTimestamps const&) { // Perform basic event selection if (!collision.sel8()) { @@ -292,6 +373,7 @@ struct hstrangecorrelationfilter { physicalPrimary, track.globalIndex(), origPt); + triggerTrackExtra(1); } } @@ -317,59 +399,12 @@ struct hstrangecorrelationfilter { /// _________________________________________________ /// Step 1: Populate table with trigger tracks for (auto const& track : tracks) { - if (track.eta() > assocEtaMax || track.eta() < assocEtaMin) { + if (!isValidAssocTrack) continue; - } - // if (track.sign()= 1 ) {continue;} - if (track.pt() > assocPtCutMax || track.pt() < assocPtCutMin) { - continue; - } - if (track.tpcNClsCrossedRows() < minTPCNCrossedRows) { - continue; // crossed rows - } - if (!track.hasITS() && triggerRequireITS) { - continue; // skip, doesn't have ITS signal (skips lots of TPC-only!) - } - // prepared for Bayesian PID - // if (!track.bayesPi() > pionMinBayesProb) { - // continue; - // } - // if (track.bayesPi() < track.bayesPr() || track.bayesPi() < track.bayesKa()){ - // continue; - // } - // if (track.tpcNSigmaPi() < assocPionNSigmaTPCFOF){ - // continue; - // } - // if (track.tofSignal() > 0 && track.tofNSigmaPi() < assocPionNSigmaTPCFOF){ - // continue; - // } - if (track.tofSignal() > 0) { - if (std::sqrt(track.tofNSigmaPi() * track.tofNSigmaPi() + track.tpcNSigmaPi() * track.tpcNSigmaPi()) > assocPionNSigmaTPCFOF) - continue; - if (track.tofNSigmaPr() < rejectSigma) - continue; - if (track.tpcNSigmaPr() < rejectSigma) - continue; - if (track.tofNSigmaKa() < rejectSigma) - continue; - if (track.tpcNSigmaKa() < rejectSigma) - continue; - } else { - if (track.tpcNSigmaPi() > assocPionNSigmaTPCFOF) - continue; - if (track.tpcNSigmaPr() < rejectSigma) - continue; - if (track.tpcNSigmaKa() < rejectSigma) - continue; - } - - assocHadrons( - track.collisionId(), - track.globalIndex()); } } - void processAssocHadrons(soa::Join::iterator const& collision, soa::Filtered> const& tracks, aod::BCsWithTimestamps const&) + void processAssocPionsMC(soa::Join::iterator const& collision, soa::Filtered const& tracks, aod::BCsWithTimestamps const&) { // Perform basic event selection if (!collision.sel8()) { @@ -391,23 +426,61 @@ struct hstrangecorrelationfilter { /// _________________________________________________ /// Step 1: Populate table with trigger tracks for (auto const& track : tracks) { - if (track.eta() > assocEtaMax || track.eta() < assocEtaMin) { + if (!isValidAssocTrack) continue; + } + } + + void processAssocHadrons(soa::Join::iterator const& collision, soa::Filtered const& tracks, aod::BCsWithTimestamps const&) + { + // Perform basic event selection + if (!collision.sel8()) { + return; + } + // No need to correlate stuff that's in far collisions + if (TMath::Abs(collision.posZ()) > 10.0) { + return; + } + if (zorroMask.value != "") { + auto bc = collision.bc_as(); + initCCDB(bc); + bool zorroSelected = zorro.isSelected(collision.bc_as().globalBC()); /// Just let Zorro do the accounting + if (!zorroSelected) { + return; } - // if (track.sign()= 1 ) {continue;} - if (track.pt() > assocPtCutMax || track.pt() < assocPtCutMin) { + } + + /// _________________________________________________ + /// Step 1: Populate table with trigger tracks + for (auto const& track : tracks) { + if (!isValidAssocTrack) continue; + } + } + void processAssocHadronsMC(soa::Join::iterator const& collision, soa::Filtered const& tracks, aod::BCsWithTimestamps const&) + { + // Perform basic event selection + if (!collision.sel8()) { + return; + } + // No need to correlate stuff that's in far collisions + if (TMath::Abs(collision.posZ()) > 10.0) { + return; + } + if (zorroMask.value != "") { + auto bc = collision.bc_as(); + initCCDB(bc); + bool zorroSelected = zorro.isSelected(collision.bc_as().globalBC()); /// Just let Zorro do the accounting + if (!zorroSelected) { + return; } - if (track.tpcNClsCrossedRows() < minTPCNCrossedRows) { - continue; // crossed rows - } - if (!track.hasITS() && triggerRequireITS) { - continue; // skip, doesn't have ITS signal (skips lots of TPC-only!) - } + } - assocHadrons( - track.collisionId(), - track.globalIndex()); + /// _________________________________________________ + /// Step 1: Populate table with trigger tracks + for (auto const& track : tracks) { + if (!isValidAssocTrack) + continue; } } @@ -600,9 +673,11 @@ struct hstrangecorrelationfilter { PROCESS_SWITCH(hstrangecorrelationfilter, processTriggers, "Produce trigger tables", true); PROCESS_SWITCH(hstrangecorrelationfilter, processTriggersMC, "Produce trigger tables for MC", false); PROCESS_SWITCH(hstrangecorrelationfilter, processV0s, "Produce associated V0 tables", true); - PROCESS_SWITCH(hstrangecorrelationfilter, processAssocPions, "Produce associated Pion tables", true); + PROCESS_SWITCH(hstrangecorrelationfilter, processAssocPions, "Produce associated Pion tables", false); + PROCESS_SWITCH(hstrangecorrelationfilter, processAssocPionsMC, "Produce associated Pion tables for MC", false); PROCESS_SWITCH(hstrangecorrelationfilter, processCascades, "Produce associated cascade tables", true); PROCESS_SWITCH(hstrangecorrelationfilter, processAssocHadrons, "Produce associated Hadron tables", true); + PROCESS_SWITCH(hstrangecorrelationfilter, processAssocHadronsMC, "Produce associated Hadron tables for MC", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx b/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx index 0126854b3b5..4a18f233db8 100644 --- a/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx +++ b/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx @@ -476,31 +476,33 @@ struct correlateStrangeness { } } } - - void fillCorrelationsHadron(aod::TriggerTracks const& triggers, aod::AssocHadrons const& assocs, bool mixing, float pvz, float mult, int /*indexAssoc*/) + template + void fillCorrelationsHadron(TTriggers const& triggers, THadrons const& assocs, bool mixing, float pvz, float mult) { for (auto& triggerTrack : triggers) { if (doTriggPhysicalPrimary && !triggerTrack.mcPhysicalPrimary()) continue; - auto trigg = triggerTrack.track_as(); + auto trigg = triggerTrack.template track_as(); if (!isValidTrigger(trigg)) continue; - static_for<7, 8>([&](auto i) { - constexpr int index = i.value; - if (bitcheck(doCorrelation, i)) { - if (!mixing) - histos.fill(HIST("sameEvent/TriggerParticles") + HIST(particlenames[index]), trigg.pt(), mult); + if (!mixing) { + if constexpr (requires { triggerTrack.extra(); }) + histos.fill(HIST("sameEvent/TriggerParticlesPion"), trigg.pt(), mult); + else + histos.fill(HIST("sameEvent/TriggerParticlesHadron"), trigg.pt(), mult); + } for (auto& assocTrack : assocs) { - auto assoc = assocTrack.track_as(); - - + auto assoc = assocTrack.template track_as(); //---] removing autocorrelations [--- if (doAutocorrelationRejection) { if (trigg.globalIndex() == assoc.globalIndex()) { - histos.fill(HIST("hNumberOfRejectedPairs") + HIST(particlenames[index]), 0.5); + if constexpr (requires { assocTrack.nSigmaTPCPi(); }) + histos.fill(HIST("hNumberOfRejectedPairsPion"), 0.5); + else + histos.fill(HIST("hNumberOfRejectedPairsHadron"), 0.5); continue; } } @@ -522,12 +524,20 @@ struct correlateStrangeness { if (ptassoc < axisRanges[2][0] || ptassoc > axisRanges[2][1]) continue; - if (!mixing) - histos.fill(HIST("sameEvent/Signal/") + HIST(particlenames[index]), deltaphi, deltaeta, ptassoc, pttrigger, pvz, mult); - else - histos.fill(HIST("mixedEvent/Signal/") + HIST(particlenames[index]), deltaphi, deltaeta, ptassoc, pttrigger, pvz, mult); + if (!mixing) { + if constexpr (requires { assocTrack.nSigmaTPCPi(); }) { + histos.fill(HIST("sameEvent/Signal/Pion"), deltaphi, deltaeta, ptassoc, pttrigger, pvz, mult); + } else { + histos.fill(HIST("sameEvent/Signal/Hadron"), deltaphi, deltaeta, ptassoc, pttrigger, pvz, mult); + } + } else { + if constexpr (requires { assocTrack.nSigmaTPCPi(); }) { + histos.fill(HIST("mixedEvent/Signal/Pion"), deltaphi, deltaeta, ptassoc, pttrigger, pvz, mult); + } else { + histos.fill(HIST("mixedEvent/Signal/Hadron"), deltaphi, deltaeta, ptassoc, pttrigger, pvz, mult); + } + } } - } }); } } @@ -733,11 +743,6 @@ struct correlateStrangeness { histos.add("hNumberOfRejectedPairsCascades", "hNumberOfRejectedPairsCascades", kTH1F, {{1, 0, 1}}); histos.add("hNumberOfRejectedPairsPion", "hNumberOfRejectedPairsPion", kTH1F, {{1, 0, 1}}); - histos.add("sameEvent/TriggerParticlesHadron", "TriggersHadron", kTH2F, {axisPtQA, axisMult}); - histos.add("sameEvent/TriggerParticlesV0", "TriggersV0", kTH2F, {axisPtQA, axisMult}); - histos.add("sameEvent/TriggerParticlesCascade", "TriggersCascade", kTH2F, {axisPtQA, axisMult}); - histos.add("sameEvent/TriggerParticlesPion", "TriggersPion", kTH2F, {axisPtQA, axisMult}); - // mixing QA histos.add("MixingQA/hSECollisionBins", ";bin;Entries", kTH1F, {{140, -0.5, 139.5}}); histos.add("MixingQA/hMECollisionBins", ";bin;Entries", kTH1F, {{140, -0.5, 139.5}}); @@ -783,6 +788,14 @@ struct correlateStrangeness { if (doprocessMixedEventHV0s || doprocessMixedEventHCascades || doprocessMixedEventHPions || doprocessMixedEventHHadrons) { histos.addClone("sameEvent/", "mixedEvent/"); } + if (doprocessSameEventHHadrons) + histos.add("sameEvent/TriggerParticlesHadron", "TriggersHadron", kTH2F, {axisPtQA, axisMult}); + if (doprocessSameEventHV0s) + histos.add("sameEvent/TriggerParticlesV0", "TriggersV0", kTH2F, {axisPtQA, axisMult}); + if (doprocessSameEventHCascades) + histos.add("sameEvent/TriggerParticlesCascade", "TriggersCascade", kTH2F, {axisPtQA, axisMult}); + if (doprocessSameEventHPions) + histos.add("sameEvent/TriggerParticlesPion", "TriggersPion", kTH2F, {axisPtQA, axisMult}); // MC generated plots if (doprocessMCGenerated) { @@ -928,7 +941,7 @@ struct correlateStrangeness { // ________________________________________________ // Do hadron - hadron correlations - fillCorrelationsHadron(triggerTracks, assocHadrons, false, collision.posZ(), collision.centFT0M(), 7); + fillCorrelationsHadron(triggerTracks, assocHadrons, false, collision.posZ(), collision.centFT0M()); } void processSameEventHV0s(soa::Join::iterator const& collision, @@ -1113,7 +1126,7 @@ struct correlateStrangeness { fillCorrelationsCascade(triggerTracks, associatedCascades, false, collision.posX(), collision.posY(), collision.posZ(), collision.centFT0M()); } void processSameEventHPions(soa::Join::iterator const& collision, - aod::AssocHadrons const& associatedPions, aod::TriggerTracks const& triggerTracks, + soa::Join const& associatedPions, soa::Join const& triggerTracks, TracksComplete const&, aod::BCsWithTimestamps const&) { // ________________________________________________ @@ -1154,7 +1167,7 @@ struct correlateStrangeness { // ________________________________________________ // Do hadron - Pion correlations - fillCorrelationsHadron(triggerTracks, associatedPions, false, collision.posZ(), collision.centFT0M(), 8); + fillCorrelationsHadron(triggerTracks, associatedPions, false, collision.posZ(), collision.centFT0M()); } void processMixedEventHHadrons(soa::Join const& collisions, @@ -1192,7 +1205,7 @@ struct correlateStrangeness { auto slicedAssocHadrons = assocHadrons.sliceBy(collisionSliceHadrons, collision2.globalIndex()); // ________________________________________________ // Do hadron - hadron correlations - fillCorrelationsHadron(slicedTriggerTracks, slicedAssocHadrons, true, collision1.posZ(), collision1.centFT0M(), 7); + fillCorrelationsHadron(slicedTriggerTracks, slicedAssocHadrons, true, collision1.posZ(), collision1.centFT0M()); } } @@ -1280,7 +1293,7 @@ struct correlateStrangeness { } } void processMixedEventHPions(soa::Join const& collisions, - aod::AssocHadrons const& assocPions, aod::TriggerTracks const& triggerTracks, + soa::Join const& assocPions, soa::Join const& triggerTracks, TracksComplete const&) { for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, mixingParameter, -1, collisions, collisions)) { @@ -1314,7 +1327,7 @@ struct correlateStrangeness { auto slicedAssocPions = assocPions.sliceBy(collisionSliceHadrons, collision2.globalIndex()); // ________________________________________________ // Do hadron - cascade correlations - fillCorrelationsHadron(slicedTriggerTracks, slicedAssocPions, true, collision1.posZ(), collision1.centFT0M(), 8); + fillCorrelationsHadron(slicedTriggerTracks, slicedAssocPions, true, collision1.posZ(), collision1.centFT0M()); } } From 903ef18ce92026af7771da8e01f6793d28ce73e4 Mon Sep 17 00:00:00 2001 From: Lucia Anna Tarasovicova Date: Fri, 10 Jan 2025 15:25:42 +0100 Subject: [PATCH 2/2] fix --- .../Strangeness/hStrangeCorrelationFilter.cxx | 49 +++++++++---------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx b/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx index 7aeea6b71b6..c2fd9b5074e 100644 --- a/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx +++ b/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx @@ -226,7 +226,7 @@ struct hstrangecorrelationfilter { } return true; } - + template bool isValidAssocTrack(TTrack assoc) { if (assoc.eta() > assocEtaMax || assoc.eta() < assocEtaMin) { @@ -243,7 +243,7 @@ struct hstrangecorrelationfilter { } // do this only if information is available - float nSigmaPTCTOF[8] = {-10, -10, -10, -10, -10, -10, -10, -10}; + float nSigmaTPCTOF[8] = {-10, -10, -10, -10, -10, -10, -10, -10}; if constexpr (requires { assoc.tofSignal(); }) { if (assoc.tofSignal() > 0) { if (std::sqrt(assoc.tofNSigmaPi() * assoc.tofNSigmaPi() + assoc.tpcNSigmaPi() * assoc.tpcNSigmaPi()) > assocPionNSigmaTPCFOF) @@ -256,10 +256,10 @@ struct hstrangecorrelationfilter { return false; if (assoc.tpcNSigmaKa() < rejectSigma) return false; - nSigmaPTCTOF[4] = assoc.tofNSigmaPi(); - nSigmaPTCTOF[5] = assoc.tofNSigmaKa(); - nSigmaPTCTOF[6] = assoc.tofNSigmaPr(); - nSigmaPTCTOF[7] = assoc.tofNSigmaEl(); + nSigmaTPCTOF[4] = assoc.tofNSigmaPi(); + nSigmaTPCTOF[5] = assoc.tofNSigmaKa(); + nSigmaTPCTOF[6] = assoc.tofNSigmaPr(); + nSigmaTPCTOF[7] = assoc.tofNSigmaEl(); } else { if (assoc.tpcNSigmaPi() > assocPionNSigmaTPCFOF) return false; @@ -268,10 +268,10 @@ struct hstrangecorrelationfilter { if (assoc.tpcNSigmaKa() < rejectSigma) return false; } - nSigmaPTCTOF[0] = assoc.tpcNSigmaPi(); - nSigmaPTCTOF[1] = assoc.tpcNSigmaKa(); - nSigmaPTCTOF[2] = assoc.tpcNSigmaPr(); - nSigmaPTCTOF[3] = assoc.tpcNSigmaEl(); + nSigmaTPCTOF[0] = assoc.tpcNSigmaPi(); + nSigmaTPCTOF[1] = assoc.tpcNSigmaKa(); + nSigmaTPCTOF[2] = assoc.tpcNSigmaPr(); + nSigmaTPCTOF[3] = assoc.tpcNSigmaEl(); } bool physicalPrimary = false; @@ -285,20 +285,19 @@ struct hstrangecorrelationfilter { } assocHadrons( - track.collisionId(), + assoc.collisionId(), physicalPrimary, - track.globalIndex(), + assoc.globalIndex(), origPt); assocPID( - nSigmaPTCTOF[0], - nSigmaPTCTOF[1], - nSigmaPTCTOF[2], - nSigmaPTCTOF[3], - nSigmaPTCTOF[4], - nSigmaPTCTOF[5], - nSigmaPTCTOF[6], - nSigmaPTCTOF[7], - nSigmaPTCTOF[8]); + nSigmaTPCTOF[0], + nSigmaTPCTOF[1], + nSigmaTPCTOF[2], + nSigmaTPCTOF[3], + nSigmaTPCTOF[4], + nSigmaTPCTOF[5], + nSigmaTPCTOF[6], + nSigmaTPCTOF[7]); return true; } @@ -399,7 +398,7 @@ struct hstrangecorrelationfilter { /// _________________________________________________ /// Step 1: Populate table with trigger tracks for (auto const& track : tracks) { - if (!isValidAssocTrack) + if (!isValidAssocTrack(track)) continue; } } @@ -426,7 +425,7 @@ struct hstrangecorrelationfilter { /// _________________________________________________ /// Step 1: Populate table with trigger tracks for (auto const& track : tracks) { - if (!isValidAssocTrack) + if (!isValidAssocTrack(track)) continue; } } @@ -453,7 +452,7 @@ struct hstrangecorrelationfilter { /// _________________________________________________ /// Step 1: Populate table with trigger tracks for (auto const& track : tracks) { - if (!isValidAssocTrack) + if (!isValidAssocTrack(track)) continue; } } @@ -479,7 +478,7 @@ struct hstrangecorrelationfilter { /// _________________________________________________ /// Step 1: Populate table with trigger tracks for (auto const& track : tracks) { - if (!isValidAssocTrack) + if (!isValidAssocTrack(track)) continue; } }