diff --git a/straxen/contexts.py b/straxen/contexts.py index 7714273ee..c59880e51 100644 --- a/straxen/contexts.py +++ b/straxen/contexts.py @@ -38,9 +38,30 @@ common_config = dict( n_tpc_pmts=straxen.n_tpc_pmts, n_top_pmts=straxen.n_top_pmts, - gain_model="cmt://to_pe_model?version=ONLINE&run_id=plugin.run_id", - gain_model_nv="cmt://to_pe_model_nv?version=ONLINE&run_id=plugin.run_id", - gain_model_mv="cmt://to_pe_model_mv?version=ONLINE&run_id=plugin.run_id", + gain_model="list-to-array://" + "xedocs://pmt_area_to_pes" + "?as_list=True" + "&sort=pmt" + "&detector=tpc" + "&run_id=plugin.run_id" + "&version=ONLINE" + "&attr=value", + gain_model_nv="list-to-array://" + "xedocs://pmt_area_to_pes" + "?as_list=True" + "&sort=pmt" + "&detector=neutron_veto" + "&run_id=plugin.run_id" + "&version=ONLINE" + "&attr=value", + gain_model_mv="list-to-array://" + "xedocs://pmt_area_to_pes" + "?as_list=True" + "&sort=pmt" + "&detector=muon_veto" + "&run_id=plugin.run_id" + "&version=ONLINE" + "&attr=value", channel_map=immutabledict( # (Minimum channel, maximum channel) # Channels must be listed in a ascending order! @@ -57,38 +78,28 @@ ), # Clustering/classification parameters # Event level parameters - fdc_map=( - "itp_map://" - "resource://" - "cmt://" - "format://fdc_map_{alg}" - "?alg=plugin.default_reconstruction_algorithm" - "&version=ONLINE" - "&run_id=plugin.run_id" - "&fmt=binary" - "&scale_coordinates=plugin.coordinate_scales" - ), - z_bias_map=( - "itp_map://" - "resource://" - "XnT_z_bias_map_chargeup_20230329.json.gz?" - "fmt=json.gz" - "&method=RegularGridInterpolator" - ), + fdc_map="xedocs://fdc_maps" + "?algorithm=plugin.default_reconstruction_algorithm" + "&run_id=plugin.run_id" + "&attr=map" + "&scale_coordinates=plugin.coordinate_scale" + "&version=ONLINE", + z_bias_map="itp_map://" + "resource://" + "XnT_z_bias_map_chargeup_20230329.json.gz?" + "fmt=json.gz" + "&method=RegularGridInterpolator", ) # these are placeholders to avoid calling cmt with non integer run_ids. Better solution pending. # s1, s2 and fd corrections are still problematic -def xenonnt(cmt_version="global_ONLINE", xedocs_version=None, _from_cutax=False, **kwargs): +def xenonnt(xedocs_version="global_ONLINE", _from_cutax=False, **kwargs): """XENONnT context.""" - if not _from_cutax and cmt_version != "global_ONLINE": + if not _from_cutax and xedocs_version != "global_ONLINE": warnings.warn("Don't load a context directly from straxen, use cutax instead!") - st = straxen.contexts.xenonnt_online(**kwargs) - st.apply_cmt_version(cmt_version) - if xedocs_version is not None: - st.apply_xedocs_configs(version=xedocs_version, **kwargs) + st = straxen.contexts.xenonnt_online(xedocs_version=xedocs_version, **kwargs) return st diff --git a/straxen/plugins/afterpulses/afterpulse_processing.py b/straxen/plugins/afterpulses/afterpulse_processing.py index fdba90a7a..a4ea7c319 100644 --- a/straxen/plugins/afterpulses/afterpulse_processing.py +++ b/straxen/plugins/afterpulses/afterpulse_processing.py @@ -59,13 +59,22 @@ class LEDAfterpulseProcessing(strax.Plugin): hit_min_amplitude = straxen.URLConfig( track=True, infer_type=False, - default="cmt://hit_thresholds_tpc?version=ONLINE&run_id=plugin.run_id", - help=( - "Minimum hit amplitude in ADC counts above baseline. " - "Specify as a tuple of length n_tpc_pmts, or a number, " - 'or url string like "cmt://hit_thresholds_tpc?version=ONLINE" which means' - "calling cmt." + default=( + "list-to-array://" + "xedocs://hit_thresholds" + "?as_list=True" + "&sort=pmt" + "&attr=value" + "&detector=tpc" + "&run_id=plugin.run_id" + "&version=ONLINE" ), + help="Minimum hit amplitude in ADC counts above baseline. " + "Specify as a tuple of length n_tpc_pmts, or a number," + 'or a string like "legacy-thresholds://pmt_commissioning_initial" which means calling' + "hitfinder_thresholds.py" + 'or url string like "xedocs://hit_thresholds_tpc?version=ONLINE" which means' + "calling xedocs.", ) hit_min_height_over_noise = straxen.URLConfig( diff --git a/straxen/plugins/defaults.py b/straxen/plugins/defaults.py index ac2f6b0b0..501565add 100644 --- a/straxen/plugins/defaults.py +++ b/straxen/plugins/defaults.py @@ -8,12 +8,34 @@ NV_HIT_DEFAULTS = { "save_outside_hits_nv": (3, 15), - "hit_min_amplitude_nv": "cmt://hit_thresholds_nv?version=ONLINE&run_id=plugin.run_id", + "hit_min_amplitude_nv": ( + "list-to-array://" + "pad-array://" + "xedocs://hit_thresholds" + "?pad_left=2000" + "&as_list=True" + "&sort=pmt" + "&attr=value" + "&detector=neutron_veto" + "&run_id=plugin.run_id" + "&version=ONLINE" + ), } MV_HIT_DEFAULTS = { "save_outside_hits_mv": (2, 5), - "hit_min_amplitude_mv": "cmt://hit_thresholds_mv?version=ONLINE&run_id=plugin.run_id", + "hit_min_amplitude_mv": ( + "list-to-array://" + "pad-array://" + "xedocs://hit_thresholds" + "?pad_left=1000" + "&as_list=True" + "&sort=pmt" + "&attr=value" + "&detector=muon_veto" + "&run_id=plugin.run_id" + "&version=ONLINE" + ), } FAKE_MERGED_S2_TYPE = -42 diff --git a/straxen/plugins/events/_event_s1_positions_base.py b/straxen/plugins/events/_event_s1_positions_base.py index e48530d86..3533e0fa6 100644 --- a/straxen/plugins/events/_event_s1_positions_base.py +++ b/straxen/plugins/events/_event_s1_positions_base.py @@ -57,12 +57,12 @@ def infer_dtype(self): return dtype def get_tf_model(self): - """Simple wrapper to have several tf_event_model_s1_cnn, .. + """Simple wrapper to have several tf_model_s1_cnn, .. point to this same function in the compute method """ - model = getattr(self, f"tf_event_model_{self.algorithm}", None) + model = getattr(self, f"tf_model_{self.algorithm}", None) if model is None: warn( f"Setting model to None for {self.__class__.__name__} will " diff --git a/straxen/plugins/events/_event_s2_positions_base.py b/straxen/plugins/events/_event_s2_positions_base.py index 14d4b4ade..41c8014b8 100644 --- a/straxen/plugins/events/_event_s2_positions_base.py +++ b/straxen/plugins/events/_event_s2_positions_base.py @@ -59,12 +59,12 @@ def infer_dtype(self): return dtype def get_tf_model(self): - """Simple wrapper to have several tf_event_model_mlp, tf_event_model_cnf, .. + """Simple wrapper to have several tf_model_mlp, tf_model_cnf, .. point to this same function in the compute method """ - model = getattr(self, f"tf_event_model_{self.algorithm}", None) + model = getattr(self, f"tf_model_{self.algorithm}", None) if model is None: warn( f"Setting model to None for {self.__class__.__name__} will " diff --git a/straxen/plugins/events/corrected_areas.py b/straxen/plugins/events/corrected_areas.py index c27c679df..5355569c5 100644 --- a/straxen/plugins/events/corrected_areas.py +++ b/straxen/plugins/events/corrected_areas.py @@ -30,55 +30,56 @@ class CorrectedAreas(strax.Plugin): # Descriptor configs elife = straxen.URLConfig( - default="cmt://elife?version=ONLINE&run_id=plugin.run_id", help="electron lifetime in [ns]" + default="xedocs://electron_lifetimes?attr=value&run_id=plugin.run_id&version=ONLINE", + help="electron lifetime in [ns]", ) default_reconstruction_algorithm = straxen.URLConfig( default=DEFAULT_POSREC_ALGO, help="default reconstruction algorithm that provides (x,y)" ) s1_xyz_map = straxen.URLConfig( - default=( - "itp_map://resource://cmt://format://" - "s1_xyz_map_{alg}?version=ONLINE&run_id=plugin.run_id" - "&fmt=json&alg=plugin.default_reconstruction_algorithm" - ), + default="xedocs://s1_xyz_maps" + "?run_id=plugin.run_id" + "&algorithm=plugin.default_reconstruction_algorithm&attr=map&version=ONLINE", cache=True, ) s2_xy_map = straxen.URLConfig( - default=( - "itp_map://resource://cmt://format://" - "s2_xy_map_{alg}?version=ONLINE&run_id=plugin.run_id" - "&fmt=json&alg=plugin.default_reconstruction_algorithm" - ), + default="xedocs://s2_xy_maps" + "?run_id=plugin.run_id" + "&algorithm=plugin.default_reconstruction_algorithm&attr=map&version=ONLINE", cache=True, ) # average SE gain for a given time period. default to the value of this run in ONLINE model # thus, by default, there will be no time-dependent correction according to se gain avg_se_gain = straxen.URLConfig( - default="cmt://avg_se_gain?version=ONLINE&run_id=plugin.run_id", - help=( - "Nominal single electron (SE) gain in PE / electron extracted. " - "Data will be corrected to this value" - ), + default="xedocs://avg_se_gains?run_id=plugin.run_id&version=ONLINE&attr=value", + help="Nominal single electron (SE) gain in PE / electron extracted. " + "Data will be corrected to this value", ) # se gain for this run, allowing for using CMT. default to online se_gain = straxen.URLConfig( - default="cmt://se_gain?version=ONLINE&run_id=plugin.run_id", + default="take://objects-to-dict://" + "xedocs://se_gains" + "?partition=all_tpc&run_id=plugin.run_id&sort=partition" + "&as_list=True&key_attr=partition&value_attr=value&take=all_tpc&version=ONLINE", help="Actual SE gain for a given run (allows for time dependence)", ) # relative extraction efficiency which can change with time and modeled by CMT. rel_extraction_eff = straxen.URLConfig( - default="cmt://rel_extraction_eff?version=ONLINE&run_id=plugin.run_id", + default="take://objects-to-dict://" + "xedocs://rel_extraction_effs" + "?partition=all_tpc&run_id=plugin.run_id&sort=partition" + "&as_list=True&key_attr=partition&value_attr=value&take=all_tpc&version=ONLINE", help="Relative extraction efficiency for this run (allows for time dependence)", ) # relative light yield # defaults to no correction rel_light_yield = straxen.URLConfig( - default="cmt://relative_light_yield?version=ONLINE&run_id=plugin.run_id", + default="xedocs://relative_light_yield?attr=value&run_id=plugin.run_id&version=ONLINE", help="Relative light yield (allows for time dependence)", ) diff --git a/straxen/plugins/events/event_basics_vanilla.py b/straxen/plugins/events/event_basics_vanilla.py index e9c316caf..9c1e94294 100644 --- a/straxen/plugins/events/event_basics_vanilla.py +++ b/straxen/plugins/events/event_basics_vanilla.py @@ -24,7 +24,7 @@ class EventBasicsVanilla(strax.Plugin): data_kind = "events" electron_drift_velocity = straxen.URLConfig( - default="cmt://electron_drift_velocity?version=ONLINE&run_id=plugin.run_id", + default="xedocs://electron_drift_velocities?attr=value&run_id=plugin.run_id&version=ONLINE", cache=True, help="Vertical electron drift velocity in cm/ns (1e4 m/ms)", ) diff --git a/straxen/plugins/events/event_pattern_fit.py b/straxen/plugins/events/event_pattern_fit.py index c66e5b249..5f6c3a69d 100644 --- a/straxen/plugins/events/event_pattern_fit.py +++ b/straxen/plugins/events/event_pattern_fit.py @@ -23,20 +23,19 @@ class EventPatternFit(strax.Plugin): # Getting S1 AFT maps s1_aft_map = straxen.URLConfig( - default=( - "itp_map://resource://cmt://s1_aft_xyz_map?version=ONLINE&run_id=plugin.run_id&fmt=json" - ), + default="itp_map://resource://xedocs://s1_aft_xyz_maps" + "?attr=value&fmt=json&run_id=plugin.run_id&version=ONLINE", cache=True, ) electron_drift_velocity = straxen.URLConfig( - default="cmt://electron_drift_velocity?version=ONLINE&run_id=plugin.run_id", + default="xedocs://electron_drift_velocities?attr=value&run_id=plugin.run_id&version=ONLINE", cache=True, help="Vertical electron drift velocity in cm/ns (1e4 m/ms)", ) electron_drift_time_gate = straxen.URLConfig( - default="cmt://electron_drift_time_gate?version=ONLINE&run_id=plugin.run_id", + default="xedocs://electron_drift_time_gates?attr=value&run_id=plugin.run_id&version=ONLINE", help="Electron drift time from the gate in ns", cache=True, ) diff --git a/straxen/plugins/events/event_position_uncertainty.py b/straxen/plugins/events/event_position_uncertainty.py index 047f44a9e..5e991147c 100644 --- a/straxen/plugins/events/event_position_uncertainty.py +++ b/straxen/plugins/events/event_position_uncertainty.py @@ -55,7 +55,7 @@ class EventPositionContour(strax.Plugin): ) electron_drift_velocity = straxen.URLConfig( - default="cmt://electron_drift_velocity?version=ONLINE&run_id=plugin.run_id", + default="xedocs://electron_drift_velocities?attr=value&run_id=plugin.run_id&version=ONLINE", cache=True, help="Vertical electron drift velocity in cm/ns (1e4 m/ms)", ) diff --git a/straxen/plugins/events/event_positions.py b/straxen/plugins/events/event_positions.py index 4849cc8c3..0f342803d 100644 --- a/straxen/plugins/events/event_positions.py +++ b/straxen/plugins/events/event_positions.py @@ -26,13 +26,13 @@ class EventPositions(strax.Plugin): ) electron_drift_velocity = straxen.URLConfig( - default="cmt://electron_drift_velocity?version=ONLINE&run_id=plugin.run_id", + default="xedocs://electron_drift_velocities?attr=value&run_id=plugin.run_id&version=ONLINE", cache=True, help="Vertical electron drift velocity in cm/ns (1e4 m/ms)", ) electron_drift_time_gate = straxen.URLConfig( - default="cmt://electron_drift_time_gate?version=ONLINE&run_id=plugin.run_id", + default="xedocs://electron_drift_time_gates?attr=value&run_id=plugin.run_id&version=ONLINE", help="Electron drift time from the gate in ns", cache=True, ) diff --git a/straxen/plugins/events/event_s1_positions_cnn.py b/straxen/plugins/events/event_s1_positions_cnn.py index 69f9d4994..5968ec6e7 100644 --- a/straxen/plugins/events/event_s1_positions_cnn.py +++ b/straxen/plugins/events/event_s1_positions_cnn.py @@ -13,7 +13,7 @@ class EventS1PositionCNN(EventS1PositionBase): algorithm = "s1_cnn" provides = "event_s1_positions_cnn" - tf_event_model_s1_cnn = straxen.URLConfig( + tf_model_s1_cnn = straxen.URLConfig( default=( f"tf://" f"resource://" diff --git a/straxen/plugins/events/event_s2_positions_mlp.py b/straxen/plugins/events/event_s2_positions_mlp.py index 3c94bbb07..b39c3883a 100644 --- a/straxen/plugins/events/event_s2_positions_mlp.py +++ b/straxen/plugins/events/event_s2_positions_mlp.py @@ -13,18 +13,18 @@ class EventS2PositionMLP(EventS2PositionBase): algorithm = "mlp" provides = "event_s2_positions_mlp" - tf_event_model_mlp = straxen.URLConfig( + tf_model_mlp = straxen.URLConfig( default=( "tf://" "resource://" - f"cmt://{algorithm}_model" - "?version=ONLINE" - "&run_id=plugin.run_id" + "xedocs://posrec_models" + "?attr=value" "&fmt=abs_path" + "&kind=mlp" + "&run_id=plugin.run_id" + "&version=ONLINE" ), - help=( - 'MLP model. Should be opened using the "tf" descriptor. ' - 'Set to "None" to skip computation' - ), + help='MLP model. Should be opened using the "tf" descriptor. ' + 'Set to "None" to skip computation', cache=3, ) diff --git a/straxen/plugins/events/events.py b/straxen/plugins/events/events.py index 3696ea31c..da891968c 100644 --- a/straxen/plugins/events/events.py +++ b/straxen/plugins/events/events.py @@ -40,7 +40,7 @@ class Events(strax.OverlapWindowPlugin): events_seen = 0 electron_drift_velocity = straxen.URLConfig( - default="cmt://electron_drift_velocity?version=ONLINE&run_id=plugin.run_id", + default="xedocs://electron_drift_velocities?attr=value&run_id=plugin.run_id&version=ONLINE", cache=True, help="Vertical electron drift velocity in cm/ns (1e4 m/ms)", ) diff --git a/straxen/plugins/events/multi_scatter.py b/straxen/plugins/events/multi_scatter.py index ad9b693c5..a666847e2 100644 --- a/straxen/plugins/events/multi_scatter.py +++ b/straxen/plugins/events/multi_scatter.py @@ -31,7 +31,7 @@ class EventInfoMS(strax.Plugin): ) lxe_w = straxen.URLConfig(default=13.7e-3, help="LXe work function in quanta/keV") electron_drift_velocity = straxen.URLConfig( - default="cmt://electron_drift_velocity?version=ONLINE&run_id=plugin.run_id", + default="xedocs://electron_drift_velocities?attr=value&run_id=plugin.run_id&version=ONLINE", cache=True, help="Vertical electron drift velocity in cm/ns (1e4 m/ms)", ) diff --git a/straxen/plugins/events_nv/event_waveform_nv.py b/straxen/plugins/events_nv/event_waveform_nv.py index 9bc8b1afd..8e308ec46 100644 --- a/straxen/plugins/events_nv/event_waveform_nv.py +++ b/straxen/plugins/events_nv/event_waveform_nv.py @@ -19,7 +19,16 @@ class nVETOEventWaveform(strax.Plugin): compressor = "zstd" gain_model_nv = straxen.URLConfig( - default="cmt://to_pe_model_nv?version=ONLINE&run_id=plugin.run_id", + default=( + "list-to-array://" + "xedocs://pmt_area_to_pes" + "?as_list=True" + "&sort=pmt" + "&detector=neutron_veto" + "&run_id=plugin.run_id" + "&version=ONLINE" + "&attr=value" + ), infer_type=False, help="PMT gain model. Specify as (model_type, model_config, nT = True)", ) diff --git a/straxen/plugins/hitlets_mv/hitlets_mv.py b/straxen/plugins/hitlets_mv/hitlets_mv.py index 275a89eaa..9cdf66509 100644 --- a/straxen/plugins/hitlets_mv/hitlets_mv.py +++ b/straxen/plugins/hitlets_mv/hitlets_mv.py @@ -64,7 +64,16 @@ class muVETOHitlets(nVETOHitlets): ) gain_model_mv = straxen.URLConfig( - default="cmt://to_pe_model_mv?version=ONLINE&run_id=plugin.run_id", + default=( + "list-to-array://" + "xedocs://pmt_area_to_pes" + "?as_list=True" + "&sort=pmt" + "&detector=muon_veto" + "&run_id=plugin.run_id" + "&version=ONLINE" + "&attr=value" + ), infer_type=False, child_option=True, parent_option_name="gain_model_nv", diff --git a/straxen/plugins/hitlets_nv/hitlets_nv.py b/straxen/plugins/hitlets_nv/hitlets_nv.py index 9069ca673..3da7993ac 100644 --- a/straxen/plugins/hitlets_nv/hitlets_nv.py +++ b/straxen/plugins/hitlets_nv/hitlets_nv.py @@ -82,11 +82,20 @@ class nVETOHitlets(strax.Plugin): channel_map = straxen.URLConfig( track=False, type=immutabledict, - help="immutabledict mapping subdetector to (min, max) " "channel number.", + help="immutabledict mapping subdetector to (min, max) channel number.", ) gain_model_nv = straxen.URLConfig( - default="cmt://to_pe_model_nv?version=ONLINE&run_id=plugin.run_id", + default=( + "list-to-array://" + "xedocs://pmt_area_to_pes" + "?as_list=True" + "&sort=pmt" + "&detector=neutron_veto" + "&run_id=plugin.run_id" + "&version=ONLINE" + "&attr=value" + ), infer_type=False, help="PMT gain model. Specify as (model_type, model_config, nT = True)", ) diff --git a/straxen/plugins/peaklets/peaklet_positions_mlp.py b/straxen/plugins/peaklets/peaklet_positions_mlp.py index b4b03b526..a0e3a4afd 100644 --- a/straxen/plugins/peaklets/peaklet_positions_mlp.py +++ b/straxen/plugins/peaklets/peaklet_positions_mlp.py @@ -20,14 +20,14 @@ class PeakletPositionsMLP(PeakletPositionsBase): default=( "tf://" "resource://" - f"cmt://{algorithm}_model" - "?version=ONLINE" - "&run_id=plugin.run_id" + "xedocs://posrec_models" + "?attr=value" "&fmt=abs_path" + "&kind=mlp" + "&run_id=plugin.run_id" + "&version=ONLINE" ), - help=( - 'MLP model. Should be opened using the "tf" descriptor. ' - 'Set to "None" to skip computation' - ), + help='MLP model. Should be opened using the "tf" descriptor. ' + 'Set to "None" to skip computation', cache=3, ) diff --git a/straxen/plugins/peaklets/peaklets.py b/straxen/plugins/peaklets/peaklets.py index 3e7ecc98a..2c50655ba 100644 --- a/straxen/plugins/peaklets/peaklets.py +++ b/straxen/plugins/peaklets/peaklets.py @@ -150,15 +150,24 @@ class Peaklets(strax.Plugin): ) hit_min_amplitude = straxen.URLConfig( + default=( + "list-to-array://" + "xedocs://hit_thresholds" + "?as_list=True" + "&sort=pmt" + "&attr=value" + "&detector=tpc" + "&run_id=plugin.run_id" + "&version=ONLINE" + ), + help="Minimum hit amplitude in ADC counts above baseline. " + "Specify as a tuple of length n_tpc_pmts, or a number," + 'or a string like "pmt_commissioning_initial" which means calling' + "hitfinder_thresholds.py" + "or a tuple like (correction=str, version=str, nT=boolean)," + "which means we are using cmt.", track=True, infer_type=False, - default="cmt://hit_thresholds_tpc?version=ONLINE&run_id=plugin.run_id", - help=( - "Minimum hit amplitude in ADC counts above baseline. " - "Specify as a tuple of length n_tpc_pmts, or a number, " - "or a tuple like (correction=str, version=str, nT=boolean)," - "which means we are using cmt." - ), ) def infer_dtype(self): diff --git a/straxen/plugins/peaklets_he/peaklets_he.py b/straxen/plugins/peaklets_he/peaklets_he.py index 471d8afda..5932de6d8 100644 --- a/straxen/plugins/peaklets_he/peaklets_he.py +++ b/straxen/plugins/peaklets_he/peaklets_he.py @@ -51,15 +51,24 @@ class PeakletsHighEnergy(Peaklets): ) hit_min_amplitude_he = straxen.URLConfig( - default="cmt://hit_thresholds_he?version=ONLINE&run_id=plugin.run_id", + default=( + "list-to-array://" + "xedocs://hit_thresholds" + "?as_list=True" + "&sort=pmt" + "&attr=value" + "&detector=tpc_he" + "&run_id=plugin.run_id" + "&version=ONLINE" + ), + help="Minimum hit amplitude in ADC counts above baseline. " + "Specify as a tuple of length n_tpc_pmts, or a number," + 'or a string like "pmt_commissioning_initial" which means calling' + "hitfinder_thresholds.py" + "or a tuple like (correction=str, version=str, nT=boolean)," + "which means we are using cmt.", track=True, infer_type=False, - help=( - "Minimum hit amplitude in ADC counts above baseline. " - "Specify as a tuple of length n_tpc_pmts, or a number, " - "or a tuple like (correction=str, version=str, nT=boolean)," - "which means we are using cmt." - ), ) # We cannot, we only have the top array, so should not. diff --git a/straxen/plugins/peaks/peak_corrections.py b/straxen/plugins/peaks/peak_corrections.py index 7f8212fe4..8e2ec6705 100644 --- a/straxen/plugins/peaks/peak_corrections.py +++ b/straxen/plugins/peaks/peak_corrections.py @@ -18,13 +18,13 @@ class PeakCorrectedAreas(CorrectedAreas): provides = "peak_corrections" electron_drift_velocity = straxen.URLConfig( - default="cmt://electron_drift_velocity?version=ONLINE&run_id=plugin.run_id", + default="xedocs://electron_drift_velocities?attr=value&run_id=plugin.run_id&version=ONLINE", cache=True, help="Vertical electron drift velocity in cm/ns (1e4 m/ms)", ) electron_drift_time_gate = straxen.URLConfig( - default="cmt://electron_drift_time_gate?version=ONLINE&run_id=plugin.run_id", + default="xedocs://electron_drift_time_gates?attr=value&run_id=plugin.run_id&version=ONLINE", help="Electron drift time from the gate in ns", cache=True, ) diff --git a/straxen/plugins/raw_records_coin_nv/nveto_recorder.py b/straxen/plugins/raw_records_coin_nv/nveto_recorder.py index 3e7eee4df..a51ecf852 100644 --- a/straxen/plugins/raw_records_coin_nv/nveto_recorder.py +++ b/straxen/plugins/raw_records_coin_nv/nveto_recorder.py @@ -55,7 +55,7 @@ class nVETORecorder(strax.Plugin): baseline_software_trigger_samples_nv = straxen.URLConfig( infer_type=False, default=26, - track=False, + track=True, help="Number of samples used in baseline rms calculation", ) diff --git a/straxen/plugins/records/records.py b/straxen/plugins/records/records.py index 56be3e3ca..e78bb23b0 100644 --- a/straxen/plugins/records/records.py +++ b/straxen/plugins/records/records.py @@ -128,13 +128,22 @@ class PulseProcessing(strax.Plugin): hit_min_amplitude = straxen.URLConfig( track=True, infer_type=False, - default="cmt://hit_thresholds_tpc?version=ONLINE&run_id=plugin.run_id", - help=( - "Minimum hit amplitude in ADC counts above baseline. " - "Specify as a tuple of length n_tpc_pmts, or a number, " - "or a tuple like (correction=str, version=str, nT=boolean)," - "which means we are using cmt." + default=( + "list-to-array://" + "xedocs://hit_thresholds" + "?as_list=True" + "&sort=pmt" + "&attr=value" + "&detector=tpc" + "&run_id=plugin.run_id" + "&version=ONLINE" ), + help="Minimum hit amplitude in ADC counts above baseline. " + "Specify as a tuple of length n_tpc_pmts, or a number," + 'or a string like "pmt_commissioning_initial" which means calling' + "hitfinder_thresholds.py" + "or a tuple like (correction=str, version=str, nT=boolean)," + "which means we are using cmt.", ) def infer_dtype(self): diff --git a/straxen/plugins/records_he/records_he.py b/straxen/plugins/records_he/records_he.py index 1082fcd78..dd1a809d7 100644 --- a/straxen/plugins/records_he/records_he.py +++ b/straxen/plugins/records_he/records_he.py @@ -29,15 +29,24 @@ class PulseProcessingHighEnergy(PulseProcessing): ) hit_min_amplitude_he = straxen.URLConfig( - default="cmt://hit_thresholds_he?version=ONLINE&run_id=plugin.run_id", + default=( + "list-to-array://" + "xedocs://hit_thresholds" + "?as_list=True" + "&sort=pmt" + "&attr=value" + "&detector=tpc_he" + "&run_id=plugin.run_id" + "&version=ONLINE" + ), track=True, infer_type=False, - help=( - "Minimum hit amplitude in ADC counts above baseline. " - "Specify as a tuple of length n_tpc_pmts, or a number, " - "or a tuple like (correction=str, version=str, nT=boolean)," - "which means we are using cmt." - ), + help="Minimum hit amplitude in ADC counts above baseline. " + "Specify as a tuple of length n_tpc_pmts, or a number," + 'or a string like "pmt_commissioning_initial" which means calling' + "hitfinder_thresholds.py" + "or a tuple like (correction=str, version=str, nT=boolean)," + "which means we are using cmt.", ) def infer_dtype(self): diff --git a/straxen/plugins/records_nv/records_nv.py b/straxen/plugins/records_nv/records_nv.py index 2b78c5a13..09110bb83 100644 --- a/straxen/plugins/records_nv/records_nv.py +++ b/straxen/plugins/records_nv/records_nv.py @@ -49,7 +49,7 @@ class nVETOPulseProcessing(strax.Plugin): baseline_samples_nv = straxen.URLConfig( infer_type=False, - default="cmt://baseline_samples_nv?version=ONLINE&run_id=plugin.run_id", + default=26, track=True, help="Number of samples to use at the start of the pulse to determine the baseline", ) diff --git a/tests/plugins/s1_posrec_plugins.py b/tests/plugins/s1_posrec_plugins.py index fca6ffbfb..b14c326d4 100644 --- a/tests/plugins/s1_posrec_plugins.py +++ b/tests/plugins/s1_posrec_plugins.py @@ -10,7 +10,7 @@ def test_posrec_set_path( self, target="event_s1_positions_cnn", - config_name="tf_event_model_s1_cnn", + config_name="tf_model_s1_cnn", field="event_x_s1_cnn", ): """Test that we can reconstruct even if we set a hardcoded path.""" @@ -46,7 +46,7 @@ def test_posrec_set_path( def test_posrec_set_to_none( self, target="event_s1_positions_cnn", - config_name="tf_event_model_s1_cnn", + config_name="tf_model_s1_cnn", field="event_x_s1_cnn", ): """Test that we can set the config to None, giving only nan results.""" @@ -60,7 +60,7 @@ def test_posrec_set_to_none( def test_posrec_bad_configs_raising_errors( self, target="event_s1_positions_cnn", - config_name="tf_event_model_s1_cnn", + config_name="tf_model_s1_cnn", ): """Test that we get the right errors when we set invalid options.""" dummy_st = self.st.new_context() diff --git a/tests/test_peaklet_processing.py b/tests/test_peaklet_processing.py index a94ec7a1e..9ea79b422 100644 --- a/tests/test_peaklet_processing.py +++ b/tests/test_peaklet_processing.py @@ -6,6 +6,7 @@ import straxen from straxen.plugins.peaklets.peaklets import get_tight_coin from straxen.plugins.peaklets.peaklet_classification_som import compute_wf_attributes +from straxen.test_utils import nt_test_run_id def get_filled_peaks(peak_length, data_length, n_widths): @@ -55,8 +56,8 @@ def test_create_outside_peaks_region(time): time_intervals["length"] = time[1::2] - time[::2] time_intervals["dt"] = 1 - st = straxen.test_utils.nt_test_context() - p = st.get_single_plugin("0", "peaklets") + st = straxen.contexts.xenonnt_online() + p = st.get_single_plugin(nt_test_run_id, "peaklets") outside = p.create_outside_peaks_region(time_intervals, 0, np.max(time)) touching = strax.touching_windows(outside, time_intervals, window=0) @@ -79,7 +80,7 @@ def test_n_hits(): st = straxen.contexts.xenonnt_online() st.set_config({"hit_min_amplitude": 1}) - p = st.get_single_plugin("0", "peaklets") + p = st.get_single_plugin(nt_test_run_id, "peaklets") res = p.compute(records, 0, 999) peaklets = res["peaklets"] assert peaklets["n_hits"] == 3, f"Peaklet has the wrong number of hits!"