Skip to content

Commit

Permalink
Better variable name for y
Browse files Browse the repository at this point in the history
  • Loading branch information
HenningSE committed Sep 9, 2024
1 parent d99c307 commit adc115e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions fuse/plugins/micro_physics/yields.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ def compute(self, interactions_in_roi):
def get_quanta(self, en, model, e_field, A, Z, create_s2, density):
"""Function to get quanta for given parameters using NEST."""

y = self.get_yields_from_NEST(en, model, e_field, A, Z, density)
yields_result = self.get_yields_from_NEST(en, model, e_field, A, Z, density)

return self.process_yields(y, create_s2)
return self.process_yields(yields_result, create_s2)

def get_yields_from_NEST(self, en, model, e_field, A, Z, density):
"""Function which uses NEST to yield photons and electrons for a given
Expand Down Expand Up @@ -202,20 +202,22 @@ def get_yields_from_NEST(self, en, model, e_field, A, Z, density):

return yields_result

def process_yields(self, y, create_s2):
def process_yields(self, yields_result, create_s2):
"""Process the yields with NEST to get actual quanta."""

# Density argument is not used in function...
event_quanta = self.nc.GetQuanta(y, free_parameters=self.updated_nest_width_parameters)
event_quanta = self.nc.GetQuanta(
yields_result, free_parameters=self.updated_nest_width_parameters
)

excitons = event_quanta.excitons
photons = event_quanta.photons
electrons = event_quanta.electrons

# Only for testing purposes, return the yields directly
if self.return_yields_only:
photons = y.PhotonYield
electrons = y.ElectronYield
photons = yields_result.PhotonYield
electrons = yields_result.ElectronYield

# If we don't want to create S2, set electrons to 0
if not create_s2:
Expand Down

0 comments on commit adc115e

Please sign in to comment.