From a6e15720b0977db5e9e20c494b6dae147b9fed2e Mon Sep 17 00:00:00 2001 From: louisemillot Date: Fri, 9 Oct 2026 15:13:05 +0200 Subject: [PATCH 1/5] adding log debbug for pt hat --- PWGJE/TableProducer/slimTablesProducer.cxx | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/PWGJE/TableProducer/slimTablesProducer.cxx b/PWGJE/TableProducer/slimTablesProducer.cxx index cbaf139646e..8fab887e46a 100644 --- a/PWGJE/TableProducer/slimTablesProducer.cxx +++ b/PWGJE/TableProducer/slimTablesProducer.cxx @@ -25,12 +25,14 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -50,11 +52,13 @@ using SlimCollision = SlimCollisions::iterator; namespace slmccollision { DECLARE_SOA_COLUMN(McWeight, mcWeight, float); -} +DECLARE_SOA_COLUMN(PtHard, ptHard, float); +} // namespace slmccollision DECLARE_SOA_TABLE(SlMcCollisions, "AOD", "SLMCCOLLISION", o2::soa::Index<>, o2::aod::mccollision::PosZ, - slmccollision::McWeight); + slmccollision::McWeight, + slmccollision::PtHard); using SlMcCollision = SlMcCollisions::iterator; namespace slimtracks { @@ -198,6 +202,16 @@ struct SlimTablesProducer { soa::Filtered const& particles) { float eventWeightMC = mccollision.weight(); + + // --- TEST pT hat (a retirer une fois la formule validee) --- + float ptHardTrue = mccollision.ptHard(); + float ptHardFromW = 10.f * std::pow(eventWeightMC, -0.25f); + static int nPrint = 0; + if (nPrint < 50) { + LOG(info) << "ptHard vrai = " << ptHardTrue << " | ptHard formule = " << ptHardFromW; + ++nPrint; + } + if (collisions.size() != 1) { // skip the mccollision if it has mre than 1 associated rec collision return; } @@ -237,7 +251,7 @@ struct SlimTablesProducer { histos.fill(HIST("Ntracks_pT"), track.pt(), eventWeight); slimTracks(slimCollIndex, track.px(), track.py(), track.pz()); } - slimMcCollisions(mccollision.posZ(), eventWeightMC); + slimMcCollisions(mccollision.posZ(), eventWeightMC, ptHardFromW); auto slimMcCollIndex = slimMcCollisions.lastIndex(); for (const auto& particle : particles) { if (!particle.isPhysicalPrimary()) { From be144b1c1540d3fa77f5c68673cfcb798f492e66 Mon Sep 17 00:00:00 2001 From: louisemillot Date: Fri, 9 Oct 2026 21:32:01 +0200 Subject: [PATCH 2/5] log --- PWGJE/TableProducer/slimTablesProducer.cxx | 24 +++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/PWGJE/TableProducer/slimTablesProducer.cxx b/PWGJE/TableProducer/slimTablesProducer.cxx index 8fab887e46a..a52159d497f 100644 --- a/PWGJE/TableProducer/slimTablesProducer.cxx +++ b/PWGJE/TableProducer/slimTablesProducer.cxx @@ -203,15 +203,6 @@ struct SlimTablesProducer { { float eventWeightMC = mccollision.weight(); - // --- TEST pT hat (a retirer une fois la formule validee) --- - float ptHardTrue = mccollision.ptHard(); - float ptHardFromW = 10.f * std::pow(eventWeightMC, -0.25f); - static int nPrint = 0; - if (nPrint < 50) { - LOG(info) << "ptHard vrai = " << ptHardTrue << " | ptHard formule = " << ptHardFromW; - ++nPrint; - } - if (collisions.size() != 1) { // skip the mccollision if it has mre than 1 associated rec collision return; } @@ -224,6 +215,19 @@ struct SlimTablesProducer { return; } histos.fill(HIST("h_mcCollMCP_counts_weight"), 2.5, eventWeightMC); + + // --- TEST pT hat (a retirer une fois la formule validee) --- + // Ce log est place APRES le rejet des events min bias gap : + // il n'affiche donc que les events qui sont vraiment gardes dans l'analyse. + float ptHardTrue = mccollision.ptHard(); + float ptHardFromW = 10.f * std::pow(eventWeightMC, -0.25f); + static int nPrint = 0; + if (nPrint < 50) { + LOG(info) << "ptHard vrai = " << ptHardTrue << " | ptHard formule = " << ptHardFromW; + ++nPrint; + } + // --- fin du test --- + for (auto const& collision : collisions) { float eventWeight = collision.weight(); histos.fill(HIST("h_mcCollMCD_counts_weight"), 0.5, eventWeightMC); @@ -251,7 +255,7 @@ struct SlimTablesProducer { histos.fill(HIST("Ntracks_pT"), track.pt(), eventWeight); slimTracks(slimCollIndex, track.px(), track.py(), track.pz()); } - slimMcCollisions(mccollision.posZ(), eventWeightMC, ptHardFromW); + slimMcCollisions(mccollision.posZ(), eventWeightMC, ptHardTrue); auto slimMcCollIndex = slimMcCollisions.lastIndex(); for (const auto& particle : particles) { if (!particle.isPhysicalPrimary()) { From 8bbe75b1b96f1e1636c8ccbf16a4034851e972c6 Mon Sep 17 00:00:00 2001 From: louisemillot Date: Mon, 16 Nov 2026 15:31:25 +0100 Subject: [PATCH 3/5] slimTablesProducer: adding Xsection --- PWGJE/TableProducer/slimTablesProducer.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PWGJE/TableProducer/slimTablesProducer.cxx b/PWGJE/TableProducer/slimTablesProducer.cxx index a52159d497f..3b90fa04fd2 100644 --- a/PWGJE/TableProducer/slimTablesProducer.cxx +++ b/PWGJE/TableProducer/slimTablesProducer.cxx @@ -147,6 +147,8 @@ struct SlimTablesProducer { hMCP->GetXaxis()->SetBinLabel(2, "Zvertex"); hMCP->GetXaxis()->SetBinLabel(3, "selectMcCollision"); + histos.add("p_xSection", "generated cross section;;#sigma_{gen} (pb)", {HistType::kTProfile, {{1, 0.0, 1.0}}}); + histos.add("Ntracks_pT", "track pT distribution;#it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{200, -0.5, 199.5}}}, doSumw2); histos.add("Nparticles_pT", "particle pT distribution;#it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{200, -0.5, 199.5}}}, doSumw2); @@ -202,6 +204,7 @@ struct SlimTablesProducer { soa::Filtered const& particles) { float eventWeightMC = mccollision.weight(); + histos.fill(HIST("p_xSection"), 0.5, mccollision.xsectGen()); if (collisions.size() != 1) { // skip the mccollision if it has mre than 1 associated rec collision return; From 08a721f595e5d97fe279e2ed812f82e74bdeaf5a Mon Sep 17 00:00:00 2001 From: louisemillot Date: Tue, 17 Nov 2026 12:02:29 +0100 Subject: [PATCH 4/5] PWGJE: fill p_xSection with jet-jet events only in slimTablesProducer Reject MB gap events before filling the cross-section profile, so that the MB and jet-jet generator cross sections are no longer averaged together. Weight each xsectGen value by accepted(), since it is Pythia's running estimate and is unstable for the first events of each generator instance. --- PWGJE/TableProducer/slimTablesProducer.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PWGJE/TableProducer/slimTablesProducer.cxx b/PWGJE/TableProducer/slimTablesProducer.cxx index 3b90fa04fd2..6f675c54ac0 100644 --- a/PWGJE/TableProducer/slimTablesProducer.cxx +++ b/PWGJE/TableProducer/slimTablesProducer.cxx @@ -204,7 +204,10 @@ struct SlimTablesProducer { soa::Filtered const& particles) { float eventWeightMC = mccollision.weight(); - histos.fill(HIST("p_xSection"), 0.5, mccollision.xsectGen()); + if (skipMBGapEvents && mccollision.getSubGeneratorId() == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap) { + return; // gap events: not part of the jet-jet sample + } + histos.fill(HIST("p_xSection"), 0.5, mccollision.xsectGen(), mccollision.accepted()); // running estimate: weight late (converged) values more if (collisions.size() != 1) { // skip the mccollision if it has mre than 1 associated rec collision return; From 54e5502fb5d855c28621e362ffd56e04a0671180 Mon Sep 17 00:00:00 2001 From: louisemillot Date: Tue, 17 Nov 2026 16:42:30 +0100 Subject: [PATCH 5/5] slimTablesProducer: remove pT hat debug log --- PWGJE/TableProducer/slimTablesProducer.cxx | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/PWGJE/TableProducer/slimTablesProducer.cxx b/PWGJE/TableProducer/slimTablesProducer.cxx index 6f675c54ac0..042b68228c2 100644 --- a/PWGJE/TableProducer/slimTablesProducer.cxx +++ b/PWGJE/TableProducer/slimTablesProducer.cxx @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -222,17 +221,7 @@ struct SlimTablesProducer { } histos.fill(HIST("h_mcCollMCP_counts_weight"), 2.5, eventWeightMC); - // --- TEST pT hat (a retirer une fois la formule validee) --- - // Ce log est place APRES le rejet des events min bias gap : - // il n'affiche donc que les events qui sont vraiment gardes dans l'analyse. float ptHardTrue = mccollision.ptHard(); - float ptHardFromW = 10.f * std::pow(eventWeightMC, -0.25f); - static int nPrint = 0; - if (nPrint < 50) { - LOG(info) << "ptHard vrai = " << ptHardTrue << " | ptHard formule = " << ptHardFromW; - ++nPrint; - } - // --- fin du test --- for (auto const& collision : collisions) { float eventWeight = collision.weight();