icecube / skyllh

https://icecube.github.io/skyllh/
GNU General Public License v3.0
11 stars 5 forks source link

Fix in poissonian # of signal events generated for Public Data #223

Closed juanma-cano-vila closed 3 months ago

juanma-cano-vila commented 3 months ago

There is a bug in the current implementation of the Poissonian # of signal events generated in the public data signal generator PDDatasetSignaGenerator.

In the current implemetation we have:

https://github.com/icecube/skyllh/blob/53461a668900fa73f615310a67dc86f285d2e8d9/skyllh/analyses/i3/publicdata_ps/signal_generator.py#L507-L516

This rewrites the variable n_events, making the possion option irrelevant. To fix it, we just have to change the first n_events in line 508 by mean, so if we have the poisson option activated the n_events comes from it.


if poisson: 
     mean = rss.random.poisson( 
         float_cast( 
             mean, 
             'The  'mean' argument must be castable to type of float!')) 

n_events = int_cast( 
     mean, 
     'The 'mean' argument must be castable to type of int!') ```