From b9ae9682585b5716c5bb5a7b7af9e0e71c4a4c7a Mon Sep 17 00:00:00 2001 From: Gauthier Legras Date: Mon, 25 May 2026 11:56:45 +0200 Subject: [PATCH 1/3] optimizations for dalitz-selection --- PWGDQ/Tasks/DalitzSelection.cxx | 310 ++++++++++++++++++++++---------- 1 file changed, 220 insertions(+), 90 deletions(-) diff --git a/PWGDQ/Tasks/DalitzSelection.cxx b/PWGDQ/Tasks/DalitzSelection.cxx index 317015a044f..e93389ceea8 100644 --- a/PWGDQ/Tasks/DalitzSelection.cxx +++ b/PWGDQ/Tasks/DalitzSelection.cxx @@ -61,6 +61,7 @@ using namespace o2::framework::expressions; using namespace o2::aod; using namespace o2::soa; + // using MyEvents = soa::Join using MyEventsWithCent = soa::Join; @@ -70,9 +71,14 @@ using MyBarrelTracks = soa::Join; +using MyBarrelTracksNoTOF = soa::Join; + // constexpr static uint32_t EventFillMap = VarManager::ObjTypes::Collision; constexpr static uint32_t EventFillMapWithCent = VarManager::ObjTypes::Collision | VarManager::ObjTypes::CollisionCent; constexpr static uint32_t TrackFillMap = VarManager::ObjTypes::Track | VarManager::ObjTypes::TrackExtra | VarManager::ObjTypes::TrackDCA | VarManager::ObjTypes::TrackPID; +constexpr static uint32_t TrackFillMapNoTOF = VarManager::ObjTypes::Track | VarManager::ObjTypes::TrackExtra | VarManager::ObjTypes::TrackDCA | VarManager::ObjTypes::TrackTPCPID; struct DalitzSelection { Produces dalitzbits; @@ -89,10 +95,11 @@ struct DalitzSelection { Configurable fConfigTrackCutsJSON{"cfgTrackCutsJSON", "", "Additional list of barrel track cuts in JSON format"}; Configurable fConfigTrackCutsProbeJSON{"cfgTrackCutsProbeJSON", "", "Additional list of barrel track cuts for the probe in JSON format"}; Configurable fConfigPairCutsJSON{"cfgPairCutsJSON", "", "Additional list of barrel track cuts in JSON format"}; - Configurable fConfigBarrelTrackPINLow{"cfgBarrelLowPIN", 0.1f, "Low pt cut for Dalitz tracks in the barrel"}; + Configurable fConfigPtLow{"cfgLowPt", 0.1f, "Low pt cut for Dalitz tracks in the barrel"}; Configurable fConfigEtaCut{"cfgEtaCut", 0.9f, "Eta cut for Dalitz tracks in the barrel"}; Configurable fConfigTPCNSigLow{"cfgTPCNSigElLow", -3.f, "Low TPCNSigEl cut for Dalitz tracks in the barrel"}; Configurable fConfigTPCNSigHigh{"cfgTPCNSigElHigh", 3.f, "High TPCNsigEl cut for Dalitz tracks in the barrel"}; + Configurable fConfigTrackSel{"cfgTrackSel", 0, "track selection requirement: 0: all, 1: reject ITS only, 2: reject TPC only, 3: reject ITS only and TPC only"}; } fConfigCuts; // histograms @@ -121,7 +128,7 @@ struct DalitzSelection { o2::parameters::GRPMagField* grpmag = nullptr; int fCurrentRun; // needed to detect if the run changed and trigger update of calibrations etc. - Filter filterBarrelTrack = o2::aod::track::tpcInnerParam >= fConfigCuts.fConfigBarrelTrackPINLow && nabs(o2::aod::track::eta) <= fConfigCuts.fConfigEtaCut && o2::aod::pidtpc::tpcNSigmaEl <= fConfigCuts.fConfigTPCNSigHigh && o2::aod::pidtpc::tpcNSigmaEl >= fConfigCuts.fConfigTPCNSigLow; + Filter filterBarrelTrack = (o2::aod::track::pt >= fConfigCuts.fConfigPtLow) && (nabs(o2::aod::track::eta) <= fConfigCuts.fConfigEtaCut) && ((o2::aod::pidtpc::tpcNSigmaEl <= fConfigCuts.fConfigTPCNSigHigh && o2::aod::pidtpc::tpcNSigmaEl >= fConfigCuts.fConfigTPCNSigLow) || ((o2::aod::track::v001::detectorMap & 2) == 0)) && ((fConfigCuts.fConfigTrackSel != 1 && fConfigCuts.fConfigTrackSel != 3) || ((o2::aod::track::v001::detectorMap & 2) != 0)) && ((fConfigCuts.fConfigTrackSel != 2 && fConfigCuts.fConfigTrackSel != 3) || ((o2::aod::track::v001::detectorMap & 1) != 0)); OutputObj fOutputList{"output"}; //! the histogram manager output list OutputObj fStatsList{"Statistics"}; //! skimming statistics @@ -142,10 +149,12 @@ struct DalitzSelection { std::vector fPairCuts; bool fIsTagAndProbe; // whether we are doing tag and probe, or just symmetric cuts + bool fIsOutputRequested; + bool fSkipEvent; // speed up by skipping next step of event if no track/pair is selected HistogramManager* fHistMan; - void init(o2::framework::InitContext&) + void init(o2::framework::InitContext& context) { fIsTagAndProbe = false; VarManager::SetDefaultVarNames(); @@ -303,17 +312,52 @@ struct DalitzSelection { VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill fOutputList.setObject(fHistMan->GetMainHistogramList()); + + // autodetect whether the dalitz bits are requested + fIsOutputRequested = false; + auto& workflows = context.services().template get(); + // autodetect this table in other devices + for (o2::framework::DeviceSpec const& device : workflows.devices) { + // Check if this device subscribed to the dalitz table + for (auto const& input : device.inputs) { + if (o2::framework::DataSpecUtils::partialMatch(input.matcher, o2::header::DataOrigin("AOD"))) { + auto&& [origin, description, version] = o2::framework::DataSpecUtils::asConcreteDataMatcher(input.matcher); + std::string tableName = "DalitzBits"; + if (input.matcher.binding == tableName) { + LOGF(info, "Device %s has subscribed to %s", device.name, "DalitzBits"); + fIsOutputRequested = true; + } + } + } + } } - template + template void runTrackSelection(TTracks const& tracksBarrel, TEvent const& collision) { + fSkipEvent = true; for (const auto& track1 : tracksBarrel) { uint8_t filterMap = uint8_t(0); uint8_t filterMapProbe = uint8_t(0); int fullTrackIdx = 0; if constexpr (isReassoc) { - auto const& fullTrack = track1.template track_as(); + auto const& fullTrack = track1.template track_as(); + // Basic filter cuts which cannot be applied directly in case of reassoc + if (fullTrack.pt() < fConfigCuts.fConfigPtLow) { + continue; + } + if (abs(fullTrack.eta()) > fConfigCuts.fConfigEtaCut) { + continue; + } + if (fullTrack.hasTPC() && (fullTrack.tpcNSigmaEl() < fConfigCuts.fConfigTPCNSigLow || fullTrack.tpcNSigmaEl() > fConfigCuts.fConfigTPCNSigHigh)) { + continue; + } + if ((fConfigCuts.fConfigTrackSel == 1 || fConfigCuts.fConfigTrackSel == 3) && !fullTrack.hasTPC()) { + continue; + } + if ((fConfigCuts.fConfigTrackSel == 2 || fConfigCuts.fConfigTrackSel == 3) && !fullTrack.hasITS()) { + continue; + } VarManager::FillTrack(fullTrack); VarManager::FillTrackCollision(fullTrack, collision); fullTrackIdx = fullTrack.globalIndex(); @@ -325,6 +369,7 @@ struct DalitzSelection { for (auto cut = fTrackCuts.begin(); cut != fTrackCuts.end(); ++cut, ++i) { if ((*cut).IsSelected(VarManager::fgValues)) { filterMap |= (uint8_t(1) << i); + fSkipEvent = false; } } if (fIsTagAndProbe) { @@ -344,115 +389,149 @@ struct DalitzSelection { } // end loop over tracks } - template + template void runDalitzPairing(TTracks const& tracks1, TTracks const& tracks2, TEvent collision) { if (isReassoc & fConfigOptions.fRemoveDoubleCounting) { - // keep track of selections from previous events to check if the track was already selected or not - fDalitzmapAmbiguity = fDalitzmap; - fDalitzmapProbeAmbiguity = fDalitzmapProbe; + fDalitzmapAmbiguity.clear(); + fDalitzmapProbeAmbiguity.clear(); } + fSkipEvent = true; - for (const auto& [track1, track2] : o2::soa::combinations(CombinationsFullIndexPolicy(tracks1, tracks2))) { - + for (const auto& track1 : tracks1) { int trackIdx1; - int trackIdx2; - bool isLikeSign; + bool isTrack1P; + if constexpr (isReassoc) { - auto const& fullTrack1 = track1.template track_as(); - auto const& fullTrack2 = track2.template track_as(); + auto const& fullTrack1 = track1.template track_as(); trackIdx1 = fullTrack1.globalIndex(); - trackIdx2 = fullTrack2.globalIndex(); - isLikeSign = (fullTrack1.sign() * fullTrack2.sign() > 0); - } else { - trackIdx1 = track1.globalIndex(); - trackIdx2 = track2.globalIndex(); - isLikeSign = (track1.sign() * track2.sign() > 0); - } - - if (trackIdx1 == trackIdx2) { - continue; - } - if (!fIsTagAndProbe && trackIdx1 >= trackIdx2) { - continue; + isTrack1P = fullTrack1.sign() > 0; } - if (!fConfigOptions.fConfigEnableLikeSign && isLikeSign) { - continue; + else { + trackIdx1 = track1.globalIndex(); + isTrack1P = track1.sign() > 0; } - - uint8_t twoTracksFilterMap = fTrackmap[trackIdx1] & (fIsTagAndProbe ? fTrackmapProbe[trackIdx2] : fTrackmap[trackIdx2]); - if (!twoTracksFilterMap) { + + if (!fTrackmap[trackIdx1]) { continue; } + + for (const auto& track2 : tracks2) { + int trackIdx2; + bool isLikeSign; + if constexpr (isReassoc) { + auto const& fullTrack2 = track2.template track_as(); + trackIdx2 = fullTrack2.globalIndex(); + isLikeSign = (isTrack1P && (fullTrack2.sign() > 0)) || (!isTrack1P && (fullTrack2.sign() < 0)); + } else { + trackIdx2 = track2.globalIndex(); + isLikeSign = (isTrack1P && (track2.sign() > 0)) || (!isTrack1P && (track2.sign() < 0)); + } + + if (trackIdx1 == trackIdx2) { + continue; + } + if (!fIsTagAndProbe && trackIdx1 >= trackIdx2) { + continue; + } + if (!fConfigOptions.fConfigEnableLikeSign && isLikeSign) { + continue; + } - // pairing - if constexpr (isReassoc) { - auto const& fullTrack1 = track1.template track_as(); - auto const& fullTrack2 = track2.template track_as(); - VarManager::FillPair(fullTrack1, fullTrack2); - } else { - VarManager::FillPair(track1, track2); - } - - // Fill pair selection map and fill pair histogram - int icut = 0; - auto trackCut = fTrackCuts.begin(); - for (auto pairCut = fPairCuts.begin(); pairCut != fPairCuts.end(); pairCut++, trackCut++, icut++) { - if (!(twoTracksFilterMap & (uint8_t(1) << icut))) { + uint8_t twoTracksFilterMap = fTrackmap[trackIdx1] & (fIsTagAndProbe ? fTrackmapProbe[trackIdx2] : fTrackmap[trackIdx2]); + if (!twoTracksFilterMap) { continue; } - if ((*pairCut).IsSelected(VarManager::fgValues)) { - bool isPairAlreadySelected = false; - if (isReassoc & fConfigOptions.fRemoveDoubleCounting) { - // if we remove double counting and the pair is already selected, we don't fill the histograms - std::pair iPair(trackIdx1, trackIdx2); - if (fAmbiguousPairs.find(iPair) != fAmbiguousPairs.end()) { - if (fAmbiguousPairs[iPair] & (static_cast(1) << icut)) { // if this pair is already stored with this cut - isPairAlreadySelected = true; + + // pairing + if constexpr (isReassoc) { + auto const& fullTrack1 = track1.template track_as(); + auto const& fullTrack2 = track2.template track_as(); + VarManager::FillPair(fullTrack1, fullTrack2); + } else { + VarManager::FillPair(track1, track2); + } + + // Fill pair selection map and fill pair histogram + int icut = 0; + auto trackCut = fTrackCuts.begin(); + for (auto pairCut = fPairCuts.begin(); pairCut != fPairCuts.end(); pairCut++, trackCut++, icut++) { + if (!(twoTracksFilterMap & (uint8_t(1) << icut))) { + continue; + } + if ((*pairCut).IsSelected(VarManager::fgValues)) { + fSkipEvent = false; + bool isPairAlreadySelected = false; + if (isReassoc & fConfigOptions.fRemoveDoubleCounting) { + // if we remove double counting and the pair is already selected, we don't fill the histograms + std::pair iPair(trackIdx1, trackIdx2); + if (fAmbiguousPairs.find(iPair) != fAmbiguousPairs.end()) { + if (fAmbiguousPairs[iPair] & (static_cast(1) << icut)) { // if this pair is already stored with this cut + isPairAlreadySelected = true; + } else { + fAmbiguousPairs[iPair] |= static_cast(1) << icut; + } } else { - fAmbiguousPairs[iPair] |= static_cast(1) << icut; + fAmbiguousPairs[iPair] = static_cast(1) << icut; } - } else { - fAmbiguousPairs[iPair] = static_cast(1) << icut; } - } - if (!isLikeSign) { - fDalitzmap[trackIdx1] |= (uint8_t(1) << icut); - if (fIsTagAndProbe) { - fDalitzmapProbe[trackIdx2] |= (uint8_t(1) << icut); - if (fConfigOptions.fQA && !isPairAlreadySelected) { - fHistMan->FillHistClass(Form("Pair_%s_%s_%s", (*trackCut).GetName(), fTrackCutsProbe.at(icut).GetName(), (*pairCut).GetName()), VarManager::fgValues); + if (!isLikeSign) { + if (isReassoc & fConfigOptions.fRemoveDoubleCounting) { + // if we want to remove double-counting, we fill separately the map for this event and for previous ones, in order to check if it was previously selected + fDalitzmapAmbiguity[trackIdx1] |= (uint8_t(1) << icut); + } + else { + fDalitzmap[trackIdx1] |= (uint8_t(1) << icut); + } + if (fIsTagAndProbe) { + if (isReassoc & fConfigOptions.fRemoveDoubleCounting) { + fDalitzmapProbeAmbiguity[trackIdx1] |= (uint8_t(1) << icut); + } + else { + fDalitzmapProbe[trackIdx2] |= (uint8_t(1) << icut); + } + if (fConfigOptions.fQA && !isPairAlreadySelected) { + fHistMan->FillHistClass(Form("Pair_%s_%s_%s", (*trackCut).GetName(), fTrackCutsProbe.at(icut).GetName(), (*pairCut).GetName()), VarManager::fgValues); + } + } else { + if (isReassoc & fConfigOptions.fRemoveDoubleCounting) { + fDalitzmapAmbiguity[trackIdx1] |= (uint8_t(1) << icut); + } + else { + fDalitzmap[trackIdx2] |= (uint8_t(1) << icut); + } + if (fConfigOptions.fQA && !isPairAlreadySelected) { + fHistMan->FillHistClass(Form("Pair_%s_%s", (*trackCut).GetName(), (*pairCut).GetName()), VarManager::fgValues); + } } } else { - fDalitzmap[trackIdx2] |= (uint8_t(1) << icut); if (fConfigOptions.fQA && !isPairAlreadySelected) { - fHistMan->FillHistClass(Form("Pair_%s_%s", (*trackCut).GetName(), (*pairCut).GetName()), VarManager::fgValues); + fHistMan->FillHistClass(fIsTagAndProbe ? Form("PairLS_%s_%s_%s", (*trackCut).GetName(), fTrackCutsProbe.at(icut).GetName(), (*pairCut).GetName()) : Form("PairLS_%s_%s", (*trackCut).GetName(), (*pairCut).GetName()), VarManager::fgValues); } - } - } else { - if (fConfigOptions.fQA && !isPairAlreadySelected) { - fHistMan->FillHistClass(fIsTagAndProbe ? Form("PairLS_%s_%s_%s", (*trackCut).GetName(), fTrackCutsProbe.at(icut).GetName(), (*pairCut).GetName()) : Form("PairLS_%s_%s", (*trackCut).GetName(), (*pairCut).GetName()), VarManager::fgValues); - } - } // end if like-sign - } // end if isSelected - } // end cut loop + } // end if like-sign + } // end if isSelected + } // end cut loop + } } // end of tracksP,N loop // Fill Hists - if (fConfigOptions.fQA) { + if (fConfigOptions.fQA && !fSkipEvent) { for (const auto& track : tracks1) { uint8_t filterMap; uint8_t filterMapProbe; if constexpr (isReassoc) { - auto const& fullTrack = track.template track_as(); + auto const& fullTrack = track.template track_as(); filterMap = fDalitzmap[fullTrack.globalIndex()]; filterMapProbe = fDalitzmapProbe[fullTrack.globalIndex()]; if (fConfigOptions.fRemoveDoubleCounting) { // we remove track selections which were already selected before - uint8_t previousFilterMap = fDalitzmapAmbiguity[fullTrack.globalIndex()]; - uint8_t previousFilterMapProbe = fDalitzmapProbeAmbiguity[fullTrack.globalIndex()]; - filterMap &= ~previousFilterMap; - filterMapProbe &= ~previousFilterMapProbe; + uint8_t currentFilterMap = fDalitzmapAmbiguity[fullTrack.globalIndex()]; + uint8_t currentFilterMapProbe = fDalitzmapProbeAmbiguity[fullTrack.globalIndex()]; + filterMap = currentFilterMap & ~filterMap; + filterMapProbe = currentFilterMapProbe & ~filterMapProbe; + // Then only we can fill the final map + fDalitzmap[fullTrack.globalIndex()] |= fDalitzmapAmbiguity[fullTrack.globalIndex()]; + fDalitzmapProbe[fullTrack.globalIndex()] |= fDalitzmapProbeAmbiguity[fullTrack.globalIndex()]; } if (!filterMap && !filterMapProbe) { @@ -537,7 +616,6 @@ struct DalitzSelection { bool isEventSelected = fEventCut->IsSelected(VarManager::fgValues); if (isEventSelected) { - reinterpret_cast(fStatsList->At(0))->Fill(0); auto bc = collision.template bc_as(); @@ -548,13 +626,17 @@ struct DalitzSelection { } auto groupedFilteredTracks = filteredTracks.sliceBy(perCollision, collision.globalIndex()); - runTrackSelection(groupedFilteredTracks, nullptr); - runDalitzPairing(groupedFilteredTracks, groupedFilteredTracks, nullptr); + runTrackSelection(groupedFilteredTracks, nullptr); + if (!fSkipEvent) { + runDalitzPairing(groupedFilteredTracks, groupedFilteredTracks, nullptr); + } } } - for (const auto& track : tracks) { // Fill dalitz bits - dalitzbits(fIsTagAndProbe ? fDalitzmapProbe[track.globalIndex()] : fDalitzmap[track.globalIndex()]); + if (fIsOutputRequested) { + for (const auto& track : tracks) { // Fill dalitz bits + dalitzbits(fIsTagAndProbe ? fDalitzmapProbe[track.globalIndex()] : fDalitzmap[track.globalIndex()]); + } } } @@ -587,13 +669,60 @@ struct DalitzSelection { } auto groupedTracksAssoc = trackAssocs.sliceBy(trackIndicesPerCollision, collision.globalIndex()); - runTrackSelection(groupedTracksAssoc, collision); - runDalitzPairing(groupedTracksAssoc, groupedTracksAssoc, collision); + runTrackSelection(groupedTracksAssoc, collision); + if (!fSkipEvent) { + runDalitzPairing(groupedTracksAssoc, groupedTracksAssoc, collision); + } } } - for (const auto& track : tracks) { // Fill dalitz bits - dalitzbits(fIsTagAndProbe ? fDalitzmapProbe[track.globalIndex()] : fDalitzmap[track.globalIndex()]); + if (fIsOutputRequested) { + for (const auto& track : tracks) { // Fill dalitz bits + dalitzbits(fIsTagAndProbe ? fDalitzmapProbe[track.globalIndex()] : fDalitzmap[track.globalIndex()]); + } + } + } + + void processFullTracksWithAssocNoTOF(MyEventsWithCent const& collisions, aod::BCsWithTimestamps const&, MyBarrelTracksNoTOF const& tracks, TrackAssoc const& trackAssocs) + { + + const int pairType = VarManager::kDecayToEE; + fDalitzmap.clear(); + fDalitzmapProbe.clear(); + fDalitzmapAmbiguity.clear(); + fDalitzmapProbeAmbiguity.clear(); + fAmbiguousPairs.clear(); + + for (const auto& collision : collisions) { + fTrackmap.clear(); + fTrackmapProbe.clear(); + VarManager::ResetValues(VarManager::kNRunWiseVariables, VarManager::kNBarrelTrackVariables); + VarManager::FillEvent(collision); + bool isEventSelected = fEventCut->IsSelected(VarManager::fgValues); + + if (isEventSelected) { + + reinterpret_cast(fStatsList->At(0))->Fill(0); + + auto bc = collision.template bc_as(); + + if (fCurrentRun != bc.runNumber()) { + initNewRun(bc.timestamp()); + fCurrentRun = bc.runNumber(); + } + + auto groupedTracksAssoc = trackAssocs.sliceBy(trackIndicesPerCollision, collision.globalIndex()); + runTrackSelection(groupedTracksAssoc, collision); + if (!fSkipEvent) { + runDalitzPairing(groupedTracksAssoc, groupedTracksAssoc, collision); + } + } + } + + if (fIsOutputRequested) { + for (const auto& track : tracks) { // Fill dalitz bits + dalitzbits(fIsTagAndProbe ? fDalitzmapProbe[track.globalIndex()] : fDalitzmap[track.globalIndex()]); + } } } @@ -601,6 +730,7 @@ struct DalitzSelection { { } + PROCESS_SWITCH(DalitzSelection, processFullTracksWithAssocNoTOF, "Run Dalitz selection on AO2D tables with reassociation and without TOF PID", false); PROCESS_SWITCH(DalitzSelection, processFullTracksWithAssoc, "Run Dalitz selection on AO2D tables with reassociation", false); PROCESS_SWITCH(DalitzSelection, processFullTracks, "Run Dalitz selection on AO2D tables", false); PROCESS_SWITCH(DalitzSelection, processDummy, "Do nothing", false); From d7b74894193d332a5c16fad6b053a9043365d6be Mon Sep 17 00:00:00 2001 From: Gauthier Legras Date: Mon, 25 May 2026 11:57:26 +0200 Subject: [PATCH 2/3] clang format --- PWGDQ/Tasks/DalitzSelection.cxx | 37 ++++++++++++++------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/PWGDQ/Tasks/DalitzSelection.cxx b/PWGDQ/Tasks/DalitzSelection.cxx index e93389ceea8..0a77423948d 100644 --- a/PWGDQ/Tasks/DalitzSelection.cxx +++ b/PWGDQ/Tasks/DalitzSelection.cxx @@ -61,7 +61,6 @@ using namespace o2::framework::expressions; using namespace o2::aod; using namespace o2::soa; - // using MyEvents = soa::Join using MyEventsWithCent = soa::Join; @@ -72,8 +71,8 @@ using MyBarrelTracks = soa::Join; using MyBarrelTracksNoTOF = soa::Join; + aod::pidTPCFullEl, aod::pidTPCFullPi, aod::pidTPCFullMu, + aod::pidTPCFullKa, aod::pidTPCFullPr>; // constexpr static uint32_t EventFillMap = VarManager::ObjTypes::Collision; constexpr static uint32_t EventFillMapWithCent = VarManager::ObjTypes::Collision | VarManager::ObjTypes::CollisionCent; @@ -312,7 +311,7 @@ struct DalitzSelection { VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill fOutputList.setObject(fHistMan->GetMainHistogramList()); - + // autodetect whether the dalitz bits are requested fIsOutputRequested = false; auto& workflows = context.services().template get(); @@ -329,7 +328,7 @@ struct DalitzSelection { } } } - } + } } template @@ -406,16 +405,15 @@ struct DalitzSelection { auto const& fullTrack1 = track1.template track_as(); trackIdx1 = fullTrack1.globalIndex(); isTrack1P = fullTrack1.sign() > 0; - } - else { + } else { trackIdx1 = track1.globalIndex(); isTrack1P = track1.sign() > 0; } - + if (!fTrackmap[trackIdx1]) { continue; } - + for (const auto& track2 : tracks2) { int trackIdx2; bool isLikeSign; @@ -427,7 +425,7 @@ struct DalitzSelection { trackIdx2 = track2.globalIndex(); isLikeSign = (isTrack1P && (track2.sign() > 0)) || (!isTrack1P && (track2.sign() < 0)); } - + if (trackIdx1 == trackIdx2) { continue; } @@ -442,7 +440,7 @@ struct DalitzSelection { if (!twoTracksFilterMap) { continue; } - + // pairing if constexpr (isReassoc) { auto const& fullTrack1 = track1.template track_as(); @@ -479,25 +477,22 @@ struct DalitzSelection { if (isReassoc & fConfigOptions.fRemoveDoubleCounting) { // if we want to remove double-counting, we fill separately the map for this event and for previous ones, in order to check if it was previously selected fDalitzmapAmbiguity[trackIdx1] |= (uint8_t(1) << icut); - } - else { + } else { fDalitzmap[trackIdx1] |= (uint8_t(1) << icut); } if (fIsTagAndProbe) { if (isReassoc & fConfigOptions.fRemoveDoubleCounting) { fDalitzmapProbeAmbiguity[trackIdx1] |= (uint8_t(1) << icut); - } - else { + } else { fDalitzmapProbe[trackIdx2] |= (uint8_t(1) << icut); } if (fConfigOptions.fQA && !isPairAlreadySelected) { fHistMan->FillHistClass(Form("Pair_%s_%s_%s", (*trackCut).GetName(), fTrackCutsProbe.at(icut).GetName(), (*pairCut).GetName()), VarManager::fgValues); } - } else { + } else { if (isReassoc & fConfigOptions.fRemoveDoubleCounting) { fDalitzmapAmbiguity[trackIdx1] |= (uint8_t(1) << icut); - } - else { + } else { fDalitzmap[trackIdx2] |= (uint8_t(1) << icut); } if (fConfigOptions.fQA && !isPairAlreadySelected) { @@ -510,8 +505,8 @@ struct DalitzSelection { } } // end if like-sign } // end if isSelected - } // end cut loop - } + } // end cut loop + } } // end of tracksP,N loop // Fill Hists @@ -682,7 +677,7 @@ struct DalitzSelection { } } } - + void processFullTracksWithAssocNoTOF(MyEventsWithCent const& collisions, aod::BCsWithTimestamps const&, MyBarrelTracksNoTOF const& tracks, TrackAssoc const& trackAssocs) { From b942dcedc521b33e262ea6ced31a56d7492f20b7 Mon Sep 17 00:00:00 2001 From: Gauthier Legras Date: Mon, 25 May 2026 12:31:59 +0200 Subject: [PATCH 3/3] small fix --- PWGDQ/Tasks/DalitzSelection.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PWGDQ/Tasks/DalitzSelection.cxx b/PWGDQ/Tasks/DalitzSelection.cxx index 0a77423948d..0035b0a37e9 100644 --- a/PWGDQ/Tasks/DalitzSelection.cxx +++ b/PWGDQ/Tasks/DalitzSelection.cxx @@ -320,7 +320,6 @@ struct DalitzSelection { // Check if this device subscribed to the dalitz table for (auto const& input : device.inputs) { if (o2::framework::DataSpecUtils::partialMatch(input.matcher, o2::header::DataOrigin("AOD"))) { - auto&& [origin, description, version] = o2::framework::DataSpecUtils::asConcreteDataMatcher(input.matcher); std::string tableName = "DalitzBits"; if (input.matcher.binding == tableName) { LOGF(info, "Device %s has subscribed to %s", device.name, "DalitzBits"); @@ -345,7 +344,7 @@ struct DalitzSelection { if (fullTrack.pt() < fConfigCuts.fConfigPtLow) { continue; } - if (abs(fullTrack.eta()) > fConfigCuts.fConfigEtaCut) { + if (std::fabs(fullTrack.eta()) > fConfigCuts.fConfigEtaCut) { continue; } if (fullTrack.hasTPC() && (fullTrack.tpcNSigmaEl() < fConfigCuts.fConfigTPCNSigLow || fullTrack.tpcNSigmaEl() > fConfigCuts.fConfigTPCNSigHigh)) {