Skip to content

Commit

Permalink
Accout for acceptance with mu_estimator when simulating & temporarily…
Browse files Browse the repository at this point in the history
… remove priors for annotating
  • Loading branch information
josh0-jrg committed Jan 26, 2024
1 parent 23e648f commit ec2710f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion flamedisx/likelihood.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def set_data(self,
continue

# Copy ensures annotations don't clobber
source.set_data(deepcopy(data[dname]), data_is_annotated)
source.set_data(deepcopy(data[dname]), data_is_annotated,ignore_priors=True)

# Update batch info
dset_index = self.dsetnames.index(dname)
Expand Down Expand Up @@ -355,6 +355,10 @@ def simulate(self, fix_truth=None, **params):
mu = rm * s.mu_before_efficiencies(
**self._filter_source_kwargs(params, sname))
# Simulate this many events from source
if type(self.sources[sname]).__name__!='TemplateSource':
#only do for non-template sources
mu=mu/self.mu_estimators[sname](**self._filter_source_kwargs(params, sname))

n_to_sim = np.random.poisson(mu)
if n_to_sim == 0:
continue
Expand Down

0 comments on commit ec2710f

Please sign in to comment.