From c024131905c8f0ba4d0b9b77704a11923373e614 Mon Sep 17 00:00:00 2001 From: abmodak <67369858+abmodak@users.noreply.github.com> Date: Sun, 19 Oct 2025 12:38:28 +0200 Subject: [PATCH 1/3] Reorganise histograms to reduce memory consumption --- .../Tasks/longrangeCorrelation.cxx | 266 ++++++------------ 1 file changed, 89 insertions(+), 177 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/longrangeCorrelation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/longrangeCorrelation.cxx index e17a88c1cab..f5ff447e8a8 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/longrangeCorrelation.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/longrangeCorrelation.cxx @@ -7,7 +7,7 @@ // // 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. +// or submit itself to any jurisdicstion. /// /// \file longrangeCorrelation.cxx /// @@ -98,7 +98,12 @@ enum KindOfParticles { PROTONS }; -static constexpr std::string_view kCorrType[] = {"Ft0aGlobal/", "Ft0cGlobal/", "MftGlobal/", "Ft0aMft/", "Ft0aFt0c/"}; +static constexpr std::string_view kCorrType[] = { + "Ft0aGlobal/", + "Ft0cGlobal/", + "MftGlobal/", + "Ft0aMft/", + "Ft0aFt0c/"}; static constexpr std::string_view kEvntType[] = {"SE/", "ME/"}; auto static constexpr kMinFt0cCell = 96; auto static constexpr kMinCharge = 3.f; @@ -124,8 +129,6 @@ struct LongrangeCorrelation { Configurable cfgPtCutMin{"cfgPtCutMin", 0.2f, "minimum accepted track pT"}; Configurable cfgPtCutMax{"cfgPtCutMax", 10.0f, "maximum accepted track pT"}; Configurable mixingParameter{"mixingParameter", 5, "how many events are mixed"}; - Configurable cfgMinMult{"cfgMinMult", 0, "Minimum multiplicity for collision"}; - Configurable cfgMaxMult{"cfgMaxMult", 10, "Maximum multiplicity for collision"}; Configurable cfigMftEtaMax{"cfigMftEtaMax", -2.5f, "Maximum MFT eta cut"}; Configurable cfigMftEtaMin{"cfigMftEtaMin", -3.6f, "Minimum MFT eta cut"}; Configurable cfigMftDcaxy{"cfigMftDcaxy", 2.0f, "cut on DCA xy for MFT tracks"}; @@ -177,16 +180,16 @@ struct LongrangeCorrelation { Preslice perColMC = aod::track::collisionId; Preslice perColMft = aod::fwdtrack::collisionId; - OutputObj sameFt0aGlobal{Form("sameEventFt0aGlobal_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult))}; - OutputObj mixedFt0aGlobal{Form("mixedEventFt0aGlobal_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult))}; - OutputObj sameFt0cGlobal{Form("sameEventFt0cGlobal_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult))}; - OutputObj mixedFt0cGlobal{Form("mixedEventFt0cGlobal_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult))}; - OutputObj sameMftGlobal{Form("sameEventMftGlobal_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult))}; - OutputObj mixedMftGlobal{Form("mixedEventMftGlobal_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult))}; - OutputObj sameFt0aMft{Form("sameEventFt0aMft_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult))}; - OutputObj mixedFt0aMft{Form("mixedEventFt0aMft_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult))}; - OutputObj sameFt0aFt0c{Form("sameEventFt0aFt0c_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult))}; - OutputObj mixedFt0aFt0c{Form("mixedEventFt0aFt0c_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult))}; + OutputObj sameFt0aGlobal{"sameEventFt0aGlobal"}; + OutputObj mixedFt0aGlobal{"mixedEventFt0aGlobal"}; + OutputObj sameFt0cGlobal{"sameEventFt0cGlobal"}; + OutputObj mixedFt0cGlobal{"mixedEventFt0cGlobal"}; + OutputObj sameMftGlobal{"sameEventMftGlobal"}; + OutputObj mixedMftGlobal{"mixedEventMftGlobal"}; + OutputObj sameFt0aMft{"sameEventFt0aMft"}; + OutputObj mixedFt0aMft{"mixedEventFt0aMft"}; + OutputObj sameFt0aFt0c{"sameEventFt0aFt0c"}; + OutputObj mixedFt0aFt0c{"mixedEventFt0aFt0c"}; // corrections TH3D* hTrkEff = nullptr; @@ -200,15 +203,14 @@ struct LongrangeCorrelation { o2::aod::ITSResponse itsResponse; template - void addHistos() + void addhistosQA() { histos.add(Form("%s%shMult", kCorrType[corrType].data(), kEvntType[evntType].data()), "", kTH1D, {axisMultiplicity}); histos.add(Form("%s%sTrig_etavsphi", kCorrType[corrType].data(), kEvntType[evntType].data()), "", kTH2D, {axisPhi, axisEtaTrig}); histos.add(Form("%s%sTrig_eta", kCorrType[corrType].data(), kEvntType[evntType].data()), "", kTH1D, {axisEtaTrig}); histos.add(Form("%s%sTrig_phi", kCorrType[corrType].data(), kEvntType[evntType].data()), "", kTH1D, {axisPhi}); histos.add(Form("%s%sTrig_pt", kCorrType[corrType].data(), kEvntType[evntType].data()), "", kTH1D, {axisPtTrigger}); - histos.add(Form("%s%shMult_used", kCorrType[corrType].data(), kEvntType[evntType].data()), "", kTH1F, {axisMultiplicity}); - histos.add(Form("%s%sTrig_hist", kCorrType[corrType].data(), kEvntType[evntType].data()), "", kTHnSparseF, {axisSample, axisVtxZ, axisPtTrigger}); + histos.add(Form("%s%sTrig_hist", kCorrType[corrType].data(), kEvntType[evntType].data()), "", kTHnSparseF, {axisSample, axisVtxZ, axisPtTrigger, axisMultiplicity}); histos.add(Form("%s%sAssoc_amp", kCorrType[corrType].data(), kEvntType[evntType].data()), "", kTH2D, {channelFt0aAxis, amplitudeFt0a}); histos.add(Form("%s%sAssoc_eta", kCorrType[corrType].data(), kEvntType[evntType].data()), "", kTH1D, {axisEtaAssoc}); histos.add(Form("%s%sAssoc_phi", kCorrType[corrType].data(), kEvntType[evntType].data()), "", kTH1D, {axisPhi}); @@ -239,6 +241,7 @@ struct LongrangeCorrelation { {axisEtaEfficiency, "#eta"}}; std::vector userAxis; + userAxis.emplace_back(axisMultiplicity, "multiplicity"); tofNsigmaCut = tofNsigmaPidCut; itsNsigmaCut = itsNsigmaPidCut; @@ -258,38 +261,38 @@ struct LongrangeCorrelation { } if (doprocessFt0aGlobalSE || doprocessFt0aGlobalME) { - addHistos(); - addHistos(); - sameFt0aGlobal.setObject(new CorrelationContainer(Form("sameEventFt0aGlobal_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult)), Form("sameEventFt0aGlobal_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult)), corrAxis, effAxis, userAxis)); - mixedFt0aGlobal.setObject(new CorrelationContainer(Form("mixedEventFt0aGlobal_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult)), Form("mixedEventFt0aGlobal_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult)), corrAxis, effAxis, userAxis)); + addhistosQA(); + histos.add("Ft0aGlobal/ME/deltaEta_deltaPhi", "", kTH2D, {axisDeltaPhi, axisDeltaEta}); + sameFt0aGlobal.setObject(new CorrelationContainer("sameEventFt0aGlobal", "sameEventFt0aGlobal", corrAxis, effAxis, userAxis)); + mixedFt0aGlobal.setObject(new CorrelationContainer("mixedEventFt0aGlobal", "mixedEventFt0aGlobal", corrAxis, effAxis, userAxis)); } if (doprocessFt0cGlobalSE || doprocessFt0cGlobalME) { - addHistos(); - addHistos(); - sameFt0cGlobal.setObject(new CorrelationContainer(Form("sameEventFt0cGlobal_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult)), Form("sameEventFt0cGlobal_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult)), corrAxis, effAxis, userAxis)); - mixedFt0cGlobal.setObject(new CorrelationContainer(Form("mixedEventFt0cGlobal_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult)), Form("mixedEventFt0cGlobal_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult)), corrAxis, effAxis, userAxis)); + addhistosQA(); + histos.add("Ft0cGlobal/ME/deltaEta_deltaPhi", "", kTH2D, {axisDeltaPhi, axisDeltaEta}); + sameFt0cGlobal.setObject(new CorrelationContainer("sameEventFt0cGlobal", "sameEventFt0cGlobal", corrAxis, effAxis, userAxis)); + mixedFt0cGlobal.setObject(new CorrelationContainer("mixedEventFt0cGlobal", "mixedEventFt0cGlobal", corrAxis, effAxis, userAxis)); } if (doprocessMftGlobalSE || doprocessMftGlobalME) { - addHistos(); - addHistos(); - sameMftGlobal.setObject(new CorrelationContainer(Form("sameEventMftGlobal_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult)), Form("sameEventMftGlobal_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult)), corrAxis, effAxis, userAxis)); - mixedMftGlobal.setObject(new CorrelationContainer(Form("mixedEventMftGlobal_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult)), Form("mixedEventMftGlobal_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult)), corrAxis, effAxis, userAxis)); + addhistosQA(); + histos.add("MftGlobal/ME/deltaEta_deltaPhi", "", kTH2D, {axisDeltaPhi, axisDeltaEta}); + sameMftGlobal.setObject(new CorrelationContainer("sameEventMftGlobal", "sameEventMftGlobal", corrAxis, effAxis, userAxis)); + mixedMftGlobal.setObject(new CorrelationContainer("mixedEventMftGlobal", "mixedEventMftGlobal", corrAxis, effAxis, userAxis)); } if (doprocessFt0aMftSE || doprocessFt0aMftME) { - addHistos(); - addHistos(); - sameFt0aMft.setObject(new CorrelationContainer(Form("sameEventFt0aMft_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult)), Form("sameEventFt0aMft_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult)), corrAxis, effAxis, userAxis)); - mixedFt0aMft.setObject(new CorrelationContainer(Form("mixedEventFt0aMft_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult)), Form("mixedEventFt0aMft_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult)), corrAxis, effAxis, userAxis)); + addhistosQA(); + histos.add("Ft0aMft/ME/deltaEta_deltaPhi", "", kTH2D, {axisDeltaPhi, axisDeltaEta}); + sameFt0aMft.setObject(new CorrelationContainer("sameEventFt0aMft", "sameEventFt0aMft", corrAxis, effAxis, userAxis)); + mixedFt0aMft.setObject(new CorrelationContainer("mixedEventFt0aMft", "mixedEventFt0aMft", corrAxis, effAxis, userAxis)); } if (doprocessFt0aFt0cSE || doprocessFt0aFt0cME) { - addHistos(); - addHistos(); - sameFt0aFt0c.setObject(new CorrelationContainer(Form("sameEventFt0aFt0c_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult)), Form("sameEventFt0aFt0c_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult)), corrAxis, effAxis, userAxis)); - mixedFt0aFt0c.setObject(new CorrelationContainer(Form("mixedEventFt0aFt0c_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult)), Form("mixedEventFt0aFt0c_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult)), corrAxis, effAxis, userAxis)); + addhistosQA(); + histos.add("Ft0aFt0c/ME/deltaEta_deltaPhi", "", kTH2D, {axisDeltaPhi, axisDeltaEta}); + sameFt0aFt0c.setObject(new CorrelationContainer("sameEventFt0aFt0c", "sameEventFt0aFt0c", corrAxis, effAxis, userAxis)); + mixedFt0aFt0c.setObject(new CorrelationContainer("mixedEventFt0aFt0c", "mixedEventFt0aFt0c", corrAxis, effAxis, userAxis)); } if (doprocessEff) { @@ -361,32 +364,13 @@ struct LongrangeCorrelation { return true; } - template - void fillYieldTpc(TTracks tracks) + template + void fillTrackQA(TTrack const& track) { - histos.fill(HIST(kCorrType[corrType]) + HIST(kEvntType[evntType]) + HIST("hMult"), tracks.size()); - for (auto const& iTrk : tracks) { - if (cfgTrackPid && getTrackPID(iTrk) != cfgTrackPid) - continue; // if PID is selected, check if the track has the right PID - histos.fill(HIST(kCorrType[corrType]) + HIST(kEvntType[evntType]) + HIST("Trig_etavsphi"), iTrk.phi(), iTrk.eta()); - histos.fill(HIST(kCorrType[corrType]) + HIST(kEvntType[evntType]) + HIST("Trig_eta"), iTrk.eta()); - histos.fill(HIST(kCorrType[corrType]) + HIST(kEvntType[evntType]) + HIST("Trig_phi"), iTrk.phi()); - histos.fill(HIST(kCorrType[corrType]) + HIST(kEvntType[evntType]) + HIST("Trig_pt"), iTrk.pt()); - } - } - - template - void fillYieldMft(TTracks tracks) - { - histos.fill(HIST(kCorrType[corrType]) + HIST(kEvntType[evntType]) + HIST("hMult"), tracks.size()); - for (auto const& iTrk : tracks) { - auto phi = iTrk.phi(); - o2::math_utils::bringTo02Pi(phi); - histos.fill(HIST(kCorrType[corrType]) + HIST(kEvntType[evntType]) + HIST("Trig_etavsphi"), phi, iTrk.eta()); - histos.fill(HIST(kCorrType[corrType]) + HIST(kEvntType[evntType]) + HIST("Trig_eta"), iTrk.eta()); - histos.fill(HIST(kCorrType[corrType]) + HIST(kEvntType[evntType]) + HIST("Trig_phi"), phi); - histos.fill(HIST(kCorrType[corrType]) + HIST(kEvntType[evntType]) + HIST("Trig_pt"), iTrk.pt()); - } + histos.fill(HIST(kCorrType[corrType]) + HIST(kEvntType[evntType]) + HIST("Trig_etavsphi"), track.phi(), track.eta()); + histos.fill(HIST(kCorrType[corrType]) + HIST(kEvntType[evntType]) + HIST("Trig_eta"), track.eta()); + histos.fill(HIST(kCorrType[corrType]) + HIST(kEvntType[evntType]) + HIST("Trig_phi"), track.phi()); + histos.fill(HIST(kCorrType[corrType]) + HIST(kEvntType[evntType]) + HIST("Trig_pt"), track.pt()); } template @@ -533,37 +517,30 @@ struct LongrangeCorrelation { template void fillCorrFt0aGlobal(TTarget target, TTriggers const& triggers, TFT0s const& ft0, bool mixing, float vz, float multiplicity) { + histos.fill(HIST("Ft0aGlobal/SE/hMult"), multiplicity); int fSampleIndex = gRandom->Uniform(0, cfgSampleSize); - if (!mixing) - histos.fill(HIST("Ft0aGlobal/SE/hMult_used"), multiplicity); - for (auto const& triggerTrack : triggers) { if (cfgTrackPid && getTrackPID(triggerTrack) != cfgTrackPid) continue; // if PID is selected, check if the track has the right PID + float trkeffw = 1.0f; if (isUseEffCorr) trkeffw = getTrkEffCorr(triggerTrack.eta(), triggerTrack.pt(), vz); - if (!mixing) - histos.fill(HIST("Ft0aGlobal/SE/Trig_hist"), fSampleIndex, vz, triggerTrack.pt(), trkeffw); + if (!mixing) { + fillTrackQA(triggerTrack); + histos.fill(HIST("Ft0aGlobal/SE/Trig_hist"), fSampleIndex, vz, triggerTrack.pt(), multiplicity, trkeffw); + } for (std::size_t iCh = 0; iCh < ft0.channelA().size(); iCh++) { auto chanelid = ft0.channelA()[iCh]; float ampl = ft0.amplitudeA()[iCh]; - if (mixing) - histos.fill(HIST("Ft0aGlobal/ME/Assoc_amp"), chanelid, ampl); - else - histos.fill(HIST("Ft0aGlobal/SE/Assoc_amp"), chanelid, ampl); - auto phi = getPhiFT0(chanelid, 0); auto eta = getEtaFT0(chanelid, 0); - if (mixing) { - histos.fill(HIST("Ft0aGlobal/ME/Assoc_eta"), eta); - histos.fill(HIST("Ft0aGlobal/ME/Assoc_phi"), phi); - histos.fill(HIST("Ft0aGlobal/ME/Assoc_etavsphi"), phi, eta); - } else { + if (!mixing) { + histos.fill(HIST("Ft0aGlobal/SE/Assoc_amp"), chanelid, ampl); histos.fill(HIST("Ft0aGlobal/SE/Assoc_eta"), eta); histos.fill(HIST("Ft0aGlobal/SE/Assoc_phi"), phi); histos.fill(HIST("Ft0aGlobal/SE/Assoc_etavsphi"), phi, eta); @@ -574,7 +551,7 @@ struct LongrangeCorrelation { histos.fill(HIST("Ft0aGlobal/ME/deltaEta_deltaPhi"), deltaPhi, deltaEta, trkeffw); else histos.fill(HIST("Ft0aGlobal/SE/deltaEta_deltaPhi"), deltaPhi, deltaEta, trkeffw); - target->getPairHist()->Fill(step, fSampleIndex, vz, triggerTrack.pt(), triggerTrack.pt(), deltaPhi, deltaEta, trkeffw); + target->getPairHist()->Fill(step, fSampleIndex, vz, triggerTrack.pt(), triggerTrack.pt(), deltaPhi, deltaEta, multiplicity, trkeffw); } // associated ft0 tracks } // trigger tracks } // fillCorrFt0aGlobal @@ -582,47 +559,42 @@ struct LongrangeCorrelation { template void fillCorrFt0cGlobal(TTarget target, TTriggers const& triggers, TFT0s const& ft0, bool mixing, float vz, float multiplicity) { + histos.fill(HIST("Ft0cGlobal/SE/hMult"), multiplicity); int fSampleIndex = gRandom->Uniform(0, cfgSampleSize); - if (!mixing) - histos.fill(HIST("Ft0cGlobal/SE/hMult_used"), multiplicity); for (auto const& triggerTrack : triggers) { if (cfgTrackPid && getTrackPID(triggerTrack) != cfgTrackPid) continue; // if PID is selected, check if the track has the right PID + float trkeffw = 1.0f; if (isUseEffCorr) trkeffw = getTrkEffCorr(triggerTrack.eta(), triggerTrack.pt(), vz); - if (!mixing) - histos.fill(HIST("Ft0cGlobal/SE/Trig_hist"), fSampleIndex, vz, triggerTrack.pt(), trkeffw); + if (!mixing) { + fillTrackQA(triggerTrack); + histos.fill(HIST("Ft0cGlobal/SE/Trig_hist"), fSampleIndex, vz, triggerTrack.pt(), multiplicity, trkeffw); + } for (std::size_t iCh = 0; iCh < ft0.channelC().size(); iCh++) { auto chanelid = ft0.channelC()[iCh] + 96; float ampl = ft0.amplitudeC()[iCh]; - if (mixing) - histos.fill(HIST("Ft0cGlobal/ME/Assoc_amp"), chanelid, ampl); - else - histos.fill(HIST("Ft0cGlobal/SE/Assoc_amp"), chanelid, ampl); - auto phi = getPhiFT0(chanelid, 1); auto eta = getEtaFT0(chanelid, 1); - if (mixing) { - histos.fill(HIST("Ft0cGlobal/ME/Assoc_eta"), eta); - histos.fill(HIST("Ft0cGlobal/ME/Assoc_phi"), phi); - histos.fill(HIST("Ft0cGlobal/ME/Assoc_etavsphi"), phi, eta); - } else { + if (!mixing) { + histos.fill(HIST("Ft0cGlobal/SE/Assoc_amp"), chanelid, ampl); histos.fill(HIST("Ft0cGlobal/SE/Assoc_eta"), eta); histos.fill(HIST("Ft0cGlobal/SE/Assoc_phi"), phi); histos.fill(HIST("Ft0cGlobal/SE/Assoc_etavsphi"), phi, eta); } + float deltaPhi = RecoDecay::constrainAngle(triggerTrack.phi() - phi, -PIHalf); float deltaEta = triggerTrack.eta() - eta; if (mixing) histos.fill(HIST("Ft0cGlobal/ME/deltaEta_deltaPhi"), deltaPhi, deltaEta, trkeffw); else histos.fill(HIST("Ft0cGlobal/SE/deltaEta_deltaPhi"), deltaPhi, deltaEta, trkeffw); - target->getPairHist()->Fill(step, fSampleIndex, vz, triggerTrack.pt(), triggerTrack.pt(), deltaPhi, deltaEta, trkeffw); + target->getPairHist()->Fill(step, fSampleIndex, vz, triggerTrack.pt(), triggerTrack.pt(), deltaPhi, deltaEta, multiplicity, trkeffw); } // associated ft0 tracks } // trigger tracks } // fillCorrFt0cGlobal @@ -630,18 +602,20 @@ struct LongrangeCorrelation { template void fillCorrMftGlobal(TTarget target, TTriggers const& triggers, TMFTs const& mft, bool mixing, float vz, float multiplicity) { + histos.fill(HIST("MftGlobal/SE/hMult"), multiplicity); int fSampleIndex = gRandom->Uniform(0, cfgSampleSize); - if (!mixing) - histos.fill(HIST("MftGlobal/SE/hMult_used"), multiplicity); for (auto const& triggerTrack : triggers) { if (cfgTrackPid && getTrackPID(triggerTrack) != cfgTrackPid) continue; // if PID is selected, check if the track has the right PID + float trkeffw = 1.0f; if (isUseEffCorr) trkeffw = getTrkEffCorr(triggerTrack.eta(), triggerTrack.pt(), vz); - if (!mixing) - histos.fill(HIST("MftGlobal/SE/Trig_hist"), fSampleIndex, vz, triggerTrack.pt(), trkeffw); + if (!mixing) { + fillTrackQA(triggerTrack); + histos.fill(HIST("MftGlobal/SE/Trig_hist"), fSampleIndex, vz, triggerTrack.pt(), multiplicity, trkeffw); + } for (auto const& assoTrack : mft) { if (!isMftTrackSelected(assoTrack)) { @@ -649,22 +623,20 @@ struct LongrangeCorrelation { } auto phi = assoTrack.phi(); o2::math_utils::bringTo02Pi(phi); - if (mixing) { - histos.fill(HIST("MftGlobal/ME/Assoc_eta"), assoTrack.eta()); - histos.fill(HIST("MftGlobal/ME/Assoc_phi"), phi); - histos.fill(HIST("MftGlobal/ME/Assoc_etavsphi"), phi, assoTrack.eta()); - } else { + + if (!mixing) { histos.fill(HIST("MftGlobal/SE/Assoc_eta"), assoTrack.eta()); histos.fill(HIST("MftGlobal/SE/Assoc_phi"), phi); histos.fill(HIST("MftGlobal/SE/Assoc_etavsphi"), phi, assoTrack.eta()); } + float deltaPhi = RecoDecay::constrainAngle(triggerTrack.phi() - phi, -PIHalf); float deltaEta = triggerTrack.eta() - assoTrack.eta(); if (mixing) histos.fill(HIST("MftGlobal/ME/deltaEta_deltaPhi"), deltaPhi, deltaEta, trkeffw); else histos.fill(HIST("MftGlobal/SE/deltaEta_deltaPhi"), deltaPhi, deltaEta, trkeffw); - target->getPairHist()->Fill(step, fSampleIndex, vz, triggerTrack.pt(), assoTrack.pt(), deltaPhi, deltaEta, trkeffw); + target->getPairHist()->Fill(step, fSampleIndex, vz, triggerTrack.pt(), assoTrack.pt(), deltaPhi, deltaEta, multiplicity, trkeffw); } // associated mft tracks } // trigger tracks } // fillCorrMftGlobal @@ -672,36 +644,30 @@ struct LongrangeCorrelation { template void fillCorrFt0aMft(TTarget target, TTriggers const& triggers, TFT0s const& ft0, bool mixing, float vz, float multiplicity) { + histos.fill(HIST("Ft0aMft/SE/hMult"), multiplicity); int fSampleIndex = gRandom->Uniform(0, cfgSampleSize); - if (!mixing) - histos.fill(HIST("Ft0aMft/SE/hMult_used"), multiplicity); for (auto const& triggerTrack : triggers) { if (!isMftTrackSelected(triggerTrack)) { continue; } - if (!mixing) - histos.fill(HIST("Ft0aMft/SE/Trig_hist"), fSampleIndex, vz, triggerTrack.pt()); auto trigphi = triggerTrack.phi(); o2::math_utils::bringTo02Pi(trigphi); + if (!mixing) { + fillTrackQA(triggerTrack); + histos.fill(HIST("Ft0aMft/SE/Trig_hist"), fSampleIndex, vz, triggerTrack.pt(), multiplicity); + } + for (std::size_t iCh = 0; iCh < ft0.channelA().size(); iCh++) { auto chanelid = ft0.channelA()[iCh]; float ampl = ft0.amplitudeA()[iCh]; - if (mixing) - histos.fill(HIST("Ft0aMft/ME/Assoc_amp"), chanelid, ampl); - else - histos.fill(HIST("Ft0aMft/SE/Assoc_amp"), chanelid, ampl); - auto phi = getPhiFT0(chanelid, 0); auto eta = getEtaFT0(chanelid, 0); - if (mixing) { - histos.fill(HIST("Ft0aMft/ME/Assoc_eta"), eta); - histos.fill(HIST("Ft0aMft/ME/Assoc_phi"), phi); - histos.fill(HIST("Ft0aMft/ME/Assoc_etavsphi"), phi, eta); - } else { + if (!mixing) { + histos.fill(HIST("Ft0aMft/SE/Assoc_amp"), chanelid, ampl); histos.fill(HIST("Ft0aMft/SE/Assoc_eta"), eta); histos.fill(HIST("Ft0aMft/SE/Assoc_phi"), phi); histos.fill(HIST("Ft0aMft/SE/Assoc_etavsphi"), phi, eta); @@ -713,7 +679,7 @@ struct LongrangeCorrelation { histos.fill(HIST("Ft0aMft/ME/deltaEta_deltaPhi"), deltaPhi, deltaEta); else histos.fill(HIST("Ft0aMft/SE/deltaEta_deltaPhi"), deltaPhi, deltaEta); - target->getPairHist()->Fill(step, fSampleIndex, vz, triggerTrack.pt(), triggerTrack.pt(), deltaPhi, deltaEta); + target->getPairHist()->Fill(step, fSampleIndex, vz, triggerTrack.pt(), triggerTrack.pt(), deltaPhi, deltaEta, multiplicity); } // associated ft0 tracks } // trigger tracks } // fillCorrFt0aMft @@ -721,26 +687,19 @@ struct LongrangeCorrelation { template void fillCorrFt0aFt0c(TTarget target, TFT0As const& ft0a, TFT0Cs const& ft0c, bool mixing, float vz, float multiplicity) { + histos.fill(HIST("Ft0aFt0c/SE/hMult"), multiplicity); int fSampleIndex = gRandom->Uniform(0, cfgSampleSize); - if (!mixing) - histos.fill(HIST("Ft0aFt0c/SE/hMult_used"), multiplicity); - for (std::size_t iChA = 0; iChA < ft0a.channelA().size(); iChA++) { - if (!mixing) - histos.fill(HIST("Ft0aFt0c/SE/Trig_hist"), fSampleIndex, vz, 1.0); auto chanelidA = ft0a.channelA()[iChA]; auto phiA = getPhiFT0(chanelidA, 0); auto etaA = getEtaFT0(chanelidA, 0); - if (mixing) { - histos.fill(HIST("Ft0aFt0c/ME/Trig_eta"), etaA); - histos.fill(HIST("Ft0aFt0c/ME/Trig_phi"), phiA); - histos.fill(HIST("Ft0aFt0c/ME/Trig_etavsphi"), phiA, etaA); - } else { + if (!mixing) { histos.fill(HIST("Ft0aFt0c/SE/Trig_eta"), etaA); histos.fill(HIST("Ft0aFt0c/SE/Trig_phi"), phiA); histos.fill(HIST("Ft0aFt0c/SE/Trig_etavsphi"), phiA, etaA); + histos.fill(HIST("Ft0aFt0c/SE/Trig_hist"), fSampleIndex, vz, 1.0, multiplicity); } for (std::size_t iChC = 0; iChC < ft0c.channelC().size(); iChC++) { @@ -750,16 +709,8 @@ struct LongrangeCorrelation { auto phiC = getPhiFT0(chanelidC, 1); auto etaC = getEtaFT0(chanelidC, 1); - if (mixing) - histos.fill(HIST("Ft0aFt0c/ME/Assoc_amp"), chanelidC, ampl); - else - histos.fill(HIST("Ft0aFt0c/SE/Assoc_amp"), chanelidC, ampl); - if (mixing) { - histos.fill(HIST("Ft0aFt0c/ME/Assoc_eta"), etaC); - histos.fill(HIST("Ft0aFt0c/ME/Assoc_phi"), phiC); - histos.fill(HIST("Ft0aFt0c/ME/Assoc_etavsphi"), phiC, etaC); - } else { + histos.fill(HIST("Ft0aFt0c/SE/Assoc_amp"), chanelidC, ampl); histos.fill(HIST("Ft0aFt0c/SE/Assoc_eta"), etaC); histos.fill(HIST("Ft0aFt0c/SE/Assoc_phi"), phiC); histos.fill(HIST("Ft0aFt0c/SE/Assoc_etavsphi"), phiC, etaC); @@ -771,7 +722,7 @@ struct LongrangeCorrelation { histos.fill(HIST("Ft0aFt0c/ME/deltaEta_deltaPhi"), deltaPhi, deltaEta); else histos.fill(HIST("Ft0aFt0c/SE/deltaEta_deltaPhi"), deltaPhi, deltaEta); - target->getPairHist()->Fill(step, fSampleIndex, vz, 1.0, 1.0, deltaPhi, deltaEta); + target->getPairHist()->Fill(step, fSampleIndex, vz, 1.0, 1.0, deltaPhi, deltaEta, multiplicity); } // associated ft0 tracks } // trigger tracks } // fillCorrFt0aFt0c @@ -807,7 +758,6 @@ struct LongrangeCorrelation { auto bc = col.bc_as(); loadEffCorrection(bc.timestamp()); loadMultCorrection(bc.timestamp()); - fillYieldTpc(tracks); const auto& ft0 = col.foundFT0(); auto multiplicity = 1.0f; if (isUseCentEst) @@ -817,9 +767,6 @@ struct LongrangeCorrelation { float multw = getMultEffCorr(multiplicity); if (isUseEffCorr) multiplicity = multiplicity * multw; - if (multiplicity < cfgMinMult || multiplicity >= cfgMaxMult) { - return; - } fillCorrFt0aGlobal(sameFt0aGlobal, tracks, ft0, false, col.posZ(), multiplicity); } } // same event @@ -833,7 +780,6 @@ struct LongrangeCorrelation { auto bc = col.bc_as(); loadEffCorrection(bc.timestamp()); loadMultCorrection(bc.timestamp()); - fillYieldTpc(tracks); const auto& ft0 = col.foundFT0(); auto multiplicity = 1.0f; if (isUseCentEst) @@ -843,9 +789,6 @@ struct LongrangeCorrelation { float multw = getMultEffCorr(multiplicity); if (isUseEffCorr) multiplicity = multiplicity * multw; - if (multiplicity < cfgMinMult || multiplicity >= cfgMaxMult) { - return; - } fillCorrFt0cGlobal(sameFt0cGlobal, tracks, ft0, false, col.posZ(), multiplicity); } } // same event @@ -858,7 +801,6 @@ struct LongrangeCorrelation { auto bc = col.bc_as(); loadEffCorrection(bc.timestamp()); loadMultCorrection(bc.timestamp()); - fillYieldTpc(tracks); auto multiplicity = 1.0f; if (isUseCentEst) multiplicity = selColCent(col); @@ -867,9 +809,6 @@ struct LongrangeCorrelation { float multw = getMultEffCorr(multiplicity); if (isUseEffCorr) multiplicity = multiplicity * multw; - if (multiplicity < cfgMinMult || multiplicity >= cfgMaxMult) { - return; - } fillCorrMftGlobal(sameMftGlobal, tracks, mfttracks, false, col.posZ(), multiplicity); } // same event @@ -879,7 +818,6 @@ struct LongrangeCorrelation { return; } if (col.has_foundFT0()) { - fillYieldMft(mfttracks); auto bc = col.bc_as(); loadMultCorrection(bc.timestamp()); const auto& ft0 = col.foundFT0(); @@ -891,9 +829,6 @@ struct LongrangeCorrelation { float multw = getMultEffCorr(multiplicity); if (isUseEffCorr) multiplicity = multiplicity * multw; - if (multiplicity < cfgMinMult || multiplicity >= cfgMaxMult) { - return; - } fillCorrFt0aMft(sameFt0aMft, mfttracks, ft0, false, col.posZ(), multiplicity); } } // same event @@ -912,13 +847,9 @@ struct LongrangeCorrelation { multiplicity = selColCent(col); else multiplicity = countNTracks(tracks); - histos.fill(HIST("Ft0aFt0c/SE/hMult"), multiplicity); float multw = getMultEffCorr(multiplicity); if (isUseEffCorr) multiplicity = multiplicity * multw; - if (multiplicity < cfgMinMult || multiplicity >= cfgMaxMult) { - return; - } fillCorrFt0aFt0c(sameFt0aFt0c, ft0, ft0, false, col.posZ(), multiplicity); } } // same event @@ -944,7 +875,6 @@ struct LongrangeCorrelation { loadEffCorrection(bc.timestamp()); loadMultCorrection(bc.timestamp()); auto slicedTriggerTracks = tracks.sliceBy(perColGlobal, col1.globalIndex()); - fillYieldTpc(slicedTriggerTracks); const auto& ft0 = col2.foundFT0(); auto multiplicity = 1.0f; if (isUseCentEst) @@ -954,9 +884,6 @@ struct LongrangeCorrelation { float multw = getMultEffCorr(multiplicity); if (isUseEffCorr) multiplicity = multiplicity * multw; - if (multiplicity < cfgMinMult || multiplicity >= cfgMaxMult) { - continue; - } fillCorrFt0aGlobal(mixedFt0aGlobal, slicedTriggerTracks, ft0, true, col1.posZ(), multiplicity); } } @@ -983,7 +910,6 @@ struct LongrangeCorrelation { loadEffCorrection(bc.timestamp()); loadMultCorrection(bc.timestamp()); auto slicedTriggerTracks = tracks.sliceBy(perColGlobal, col1.globalIndex()); - fillYieldTpc(slicedTriggerTracks); const auto& ft0 = col2.foundFT0(); auto multiplicity = 1.0f; if (isUseCentEst) @@ -993,9 +919,6 @@ struct LongrangeCorrelation { float multw = getMultEffCorr(multiplicity); if (isUseEffCorr) multiplicity = multiplicity * multw; - if (multiplicity < cfgMinMult || multiplicity >= cfgMaxMult) { - continue; - } fillCorrFt0cGlobal(mixedFt0cGlobal, slicedTriggerTracks, ft0, true, col1.posZ(), multiplicity); } } @@ -1027,9 +950,6 @@ struct LongrangeCorrelation { float multw = getMultEffCorr(multiplicity); if (isUseEffCorr) multiplicity = multiplicity * multw; - if (multiplicity < cfgMinMult || multiplicity >= cfgMaxMult) { - continue; - } fillCorrMftGlobal(mixedMftGlobal, tracks1, tracks2, true, col1.posZ(), multiplicity); } } // mixed event @@ -1055,7 +975,6 @@ struct LongrangeCorrelation { loadMultCorrection(bc.timestamp()); auto slicedTriggerMftTracks = mfttracks.sliceBy(perColMft, col1.globalIndex()); auto slicedTriggerTracks = tracks.sliceBy(perColGlobal, col1.globalIndex()); - fillYieldMft(slicedTriggerMftTracks); const auto& ft0 = col2.foundFT0(); auto multiplicity = 1.0f; if (isUseCentEst) @@ -1065,9 +984,6 @@ struct LongrangeCorrelation { float multw = getMultEffCorr(multiplicity); if (isUseEffCorr) multiplicity = multiplicity * multw; - if (multiplicity < cfgMinMult || multiplicity >= cfgMaxMult) { - continue; - } fillCorrFt0aMft(mixedFt0aMft, slicedTriggerMftTracks, ft0, true, col1.posZ(), multiplicity); } } @@ -1098,15 +1014,11 @@ struct LongrangeCorrelation { multiplicity = selColCent(col1); else multiplicity = countNTracks(slicedTriggerTracks); - histos.fill(HIST("Ft0aFt0c/ME/hMult"), multiplicity); const auto& ft0a = col1.foundFT0(); const auto& ft0c = col2.foundFT0(); float multw = getMultEffCorr(multiplicity); if (isUseEffCorr) multiplicity = multiplicity * multw; - if (multiplicity < cfgMinMult || multiplicity >= cfgMaxMult) { - continue; - } fillCorrFt0aFt0c(mixedFt0aFt0c, ft0a, ft0c, true, col1.posZ(), multiplicity); } } From cf82f776d9f63ed43fed62bfbc4da0f9730ca24d Mon Sep 17 00:00:00 2001 From: abmodak <67369858+abmodak@users.noreply.github.com> Date: Fri, 24 Oct 2025 19:09:23 +0200 Subject: [PATCH 2/3] Fix MegaLinter error --- PWGCF/TwoParticleCorrelations/Tasks/longrangeCorrelation.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/longrangeCorrelation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/longrangeCorrelation.cxx index f5ff447e8a8..86dee14938a 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/longrangeCorrelation.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/longrangeCorrelation.cxx @@ -1063,9 +1063,9 @@ struct LongrangeCorrelation { } else { numcontributors = RecCol.numContrib(); } - if (isUseCentEst) + if (isUseCentEst) { multiplicity = selColCent(RecCol); - else { + } else { auto recTracksPart = RecTracks.sliceBy(perColMC, RecCol.globalIndex()); multiplicity = countNTracks(recTracksPart); } From cc8859f50c80bf46e56424c769eb7b1effe3d94f Mon Sep 17 00:00:00 2001 From: abmodak <67369858+abmodak@users.noreply.github.com> Date: Fri, 24 Oct 2025 19:15:54 +0200 Subject: [PATCH 3/3] Fix PR formatting / copyright headers error --- PWGCF/TwoParticleCorrelations/Tasks/longrangeCorrelation.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/longrangeCorrelation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/longrangeCorrelation.cxx index 86dee14938a..fbf3bf419b7 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/longrangeCorrelation.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/longrangeCorrelation.cxx @@ -7,7 +7,7 @@ // // 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 jurisdicstion. +// or submit itself to any jurisdiction. /// /// \file longrangeCorrelation.cxx ///