Skip to content

[PWGJE] Add Lund jet plane task#15536

Draft
zovarga wants to merge 6 commits intoAliceO2Group:masterfrom
zovarga:zvarga-lund-plane
Draft

[PWGJE] Add Lund jet plane task#15536
zovarga wants to merge 6 commits intoAliceO2Group:masterfrom
zovarga:zvarga-lund-plane

Conversation

@zovarga
Copy link
Copy Markdown

@zovarga zovarga commented Mar 27, 2026

This PR adds a Lund plane analysis task to [PWG-JE].

Main changes:

  • add PWGJE/Tasks/jetLundPlane.cxx
  • update PWGJE/Tasks/CMakeLists.txt

Details:

  • implements Lund plane construction for charged/full jets
  • includes matching logic for splittings (unique matching with reverse check)
  • supports truth-level and reconstructed comparisons
  • produces histograms needed for offline unfolding
  • optionally produces tables with all necessary ingredients for offline analysis

Please consider the following formatting changes to AliceO2Group#15536
Copy link
Copy Markdown
Collaborator

@nzardosh nzardosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR Zoltan. I havent checked the logic of your splitting and matching operations but I left some more O2 related comments for you.

In addition you could consider using the already inbuilt Lund plane infrastructure and matching we have. Essentially you can fill this table (

DECLARE_SOA_TABLE(_jet_type_##SPs, "AOD", _jet_description_ "SP", \
) in your task and then perform the matching with this task https://github.com/AliceO2Group/O2Physics/blob/master/PWGJE/TableProducer/Matching/Substructure/jetSubstructureMatching.h
Which then gives you the matched tables. The downside is you need to have two tasks, one to fill your splittings and another to save the output but the upside is that we then have a common framework which we can keep an eye on. However this is in no way mandatory and the common framework for splittings is untested so you can do what you feel is best, but just wanted to point out the alternatives here. Let me know if it would be useful to discuss it on zoom at some point

// Mini-AOD (tables)
namespace o2::aod
{
DECLARE_SOA_COLUMN(MiniCollId, miniCollId, uint64_t); // collision global index
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be index coloumns (this and the one below)

{
DECLARE_SOA_COLUMN(MiniCollId, miniCollId, uint64_t); // collision global index
DECLARE_SOA_COLUMN(MiniJetId, miniJetId, uint64_t); // jet global index (within its table)
DECLARE_SOA_COLUMN(Level, level, uint8_t); // 0=reco(det), 1=truth(part)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could it be a bool?

DECLARE_SOA_COLUMN(JetPhi, jetPhi, float);

// Per-splitting observables (primary branch)
DECLARE_SOA_COLUMN(SplitId, splitId, uint16_t);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also should be an index coloumn

DECLARE_SOA_COLUMN(SoftPhi, softPhi, float);

// Jet-jet matching (MC)
DECLARE_SOA_COLUMN(DetJetId, detJetId, uint64_t);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these too

DECLARE_SOA_COLUMN(MatchRelPt, matchRelPt, float);

DECLARE_SOA_TABLE(MiniJets, "AOD", "MINIJET",
MiniCollId, MiniJetId, Level, JetRint, JetPt, JetEta, JetPhi);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the MiniColl table hasnt been defined?

template <typename JetRowT, typename ConstituentTableT>
std::vector<SplittingObs> getPrimarySplittings(JetRowT const& jet, ConstituentTableT const&)
{
auto fjInputs = buildFastJetInputs(jet.template tracks_as<ConstituentTableT>(), trackPtMin.value);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for this you can also use the prebult jetFinder task like here

JetFinder jetReclusterer;

soa::Filtered<RecoJets> const& jets,
aod::JetTracks const& tracks)
{
if (!doData.value) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you dont need this since you can just enable or disable the process function directly in the configuration of the task. so doData becomes redundant

if (writeMiniAOD.value) {
const uint64_t collId = collision.globalIndex();
const uint64_t jetId = jet.globalIndex();
outMiniJets(collId, jetId, /*level*/ (uint8_t)0, jet.r(), jet.pt(), jet.eta(), jet.phi());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently the collId just stores a number that will not be useful later, since hyperloop will merge many timeframes which contain the same collIds. Therefore you should write out your own collision table and store an indexcoloumn here which is then respected by the merger

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Essentially the globalIndex is only unqiue in a dateframe, not accross a whole dataset

outMiniJets(collId, jetId, /*level*/ (uint8_t)0, jet.r(), jet.pt(), jet.eta(), jet.phi());
uint16_t sid = 0;
for (auto const& s : spl) {
outMiniSplittings(collId, jetId, /*level*/ (uint8_t)0, sid++, s.deltaR, s.ptSoft, s.ptHard, s.softEta, s.softPhi, jet.pt());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same with the jet Id, it should point to the outMiniJets table index

aod::JetTracks const& tracks,
aod::JetParticles const& particles)
{
if (!doMC.value) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as before

@nzardosh nzardosh marked this pull request as draft March 27, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants