Skip to content

Commit

Permalink
do not create electrons in betayields if creates2 is false
Browse files Browse the repository at this point in the history
  • Loading branch information
cfuselli authored Jul 3, 2024
1 parent f1220c6 commit 8a4ea7e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fuse/plugins/micro_physics/yields.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,15 @@ def get_quanta(self, interactions_in_roi):
# now for the beta interactions we use the beta yields
photons_beta, electrons_beta = self.quanta_from_spline(
interactions_in_roi["ed"][mask_beta],
interactions_in_roi["create_S2"][mask_beta],
)

photons[mask_beta] = photons_beta
electrons[mask_beta] = electrons_beta

return photons, electrons, excitons

def quanta_from_spline(self, energy):
def quanta_from_spline(self, energy, create_s2):

with open(self.beta_quanta_spline, "rb") as f:
cs1_poly, cs2_poly = pickle.load(f)
Expand All @@ -253,6 +254,9 @@ def quanta_from_spline(self, energy):
beta_photons = np.clip(beta_photons, 0, np.inf)
beta_electrons = np.clip(beta_electrons, 0, np.inf)

# put electrons to zero if create_s2 is false
beta_electrons[~create_s2] = 0

return beta_photons, beta_electrons


Expand Down

0 comments on commit 8a4ea7e

Please sign in to comment.