Skip to content

Commit

Permalink
WFSim registry as argument for simulations context (#713)
Browse files Browse the repository at this point in the history
* WFSim registry as argument for sims context

* Copypasting Joran's function

* Shame on me

* use new func

Co-authored-by: Joran Angevaare <jorana@nikhef.nl>
  • Loading branch information
ramirezdiego and JoranAngevaare authored Oct 29, 2021
1 parent 983e122 commit 74a7dee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions straxen/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ def _swap_values_in_array(data_arr, buffer, items, replacements):
break
return buffer


##
# Old XENON1T Stuff
##
Expand Down
11 changes: 9 additions & 2 deletions straxen/contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,10 @@ def xenonnt_led(**kwargs):

def xenonnt_simulation(
output_folder='./strax_data',
wfsim_registry='RawRecordsFromFaxNT',
cmt_run_id_sim=None,
cmt_run_id_proc=None,
cmt_version='v3',
cmt_version='v5',
fax_config='fax_config_nt_design.json',
overwrite_from_fax_file_sim=False,
overwrite_from_fax_file_proc=False,
Expand Down Expand Up @@ -276,6 +277,7 @@ def xenonnt_simulation(
CMT options can also be overwritten via fax config file.
:param output_folder: Output folder for strax data.
:param wfsim_registry: Name of WFSim plugin used to generate data.
:param cmt_run_id_sim: Run id for detector parameters from CMT to be used
for creation of raw_records.
:param cmt_run_id_proc: Run id for detector parameters from CMT to be used
Expand Down Expand Up @@ -306,7 +308,11 @@ def xenonnt_simulation(
check_raw_record_overlaps=True,
**straxen.contexts.xnt_common_config,),
**straxen.contexts.xnt_common_opts, **kwargs)
st.register(wfsim.RawRecordsFromFaxNT)
st.register(getattr(wfsim, wfsim_registry))

# Make sure that the non-simulated raw-record types are not requested
st.deregister_plugins_with_missing_dependencies()

if straxen.utilix_is_configured(
warning_message='Bad context as we cannot set CMT since we '
'have no database access'''):
Expand Down Expand Up @@ -552,4 +558,5 @@ def xenon1t_simulation(output_folder='./strax_data'):
**x1t_common_config),
**x1t_context_config)
st.register(wfsim.RawRecordsFromFax1T)
st.deregister_plugins_with_missing_dependencies()
return st

0 comments on commit 74a7dee

Please sign in to comment.