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

fix oscillation probability and add histograms for particle origin #40

Merged
merged 6 commits into from
Feb 14, 2025

Conversation

Yurlungur
Copy link
Collaborator

PR Summary

  • Fixes the survival probability formula to properly use the shallow area divided by the deep area.
  • Adds histograms to the output that accumulate the cylindrical radius and distance from the equator of the origin of superphotons
  • Adds a flag to track whether or not a given superphoton has oscillated

PR Checklist

  • Adds a test for any bugs fixed. Adds tests for new features.

@Yurlungur Yurlungur added bug Something isn't working enhancement New feature or request labels Feb 12, 2025
@Yurlungur Yurlungur self-assigned this Feb 12, 2025
@@ -223,7 +223,7 @@ void oscillate(grid_local_moment_type local_moments, grid_Gnu_type gnu) {
double p_survival = peq;
#else
double p_survival =
in_shallow ? peq : (1 - (1 - peq) * B / (A + SMALL));
in_shallow ? peq : (1 - (1 - peq) * shallow / (deep + SMALL));
Copy link
Collaborator

@payelmuk150 payelmuk150 Feb 13, 2025

Choose a reason for hiding this comment

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

Can you explain a bit on why you did ebar=total/stddev to compare it to gtemp? I am confused a bit on the dimensions of these quantities.

Copy link
Collaborator

@payelmuk150 payelmuk150 Feb 13, 2025

Choose a reason for hiding this comment

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

In line 206,can you explain why you need the G!=0 condition if you are already checking for A!=0 and B!=0? G is dependent on the local angle (not talking about the global position angle) while A and B are not dependent on the local angle.. oh is it for ensuring not-oscillating where stddev was triggered as the comment seems to suggest?

Copy link
Collaborator

Choose a reason for hiding this comment

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

looks like you are not using the in_deep variable anywhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can you explain a bit on why you did ebar=total/stddev to compare it to gtemp? I am confused a bit on the dimensions of these quantities.

Actually, I think this is a bug. ebar is relative error. But g_temp is absolute size. So g_temp should be compared to stddev, not ebar.

In line 206,can you explain why you need the G!=0 condition if you are already checking for A!=0 and B!=0? G is dependent on the local angle (not talking about the global position angle) while A and B are not dependent on the local angle.. oh is it for ensuring not-oscillating where stddev was triggered as the comment seems to suggest?

Yes exactly. I set g = 0 when g < stddev, so it's used as a trigger.

looks like you are not using the in_deep variable anywhere?

Good catch.

Copy link
Collaborator

@payelmuk150 payelmuk150 Feb 13, 2025

Choose a reason for hiding this comment

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

@Yurlungur , okay makes sense about the G != 0 and removal of the unused variable. Regarding the g_temp vs stddev vs ebar: Yes, indeed your fix was what I had in mind while commenting. I can't find any other obvious errors so will approve this. But to double check, g_temp you calculate by taking the distribution function f, and using the formula of the paper.. and stddev is calculated using quantities like w, N, which are whole numbers, where N is calculated by counting the number of superphotons in a given location and local angle bin.. so I would just make sure that those two quantities (gtemp and stddev) are reflecting the same things (which I think it is now)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

To double check, g_temp you calculate by taking the distribution function f, and using the formula of the paper.. and stddev is calculated using quantities like w, N, which are whole numbers, where N is calculated by counting the number of superphotons in a given location and local angle bin..

Correct.

@@ -131,6 +131,7 @@
bhl.config.set_cparm('RAD_NUM_TYPES', 4)
bhl.config.set_cparm('NEUTRINO_OSCILLATIONS', True)
bhl.config.set_cparm('FORCE_EQUIPARTITION', False)
bhl.config.set_cparm("RZ_HISTOGRAMS", True)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just to confirm again, these RZ histograms will help to plot the R and Z origin locations of the photons in the bin under investigation, correct? so that we can track where the neutrinos in the bin came from and establish the effect of opacities/emissivities?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep exactly.

@Yurlungur
Copy link
Collaborator Author

Thanks for the comments @payelmuk150 . Should be addressed now. Can you please re-review and approve if it looks good to you?

@payelmuk150
Copy link
Collaborator

Thanks for the comments @payelmuk150 . Should be addressed now. Can you please re-review and approve if it looks good to you?

I approve

@Yurlungur
Copy link
Collaborator Author

Yurlungur commented Feb 13, 2025

Thanks for the comments @payelmuk150 . Should be addressed now. Can you please re-review and approve if it looks good to you?

I approve

In the files changed tab, click on review at the top right and then click approve.

@Yurlungur
Copy link
Collaborator Author

Thanks for the comments @payelmuk150 . Should be addressed now. Can you please re-review and approve if it looks good to you?

I approve

In the files changed tab, click on review at the top right and then click approve.

Ah I see. Approve button missing... Will try to give you access. This is good enough though thanks.

@Yurlungur Yurlungur merged commit 59e954f into master Feb 14, 2025
1 check passed
@Yurlungur Yurlungur deleted the jmm/fix-osc-prob branch February 14, 2025 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants