Skip to content

Comments

Fixing the get_primaries function of I3Extractor#818

Merged
sevmag merged 5 commits intographnet-team:mainfrom
sevmag:get_primaries_fix
Aug 13, 2025
Merged

Fixing the get_primaries function of I3Extractor#818
sevmag merged 5 commits intographnet-team:mainfrom
sevmag:get_primaries_fix

Conversation

@sevmag
Copy link
Collaborator

@sevmag sevmag commented Aug 12, 2025

This PR addresses the problem in #817.

As a fix to Problem 1 explained in #817, I introduce a function find_in_ice_daughters that recursively looks for in-ice particles in the subtree of the primary neutrino.

This solution makes sure that ...

  • one finds the in-ice particle, no matter how many interactions the primary neutrino undergoes outside of ice.
  • only the first in-ice particle is returned, mitigating the issue of returning a primaries list of particles where one of the particles might be a daughter of another (as explained in Unexpected behaviour in I3Extractor.get_primaries #817)
  • no particle that is a daughter of a background particle is returned

As a fix to Problem 2 explained in #817, I introduce the argument highest_energy_primary that allows to return all primaries found instead of only the highest-energy one in the case of a NuGen file

@sevmag sevmag requested a review from Aske-Rosted August 12, 2025 15:30
)
]

# This is not expected to happen
Copy link
Collaborator

@Aske-Rosted Aske-Rosted Aug 13, 2025

Choose a reason for hiding this comment

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

Is this still true, do all NuGen events have a In-Ice-neutrino generated by the daughter particles?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The message was wrong. It should say in-ice particle. Does not necessarily have to be a neutrino

Copy link
Collaborator

@Aske-Rosted Aske-Rosted left a comment

Choose a reason for hiding this comment

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

Just a single comment otherwise looks good.

@sevmag sevmag merged commit f3faff1 into graphnet-team:main Aug 13, 2025
13 of 14 checks passed
@sevmag sevmag deleted the get_primaries_fix branch August 13, 2025 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants