Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JannisNe committed May 14, 2020
2 parents 329c024 + da048ac commit b32a0c6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions flarestack/core/injector.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,12 @@ def inject_signal(self, scale):
else:
n_s = int(n_inj)

logging.debug("Injected {0} events with an expectation of {1:.2f} events for {2}".format(
n_s, n_inj if isinstance(n_inj, float) else float(n_inj[0]), source["source_name"]
))

# If n_s = 0, skips simulation step.
if n_s < 1:
logging.debug("Injected {0} events with an expectation of {1:.2f} events".format(
n_s, n_inj if isinstance(n_inj, float) else float(n_inj[0])
))
continue

source_mc = self.calculate_single_source(source, scale)
Expand Down Expand Up @@ -386,9 +387,6 @@ def inject_signal(self, scale):
(sig_events,
sim_ev[list(self.season.get_background_dtype().names)])
)
logging.debug("Injected {0} events with an expectation of {1:.2f} events".format(
n_s, n_inj if isinstance(n_inj, float) else float(n_inj[0])
))

return sig_events

Expand Down Expand Up @@ -532,6 +530,10 @@ def inject_signal(self, scale):
else:
n_s = int(n_inj)

logging.debug("Injected {0} events with an expectation of {1:.2f} events for {2}".format(
n_s, n_inj if isinstance(n_inj, float) else float(n_inj[0]), source["source_name"]
))

# If n_s = 0, skips simulation step.
if n_s < 1:
continue
Expand Down

0 comments on commit b32a0c6

Please sign in to comment.