From 953647fdc336fd6817ea23105902383ae0f14080 Mon Sep 17 00:00:00 2001 From: jaelpark Date: Thu, 8 Feb 2024 16:03:20 +0100 Subject: [PATCH] Fixes to detection of table getters (#4643) --- PWGCF/Tasks/correlations.cxx | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/PWGCF/Tasks/correlations.cxx b/PWGCF/Tasks/correlations.cxx index d7f58c4c688..a4a685671f4 100644 --- a/PWGCF/Tasks/correlations.cxx +++ b/PWGCF/Tasks/correlations.cxx @@ -217,13 +217,18 @@ struct CorrelationTask { } } + template + using hasInvMass = decltype(std::declval().invMass()); + template void fillQA(const TCollision& collision, float multiplicity, const TTracks1& tracks1, const TTracks2& tracks2) { for (auto& track1 : tracks1) { - if constexpr (std::is_same::value) { - if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << (uint32_t)track1.decay())) == 0u) - continue; + if constexpr (std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value) { + if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << (uint32_t)track1.decay())) == 0u) + continue; + } registry.fill(HIST("invMass"), track1.invMass()); } registry.fill(HIST("yieldsTrigger"), multiplicity, track1.pt(), track1.eta()); @@ -262,6 +267,12 @@ struct CorrelationTask { template using hasSign = decltype(std::declval().sign()); + template + using hasDecay = decltype(std::declval().decay()); + template + using hasProng0Id = decltype(std::declval().cfTrackProng0Id()); + template + using hasProng1Id = decltype(std::declval().cfTrackProng1Id()); template void fillCorrelations(TTarget target, TTracks1& tracks1, TTracks2& tracks2, float multiplicity, float posZ, int magField, float eventWeight) @@ -286,12 +297,12 @@ struct CorrelationTask { } } - if constexpr (std::is_same::value) { + if constexpr (std::experimental::is_detected::value) { if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << (uint32_t)track1.decay())) == 0u) continue; } - if constexpr (std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value) { if (cfgTriggerCharge != 0 && cfgTriggerCharge * track1.sign() < 0) { continue; } @@ -313,8 +324,12 @@ struct CorrelationTask { continue; } } - if constexpr (std::is_same::value) { - if (track2.globalIndex() == track1.cfTrackProng0Id() || track2.globalIndex() == track1.cfTrackProng1Id()) // do not correlate daughter tracks of the same event + if constexpr (std::experimental::is_detected::value) { + if (track2.globalIndex() == track1.cfTrackProng0Id()) // do not correlate daughter tracks of the same event + continue; + } + if constexpr (std::experimental::is_detected::value) { + if (track2.globalIndex() == track1.cfTrackProng1Id()) // do not correlate daughter tracks of the same event continue; } @@ -332,7 +347,7 @@ struct CorrelationTask { continue; } - if constexpr (std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value) { if (cfgPairCharge != 0 && cfgPairCharge * track1.sign() * track2.sign() < 0) { continue; }