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

Virtual Packet Cutoff during Montecarlo #654

Closed
yeganer opened this issue Aug 22, 2016 · 6 comments
Closed

Virtual Packet Cutoff during Montecarlo #654

yeganer opened this issue Aug 22, 2016 · 6 comments

Comments

@yeganer
Copy link
Contributor

yeganer commented Aug 22, 2016

In the montecarlo simulation there's a cutoff for virtual packets which boils down to:

if tau>10:
    tau == 100

This removes the contribution of weakly contributing packets almost completely (exp(-100) ~ 1e-44).
But because this isn't exactly 0 the packet will still register and add to the bin. If the packet is the only packet in that bin the resulting luminosity will be very small and numerical problems can surface when comparing different bins.

The solution I propose is to either set the weight or the energy of the packet to 0. This removes any contribution and even allows small performance improvements by skipping the spectrum update(which needs to be atomic)

yeganer added a commit to yeganer/tardis that referenced this issue Aug 22, 2016
This small change results in bins with actual neglegible data being zero
instead of having very small contributions.

Fixes: tardis-sn#654
@unoebauer
Copy link
Contributor

Do we still need this? I agree conceptually with you that setting the weight or energy of the packet to 0 is the cleaner approach to discard virtual packets. However, I am wondering about cases where fluctuations in these parts of the spectrum ever become relevant.

@yeganer
Copy link
Contributor Author

yeganer commented Oct 11, 2016

The current implementation creates three possible 'states' for a bin. It's either zero meaning no packet at all, ~1e-100 meaning only discarded packets registered for the bin or it has an actual value.
The first two cases should be the same and currently one needs to have a cutoff to separate these.

There are two cases where this issue was relevant in the past.

  1. It makes comparing of the non-zero parts of spectra more difficult
  2. Fred had to differentiate between the two types of packets when doing his statistical analysis for the virtual packets. If I remember correctly ~80% of the packets were discarded packets. One could skip logging these packets reducing memory consumption on the way.

As the fix is easy, quick and has no bad side effects that I know of the important question that needs to be answered should be "Why shouldn't we merge this?" instead of "Why should we merge this?"

@unoebauer
Copy link
Contributor

Fine - I'd be in favour of merging.

@unoebauer
Copy link
Contributor

Will be dealt with once the testing framework is fully operational

@unoebauer
Copy link
Contributor

@wkerzendorf, @yeganer - thoughts on this? Should we merge this. Will require an update of reference data.

@unoebauer unoebauer reopened this Aug 1, 2017
@chvogl
Copy link
Contributor

chvogl commented Apr 12, 2019

Solved with merge of #911 .

@chvogl chvogl closed this as completed Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants