From d6ed7bd4222c78f4782b28d9ed4bad52ff4dac27 Mon Sep 17 00:00:00 2001 From: Tucker Hwang Date: Sun, 13 Sep 2026 19:49:38 -0700 Subject: [PATCH 1/8] Include kappa and alpha in angularity denominator --- PWGJE/Tasks/jetFinderQA.cxx | 32 ++++++++++++++-------------- PWGJE/Tasks/jetSpectraCharged.cxx | 26 +++++++++++----------- PWGJE/Tasks/jetSpectraChargedGen.cxx | 4 ++-- PWGJE/Tasks/jetTutorial.cxx | 18 ++++++++-------- 4 files changed, 40 insertions(+), 40 deletions(-) diff --git a/PWGJE/Tasks/jetFinderQA.cxx b/PWGJE/Tasks/jetFinderQA.cxx index 4500148ee63..efcda5f3e14 100644 --- a/PWGJE/Tasks/jetFinderQA.cxx +++ b/PWGJE/Tasks/jetFinderQA.cxx @@ -558,9 +558,9 @@ struct JetFinderQATask { registry.fill(HIST("h3_jet_r_jet_pt_track_pt"), jet.r() / 100.0, jet.pt(), constituent.pt(), weight); registry.fill(HIST("h3_jet_r_jet_pt_track_eta"), jet.r() / 100.0, jet.pt(), constituent.eta(), weight); registry.fill(HIST("h3_jet_r_jet_pt_track_phi"), jet.r() / 100.0, jet.pt(), constituent.phi(), weight); - angularity += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, constituent), alpha); + angularity += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, constituent) / (jet.r() / 100.f), alpha); } - angularity /= (jet.pt() * (jet.r() / 100.f)); + angularity /= std::pow(jet.pt(), kappa); registry.fill(HIST("h3_jet_r_jet_pt_jet_angularity"), jet.r() / 100.0, jet.pt(), angularity, weight); } @@ -656,9 +656,9 @@ struct JetFinderQATask { registry.fill(HIST("h3_jet_r_part_jet_pt_part_track_pt_part"), jet.r() / 100.0, jet.pt(), constituent.pt(), weight); registry.fill(HIST("h3_jet_r_part_jet_pt_part_track_eta_part"), jet.r() / 100.0, jet.pt(), constituent.eta(), weight); registry.fill(HIST("h3_jet_r_part_jet_pt_part_track_phi_part"), jet.r() / 100.0, jet.pt(), constituent.phi(), weight); - angularity += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, constituent), alpha); + angularity += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, constituent) / (jet.r() / 100.f), alpha); } - angularity /= (jet.pt() * (jet.r() / 100.f)); + angularity /= std::pow(jet.pt(), kappa); registry.fill(HIST("h3_jet_r_part_jet_pt_part_jet_angularity_part"), jet.r() / 100.0, jet.pt(), angularity, weight); } @@ -687,9 +687,9 @@ struct JetFinderQATask { if (constituent.pt() > leadingTrackPtTag) { leadingTrackPtTag = constituent.pt(); } - angularityTag += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jetTag, constituent), alpha); + angularityTag += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jetTag, constituent) / (jetTag.r() / 100.f), alpha); } - angularityTag /= (jetTag.pt() * (jetTag.r() / 100.f)); + angularityTag /= std::pow(jetTag.pt(), kappa); registry.fill(HIST("h3_jet_r_jet_pt_tag_leadingtrack_pt_diff_matchedgeo"), jetBase.r() / 100.0, jetTag.pt(), (leadingTrackPtTag - leadingTrackPtBase) / leadingTrackPtTag, weight); registry.fill(HIST("h3_jet_r_jet_pt_tag_leadingtrack_fraction_diff_matchedgeo"), jetBase.r() / 100.0, jetTag.pt(), (leadingTrackPtTag / jetTag.pt()) - (leadingTrackPtBase / jetBase.pt()), weight); registry.fill(HIST("h3_jet_r_jet_pt_tag_angularity_matchedgeo"), jetBase.r() / 100.0, jetTag.pt(), angularityTag, weight); @@ -729,9 +729,9 @@ struct JetFinderQATask { if (constituent.pt() > leadingTrackPtTag) { leadingTrackPtTag = constituent.pt(); } - angularityTag += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jetTag, constituent), alpha); + angularityTag += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jetTag, constituent) / (jetTag.r() / 100.f), alpha); } - angularityTag /= (jetTag.pt() * (jetTag.r() / 100.f)); + angularityTag /= std::pow(jetTag.pt(), kappa); registry.fill(HIST("h3_jet_r_jet_pt_tag_leadingtrack_pt_diff_matchedpt"), jetBase.r() / 100.0, jetTag.pt(), (leadingTrackPtTag - leadingTrackPtBase) / leadingTrackPtTag, weight); registry.fill(HIST("h3_jet_r_jet_pt_tag_leadingtrack_fraction_diff_matchedpt"), jetBase.r() / 100.0, jetTag.pt(), (leadingTrackPtTag / jetTag.pt()) - (leadingTrackPtBase / jetBase.pt()), weight); registry.fill(HIST("h3_jet_r_jet_pt_tag_angularity_matchedpt"), jetBase.r() / 100.0, jetTag.pt(), angularityTag, weight); @@ -769,9 +769,9 @@ struct JetFinderQATask { if (constituent.pt() > leadingTrackPtTag) { leadingTrackPtTag = constituent.pt(); } - angularityTag += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jetTag, constituent), alpha); + angularityTag += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jetTag, constituent) / (jetTag.r() / 100.f), alpha); } - angularityTag /= (jetTag.pt() * (jetTag.r() / 100.f)); + angularityTag /= std::pow(jetTag.pt(), kappa); registry.fill(HIST("h3_jet_r_jet_pt_tag_leadingtrack_pt_diff_matchedgeopt"), jetBase.r() / 100.0, jetTag.pt(), (leadingTrackPtTag - leadingTrackPtBase) / leadingTrackPtTag, weight); registry.fill(HIST("h3_jet_r_jet_pt_tag_leadingtrack_fraction_diff_matchedgeopt"), jetBase.r() / 100.0, jetTag.pt(), (leadingTrackPtTag / jetTag.pt()) - (leadingTrackPtBase / jetBase.pt()), weight); registry.fill(HIST("h3_jet_r_jet_pt_tag_angularity_matchedgeopt"), jetBase.r() / 100.0, jetTag.pt(), angularityTag, weight); @@ -1080,9 +1080,9 @@ struct JetFinderQATask { if (constituent.pt() > leadingTrackPtBase) { leadingTrackPtBase = constituent.pt(); } - angularity += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, constituent), alpha); + angularity += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, constituent) / (jet.r() / 100.f), alpha); } - angularity /= (jet.pt() * (jet.r() / 100.f)); + angularity /= std::pow(jet.pt(), kappa); fillMatchedHistograms::iterator, soa::Join>(jet, leadingTrackPtBase, angularity); } } @@ -1205,9 +1205,9 @@ struct JetFinderQATask { if (constituent.pt() > leadingTrackPtBase) { leadingTrackPtBase = constituent.pt(); } - angularity += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(mcdjet, constituent), alpha); + angularity += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(mcdjet, constituent) / (mcdjet.r() / 100.f), alpha); } - angularity /= (mcdjet.pt() * (mcdjet.r() / 100.f)); + angularity /= std::pow(mcdjet.pt(), kappa); fillMatchedHistograms::iterator, soa::Join>(mcdjet, leadingTrackPtBase, angularity, 1., collision.mcCollision().ptHard()); } } @@ -1238,9 +1238,9 @@ struct JetFinderQATask { if (constituent.pt() > leadingTrackPtBase) { leadingTrackPtBase = constituent.pt(); } - angularity += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(mcdjet, constituent), alpha); + angularity += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(mcdjet, constituent) / (mcdjet.r() / 100.f), alpha); } - angularity /= (mcdjet.pt() * (mcdjet.r() / 100.f)); + angularity /= std::pow(mcdjet.pt(), kappa); fillMatchedHistograms::iterator, soa::Join>(mcdjet, leadingTrackPtBase, angularity, collision.weight(), collision.mcCollision().ptHard()); } } diff --git a/PWGJE/Tasks/jetSpectraCharged.cxx b/PWGJE/Tasks/jetSpectraCharged.cxx index e54e31b6e96..982da377b8b 100644 --- a/PWGJE/Tasks/jetSpectraCharged.cxx +++ b/PWGJE/Tasks/jetSpectraCharged.cxx @@ -510,9 +510,9 @@ struct JetSpectraCharged { float angularity = 0.; for (const auto& constituent : jet.template tracks_as()) { registry.fill(HIST("h2_jet_pt_track_pt"), jet.pt(), constituent.pt(), weight); - angularity += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, constituent), alpha); + angularity += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, constituent) / (jet.r() / 100.f), alpha); } - angularity /= (jet.pt() * (jet.r() / 100.f)); + angularity /= std::pow(jet.pt(), kappa); registry.fill(HIST("h2_jet_pt_jet_angularity"), jet.pt(), angularity, weight); } @@ -542,9 +542,9 @@ struct JetSpectraCharged { float angularity = 0.; for (const auto& constituent : jet.template tracks_as()) { registry.fill(HIST("h2_jet_pt_track_pt_rhoareasubtracted"), jetcorrpt, constituent.pt(), weight); - angularity += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, constituent), alpha); + angularity += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, constituent) / (jet.r() / 100.f), alpha); } - angularity /= (jet.pt() * (jet.r() / 100.f)); + angularity /= std::pow(jet.pt(), kappa); registry.fill(HIST("h2_jet_pt_jet_angularity_rhoareasubtracted"), jetcorrpt, angularity, weight); } @@ -566,9 +566,9 @@ struct JetSpectraCharged { float angularity = 0.; for (const auto& constituent : jet.template tracks_as()) { registry.fill(HIST("h2_jet_pt_part_track_pt_part"), jet.pt(), constituent.pt(), weight); - angularity += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, constituent), alpha); + angularity += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, constituent) / (jet.r() / 100.f), alpha); } - angularity /= (jet.pt() * (jet.r() / 100.f)); + angularity /= std::pow(jet.pt(), kappa); registry.fill(HIST("h2_jet_pt_jet_angularity_part"), jet.pt(), angularity, weight); } @@ -621,9 +621,9 @@ struct JetSpectraCharged { double dpt = jetMCD.pt() - jetMCP.pt(); float angularityMcd = 0.; for (const auto& constituent : jetMCD.template tracks_as()) { - angularityMcd += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jetMCD, constituent), alpha); + angularityMcd += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jetMCD, constituent) / (jetMCD.r() / 100.f), alpha); } - angularityMcd /= (jetMCD.pt() * (jetMCD.r() / 100.f)); + angularityMcd /= std::pow(jetMCD.pt(), kappa); if (jetfindingutilities::isInEtaAcceptance(jetMCD, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { registry.fill(HIST("h2_jet_pt_mcd_jet_pt_mcp_matchedgeo_mcdetaconstraint"), jetMCD.pt(), jetMCP.pt(), weight); if (jetfindingutilities::isInEtaAcceptance(jetMCP, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { @@ -660,9 +660,9 @@ struct JetSpectraCharged { double dpt = jetMCD.pt() - jetMCP.pt(); float angularityMcd = 0.; for (const auto& constituent : jetMCD.template tracks_as()) { - angularityMcd += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jetMCD, constituent), alpha); + angularityMcd += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jetMCD, constituent) / (jetMCD.r() / 100.f), alpha); } - angularityMcd /= (jetMCD.pt() * (jetMCD.r() / 100.f)); + angularityMcd /= std::pow(jetMCD.pt(), kappa); if (jetfindingutilities::isInEtaAcceptance(jetMCD, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { registry.fill(HIST("h2_jet_pt_mcd_jet_pt_mcp_matchedpt_mcdetaconstraint"), jetMCD.pt(), jetMCP.pt(), weight); if (jetfindingutilities::isInEtaAcceptance(jetMCP, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { @@ -699,9 +699,9 @@ struct JetSpectraCharged { double dpt = jetMCD.pt() - jetMCP.pt(); float angularityMcd = 0.; for (const auto& constituent : jetMCD.template tracks_as()) { - angularityMcd += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jetMCD, constituent), alpha); + angularityMcd += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jetMCD, constituent) / (jetMCD.r() / 100.f), alpha); } - angularityMcd /= (jetMCD.pt() * (jetMCD.r() / 100.f)); + angularityMcd /= std::pow(jetMCD.pt(), kappa); if (jetfindingutilities::isInEtaAcceptance(jetMCD, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { registry.fill(HIST("h2_jet_pt_mcd_jet_pt_mcp_matchedgeopt_mcdetaconstraint"), jetMCD.pt(), jetMCP.pt(), weight); if (jetfindingutilities::isInEtaAcceptance(jetMCP, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { @@ -743,7 +743,7 @@ struct JetSpectraCharged { double dcorrpt = corrBasejetpt - corrTagjetpt; float angularityMcd = 0.; for (const auto& constituent : jetMCD.template tracks_as()) { - angularityMcd += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jetMCD, constituent), alpha); + angularityMcd += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jetMCD, constituent) / (jetMCD.r() / 100.f), alpha); } angularityMcd /= (corrBasejetpt * (jetMCD.r() / 100.f)); if (jetfindingutilities::isInEtaAcceptance(jetMCD, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { diff --git a/PWGJE/Tasks/jetSpectraChargedGen.cxx b/PWGJE/Tasks/jetSpectraChargedGen.cxx index ec8e1896e40..853a39eadce 100644 --- a/PWGJE/Tasks/jetSpectraChargedGen.cxx +++ b/PWGJE/Tasks/jetSpectraChargedGen.cxx @@ -157,9 +157,9 @@ struct JetSpectraChargedGen { float angularity = 0.0f; for (const auto& constituent : jet.template tracks_as()) { registry.fill(HIST("h2_jet_pt_part_track_pt_part"), jet.pt(), constituent.pt(), weight); - angularity += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, constituent), alpha); + angularity += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, constituent) / (jet.r() / 100.f), alpha); } - angularity /= (jet.pt() * (jet.r() / 100.0f)); + angularity /= std::pow(jet.pt(), kappa); registry.fill(HIST("h2_jet_pt_jet_angularity_part"), jet.pt(), angularity, weight); } diff --git a/PWGJE/Tasks/jetTutorial.cxx b/PWGJE/Tasks/jetTutorial.cxx index 2c5e011ccc4..c157a5c6ca3 100644 --- a/PWGJE/Tasks/jetTutorial.cxx +++ b/PWGJE/Tasks/jetTutorial.cxx @@ -246,9 +246,9 @@ struct JetTutorialTask { registry.fill(HIST("h_jet_ntracks"), jet.tracksIds().size()); double angularity = 0.0; for (auto& jetConstituent : jet.tracks_as()) { - angularity += std::pow(jetConstituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, jetConstituent), alpha); + angularity += std::pow(jetConstituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, jetConstituent) / (jet.r() / 100.f), alpha); } - angularity /= (jet.pt() * (jet.r() / 100.f)); + angularity /= std::pow(jet.pt(), kappa); registry.fill(HIST("h_jet_angularity"), angularity); } } @@ -274,14 +274,14 @@ struct JetTutorialTask { registry.fill(HIST("h_full_jet_nclusters"), jet.clustersIds().size()); double angularity = 0.0; for (auto& jetConstituent : jet.tracks_as()) { - angularity += std::pow(jetConstituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, jetConstituent), alpha); + angularity += std::pow(jetConstituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, jetConstituent) / (jet.r() / 100.f), alpha); } for (auto& jetCluster : jet.clusters_as()) { - angularity += std::pow(jetCluster.energy(), kappa) * std::pow(jetutilities::deltaR(jet, jetCluster), alpha); + angularity += std::pow(jetCluster.energy(), kappa) * std::pow(jetutilities::deltaR(jet, jetCluster) / (jet.r() / 100.f), alpha); } - registry.fill(HIST("h_full_jet_angularity"), angularity / (jet.pt() * round(jet.r() * 100.0f))); + registry.fill(HIST("h_full_jet_angularity"), angularity / std::pow(jet.pt(), kappa)); } } PROCESS_SWITCH(JetTutorialTask, processDataSubstructureFull, "full jet substructure", false); @@ -291,9 +291,9 @@ struct JetTutorialTask { for (auto& jet : jets) { double angularity = 0.0; for (auto& jetConstituent : jet.tracks_as()) { - angularity += std::pow(jetConstituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, jetConstituent), alpha); + angularity += std::pow(jetConstituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, jetConstituent) / (jet.r() / 100.f), alpha); } - angularity /= (jet.pt() * (jet.r() / 100.f)); + angularity /= std::pow(jet.pt(), kappa); registry.fill(HIST("h_part_jet_angularity"), angularity, mcCollision.weight()); } } @@ -369,9 +369,9 @@ struct JetTutorialTask { registry.fill(HIST("h_jet_ntracks"), jet.tracksIds().size()); double angularity = 0.0; for (auto& jetConstituent : jet.tracks_as()) { - angularity += std::pow(jetConstituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, jetConstituent), alpha); + angularity += std::pow(jetConstituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, jetConstituent) / (jet.r() / 100.f), alpha); } - angularity /= (jet.pt() * (jet.r() / 100.f)); + angularity /= std::pow(jet.pt(), kappa); registry.fill(HIST("h_jet_angularity_constsub"), angularity); } } From 0fdf62c574811e00226a3563215ad0d6ae20c91b Mon Sep 17 00:00:00 2001 From: Tucker Hwang Date: Sun, 13 Sep 2026 20:15:42 -0700 Subject: [PATCH 2/8] Fix O2 linter issues --- PWGJE/Tasks/jetFinderQA.cxx | 160 +++++++++++++-------------- PWGJE/Tasks/jetSpectraCharged.cxx | 18 +-- PWGJE/Tasks/jetSpectraChargedGen.cxx | 10 +- PWGJE/Tasks/jetTutorial.cxx | 88 ++++++++------- 4 files changed, 139 insertions(+), 137 deletions(-) diff --git a/PWGJE/Tasks/jetFinderQA.cxx b/PWGJE/Tasks/jetFinderQA.cxx index efcda5f3e14..8274100660a 100644 --- a/PWGJE/Tasks/jetFinderQA.cxx +++ b/PWGJE/Tasks/jetFinderQA.cxx @@ -9,8 +9,8 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// jet finder QA task -// +/// \file jetFinderQA.cxx +/// \brief jet finder QA task /// \author Nima Zardoshti #include "PWGJE/Core/JetDerivedDataUtilities.h" @@ -86,16 +86,16 @@ struct JetFinderQATask { Configurable checkCentFT0M{"checkCentFT0M", false, "0: centFT0C as default, 1: use centFT0M estimator"}; // Configurable qcCutOnJetMultVsPt{"qcCutOnJetMultVsPt", false, "debug configurable for LHC26a7 10% test production with strange high mult jet pupulation"}; - Configurable multCutCheck_proportionalFactor{"multCut_proportionalFactor", 0.5, "debug cut value for LHC26a7 10% test production with strange high mult jet pupulation"}; - Configurable multCutCheck_abscissaAtOrigin{"multCut_abscissaAtOrigin", 5, "debug cut value LHC26a7 10% test production with strange high mult jet pupulation"}; - Configurable multCutCheck_analyseMBGapEvents{"multCutCheck_analyseMBGapEvents", 0, "flag to choose to reject min. bias gap events; -1: MBGap only, 0: skip MBGap events, 1: analyse all events"}; + Configurable multCutCheckProportionalFactor{"multCutCheckProportionalFactor", 0.5, "debug cut value for LHC26a7 10% test production with strange high mult jet pupulation"}; + Configurable multCutCheckAbscissaAtOrigin{"multCutCheckAbscissaAtOrigin", 5, "debug cut value LHC26a7 10% test production with strange high mult jet pupulation"}; + Configurable multCutCheckAnalyseMBGapEvents{"multCutCheckAnalyseMBGapEvents", 0, "flag to choose to reject min. bias gap events; -1: MBGap only, 0: skip MBGap events, 1: analyse all events"}; Configurable doMultCutCheck{"doMultCutCheck", false, "decide to apply multCutCheck or not"}; - Configurable multCutCheck_applyRCTSelections{"multCutCheck_applyRCTSelections", true, "decide to apply RCT selections"}; - Configurable multCutCheck_applyWeightCorrection{"multCutCheck_applyWeightCorrection", true, "decide to apply weight correction"}; + Configurable multCutCheckApplyRCTSelections{"multCutCheckApplyRCTSelections", true, "decide to apply RCT selections"}; + Configurable multCutCheckApplyWeightCorrection{"multCutCheckApplyWeightCorrection", true, "decide to apply weight correction"}; - std::vector filledJetR_Both; - std::vector filledJetR_Low; - std::vector filledJetR_High; + std::vector filledJetRBoth; + std::vector filledJetRLow; + std::vector filledJetRHigh; std::vector jetRadiiValues; std::vector eventSelectionBits; @@ -113,13 +113,13 @@ struct JetFinderQATask { jetRadiiValues = (std::vector)jetRadii; for (std::size_t iJetRadius = 0; iJetRadius < jetRadiiValues.size(); iJetRadius++) { - filledJetR_Both.push_back(0.0); - filledJetR_Low.push_back(0.0); - filledJetR_High.push_back(0.0); + filledJetRBoth.push_back(0.0); + filledJetRLow.push_back(0.0); + filledJetRHigh.push_back(0.0); } auto jetRadiiBins = (std::vector)jetRadii; if (jetRadiiBins.size() > 1) { - jetRadiiBins.push_back(jetRadiiBins[jetRadiiBins.size() - 1] + (TMath::Abs(jetRadiiBins[jetRadiiBins.size() - 1] - jetRadiiBins[jetRadiiBins.size() - 2]))); + jetRadiiBins.push_back(jetRadiiBins[jetRadiiBins.size() - 1] + (std::abs(jetRadiiBins[jetRadiiBins.size() - 1] - jetRadiiBins[jetRadiiBins.size() - 2]))); } else { jetRadiiBins.push_back(jetRadiiBins[jetRadiiBins.size() - 1] + 0.1); } @@ -471,16 +471,16 @@ struct JetFinderQATask { Filter eventCuts = (nabs(aod::jcollision::posZ) < vertexZCut && ((checkCentFT0M ? aod::jcollision::centFT0M : aod::jcollision::centFT0C) >= centralityMin) && ((checkCentFT0M ? aod::jcollision::centFT0M : aod::jcollision::centFT0C) < centralityMax)); - PresliceUnsorted> CollisionsPerMCPCollision = aod::jmccollisionlb::mcCollisionId; - PresliceUnsorted> McCollisionsPerMCPCollision = aod::jmccollision::mcCollisionId; - Preslice ParticlesPerMCPCollision = aod::jmcparticle::mcCollisionId; + PresliceUnsorted> collisionsPerMCPCollision = aod::jmccollisionlb::mcCollisionId; + PresliceUnsorted> mcCollisionsPerMCPCollision = aod::jmccollision::mcCollisionId; + Preslice particlesPerMCPCollision = aod::jmcparticle::mcCollisionId; template bool isAcceptedJet(U const& jet) { if (jetAreaFractionMin > -98.0) { - if (jet.area() < jetAreaFractionMin * M_PI * (jet.r() / 100.0) * (jet.r() / 100.0)) { + if (jet.area() < jetAreaFractionMin * o2::constants::math::PI * (jet.r() / 100.0) * (jet.r() / 100.0)) { return false; } } @@ -553,7 +553,7 @@ struct JetFinderQATask { registry.fill(HIST("h3_jet_r_jet_pt_jet_area"), jet.r() / 100.0, jet.pt(), jet.area(), weight); float angularity = 0.; - for (auto& constituent : jet.template tracks_as()) { + for (const auto& constituent : jet.template tracks_as()) { registry.fill(HIST("h3_jet_r_jet_pt_track_pt"), jet.r() / 100.0, jet.pt(), constituent.pt(), weight); registry.fill(HIST("h3_jet_r_jet_pt_track_eta"), jet.r() / 100.0, jet.pt(), constituent.eta(), weight); @@ -590,7 +590,7 @@ struct JetFinderQATask { registry.fill(HIST("h3_jet_r_jet_pt_jet_area_rhoareasubtracted"), jet.r() / 100.0, jet.pt() - (rho * jet.area()), jet.area(), weight); registry.fill(HIST("h3_jet_r_jet_pt_jet_pt_rhoareasubtracted"), jet.r() / 100.0, jet.pt(), jet.pt() - (rho * jet.area()), weight); - for (auto& constituent : jet.template tracks_as()) { + for (const auto& constituent : jet.template tracks_as()) { registry.fill(HIST("h3_jet_r_jet_pt_track_pt_rhoareasubtracted"), jet.r() / 100.0, jet.pt() - (rho * jet.area()), constituent.pt(), weight); registry.fill(HIST("h3_jet_r_jet_pt_track_eta_rhoareasubtracted"), jet.r() / 100.0, jet.pt() - (rho * jet.area()), constituent.eta(), weight); @@ -620,7 +620,7 @@ struct JetFinderQATask { registry.fill(HIST("h3_jet_r_jet_pt_jet_ntracks_eventwiseconstituentsubtracted"), jet.r() / 100.0, jet.pt(), jet.tracksIds().size(), weight); registry.fill(HIST("h3_jet_r_jet_pt_jet_area_eventwiseconstituentsubtracted"), jet.r() / 100.0, jet.pt(), jet.area(), weight); - for (auto& constituent : jet.template tracks_as()) { + for (const auto& constituent : jet.template tracks_as()) { registry.fill(HIST("h3_jet_r_jet_pt_track_pt_eventwiseconstituentsubtracted"), jet.r() / 100.0, jet.pt(), constituent.pt(), weight); registry.fill(HIST("h3_jet_r_jet_pt_track_eta_eventwiseconstituentsubtracted"), jet.r() / 100.0, jet.pt(), constituent.eta(), weight); @@ -651,7 +651,7 @@ struct JetFinderQATask { registry.fill(HIST("h3_jet_r_part_jet_pt_part_jet_ntracks_part"), jet.r() / 100.0, jet.pt(), jet.tracksIds().size(), weight); float angularity = 0.; - for (auto& constituent : jet.template tracks_as()) { + for (const auto& constituent : jet.template tracks_as()) { registry.fill(HIST("h3_jet_r_part_jet_pt_part_track_pt_part"), jet.r() / 100.0, jet.pt(), constituent.pt(), weight); registry.fill(HIST("h3_jet_r_part_jet_pt_part_track_eta_part"), jet.r() / 100.0, jet.pt(), constituent.eta(), weight); @@ -670,7 +670,7 @@ struct JetFinderQATask { } if (jetBase.has_matchedJetGeo()) { - for (auto& jetTag : jetBase.template matchedJetGeo_as>()) { + for (const auto& jetTag : jetBase.template matchedJetGeo_as>()) { if (jetTag.pt() > pTHatMaxMCP * pTHat) { continue; } @@ -683,7 +683,7 @@ struct JetFinderQATask { registry.fill(HIST("h3_jet_r_jet_pt_tag_jet_phi_base_diff_matchedgeo"), jetBase.r() / 100.0, jetTag.pt(), jetTag.phi() - jetBase.phi(), weight); float leadingTrackPtTag = 0.; float angularityTag = 0.; - for (auto& constituent : jetTag.template tracks_as()) { + for (const auto& constituent : jetTag.template tracks_as()) { if (constituent.pt() > leadingTrackPtTag) { leadingTrackPtTag = constituent.pt(); } @@ -712,7 +712,7 @@ struct JetFinderQATask { } } if (jetBase.has_matchedJetPt()) { - for (auto& jetTag : jetBase.template matchedJetPt_as>()) { + for (const auto& jetTag : jetBase.template matchedJetPt_as>()) { if (jetTag.pt() > pTHatMaxMCP * pTHat) { continue; } @@ -725,7 +725,7 @@ struct JetFinderQATask { registry.fill(HIST("h3_jet_r_jet_pt_tag_jet_phi_base_diff_matchedpt"), jetBase.r() / 100.0, jetTag.pt(), jetTag.phi() - jetBase.phi(), weight); float leadingTrackPtTag = 0.; float angularityTag = 0.; - for (auto& constituent : jetTag.template tracks_as()) { + for (const auto& constituent : jetTag.template tracks_as()) { if (constituent.pt() > leadingTrackPtTag) { leadingTrackPtTag = constituent.pt(); } @@ -750,7 +750,7 @@ struct JetFinderQATask { if (jetBase.has_matchedJetGeo() && jetBase.has_matchedJetPt()) { - for (auto& jetTag : jetBase.template matchedJetGeo_as>()) { + for (const auto& jetTag : jetBase.template matchedJetGeo_as>()) { if (jetTag.pt() > pTHatMaxMCP * pTHat) { continue; } @@ -765,7 +765,7 @@ struct JetFinderQATask { registry.fill(HIST("h3_jet_r_jet_pt_tag_jet_phi_base_diff_matchedgeopt"), jetBase.r() / 100.0, jetTag.pt(), jetTag.phi() - jetBase.phi(), weight); float leadingTrackPtTag = 0.; float angularityTag = 0.; - for (auto& constituent : jetTag.template tracks_as()) { + for (const auto& constituent : jetTag.template tracks_as()) { if (constituent.pt() > leadingTrackPtTag) { leadingTrackPtTag = constituent.pt(); } @@ -818,52 +818,52 @@ struct JetFinderQATask { } TRandom3 randomNumber(0); float randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR); - float randomConePhi = randomNumber.Uniform(0.0, 2 * M_PI); + float randomConePhi = randomNumber.Uniform(0.0, o2::constants::math::TwoPI); float randomConePt = 0; for (auto const& track : tracks) { if (jetderiveddatautilities::selectTrack(track, trackSelection)) { - float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast(-M_PI)); + float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast(-o2::constants::math::PI)); float dEta = track.eta() - randomConeEta; - if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { + if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { randomConePt += track.pt(); } } } - registry.fill(HIST("h2_centrality_rhorandomcone"), collision.centFT0M(), randomConePt - M_PI * randomConeR * randomConeR * collision.rho()); + registry.fill(HIST("h2_centrality_rhorandomcone"), collision.centFT0M(), 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 randomConePt = 0; for (auto const& track : tracks) { if (jetderiveddatautilities::selectTrack(track, trackSelection)) { - float dPhi = RecoDecay::constrainAngle(randomNumber.Uniform(0.0, 2 * M_PI) - randomConePhi, static_cast(-M_PI)); // ignores actual phi of track - float dEta = randomNumber.Uniform(trackEtaMin, trackEtaMax) - randomConeEta; // ignores actual eta of track - if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { + 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) { randomConePt += track.pt(); } } } - registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirection"), collision.centFT0M(), randomConePt - M_PI * randomConeR * randomConeR * collision.rho()); + registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirection"), collision.centFT0M(), randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho()); // removing the leading jet from the random cone if (jets.size() > 0) { // if there are no jets in the acceptance (from the jetfinder cuts) then there can be no leading jet - float dPhiLeadingJet = RecoDecay::constrainAngle(jets.iteratorAt(0).phi() - randomConePhi, static_cast(-M_PI)); + 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 && (TMath::Sqrt(dEtaLeadingJet * dEtaLeadingJet + dPhiLeadingJet * dPhiLeadingJet) < jets.iteratorAt(0).r() / 100.0 + randomConeR)) || (randomConeLeadJetDeltaR > 0 && (TMath::Sqrt(dEtaLeadingJet * dEtaLeadingJet + dPhiLeadingJet * dPhiLeadingJet) < randomConeLeadJetDeltaR))) { + 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, 2 * M_PI); - dPhiLeadingJet = RecoDecay::constrainAngle(jets.iteratorAt(0).phi() - randomConePhi, static_cast(-M_PI)); + 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) { randomConePt = 0.0; for (auto const& track : tracks) { if (jetderiveddatautilities::selectTrack(track, trackSelection)) { // if track selection is uniformTrack, dcaXY and dcaZ cuts need to be added as they aren't in the selection so that they can be studied here - float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast(-M_PI)); + float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast(-o2::constants::math::PI)); float dEta = track.eta() - randomConeEta; - if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { + if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { randomConePt += track.pt(); } } @@ -871,16 +871,16 @@ struct JetFinderQATask { } } - registry.fill(HIST("h2_centrality_rhorandomconewithoutleadingjet"), collision.centFT0M(), randomConePt - M_PI * randomConeR * randomConeR * collision.rho()); + registry.fill(HIST("h2_centrality_rhorandomconewithoutleadingjet"), collision.centFT0M(), 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, removing tracks from 2 leading jets double randomConePtWithoutOneLeadJet = 0; double randomConePtWithoutTwoLeadJet = 0; for (auto const& track : tracks) { if (jetderiveddatautilities::selectTrack(track, trackSelection)) { - float dPhi = RecoDecay::constrainAngle(randomNumber.Uniform(0.0, 2 * M_PI) - randomConePhi, static_cast(-M_PI)); // ignores actual phi of track - float dEta = randomNumber.Uniform(trackEtaMin, trackEtaMax) - randomConeEta; // ignores actual eta of track - if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { + 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) { if (!trackIsInJet(track, jets.iteratorAt(0))) { randomConePtWithoutOneLeadJet += track.pt(); if (!trackIsInJet(track, jets.iteratorAt(1))) { @@ -890,18 +890,18 @@ struct JetFinderQATask { } } } - registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirectionwithoutoneleadingjets"), collision.centFT0M(), randomConePtWithoutOneLeadJet - M_PI * randomConeR * randomConeR * collision.rho()); - registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirectionwithouttwoleadingjets"), collision.centFT0M(), randomConePtWithoutTwoLeadJet - M_PI * randomConeR * randomConeR * collision.rho()); + registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirectionwithoutoneleadingjets"), collision.centFT0M(), randomConePtWithoutOneLeadJet - o2::constants::math::PI * randomConeR * randomConeR * collision.rho()); + registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirectionwithouttwoleadingjets"), collision.centFT0M(), randomConePtWithoutTwoLeadJet - o2::constants::math::PI * randomConeR * randomConeR * collision.rho()); } - enum mbGapSelectionRequirement { - mbGapOnly = -1, - mbGapSkip = 0, - mbGapAndSignal = 1 + enum MbGapSelectionRequirement { + MbGapOnly = -1, + MbGapSkip = 0, + MbGapAndSignal = 1 }; template - bool applyCollisionCuts_multCutCheck(TColl const& collision, bool fillHistograms = false, bool isWeighted = false, float eventWeight = 1.0) + bool applyCollisionCutsMultCutCheck(TColl const& collision, bool fillHistograms = false, bool isWeighted = false, float eventWeight = 1.0) { float centrality = -1.0; checkCentFT0M ? centrality = collision.centFT0M() : centrality = collision.centFT0C(); @@ -913,7 +913,7 @@ struct JetFinderQATask { registry.fill(HIST("h_collisions_weighted"), 0.5, eventWeight); } - if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents, multCutCheck_applyRCTSelections)) { + if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents, multCutCheckApplyRCTSelections)) { return false; } if (fillHistograms) { @@ -943,9 +943,9 @@ struct JetFinderQATask { registry.fill(HIST("h_collisions_weighted"), 3.5, eventWeight); } - if (multCutCheck_analyseMBGapEvents == mbGapSelectionRequirement::mbGapOnly && collision.getSubGeneratorId() != jetderiveddatautilities::JCollisionSubGeneratorId::mbGap) { + if (multCutCheckAnalyseMBGapEvents == MbGapSelectionRequirement::MbGapOnly && collision.getSubGeneratorId() != jetderiveddatautilities::JCollisionSubGeneratorId::mbGap) { return false; - } else if (multCutCheck_analyseMBGapEvents == mbGapSelectionRequirement::mbGapSkip && collision.getSubGeneratorId() == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap) { + } else if (multCutCheckAnalyseMBGapEvents == MbGapSelectionRequirement::MbGapSkip && collision.getSubGeneratorId() == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap) { return false; } @@ -1076,7 +1076,7 @@ struct JetFinderQATask { } float leadingTrackPtBase = 0.; float angularity = 0.; - for (auto& constituent : jet.template tracks_as()) { + for (const auto& constituent : jet.template tracks_as()) { if (constituent.pt() > leadingTrackPtBase) { leadingTrackPtBase = constituent.pt(); } @@ -1141,9 +1141,9 @@ struct JetFinderQATask { if (!isAcceptedJet(jet)) { return; } - auto mcCollision = mcCollisions.sliceBy(McCollisionsPerMCPCollision, jet.mcCollisionId()); + auto mcCollision = mcCollisions.sliceBy(mcCollisionsPerMCPCollision, jet.mcCollisionId()); if (checkMcCollisionIsMatched) { - auto collisionspermcpjet = collisions.sliceBy(CollisionsPerMCPCollision, jet.mcCollisionId()); + auto collisionspermcpjet = collisions.sliceBy(collisionsPerMCPCollision, jet.mcCollisionId()); if (collisionspermcpjet.size() >= 1 && jetderiveddatautilities::selectCollision(collisionspermcpjet.begin(), eventSelectionBits)) { fillMCPHistograms(jet, 1., mcCollision.begin().ptHard()); } @@ -1161,7 +1161,7 @@ struct JetFinderQATask { if (!isAcceptedJet(jet)) { return; } - auto mcCollision = mcCollisions.sliceBy(McCollisionsPerMCPCollision, jet.mcCollisionId()); + auto mcCollision = mcCollisions.sliceBy(mcCollisionsPerMCPCollision, jet.mcCollisionId()); if (mcCollision.size() == 1) { for (int N = 1; N < 21; N++) { if (jet.pt() < N * 0.25 * mcCollision.begin().ptHard() && jet.r() == round(selectedJetsRadius * 100.0f)) { @@ -1169,7 +1169,7 @@ struct JetFinderQATask { } } if (checkMcCollisionIsMatched) { - auto collisionspermcpjet = collisions.sliceBy(CollisionsPerMCPCollision, jet.mcCollisionId()); + auto collisionspermcpjet = collisions.sliceBy(collisionsPerMCPCollision, jet.mcCollisionId()); if (collisionspermcpjet.size() >= 1 && jetderiveddatautilities::selectCollision(collisionspermcpjet.begin(), eventSelectionBits)) { fillMCPHistograms(jet, mcCollision.begin().weight(), mcCollision.begin().ptHard()); } @@ -1201,7 +1201,7 @@ struct JetFinderQATask { } float leadingTrackPtBase = 0.; float angularity = 0.; - for (auto& constituent : mcdjet.template tracks_as()) { + for (const auto& constituent : mcdjet.template tracks_as()) { if (constituent.pt() > leadingTrackPtBase) { leadingTrackPtBase = constituent.pt(); } @@ -1234,7 +1234,7 @@ struct JetFinderQATask { } float leadingTrackPtBase = 0.; float angularity = 0.; - for (auto& constituent : mcdjet.template tracks_as()) { + for (const auto& constituent : mcdjet.template tracks_as()) { if (constituent.pt() > leadingTrackPtBase) { leadingTrackPtBase = constituent.pt(); } @@ -1287,27 +1287,27 @@ struct JetFinderQATask { } for (std::size_t iJetRadius = 0; iJetRadius < jetRadiiValues.size(); iJetRadius++) { - filledJetR_Both[iJetRadius] = false; - filledJetR_Low[iJetRadius] = false; - filledJetR_High[iJetRadius] = false; + filledJetRBoth[iJetRadius] = false; + filledJetRLow[iJetRadius] = false; + filledJetRHigh[iJetRadius] = false; } - for (auto& jet : jets) { + for (const auto& jet : jets) { for (std::size_t iJetRadius = 0; iJetRadius < jetRadiiValues.size(); iJetRadius++) { if (jet.r() == round(jetRadiiValues[iJetRadius] * 100.0f)) { - if (jetderiveddatautilities::selectTrigger(collision, jetderiveddatautilities::JTrigSel::JetChLowPt) && !filledJetR_Low[iJetRadius]) { - filledJetR_Low[iJetRadius] = true; + if (jetderiveddatautilities::selectTrigger(collision, jetderiveddatautilities::JTrigSel::JetChLowPt) && !filledJetRLow[iJetRadius]) { + filledJetRLow[iJetRadius] = true; for (double pt = 0.0; pt <= jet.pt(); pt += 1.0) { registry.fill(HIST("h2_jet_r_jet_pT_triggered_Low"), jet.r() / 100.0, pt); } } - if (jetderiveddatautilities::selectTrigger(collision, jetderiveddatautilities::JTrigSel::JetChHighPt) && !filledJetR_High[iJetRadius]) { - filledJetR_High[iJetRadius] = true; + if (jetderiveddatautilities::selectTrigger(collision, jetderiveddatautilities::JTrigSel::JetChHighPt) && !filledJetRHigh[iJetRadius]) { + filledJetRHigh[iJetRadius] = true; for (double pt = 0.0; pt <= jet.pt(); pt += 1.0) { registry.fill(HIST("h2_jet_r_jet_pT_triggered_High"), jet.r() / 100.0, pt); } } - if (jetderiveddatautilities::selectTrigger(collision, jetderiveddatautilities::JTrigSel::JetChLowPt) && jetderiveddatautilities::selectTrigger(collision, jetderiveddatautilities::JTrigSel::JetChHighPt) && !filledJetR_Both[iJetRadius]) { - filledJetR_Both[iJetRadius] = true; + if (jetderiveddatautilities::selectTrigger(collision, jetderiveddatautilities::JTrigSel::JetChLowPt) && jetderiveddatautilities::selectTrigger(collision, jetderiveddatautilities::JTrigSel::JetChHighPt) && !filledJetRBoth[iJetRadius]) { + filledJetRBoth[iJetRadius] = true; for (double pt = 0.0; pt <= jet.pt(); pt += 1.0) { registry.fill(HIST("h2_jet_r_jet_pT_triggered_Both"), jet.r() / 100.0, pt); } @@ -1339,7 +1339,7 @@ struct JetFinderQATask { registry.fill(HIST("h3_jet_r_jet_phi_collision"), jet.r() / 100.0, jet.phi(), 3.0); } - for (auto& constituent : jet.template tracks_as>()) { + for (const auto& constituent : jet.template tracks_as>()) { registry.fill(HIST("h3_jet_r_jet_pt_track_pt_MB"), jet.r() / 100.0, jet.pt(), constituent.pt()); registry.fill(HIST("h3_jet_r_jet_pt_track_eta_MB"), jet.r() / 100.0, jet.pt(), constituent.eta()); registry.fill(HIST("h3_jet_r_jet_pt_track_phi_MB"), jet.r() / 100.0, jet.pt(), constituent.phi()); @@ -1362,7 +1362,7 @@ struct JetFinderQATask { } } - for (auto& track : tracks) { + for (const auto& track : tracks) { if (!jetderiveddatautilities::selectTrack(track, trackSelection)) { continue; } @@ -1534,11 +1534,11 @@ struct JetFinderQATask { soa::Filtered> const& tracks, soa::Filtered const& mcparticles) { - float eventWeight = multCutCheck_applyWeightCorrection ? collision.weight() : 1; + float eventWeight = multCutCheckApplyWeightCorrection ? collision.weight() : 1; bool hasJetAboveMultCut = false; for (auto const& mcdjet : mcdjets) { - if (mcdjet.tracksIds().size() > multCutCheck_proportionalFactor * mcdjet.pt() + multCutCheck_abscissaAtOrigin) { + if (mcdjet.tracksIds().size() > multCutCheckProportionalFactor * mcdjet.pt() + multCutCheckAbscissaAtOrigin) { hasJetAboveMultCut = true; } } @@ -1547,8 +1547,8 @@ struct JetFinderQATask { } bool fillHistograms = true; - bool isWeighted = multCutCheck_applyWeightCorrection; - if (!applyCollisionCuts_multCutCheck(collision, fillHistograms, isWeighted, eventWeight)) { + bool isWeighted = multCutCheckApplyWeightCorrection; + if (!applyCollisionCutsMultCutCheck(collision, fillHistograms, isWeighted, eventWeight)) { return; } registry.fill(HIST("h_collisions_zvertex"), collision.posZ(), eventWeight); @@ -1589,7 +1589,7 @@ struct JetFinderQATask { int nParticlesPrimary = 0; if (collision.has_mcCollision()) { - auto particleMcCollision = mcparticles.sliceBy(ParticlesPerMCPCollision, collision.mcCollisionId()); + auto particleMcCollision = mcparticles.sliceBy(particlesPerMCPCollision, collision.mcCollisionId()); for (auto const& mcparticle : particleMcCollision) { registry.fill(HIST("h_particle_pdgcode"), mcparticle.pdgCode(), eventWeight); registry.fill(HIST("h_particle_genstatuscode"), mcparticle.getGenStatusCode(), eventWeight); diff --git a/PWGJE/Tasks/jetSpectraCharged.cxx b/PWGJE/Tasks/jetSpectraCharged.cxx index 982da377b8b..75aa98aba2e 100644 --- a/PWGJE/Tasks/jetSpectraCharged.cxx +++ b/PWGJE/Tasks/jetSpectraCharged.cxx @@ -96,7 +96,7 @@ struct JetSpectraCharged { float configSwitchHigh = 9998.0; float ptHardCalcMethodSwitch = 999.0; - static constexpr float kBrokenPtHardSentinel = 1.0f; + static constexpr float BrokenPtHardSentinel = 1.0f; enum AcceptSplitCollisionsOptions { NonSplitOnly = 0, @@ -936,7 +936,7 @@ struct JetSpectraCharged { if (collision.mcCollisionId() >= 0) { float storedPtHard = mccollisions.rawIteratorAt(collision.mcCollisionId()).ptHard(); // LHC26b5 ships placeholder ptHard=1.0; fall back to weight-derived. - if (storedPtHard > kBrokenPtHardSentinel && storedPtHard < ptHardCalcMethodSwitch) { + if (storedPtHard > BrokenPtHardSentinel && storedPtHard < ptHardCalcMethodSwitch) { ptHardFromMc = storedPtHard; } } @@ -972,7 +972,7 @@ struct JetSpectraCharged { float ptHardFromMc = ptHardCalcMethodSwitch; if (collision.mcCollisionId() >= 0) { float storedPtHard = mccollisions.rawIteratorAt(collision.mcCollisionId()).ptHard(); - if (storedPtHard > kBrokenPtHardSentinel && storedPtHard < ptHardCalcMethodSwitch) { + if (storedPtHard > BrokenPtHardSentinel && storedPtHard < ptHardCalcMethodSwitch) { ptHardFromMc = storedPtHard; } } @@ -1220,7 +1220,7 @@ struct JetSpectraCharged { return; } // LHC26b5 ships placeholder ptHard=1.0; fall back to weight-derived. - float pTHat = (mccollision.ptHard() > kBrokenPtHardSentinel && mccollision.ptHard() < ptHardCalcMethodSwitch) ? mccollision.ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = (mccollision.ptHard() > BrokenPtHardSentinel && mccollision.ptHard() < ptHardCalcMethodSwitch) ? mccollision.ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); for (auto const& jet : jets) { if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; @@ -1228,8 +1228,8 @@ struct JetSpectraCharged { if (!isAcceptedJet(jet, mcLevelIsParticleLevel)) { continue; } - int Nmax = 21; - for (int N = 1; N < Nmax; N++) { + int nMax = 21; + for (int N = 1; N < nMax; N++) { if (jet.pt() < N * 0.25 * pTHat && jet.r() == round(selectedJetsRadius * 100.0f)) { registry.fill(HIST("h2_jet_ptcut_part"), jet.pt(), N * 0.25, eventWeight); } @@ -1254,7 +1254,7 @@ struct JetSpectraCharged { } // See note in processSpectraMCPWeighted re: ptHard=1.0 placeholder in // current LHC26b5-class MC. - float pTHat = (mccollision.ptHard() > kBrokenPtHardSentinel && mccollision.ptHard() < ptHardCalcMethodSwitch) ? mccollision.ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = (mccollision.ptHard() > BrokenPtHardSentinel && mccollision.ptHard() < ptHardCalcMethodSwitch) ? mccollision.ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); registry.fill(HIST("h_mccollisions_rho"), mccollision.rho(), eventWeight); for (auto const& jet : jets) { @@ -1350,7 +1350,7 @@ struct JetSpectraCharged { float ptHardFromMc = ptHardCalcMethodSwitch; if (collision.mcCollisionId() >= 0) { float storedPtHard = mccollisions.rawIteratorAt(collision.mcCollisionId()).ptHard(); - if (storedPtHard > kBrokenPtHardSentinel && storedPtHard < ptHardCalcMethodSwitch) { + if (storedPtHard > BrokenPtHardSentinel && storedPtHard < ptHardCalcMethodSwitch) { ptHardFromMc = storedPtHard; } } @@ -1405,7 +1405,7 @@ struct JetSpectraCharged { float ptHardFromMc = ptHardCalcMethodSwitch; if (hasMc) { float storedPtHard = collision.mcCollision_as().ptHard(); - if (storedPtHard > kBrokenPtHardSentinel && storedPtHard < ptHardCalcMethodSwitch) { + if (storedPtHard > BrokenPtHardSentinel && storedPtHard < ptHardCalcMethodSwitch) { ptHardFromMc = storedPtHard; } } diff --git a/PWGJE/Tasks/jetSpectraChargedGen.cxx b/PWGJE/Tasks/jetSpectraChargedGen.cxx index 853a39eadce..16d24dd0c2e 100644 --- a/PWGJE/Tasks/jetSpectraChargedGen.cxx +++ b/PWGJE/Tasks/jetSpectraChargedGen.cxx @@ -62,8 +62,8 @@ struct JetSpectraChargedGen { Configurable alpha{"alpha", 1.0, "angularity alpha"}; Configurable jetPtMax{"jetPtMax", 200.0, "max of the jet pT axis"}; - static constexpr float kConfigSwitchLow = -98.0f; - static constexpr float kConfigSwitchHigh = 9998.0f; + static constexpr float ConfigSwitchLow = -98.0f; + static constexpr float ConfigSwitchHigh = 9998.0f; void init(InitContext const&) { @@ -116,13 +116,13 @@ struct JetSpectraChargedGen { template bool isAcceptedJet(TJet const& jet) { - if (jetAreaFractionMin > kConfigSwitchLow) { + if (jetAreaFractionMin > ConfigSwitchLow) { if (jet.area() < jetAreaFractionMin * o2::constants::math::PI * (jet.r() / 100.0) * (jet.r() / 100.0)) { return false; } } - bool checkMin = (leadingConstituentPtMin > kConfigSwitchLow); - bool checkMax = (leadingConstituentPtMax < kConfigSwitchHigh); + bool checkMin = (leadingConstituentPtMin > ConfigSwitchLow); + bool checkMax = (leadingConstituentPtMax < ConfigSwitchHigh); if (!checkMin && !checkMax) { return true; } diff --git a/PWGJE/Tasks/jetTutorial.cxx b/PWGJE/Tasks/jetTutorial.cxx index c157a5c6ca3..c5544e14257 100644 --- a/PWGJE/Tasks/jetTutorial.cxx +++ b/PWGJE/Tasks/jetTutorial.cxx @@ -9,10 +9,9 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// jet tutorial task for hands on tutorial session (16/11/2024) -// +/// \file jetTutorial.cxx +/// \brief jet tutorial task for hands on tutorial session (16/11/2024) /// \author Nima Zardoshti -// #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/Core/JetUtilities.h" @@ -42,7 +41,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -struct JetTutorialTask { +struct JetTutorial { HistogramRegistry registry{"registry", {{"h_collisions", "event status;event status;entries", {HistType::kTH1F, {{4, 0.0, 4.0}}}}, {"h_track_pt", "track pT;#it{p}_{T,track} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}}, @@ -122,7 +121,7 @@ struct JetTutorialTask { registry.fill(HIST("h_track_phi"), track.phi()); } } - PROCESS_SWITCH(JetTutorialTask, processCollisions, "process JE collisions", false); + PROCESS_SWITCH(JetTutorial, processCollisions, "process JE collisions", false); void processCollisionsWithExternalTracks(soa::Filtered::iterator const& collision, soa::Join const& tracks, soa::Join const&) { @@ -143,75 +142,75 @@ struct JetTutorialTask { registry.fill(HIST("h_track_chi2PerCluster"), originalTrack.tpcChi2NCl()); } } - PROCESS_SWITCH(JetTutorialTask, processCollisionsWithExternalTracks, "process JE collisions with access to the original track table", false); + PROCESS_SWITCH(JetTutorial, processCollisionsWithExternalTracks, "process JE collisions with access to the original track table", false); void processDataCharged(soa::Filtered::iterator const& collision, soa::Filtered const& jets) { if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits)) { return; } - for (auto& jet : jets) { + for (const auto& jet : jets) { registry.fill(HIST("h_jet_pt"), jet.pt()); registry.fill(HIST("h_jet_eta"), jet.eta()); registry.fill(HIST("h_jet_phi"), jet.phi()); } } - PROCESS_SWITCH(JetTutorialTask, processDataCharged, "charged jets in data", false); + PROCESS_SWITCH(JetTutorial, processDataCharged, "charged jets in data", false); void processMCDetectorLevelCharged(soa::Filtered::iterator const& collision, soa::Filtered const& jets) { if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits)) { return; } - for (auto& jet : jets) { + for (const auto& jet : jets) { registry.fill(HIST("h_jet_pt"), jet.pt()); registry.fill(HIST("h_jet_eta"), jet.eta()); registry.fill(HIST("h_jet_phi"), jet.phi()); } } - PROCESS_SWITCH(JetTutorialTask, processMCDetectorLevelCharged, "charged jets in detector level MC", false); + PROCESS_SWITCH(JetTutorial, processMCDetectorLevelCharged, "charged jets in detector level MC", false); void processMCDetectorLevelWeightedCharged(soa::Filtered::iterator const& collision, aod::JetMcCollisions const&, soa::Filtered const& jets) { if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits)) { return; } - for (auto& jet : jets) { + for (const auto& jet : jets) { registry.fill(HIST("h_jet_pt"), jet.pt(), collision.mcCollision().weight()); registry.fill(HIST("h_jet_eta"), jet.eta(), collision.mcCollision().weight()); registry.fill(HIST("h_jet_phi"), jet.phi(), collision.mcCollision().weight()); } } - PROCESS_SWITCH(JetTutorialTask, processMCDetectorLevelWeightedCharged, "charged jets in weighted detector level MC", false); + PROCESS_SWITCH(JetTutorial, processMCDetectorLevelWeightedCharged, "charged jets in weighted detector level MC", false); void processMCParticleLevelCharged(soa::Filtered::iterator const& mcCollision, soa::Filtered const& jets) { - for (auto& jet : jets) { + for (const auto& jet : jets) { registry.fill(HIST("h_part_jet_pt"), jet.pt(), mcCollision.weight()); registry.fill(HIST("h_part_jet_eta"), jet.eta(), mcCollision.weight()); registry.fill(HIST("h_part_jet_phi"), jet.phi(), mcCollision.weight()); } } - PROCESS_SWITCH(JetTutorialTask, processMCParticleLevelCharged, "charged jets in particle level MC", false); + PROCESS_SWITCH(JetTutorial, processMCParticleLevelCharged, "charged jets in particle level MC", false); void processMCCharged(soa::Filtered::iterator const& collision, aod::JetMcCollisions const&, soa::Filtered const& mcdjets, soa::Filtered const& mcpjets) { if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits)) { return; } - for (auto& mcdjet : mcdjets) { + for (const auto& mcdjet : mcdjets) { registry.fill(HIST("h_jet_pt"), mcdjet.pt(), collision.mcCollision().weight()); registry.fill(HIST("h_jet_eta"), mcdjet.eta(), collision.mcCollision().weight()); registry.fill(HIST("h_jet_phi"), mcdjet.phi(), collision.mcCollision().weight()); } auto mcpjetsPerCollision = mcpjets.sliceBy(perMcCollisionJets, collision.mcCollisionId()); - for (auto& mcpjet : mcpjetsPerCollision) { + for (const auto& mcpjet : mcpjetsPerCollision) { registry.fill(HIST("h_part_jet_pt"), mcpjet.pt(), collision.mcCollision().weight()); registry.fill(HIST("h_part_jet_eta"), mcpjet.eta(), collision.mcCollision().weight()); registry.fill(HIST("h_part_jet_phi"), mcpjet.phi(), collision.mcCollision().weight()); } } - PROCESS_SWITCH(JetTutorialTask, processMCCharged, "charged jets in detector and particle level MC", false); + PROCESS_SWITCH(JetTutorial, processMCCharged, "charged jets in detector and particle level MC", false); using JetMCPTable = soa::Filtered>; void processMCMatchedCharged(soa::Filtered::iterator const& collision, @@ -225,79 +224,79 @@ struct JetTutorialTask { return; } for (const auto& mcdjet : mcdjets) { - for (auto& mcpjet : mcdjet.template matchedJetGeo_as()) { + for (const auto& mcpjet : mcdjet.template matchedJetGeo_as()) { registry.fill(HIST("h_matched_jets_pt"), mcpjet.pt(), mcdjet.pt(), collision.mcCollision().weight()); registry.fill(HIST("h_matched_jets_phi"), mcpjet.phi(), mcdjet.phi(), collision.mcCollision().weight()); registry.fill(HIST("h_matched_jets_eta"), mcpjet.eta(), mcdjet.eta(), collision.mcCollision().weight()); } } } - PROCESS_SWITCH(JetTutorialTask, processMCMatchedCharged, "matched detector and particle level charged jets", false); + PROCESS_SWITCH(JetTutorial, processMCMatchedCharged, "matched detector and particle level charged jets", false); void processDataSubstructureCharged(soa::Filtered::iterator const& collision, soa::Filtered> const& jets, aod::JetTracks const&) { if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits)) { return; } - for (auto& jet : jets) { + for (const auto& jet : jets) { registry.fill(HIST("h_jet_pt"), jet.pt()); registry.fill(HIST("h_jet_eta"), jet.eta()); registry.fill(HIST("h_jet_phi"), jet.phi()); registry.fill(HIST("h_jet_ntracks"), jet.tracksIds().size()); double angularity = 0.0; - for (auto& jetConstituent : jet.tracks_as()) { + for (const auto& jetConstituent : jet.tracks_as()) { angularity += std::pow(jetConstituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, jetConstituent) / (jet.r() / 100.f), alpha); } angularity /= std::pow(jet.pt(), kappa); registry.fill(HIST("h_jet_angularity"), angularity); } } - PROCESS_SWITCH(JetTutorialTask, processDataSubstructureCharged, "charged jet substructure", false); + PROCESS_SWITCH(JetTutorial, processDataSubstructureCharged, "charged jet substructure", false); void processDataFull(soa::Filtered::iterator const&, soa::Filtered const& jets) { - for (auto& jet : jets) { + for (const auto& jet : jets) { registry.fill(HIST("h_jet_pt"), jet.pt()); registry.fill(HIST("h_jet_eta"), jet.eta()); registry.fill(HIST("h_jet_phi"), jet.phi()); } } - PROCESS_SWITCH(JetTutorialTask, processDataFull, "full jets in data", false); + PROCESS_SWITCH(JetTutorial, processDataFull, "full jets in data", false); void processDataSubstructureFull(soa::Filtered::iterator const&, soa::Filtered> const& jets, aod::JetTracks const&, aod::JetClusters const&) { - for (auto& jet : jets) { + for (const auto& jet : jets) { registry.fill(HIST("h_full_jet_pt"), jet.pt()); registry.fill(HIST("h_full_jet_eta"), jet.eta()); registry.fill(HIST("h_full_jet_phi"), jet.phi()); registry.fill(HIST("h_full_jet_ntracks"), jet.tracksIds().size()); registry.fill(HIST("h_full_jet_nclusters"), jet.clustersIds().size()); double angularity = 0.0; - for (auto& jetConstituent : jet.tracks_as()) { + for (const auto& jetConstituent : jet.tracks_as()) { angularity += std::pow(jetConstituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, jetConstituent) / (jet.r() / 100.f), alpha); } - for (auto& jetCluster : jet.clusters_as()) { + for (const auto& jetCluster : jet.clusters_as()) { angularity += std::pow(jetCluster.energy(), kappa) * std::pow(jetutilities::deltaR(jet, jetCluster) / (jet.r() / 100.f), alpha); } registry.fill(HIST("h_full_jet_angularity"), angularity / std::pow(jet.pt(), kappa)); } } - PROCESS_SWITCH(JetTutorialTask, processDataSubstructureFull, "full jet substructure", false); + PROCESS_SWITCH(JetTutorial, processDataSubstructureFull, "full jet substructure", false); void processMCParticleLevelSubstructureFull(soa::Filtered::iterator const& mcCollision, soa::Filtered> const& jets, aod::JetParticles const&) { - for (auto& jet : jets) { + for (const auto& jet : jets) { double angularity = 0.0; - for (auto& jetConstituent : jet.tracks_as()) { + for (const auto& jetConstituent : jet.tracks_as()) { angularity += std::pow(jetConstituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, jetConstituent) / (jet.r() / 100.f), alpha); } angularity /= std::pow(jet.pt(), kappa); registry.fill(HIST("h_part_jet_angularity"), angularity, mcCollision.weight()); } } - PROCESS_SWITCH(JetTutorialTask, processMCParticleLevelSubstructureFull, "full particle level jet substructure", false); + PROCESS_SWITCH(JetTutorial, processMCParticleLevelSubstructureFull, "full particle level jet substructure", false); void processRecoilDataCharged(soa::Filtered::iterator const& collision, soa::Filtered const& jets, aod::JetTracks const& tracks) { @@ -307,8 +306,10 @@ struct JetTutorialTask { bool selectedEvent = false; double leadingTrackpT = 0.0; double leadingTrackPhi = 0.0; - for (auto& track : tracks) { - if (track.pt() > 6.0 && track.pt() < 10.0) { + double trackpTMin = 6.0; + double trackpTMax = 10.0; + for (const auto& track : tracks) { + if (track.pt() > trackpTMin && track.pt() < trackpTMax) { if (track.pt() > leadingTrackpT) { leadingTrackpT = track.pt(); leadingTrackPhi = track.phi(); @@ -319,8 +320,9 @@ struct JetTutorialTask { if (!selectedEvent) { return; } - for (auto& jet : jets) { - if (std::abs(RecoDecay::constrainAngle(jet.phi() - leadingTrackPhi, -o2::constants::math::PIHalf)) > 0.6) { + double phiRange = 0.6; + for (const auto& jet : jets) { + if (std::abs(RecoDecay::constrainAngle(jet.phi() - leadingTrackPhi, -o2::constants::math::PIHalf)) > phiRange) { registry.fill(HIST("h_recoil_jet_pt"), jet.pt()); registry.fill(HIST("h_recoil_jet_eta"), jet.eta()); registry.fill(HIST("h_recoil_jet_phi"), jet.phi()); @@ -328,7 +330,7 @@ struct JetTutorialTask { } } } - PROCESS_SWITCH(JetTutorialTask, processRecoilDataCharged, "hadron-recoil charged jets", false); + PROCESS_SWITCH(JetTutorial, processRecoilDataCharged, "hadron-recoil charged jets", false); void processDataRhoAreaSubtractedCharged(soa::Filtered>::iterator const& collision, soa::Filtered const& jets) { @@ -342,7 +344,7 @@ struct JetTutorialTask { registry.fill(HIST("h_jet_phi"), jet.phi()); } } - PROCESS_SWITCH(JetTutorialTask, processDataRhoAreaSubtractedCharged, "charged rho-area subtracted jets", false); + PROCESS_SWITCH(JetTutorial, processDataRhoAreaSubtractedCharged, "charged rho-area subtracted jets", false); void processDataConstituentSubtractedCharged(soa::Filtered::iterator const& collision, soa::Filtered const& jets) { @@ -355,7 +357,7 @@ struct JetTutorialTask { registry.fill(HIST("h_jet_phi"), jet.phi()); } } - PROCESS_SWITCH(JetTutorialTask, processDataConstituentSubtractedCharged, "charged constituent subtracted jets", false); + PROCESS_SWITCH(JetTutorial, processDataConstituentSubtractedCharged, "charged constituent subtracted jets", false); void processDataConstituentSubtractedSubstructureCharged(soa::Filtered::iterator const& collision, soa::Filtered> const& jets, aod::JetTracksSub const&) { @@ -368,27 +370,27 @@ struct JetTutorialTask { registry.fill(HIST("h_jet_phi"), jet.phi()); registry.fill(HIST("h_jet_ntracks"), jet.tracksIds().size()); double angularity = 0.0; - for (auto& jetConstituent : jet.tracks_as()) { + for (const auto& jetConstituent : jet.tracks_as()) { angularity += std::pow(jetConstituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, jetConstituent) / (jet.r() / 100.f), alpha); } angularity /= std::pow(jet.pt(), kappa); registry.fill(HIST("h_jet_angularity_constsub"), angularity); } } - PROCESS_SWITCH(JetTutorialTask, processDataConstituentSubtractedSubstructureCharged, "charged constituent subtracted jet substructure", false); + PROCESS_SWITCH(JetTutorial, processDataConstituentSubtractedSubstructureCharged, "charged constituent subtracted jet substructure", false); void processDataTriggered(soa::Filtered::iterator const& collision, soa::Filtered const& jets) { if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits) || !jetderiveddatautilities::selectTrigger(collision, triggerMaskBits)) { return; } - for (auto& jet : jets) { + for (const auto& jet : jets) { registry.fill(HIST("h_jet_pt"), jet.pt()); registry.fill(HIST("h_jet_eta"), jet.eta()); registry.fill(HIST("h_jet_phi"), jet.phi()); } } - PROCESS_SWITCH(JetTutorialTask, processDataTriggered, "jets triggered", false); + PROCESS_SWITCH(JetTutorial, processDataTriggered, "jets triggered", false); }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"jet-tutorial"})}; } +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From 4c579d0fd997b860f31d68eafaaa851c98e70958 Mon Sep 17 00:00:00 2001 From: Tucker Hwang Date: Mon, 14 Sep 2026 07:12:15 -0700 Subject: [PATCH 3/8] Fix axes names --- PWGJE/Tasks/jetSpectraCharged.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGJE/Tasks/jetSpectraCharged.cxx b/PWGJE/Tasks/jetSpectraCharged.cxx index 75aa98aba2e..adb37d55848 100644 --- a/PWGJE/Tasks/jetSpectraCharged.cxx +++ b/PWGJE/Tasks/jetSpectraCharged.cxx @@ -244,7 +244,7 @@ struct JetSpectraCharged { registry.add("h2_jet_phi_mcd_jet_phi_mcp_matchedgeo_mcdetaconstraint", "Phi mcd vs. Phi mcp;#varphi_{jet}^{mcd};#varphi_{jet}^{mcp}", {HistType::kTH2F, {phiAxis, phiAxis}}, doSumw2); registry.add("h2_jet_phi_mcd_jet_phi_mcp_matchedgeo_mcpetaconstraint", "Phi mcd vs. Phi mcp;#varphi_{jet}^{mcd};#varphi_{jet}^{mcp}", {HistType::kTH2F, {phiAxis, phiAxis}}, doSumw2); registry.add("h2_jet_ntracks_mcd_jet_ntracks_mcp_matchedgeo", "Ntracks mcd vs. Ntracks mcp;N_{jet tracks}^{mcd};N_{jet tracks}^{mcp}", {HistType::kTH2F, {{200, -0.5, 199.5}, {200, -0.5, 199.5}}}, doSumw2); - registry.add("h2_jet_pt_mcp_jet_pt_diff_matchedgeo", "jet mcp pT vs. delta pT / jet mcp pt;#it{p}_{T,jet}^{mcp} (GeV/#it{c}); (#it{p}_{T,jet}^{mcp} (GeV/#it{c}) - #it{p}_{T,jet}^{mcd} (GeV/#it{c})) / #it{p}_{T,jet}^{mcp} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxis, {1000, -5.0, 2.0}}}, doSumw2); + registry.add("h2_jet_pt_mcp_jet_pt_diff_matchedgeo", "jet mcp pT vs. delta pT / jet mcp pt;#it{p}_{T,jet}^{mcp} (GeV/#it{c}); (#it{p}_{T,jet}^{mcd} (GeV/#it{c}) - #it{p}_{T,jet}^{mcp} (GeV/#it{c})) / #it{p}_{T,jet}^{mcp} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxis, {1000, -5.0, 2.0}}}, doSumw2); registry.add("h2_jet_pt_mcd_jet_pt_diff_matchedgeo", "jet mcd pT vs. delta pT / jet mcd pt;#it{p}_{T,jet}^{mcd} (GeV/#it{c}); (#it{p}_{T,jet}^{mcd} (GeV/#it{c}) - #it{p}_{T,jet}^{mcp} (GeV/#it{c})) / #it{p}_{T,jet}^{mcd} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxis, {1000, -5.0, 2.0}}}, doSumw2); registry.add("h2_jet_pt_mcp_jet_pt_ratio_matchedgeo", "jet mcp pT vs. jet mcd pT / jet mcp pt;#it{p}_{T,jet}^{mcp} (GeV/#it{c}); #it{p}_{T,jet}^{mcd} (GeV/#it{c}) / #it{p}_{T,jet}^{mcp} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxis, {1000, -5.0, 5.0}}}, doSumw2); registry.add("h3_jet_pt_mcd_jet_pt_mcp_jet_mcd_angularity_matchedgeo_mcdetaconstraint", "pT mcd vs. pT mcp vs. angularity mcd;#it{p}_{T,jet}^{mcd} (GeV/#it{c});#it{p}_{T,jet}^{mcp} (GeV/#it{c});angularity", {HistType::kTH3F, {jetPtAxis, jetPtAxis, {30, 0., 1.}}}, doSumw2); @@ -258,7 +258,7 @@ struct JetSpectraCharged { registry.add("h2_jet_phi_mcd_jet_phi_mcp_matchedgpt_mcdetaconstraint", "Phi mcd vs. Phi mcp;#varphi_{jet}^{mcd};#varphi_{jet}^{mcp}", {HistType::kTH2F, {phiAxis, phiAxis}}, doSumw2); registry.add("h2_jet_phi_mcd_jet_phi_mcp_matchedgpt_mcpetaconstraint", "Phi mcd vs. Phi mcp;#varphi_{jet}^{mcd};#varphi_{jet}^{mcp}", {HistType::kTH2F, {phiAxis, phiAxis}}, doSumw2); registry.add("h2_jet_ntracks_mcd_jet_ntracks_mcp_matchedpt", "Ntracks mcd vs. Ntracks mcp;N_{jet tracks}^{mcd};N_{jet tracks}^{mcp}", {HistType::kTH2F, {{200, -0.5, 199.5}, {200, -0.5, 199.5}}}, doSumw2); - registry.add("h2_jet_pt_mcp_jet_pt_diff_matchedpt", "jet mcp pT vs. delta pT / jet mcp pt;#it{p}_{T,jet}^{mcp} (GeV/#it{c}); (#it{p}_{T,jet}^{mcp} (GeV/#it{c}) - #it{p}_{T,jet}^{mcd} (GeV/#it{c})) / #it{p}_{T,jet}^{mcp} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxis, {1000, -5.0, 2.0}}}, doSumw2); + registry.add("h2_jet_pt_mcp_jet_pt_diff_matchedpt", "jet mcp pT vs. delta pT / jet mcp pt;#it{p}_{T,jet}^{mcp} (GeV/#it{c}); (#it{p}_{T,jet}^{mcd} (GeV/#it{c}) - #it{p}_{T,jet}^{mcp} (GeV/#it{c})) / #it{p}_{T,jet}^{mcp} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxis, {1000, -5.0, 2.0}}}, doSumw2); registry.add("h2_jet_pt_mcd_jet_pt_diff_matchedpt", "jet mcd pT vs. delta pT / jet mcd pt;#it{p}_{T,jet}^{mcd} (GeV/#it{c}); (#it{p}_{T,jet}^{mcd} (GeV/#it{c}) - #it{p}_{T,jet}^{mcp} (GeV/#it{c})) / #it{p}_{T,jet}^{mcd} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxis, {1000, -5.0, 2.0}}}, doSumw2); registry.add("h2_jet_pt_mcp_jet_pt_ratio_matchedpt", "jet mcp pT vs. jet mcd pT / jet mcp pt;#it{p}_{T,jet}^{mcp} (GeV/#it{c}); #it{p}_{T,jet}^{mcd} (GeV/#it{c}) / #it{p}_{T,jet}^{mcp} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxis, {1000, -5.0, 5.0}}}, doSumw2); registry.add("h3_jet_pt_mcd_jet_pt_mcp_jet_mcd_angularity_matchedpt_mcdetaconstraint", "pT mcd vs. pT mcp vs. angularity mcd;#it{p}_{T,jet}^{mcd} (GeV/#it{c});#it{p}_{T,jet}^{mcp} (GeV/#it{c});angularity", {HistType::kTH3F, {jetPtAxis, jetPtAxis, {30, 0., 1.}}}, doSumw2); @@ -272,7 +272,7 @@ struct JetSpectraCharged { registry.add("h2_jet_phi_mcd_jet_phi_mcp_matchedgeopt_mcdetaconstraint", "Phi mcd vs. Phi mcp;#varphi_{jet}^{mcd};#varphi_{jet}^{mcp}", {HistType::kTH2F, {phiAxis, phiAxis}}, doSumw2); registry.add("h2_jet_phi_mcd_jet_phi_mcp_matchedgeopt_mcpetaconstraint", "Phi mcd vs. Phi mcp;#varphi_{jet}^{mcd};#varphi_{jet}^{mcp}", {HistType::kTH2F, {phiAxis, phiAxis}}, doSumw2); registry.add("h2_jet_ntracks_mcd_jet_ntracks_mcp_matchedgeopt", "Ntracks mcd vs. Ntracks mcp;N_{jet tracks}^{mcd};N_{jet tracks}^{mcp}", {HistType::kTH2F, {{200, -0.5, 199.5}, {200, -0.5, 199.5}}}, doSumw2); - registry.add("h2_jet_pt_mcp_jet_pt_diff_matchedgeopt", "jet mcp pT vs. delta pT / jet mcp pt;#it{p}_{T,jet}^{mcp} (GeV/#it{c}); (#it{p}_{T,jet}^{mcp} (GeV/#it{c}) - #it{p}_{T,jet}^{mcd} (GeV/#it{c})) / #it{p}_{T,jet}^{mcp} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxis, {1000, -5.0, 2.0}}}, doSumw2); + registry.add("h2_jet_pt_mcp_jet_pt_diff_matchedgeopt", "jet mcp pT vs. delta pT / jet mcp pt;#it{p}_{T,jet}^{mcp} (GeV/#it{c}); (#it{p}_{T,jet}^{mcd} (GeV/#it{c}) - #it{p}_{T,jet}^{mcp} (GeV/#it{c})) / #it{p}_{T,jet}^{mcp} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxis, {1000, -5.0, 2.0}}}, doSumw2); registry.add("h2_jet_pt_mcd_jet_pt_diff_matchedgeopt", "jet mcd pT vs. delta pT / jet mcd pt;#it{p}_{T,jet}^{mcd} (GeV/#it{c}); (#it{p}_{T,jet}^{mcd} (GeV/#it{c}) - #it{p}_{T,jet}^{mcp} (GeV/#it{c})) / #it{p}_{T,jet}^{mcd} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxis, {1000, -5.0, 2.0}}}, doSumw2); registry.add("h2_jet_pt_mcp_jet_pt_ratio_matchedgeopt", "jet mcp pT vs. jet mcd pT / jet mcp pt;#it{p}_{T,jet}^{mcp} (GeV/#it{c}); #it{p}_{T,jet}^{mcd} (GeV/#it{c}) / #it{p}_{T,jet}^{mcp} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxis, {1000, -5.0, 5.0}}}, doSumw2); registry.add("h3_jet_pt_mcd_jet_pt_mcp_jet_mcd_angularity_matchedgeopt_mcdetaconstraint", "pT mcd vs. pT mcp vs. angularity mcd;#it{p}_{T,jet}^{mcd} (GeV/#it{c});#it{p}_{T,jet}^{mcp} (GeV/#it{c});angularity", {HistType::kTH3F, {jetPtAxis, jetPtAxis, {30, 0., 1.}}}, doSumw2); From 6a40815358baa3744e5697d13dff38da7dab443f Mon Sep 17 00:00:00 2001 From: Tucker Hwang Date: Mon, 14 Sep 2026 07:16:18 -0700 Subject: [PATCH 4/8] Add missed kappa fix --- PWGJE/Tasks/jetSpectraCharged.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGJE/Tasks/jetSpectraCharged.cxx b/PWGJE/Tasks/jetSpectraCharged.cxx index adb37d55848..6a509b6789d 100644 --- a/PWGJE/Tasks/jetSpectraCharged.cxx +++ b/PWGJE/Tasks/jetSpectraCharged.cxx @@ -745,7 +745,7 @@ struct JetSpectraCharged { for (const auto& constituent : jetMCD.template tracks_as()) { angularityMcd += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jetMCD, constituent) / (jetMCD.r() / 100.f), alpha); } - angularityMcd /= (corrBasejetpt * (jetMCD.r() / 100.f)); + angularityMcd /= std::pow(corrBasejetpt, kappa); if (jetfindingutilities::isInEtaAcceptance(jetMCD, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { registry.fill(HIST("h2_jet_pt_mcd_jet_pt_mcp_matchedgeo_rhoareasubtracted_mcdetaconstraint"), corrBasejetpt, corrTagjetpt, weight); if (jetfindingutilities::isInEtaAcceptance(jetMCP, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { From 81405afc4856c0920d542390ad9f2ed719c93a81 Mon Sep 17 00:00:00 2001 From: Tucker Hwang Date: Mon, 14 Sep 2026 07:18:37 -0700 Subject: [PATCH 5/8] Recapitalize preslices --- PWGJE/Tasks/jetFinderQA.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGJE/Tasks/jetFinderQA.cxx b/PWGJE/Tasks/jetFinderQA.cxx index 8274100660a..e0aace52f75 100644 --- a/PWGJE/Tasks/jetFinderQA.cxx +++ b/PWGJE/Tasks/jetFinderQA.cxx @@ -471,9 +471,9 @@ struct JetFinderQATask { Filter eventCuts = (nabs(aod::jcollision::posZ) < vertexZCut && ((checkCentFT0M ? aod::jcollision::centFT0M : aod::jcollision::centFT0C) >= centralityMin) && ((checkCentFT0M ? aod::jcollision::centFT0M : aod::jcollision::centFT0C) < centralityMax)); - PresliceUnsorted> collisionsPerMCPCollision = aod::jmccollisionlb::mcCollisionId; - PresliceUnsorted> mcCollisionsPerMCPCollision = aod::jmccollision::mcCollisionId; - Preslice particlesPerMCPCollision = aod::jmcparticle::mcCollisionId; + PresliceUnsorted> CollisionsPerMCPCollision = aod::jmccollisionlb::mcCollisionId; + PresliceUnsorted> McCollisionsPerMCPCollision = aod::jmccollision::mcCollisionId; + Preslice ParticlesPerMCPCollision = aod::jmcparticle::mcCollisionId; template bool isAcceptedJet(U const& jet) From 303a57ec1e121f42a71703f76dfd91a3dc41bf0d Mon Sep 17 00:00:00 2001 From: Tucker Hwang Date: Mon, 14 Sep 2026 07:28:53 -0700 Subject: [PATCH 6/8] Remove unneeded includes --- PWGJE/Tasks/jetFinderQA.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/PWGJE/Tasks/jetFinderQA.cxx b/PWGJE/Tasks/jetFinderQA.cxx index e0aace52f75..e7ba7e7545a 100644 --- a/PWGJE/Tasks/jetFinderQA.cxx +++ b/PWGJE/Tasks/jetFinderQA.cxx @@ -22,6 +22,7 @@ #include "Common/Core/RecoDecay.h" +#include #include #include #include @@ -31,8 +32,6 @@ #include #include -#include -#include #include #include @@ -42,8 +41,6 @@ #include #include -#include - using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; From 8374fe5ac72c6ff6f84e2ad9655b204f7169e55b Mon Sep 17 00:00:00 2001 From: Tucker Hwang Date: Mon, 14 Sep 2026 08:03:54 -0700 Subject: [PATCH 7/8] Recapitalize preslices (missed some) --- PWGJE/Tasks/jetFinderQA.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGJE/Tasks/jetFinderQA.cxx b/PWGJE/Tasks/jetFinderQA.cxx index e7ba7e7545a..cd28f221ad9 100644 --- a/PWGJE/Tasks/jetFinderQA.cxx +++ b/PWGJE/Tasks/jetFinderQA.cxx @@ -1138,9 +1138,9 @@ struct JetFinderQATask { if (!isAcceptedJet(jet)) { return; } - auto mcCollision = mcCollisions.sliceBy(mcCollisionsPerMCPCollision, jet.mcCollisionId()); + auto mcCollision = mcCollisions.sliceBy(McCollisionsPerMCPCollision, jet.mcCollisionId()); if (checkMcCollisionIsMatched) { - auto collisionspermcpjet = collisions.sliceBy(collisionsPerMCPCollision, jet.mcCollisionId()); + auto collisionspermcpjet = collisions.sliceBy(CollisionsPerMCPCollision, jet.mcCollisionId()); if (collisionspermcpjet.size() >= 1 && jetderiveddatautilities::selectCollision(collisionspermcpjet.begin(), eventSelectionBits)) { fillMCPHistograms(jet, 1., mcCollision.begin().ptHard()); } @@ -1158,7 +1158,7 @@ struct JetFinderQATask { if (!isAcceptedJet(jet)) { return; } - auto mcCollision = mcCollisions.sliceBy(mcCollisionsPerMCPCollision, jet.mcCollisionId()); + auto mcCollision = mcCollisions.sliceBy(McCollisionsPerMCPCollision, jet.mcCollisionId()); if (mcCollision.size() == 1) { for (int N = 1; N < 21; N++) { if (jet.pt() < N * 0.25 * mcCollision.begin().ptHard() && jet.r() == round(selectedJetsRadius * 100.0f)) { @@ -1166,7 +1166,7 @@ struct JetFinderQATask { } } if (checkMcCollisionIsMatched) { - auto collisionspermcpjet = collisions.sliceBy(collisionsPerMCPCollision, jet.mcCollisionId()); + auto collisionspermcpjet = collisions.sliceBy(CollisionsPerMCPCollision, jet.mcCollisionId()); if (collisionspermcpjet.size() >= 1 && jetderiveddatautilities::selectCollision(collisionspermcpjet.begin(), eventSelectionBits)) { fillMCPHistograms(jet, mcCollision.begin().weight(), mcCollision.begin().ptHard()); } @@ -1586,7 +1586,7 @@ struct JetFinderQATask { int nParticlesPrimary = 0; if (collision.has_mcCollision()) { - auto particleMcCollision = mcparticles.sliceBy(particlesPerMCPCollision, collision.mcCollisionId()); + auto particleMcCollision = mcparticles.sliceBy(ParticlesPerMCPCollision, collision.mcCollisionId()); for (auto const& mcparticle : particleMcCollision) { registry.fill(HIST("h_particle_pdgcode"), mcparticle.pdgCode(), eventWeight); registry.fill(HIST("h_particle_genstatuscode"), mcparticle.getGenStatusCode(), eventWeight); From 7658b872bbab28cac129916086607679380e90e3 Mon Sep 17 00:00:00 2001 From: Tucker Hwang Date: Mon, 14 Sep 2026 08:10:56 -0700 Subject: [PATCH 8/8] Set corrected jet pT to float to fit kappa for std::pow signature --- PWGJE/Tasks/jetSpectraCharged.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGJE/Tasks/jetSpectraCharged.cxx b/PWGJE/Tasks/jetSpectraCharged.cxx index 6a509b6789d..44363723bf9 100644 --- a/PWGJE/Tasks/jetSpectraCharged.cxx +++ b/PWGJE/Tasks/jetSpectraCharged.cxx @@ -738,9 +738,9 @@ struct JetSpectraCharged { continue; } if (jetMCD.r() == round(selectedJetsRadius * 100.0f)) { - double corrTagjetpt = jetMCP.pt() - (mcrho * jetMCP.area()); - double corrBasejetpt = jetMCD.pt() - (rho * jetMCD.area()); - double dcorrpt = corrBasejetpt - corrTagjetpt; + float corrTagjetpt = jetMCP.pt() - (mcrho * jetMCP.area()); + float corrBasejetpt = jetMCD.pt() - (rho * jetMCD.area()); + float dcorrpt = corrBasejetpt - corrTagjetpt; float angularityMcd = 0.; for (const auto& constituent : jetMCD.template tracks_as()) { angularityMcd += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jetMCD, constituent) / (jetMCD.r() / 100.f), alpha);