@@ -14,6 +14,8 @@ function calibrate_all(data::LegendData, sel::AnyValiditySelection, datastore::A
1414 chinfo = channelinfo (data, sel)
1515 geds_channels:: Vector{ChannelId} = filterby (get_ged_evt_chsel_propfunc (data, sel))(chinfo). channel
1616 @debug " Loaded $(length (geds_channels)) HPGe channels"
17+ hitgeds_channels:: Vector{ChannelId} = filterby (get_ged_evt_hitchsel_propfunc (data, sel))(chinfo). channel
18+ @debug " Loaded $(length (hitgeds_channels)) HPGe hit channels"
1719 spms_channels:: Vector{ChannelId} = filterby (get_spms_evt_chsel_propfunc (data, sel))(chinfo). channel
1820 @debug " Loaded $(length (spms_channels)) SiPM channels"
1921 aux_channels:: Vector{ChannelId} = filterby (get_aux_evt_chsel_propfunc (data, sel))(chinfo). channel
@@ -52,23 +54,29 @@ function calibrate_all(data::LegendData, sel::AnyValiditySelection, datastore::A
5254
5355 maximum_with_init (A) = maximum (A, init= zero (eltype ((A))))
5456
57+ is_valid_hit (trig_chs:: AbstractVector{<:Int} , hit_channels:: AbstractVector{<:Int} ) = all (x -> x in hit_channels, trig_chs)
58+ # Main.@infiltrate
59+
5560 ged_additional_cols = (
5661 t0_start = min_t0 .(trig_t0),
5762 trig_t0 = trig_t0,
5863 multiplicity = n_trig,
59- max_e_ch = max_e_ch,
64+ max_e_ch_idxs = max_e_ch,
65+ max_e_ch = only .(getindex .(ged_events_pre. channel, max_e_ch)),
6066 max_e_trap_cal = maximum_with_init .(trig_e_trap_cal),
6167 max_e_cusp_cal = maximum_with_init .(trig_e_cusp_cal),
6268 max_e_trap_ctc_cal = maximum_with_init .(trig_e_trap_ctc_cal),
6369 max_e_cusp_ctc_cal = maximum_with_init .(trig_e_cusp_ctc_cal),
6470 max_e_short_cal = maximum_with_init .(trig_e_short_cal),
65- trig_e_ch = trig_e_ch,
71+ trig_e_ch_idxs = trig_e_ch,
72+ trig_e_ch = getindex .(ged_events_pre. channel, trig_e_ch),
6673 trig_e_trap_cal = trig_e_trap_cal,
6774 trig_e_cusp_cal = trig_e_cusp_cal,
6875 trig_e_trap_ctc_cal = trig_e_trap_ctc_cal,
6976 trig_e_cusp_ctc_cal = trig_e_cusp_ctc_cal,
7077 trig_e_short_cal = trig_e_short_cal,
7178 is_valid_qc = count .(ged_events_pre. is_baseline) .== n_expected_baseline,
79+ is_valid_hit = is_valid_hit .(getindex .(ged_events_pre. channel, trig_e_ch), Ref (Int .(hitgeds_channels))),
7280 is_discharge_recovery = any .(ged_events_pre. is_discharge_recovery_ml),
7381 is_saturated = any .(ged_events_pre. is_saturated),
7482 is_discharge = any .(ged_events_pre. is_discharge),
0 commit comments