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

Updating the background time profile #64

Open
jasonfan1997 opened this issue Mar 5, 2021 · 2 comments
Open

Updating the background time profile #64

jasonfan1997 opened this issue Mar 5, 2021 · 2 comments

Comments

@jasonfan1997
Copy link
Member

jasonfan1997 commented Mar 5, 2021

Not sure whether we want to add that but right the background time profile is fixed when the self.ent model is built.

This can be done by a function like

self.background_time_profile = background_time_profile
self._grl = grl
self._grl_rates = self._grl['self.ents'] / self._grl['livetime']
self.signal_time_profile = inject_signal_time_profile
start, stop = self.background_time_profile.range
return_stop_contained = True
background_run_mask = self._contained_run_mask(
start,
stop,
return_stop_contained=return_stop_contained,
)
background_grl = self._grl[background_run_mask]
self._n_background = background_grl['self.ents'].sum()
self._n_background /= background_grl['livetime'].sum()
self._n_background *= self._contained_livetime(
start,
stop,
background_grl,
)

@thejevans
Copy link
Collaborator

is there a good use case for that? if so, no problem

@jasonfan1997
Copy link
Member Author

Only when user trying to inject and a different background time window(like Liz's analysis? But our code doesn't config for that kind of analysis anyway).Right now maybe what Michael mentioned would be better(allowing save and load splines instead of loading event models directly)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants