From 0dde1c6056c0c0454b12eb64afe32ff45269dd9c Mon Sep 17 00:00:00 2001 From: Aimeric Landou Date: Thu, 27 Aug 2026 11:53:31 +0100 Subject: [PATCH 1/2] [PWGJE] jetSpectraCharged: add rhoShift, jetBackgroundAnalysis: mcp level option also fix shadowing centrality variable, fix default processes all false --- PWGJE/Tasks/jetBackgroundAnalysis.cxx | 122 +++++++++++++++++++++++++- PWGJE/Tasks/jetSpectraCharged.cxx | 49 ++++++----- 2 files changed, 146 insertions(+), 25 deletions(-) diff --git a/PWGJE/Tasks/jetBackgroundAnalysis.cxx b/PWGJE/Tasks/jetBackgroundAnalysis.cxx index 5e6c6d470de..8ded7098298 100644 --- a/PWGJE/Tasks/jetBackgroundAnalysis.cxx +++ b/PWGJE/Tasks/jetBackgroundAnalysis.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -74,6 +75,8 @@ struct JetBackgroundAnalysisTask { int trackSelection = -1; TRandom3 randomNumber{}; + o2::framework::Service pdgDatabase; + void init(o2::framework::InitContext&) { // selection settings initialisation @@ -93,6 +96,10 @@ struct JetBackgroundAnalysisTask { registry.add("h2_centrality_rho", "; centrality; #it{rho} (GeV/area);", {HistType::kTH2F, {{1100, 0., 110.}, {400, 0., 400.0}}}); registry.add("h2_centrality_rhom", ";centrality; #it{rho}_{m} (GeV/area)", {HistType::kTH2F, {{1100, 0., 110.}, {100, 0., 100.0}}}); } + if (doprocessRhoMCP) { + registry.add("h2_nparticles_rho_mcp", "; N_{tracks}; #it{rho} (GeV/area);", {HistType::kTH2F, {{10000, 0.0, 10000.0}, {400, 0.0, 400.0}}}); + registry.add("h2_nparticles_rhom_mcp", "; N_{tracks}; #it{rho}_{m} (GeV/area);", {HistType::kTH2F, {{10000, 0.0, 10000.0}, {100, 0.0, 100.0}}}); + } if (doprocessBkgFluctuationsData || doprocessBkgFluctuationsMCD) { registry.add("h2_centrality_rhorandomcone", "; centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho} (GeV/c);", {HistType::kTH2F, {{1100, 0., 110.}, bkgFluctuationsAxis}}); @@ -101,10 +108,20 @@ struct JetBackgroundAnalysisTask { registry.add("h2_centrality_rhorandomconerandomtrackdirectionwithoutoneleadingjets", "; centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho} (GeV/c);", {HistType::kTH2F, {{1100, 0., 110.}, bkgFluctuationsAxis}}); registry.add("h2_centrality_rhorandomconerandomtrackdirectionwithouttwoleadingjets", "; centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho} (GeV/c);", {HistType::kTH2F, {{1100, 0., 110.}, bkgFluctuationsAxis}}); } + + if (doprocessBkgFluctuationsMCP) { + registry.add("h_rhorandomcone", "; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho} (GeV/c);", {HistType::kTH1F, {bkgFluctuationsAxis}}); + registry.add("h_rhorandomconerandomtrackdirection", "; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho} (GeV/c);", {HistType::kTH1F, {bkgFluctuationsAxis}}); + registry.add("h_rhorandomconewithoutleadingjet", "; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho} (GeV/c);", {HistType::kTH1F, {bkgFluctuationsAxis}}); + registry.add("h_rhorandomconerandomtrackdirectionwithoutoneleadingjets", "; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho} (GeV/c);", {HistType::kTH1F, {bkgFluctuationsAxis}}); + registry.add("h_rhorandomconerandomtrackdirectionwithouttwoleadingjets", "; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho} (GeV/c);", {HistType::kTH1F, {bkgFluctuationsAxis}}); + } } Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax); + Filter particleCuts = (aod::jmcparticle::eta > trackEtaMin && aod::jmcparticle::eta < trackEtaMax); Filter eventCuts = (nabs(aod::jcollision::posZ) < vertexZCut); + Filter mcEventCuts = (nabs(aod::jmccollision::posZ) < vertexZCut); template bool trackIsInJet(TTracks const& track, TJets const& jet) @@ -205,6 +222,86 @@ struct JetBackgroundAnalysisTask { registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirectionwithouttwoleadingjets"), centrality, randomConePtWithoutTwoLeadJet - o2::constants::math::PI * randomConeR * randomConeR * collision.rho()); } + template + void bkgFluctuationsRandomConeMCP(TCollisions const& collision, TJets const& jets, TTracks const& tracks) + { + float randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR); + float randomConePhi = randomNumber.Uniform(0.0, o2::constants::math::TwoPI); + float randomConePt = 0; + for (auto const& track : tracks) { + float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast(-o2::constants::math::PI)); + float dEta = track.eta() - randomConeEta; + if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { + randomConePt += track.pt(); + } + } + registry.fill(HIST("h_rhorandomcone"), randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho()); + + // randomised eta,phi for tracks, to assess part of fluctuations coming from statistically independently emitted particles + float randomConePtRandomTrackDirection = 0; + for (auto const& track : tracks) { + float dPhi = RecoDecay::constrainAngle(randomNumber.Uniform(0.0, o2::constants::math::TwoPI) - randomConePhi, static_cast(-o2::constants::math::PI)); // ignores actual phi of track + float dEta = randomNumber.Uniform(trackEtaMin, trackEtaMax) - randomConeEta; // ignores actual eta of track + if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { + randomConePtRandomTrackDirection += track.pt(); + } + } + registry.fill(HIST("h_rhorandomconerandomtrackdirection"), randomConePtRandomTrackDirection - o2::constants::math::PI * randomConeR * randomConeR * collision.rho()); + + // removing the leading jet from the random cone + const bool hasLead = jets.size() >= 1; + const bool hasSub = jets.size() >= 2; + float randomConePtWithoutLeadingJet = randomConePt; + if (hasLead) { + float dPhiLeadingJet = RecoDecay::constrainAngle(jets.iteratorAt(0).phi() - randomConePhi, static_cast(-o2::constants::math::PI)); + float dEtaLeadingJet = jets.iteratorAt(0).eta() - randomConeEta; + + bool jetWasInCone = false; + while ((randomConeLeadJetDeltaR <= 0 && (std::sqrt(dEtaLeadingJet * dEtaLeadingJet + dPhiLeadingJet * dPhiLeadingJet) < jets.iteratorAt(0).r() / 100.0 + randomConeR)) || (randomConeLeadJetDeltaR > 0 && (std::sqrt(dEtaLeadingJet * dEtaLeadingJet + dPhiLeadingJet * dPhiLeadingJet) < randomConeLeadJetDeltaR))) { + jetWasInCone = true; + randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR); + randomConePhi = randomNumber.Uniform(0.0, o2::constants::math::TwoPI); + dPhiLeadingJet = RecoDecay::constrainAngle(jets.iteratorAt(0).phi() - randomConePhi, static_cast(-o2::constants::math::PI)); + dEtaLeadingJet = jets.iteratorAt(0).eta() - randomConeEta; + } + if (jetWasInCone) { + randomConePtWithoutLeadingJet = 0.0; + for (auto const& track : tracks) { + float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast(-o2::constants::math::PI)); + float dEta = track.eta() - randomConeEta; + if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { + randomConePtWithoutLeadingJet += track.pt(); + } + } + } + } + registry.fill(HIST("h_rhorandomconewithoutleadingjet"), randomConePtWithoutLeadingJet - o2::constants::math::PI * randomConeR * randomConeR * collision.rho()); + + // randomised eta,phi for tracks, to assess part of fluctuations coming from statistically independently emitted particles, removing tracks from 2 leading jets + double randomConePtWithoutOneLeadJet = randomConePtRandomTrackDirection; + double randomConePtWithoutTwoLeadJet = randomConePtRandomTrackDirection; + if (hasLead) { + randomConePtWithoutOneLeadJet = 0.0; + randomConePtWithoutTwoLeadJet = 0.0; + for (auto const& track : tracks) { + float dPhi = RecoDecay::constrainAngle(randomNumber.Uniform(0.0, o2::constants::math::TwoPI) - randomConePhi, static_cast(-o2::constants::math::PI)); // ignores actual phi of track + float dEta = randomNumber.Uniform(trackEtaMin, trackEtaMax) - randomConeEta; // ignores actual eta of track + if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { + const bool inLead = hasLead && trackIsInJet(track, jets.iteratorAt(0)); + const bool inSub = hasSub && trackIsInJet(track, jets.iteratorAt(1)); + if (!inLead) { + randomConePtWithoutOneLeadJet += track.pt(); + if (!hasSub || !inSub) { + randomConePtWithoutTwoLeadJet += track.pt(); + } + } + } + } + } + registry.fill(HIST("h_rhorandomconerandomtrackdirectionwithoutoneleadingjets"), randomConePtWithoutOneLeadJet - o2::constants::math::PI * randomConeR * randomConeR * collision.rho()); + registry.fill(HIST("h_rhorandomconerandomtrackdirectionwithouttwoleadingjets"), randomConePtWithoutTwoLeadJet - o2::constants::math::PI * randomConeR * randomConeR * collision.rho()); + } + void processRho(soa::Filtered>::iterator const& collision, soa::Filtered const& tracks) { if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents)) { @@ -230,7 +327,23 @@ struct JetBackgroundAnalysisTask { registry.fill(HIST("h2_centrality_rho"), centrality, collision.rho()); registry.fill(HIST("h2_centrality_rhom"), centrality, collision.rhoM()); } - PROCESS_SWITCH(JetBackgroundAnalysisTask, processRho, "QA for rho-area subtracted jets", false); + PROCESS_SWITCH(JetBackgroundAnalysisTask, processRho, "QA for rho-area subtracted jets", true); + + void processRhoMCP(soa::Filtered>::iterator const& mcCollision, soa::Filtered const& particles) + { + // no event selection as this is used for gen-only simulations + int nParticles = 0; + for (auto const& particle : particles) { + auto pdgParticle = pdgDatabase->GetParticle(particle.pdgCode()); + auto pdgCharge = pdgParticle ? std::abs(pdgParticle->Charge()) : -1.0; + if (pdgCharge > 0) { + nParticles++; + } + } + registry.fill(HIST("h2_nparticles_rho_mcp"), nParticles, mcCollision.rho()); + registry.fill(HIST("h2_nparticles_rhom_mcp"), nParticles, mcCollision.rhoM()); + } + PROCESS_SWITCH(JetBackgroundAnalysisTask, processRhoMCP, "QA for rho-area subtracted jets at the MCP level", false); void processBkgFluctuationsData(soa::Filtered>::iterator const& collision, soa::Join const& jets, soa::Filtered const& tracks) { @@ -265,6 +378,13 @@ struct JetBackgroundAnalysisTask { bkgFluctuationsRandomCone(collision, jets, tracks, centrality); } PROCESS_SWITCH(JetBackgroundAnalysisTask, processBkgFluctuationsMCD, "QA for random cone estimation of background fluctuations in mcd", false); + + void processBkgFluctuationsMCP(soa::Filtered>::iterator const& collision, soa::Join const& jets, soa::Filtered const& tracks) + { + // no event selection as this is used for gen-only simulations + bkgFluctuationsRandomConeMCP(collision, jets, tracks); + } + PROCESS_SWITCH(JetBackgroundAnalysisTask, processBkgFluctuationsMCP, "QA for random cone estimation of background fluctuations in mcp", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGJE/Tasks/jetSpectraCharged.cxx b/PWGJE/Tasks/jetSpectraCharged.cxx index 8b32a44aff4..e54e31b6e96 100644 --- a/PWGJE/Tasks/jetSpectraCharged.cxx +++ b/PWGJE/Tasks/jetSpectraCharged.cxx @@ -85,6 +85,7 @@ struct JetSpectraCharged { Configurable kappa{"kappa", 1.0, "angularity kappa"}; Configurable alpha{"alpha", 1.0, "angularity alpha"}; Configurable useFT0CVariant{"useFT0CVariant", false, "IF checkCentFT0M is false: false -> use standard FT0C centrality selection; true -> use FT0CVariant1"}; + Configurable rhoShift{"rhoShift", 0, "value of artificial rho shift: rho -> rho - rhoShift ; 0 by default"}; std::vector eventSelectionBits; int trackSelection = -1; @@ -347,13 +348,13 @@ struct JetSpectraCharged { return true; } // if isMCGenOnly is true, skip MC selection and accept all of them - float centrality = -1.0; + float mcpCentrality = -1.0; // checkCentFT0M ? centrality = mccollision.centFT0M() : centrality = mccollision.centFT0C(); - centrality = mccollision.centFT0M(); + mcpCentrality = mccollision.centFT0M(); if (fillHistograms) { registry.fill(HIST("h_mccollisions"), 0.5); - registry.fill(HIST("h2_centrality_mccollisions"), centrality, 0.5, eventWeight); + registry.fill(HIST("h2_centrality_mccollisions"), mcpCentrality, 0.5, eventWeight); if (isWeighted) registry.fill(HIST("h_mccollisions_weighted"), 0.5, eventWeight); } @@ -363,7 +364,7 @@ struct JetSpectraCharged { } if (fillHistograms) { registry.fill(HIST("h_mccollisions"), 1.5); - registry.fill(HIST("h2_centrality_mccollisions"), centrality, 1.5, eventWeight); + registry.fill(HIST("h2_centrality_mccollisions"), mcpCentrality, 1.5, eventWeight); if (isWeighted) registry.fill(HIST("h_mccollisions_weighted"), 1.5, eventWeight); } @@ -373,7 +374,7 @@ struct JetSpectraCharged { } if (fillHistograms) { registry.fill(HIST("h_mccollisions"), 2.5); - registry.fill(HIST("h2_centrality_mccollisions"), centrality, 2.5, eventWeight); + registry.fill(HIST("h2_centrality_mccollisions"), mcpCentrality, 2.5, eventWeight); if (isWeighted) registry.fill(HIST("h_mccollisions_weighted"), 2.5, eventWeight); } @@ -389,7 +390,7 @@ struct JetSpectraCharged { occupancyIsGood = true; } - if ((centralityMin < centrality) && (centrality < centralityMax)) { + if ((centralityMin < mcpCentrality) && (mcpCentrality < centralityMax)) { centralityIsGood = true; } } else { @@ -401,9 +402,9 @@ struct JetSpectraCharged { occupancyIsGood = true; } - float centrality = -1.0; - checkCentFT0M ? centrality = collision.centFT0M() : centrality = (useFT0CVariant ? collision.centFT0CVariant1() : collision.centFT0C()); - if ((centralityMin < centrality) && (centrality < centralityMax)) { + float mcdCentrality = -1.0; + checkCentFT0M ? mcdCentrality = collision.centFT0M() : mcdCentrality = (useFT0CVariant ? collision.centFT0CVariant1() : collision.centFT0C()); + if ((centralityMin < mcdCentrality) && (mcdCentrality < centralityMax)) { centralityIsGood = true; } } @@ -414,7 +415,7 @@ struct JetSpectraCharged { } if (fillHistograms) { registry.fill(HIST("h_mccollisions"), 3.5); - registry.fill(HIST("h2_centrality_mccollisions"), centrality, 3.5, eventWeight); + registry.fill(HIST("h2_centrality_mccollisions"), mcpCentrality, 3.5, eventWeight); if (isWeighted) registry.fill(HIST("h_mccollisions_weighted"), 3.5, eventWeight); } @@ -424,7 +425,7 @@ struct JetSpectraCharged { } if (fillHistograms) { registry.fill(HIST("h_mccollisions"), 4.5); - registry.fill(HIST("h2_centrality_mccollisions"), centrality, 4.5, eventWeight); + registry.fill(HIST("h2_centrality_mccollisions"), mcpCentrality, 4.5, eventWeight); if (isWeighted) registry.fill(HIST("h_mccollisions_weighted"), 4.5, eventWeight); } @@ -434,7 +435,7 @@ struct JetSpectraCharged { } if (fillHistograms) { registry.fill(HIST("h_mccollisions"), 5.5); - registry.fill(HIST("h2_centrality_mccollisions"), centrality, 5.5, eventWeight); + registry.fill(HIST("h2_centrality_mccollisions"), mcpCentrality, 5.5, eventWeight); if (isWeighted) registry.fill(HIST("h_mccollisions_weighted"), 5.5, eventWeight); } @@ -521,7 +522,7 @@ struct JetSpectraCharged { if (jet.pt() > pTHatMaxMCD * pTHat || pTHat < pTHatAbsoluteMin) { return; } - double jetcorrpt = jet.pt() - (rho * jet.area()); + double jetcorrpt = jet.pt() - ((rho - rhoShift) * jet.area()); if (jet.r() == round(selectedJetsRadius * 100.0f)) { // fill jet histograms after area-based subtraction registry.fill(HIST("h_jet_pt_rhoareasubtracted"), jetcorrpt, weight); @@ -579,7 +580,7 @@ struct JetSpectraCharged { } if (jet.r() == round(selectedJetsRadius * 100.0f)) { // fill mcp jet histograms - double jetcorrpt = jet.pt() - (rho * jet.area()); + double jetcorrpt = jet.pt() - ((rho - rhoShift) * jet.area()); registry.fill(HIST("h_jet_pt_part_rhoareasubtracted"), jetcorrpt, weight); registry.fill(HIST("h3_jet_pt_jet_eta_jet_phi_part_rhoareasubtracted"), jetcorrpt, jet.eta(), jet.phi(), weight); if (jetcorrpt > 0) { @@ -1028,7 +1029,7 @@ struct JetSpectraCharged { bool hasSel8Coll = false; bool centralityIsGood = false; bool occupancyIsGood = false; - float centrality = mccollision.centFT0M(); + float mcpCentrality = mccollision.centFT0M(); if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly) { if (hasRecoColl && jetderiveddatautilities::selectCollision(collisions.begin(), eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { hasSel8Coll = true; @@ -1036,7 +1037,7 @@ struct JetSpectraCharged { if (hasRecoColl && (trackOccupancyInTimeRangeMin < collisions.begin().trackOccupancyInTimeRange()) && (collisions.begin().trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMax)) { occupancyIsGood = true; } - if ((centralityMin < centrality) && (centrality < centralityMax)) { + if ((centralityMin < mcpCentrality) && (mcpCentrality < centralityMax)) { centralityIsGood = true; } } else { @@ -1047,9 +1048,9 @@ struct JetSpectraCharged { if ((trackOccupancyInTimeRangeMin < collision.trackOccupancyInTimeRange()) && (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMax)) { occupancyIsGood = true; } - float centrality = -1.0; - checkCentFT0M ? centrality = collision.centFT0M() : (centrality = (useFT0CVariant ? collision.centFT0CVariant1() : collision.centFT0C())); - if ((centralityMin < centrality) && (centrality < centralityMax)) { + float mcdCentrality = -1.0; + checkCentFT0M ? mcdCentrality = collision.centFT0M() : (mcdCentrality = (useFT0CVariant ? collision.centFT0CVariant1() : collision.centFT0C())); + if ((centralityMin < mcdCentrality) && (mcdCentrality < centralityMax)) { centralityIsGood = true; } } @@ -1111,7 +1112,7 @@ struct JetSpectraCharged { bool hasSel8Coll = false; bool centralityIsGood = false; bool occupancyIsGood = false; - float centrality = mccollision.centFT0M(); + float mcpCentrality = mccollision.centFT0M(); if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly) { if (hasRecoColl && jetderiveddatautilities::selectCollision(collisions.begin(), eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { hasSel8Coll = true; @@ -1119,7 +1120,7 @@ struct JetSpectraCharged { if (hasRecoColl && (trackOccupancyInTimeRangeMin < collisions.begin().trackOccupancyInTimeRange()) && (collisions.begin().trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMax)) { occupancyIsGood = true; } - if ((centralityMin < centrality) && (centrality < centralityMax)) { + if ((centralityMin < mcpCentrality) && (mcpCentrality < centralityMax)) { centralityIsGood = true; } } else { @@ -1130,9 +1131,9 @@ struct JetSpectraCharged { if ((trackOccupancyInTimeRangeMin < collision.trackOccupancyInTimeRange()) && (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMax)) { occupancyIsGood = true; } - float centrality = -1.0; - checkCentFT0M ? centrality = collision.centFT0M() : (centrality = (useFT0CVariant ? collision.centFT0CVariant1() : collision.centFT0C())); - if ((centralityMin < centrality) && (centrality < centralityMax)) { + float mcdCentrality = -1.0; + checkCentFT0M ? mcdCentrality = collision.centFT0M() : (mcdCentrality = (useFT0CVariant ? collision.centFT0CVariant1() : collision.centFT0C())); + if ((centralityMin < mcdCentrality) && (mcdCentrality < centralityMax)) { centralityIsGood = true; } } From cfdf2191207f3b27af8de6c396102f6201643a5a Mon Sep 17 00:00:00 2001 From: Aimeric Landou Date: Mon, 31 Aug 2026 14:52:55 +0100 Subject: [PATCH 2/2] megalinter fix --- PWGJE/Tasks/jetBackgroundAnalysis.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGJE/Tasks/jetBackgroundAnalysis.cxx b/PWGJE/Tasks/jetBackgroundAnalysis.cxx index 8ded7098298..87eb78241d9 100644 --- a/PWGJE/Tasks/jetBackgroundAnalysis.cxx +++ b/PWGJE/Tasks/jetBackgroundAnalysis.cxx @@ -206,7 +206,7 @@ struct JetBackgroundAnalysisTask { float dPhi = RecoDecay::constrainAngle(randomNumber.Uniform(0.0, o2::constants::math::TwoPI) - randomConePhi, static_cast(-o2::constants::math::PI)); // ignores actual phi of track float dEta = randomNumber.Uniform(trackEtaMin, trackEtaMax) - randomConeEta; // ignores actual eta of track if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { - const bool inLead = hasLead && trackIsInJet(track, jets.iteratorAt(0)); + const bool inLead = trackIsInJet(track, jets.iteratorAt(0)); const bool inSub = hasSub && trackIsInJet(track, jets.iteratorAt(1)); if (!inLead) { randomConePtWithoutOneLeadJet += track.pt(); @@ -287,7 +287,7 @@ struct JetBackgroundAnalysisTask { float dPhi = RecoDecay::constrainAngle(randomNumber.Uniform(0.0, o2::constants::math::TwoPI) - randomConePhi, static_cast(-o2::constants::math::PI)); // ignores actual phi of track float dEta = randomNumber.Uniform(trackEtaMin, trackEtaMax) - randomConeEta; // ignores actual eta of track if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { - const bool inLead = hasLead && trackIsInJet(track, jets.iteratorAt(0)); + const bool inLead = trackIsInJet(track, jets.iteratorAt(0)); const bool inSub = hasSub && trackIsInJet(track, jets.iteratorAt(1)); if (!inLead) { randomConePtWithoutOneLeadJet += track.pt();