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

Fix S1 bias coordinate #174

Merged
merged 3 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions appletree/plugins/reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ def simulate(self, key, parameters, x, y, z, num_electron_drifted):
),
)
class S1(Plugin):
depends_on = ["num_s1_phd", "num_s1_pe"]
depends_on = ["num_s1_pe"]
provides = ["s1_area"]

@partial(jit, static_argnums=(0,))
def simulate(self, key, parameters, num_s1_phd, num_s1_pe):
mean = self.s1_bias_3f.apply(num_s1_phd)
std = self.s1_smear_3f.apply(num_s1_phd)
def simulate(self, key, parameters, num_s1_pe):
mean = self.s1_bias_3f.apply(num_s1_pe)
std = self.s1_smear_3f.apply(num_s1_pe)
key, bias = randgen.normal(key, mean, std)
s1_area = num_s1_pe * (1.0 + bias)
return key, s1_area
Expand Down
5 changes: 5 additions & 0 deletions appletree/share.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ def __setitem__(self, key, value):
_cached_functions = StaticValueDict()


def clear_cache():
_cached_configs.clear()
_cached_functions.clear()


def set_global_config(configs):
"""Set new global configuration options.

Expand Down
Loading