Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Little bugfix for CSV generators #273

Merged
merged 1 commit into from
Oct 21, 2024
Merged

Little bugfix for CSV generators #273

merged 1 commit into from
Oct 21, 2024

Conversation

ramirezdiego
Copy link
Collaborator

@ramirezdiego ramirezdiego commented Oct 17, 2024

The trackid in Geant4 starts always at 1, so that parentid can be assigned to 0 for the primary particles. If we set both to 1, the get_parent function here gets confused and gives us a wrong NEST id for the evaluated interaction (hence we eventually reconstuct wrong energies along the simulation chain).

See screenshot before and after this change, in a context where clustering_method="lineage" and where gammas are simulated in our CSV input. Only the second case gives us the right lineage_type expected for these intereactions (NEST_id = 8; beta model):
image

In principle lineage clustering plays no role if we simulate single scatters, as is the case for the generators in this notebook, but this quick fix prevents confusing people when it becomes our default clustering method.

@coveralls
Copy link

coveralls commented Oct 17, 2024

Pull Request Test Coverage Report for Build 11387363334

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 79.905%

Totals Coverage Status
Change from base Build 11365746591: 0.0%
Covered Lines: 2525
Relevant Lines: 3160

💛 - Coveralls

Copy link
Collaborator

@HenningSE HenningSE 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 @ramirezdiego! As you mentioned, the lineage clustering can be a bit tricky with CSV input so one should always check if the algorithm works with the input instructions. For most cases, DBSCAN should give us the same results but the classification of clusters might differ a bit.

@HenningSE HenningSE merged commit 4209bec into main Oct 21, 2024
3 of 4 checks passed
@HenningSE HenningSE deleted the csv_generator_fix branch October 21, 2024 07:04
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.

3 participants