Skip to content

Commit 81de605

Browse files
authored
Merge pull request #20 from legend-exp/ft-spm-default-cut
New `ft_spm` LAr cut
2 parents 23c71e9 + 91aac66 commit 81de605

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/calibrate_all.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ function calibrate_all(data::LegendData, sel::AnyValiditySelection, datastore::A
159159
global_events = StructVector(merge(Base.structdiff(columns(global_events_pre), NamedTuple{keys(aux_events)}), (aux = StructArray(aux_cols),)))
160160

161161
cross_systems_cols = (
162-
ged_spm = _build_lar_cut(data, sel, global_events),
162+
ged_spm = _build_lar_cut(data, sel, global_events, global_events.geds.t0_start),
163+
ft_spm = _build_lar_cut(data, sel, global_events, fill(get_spms_evt_lar_cut_props(data, sel).ft_cut_t0, length(global_events.geds.t0_start))),
163164
ged_pmt = _build_muon_evt_cut(data, sel, global_events, pmt_events)
164165
)
165166

src/calibrate_smps.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ function _lar_cut(
7272
return NamedTuple{colnames, Tuple{Bool, eltype(eltype(spm_pe)), Int}}([lar_cut, pe_sum, n_over_thresh])
7373
end
7474

75-
function _build_lar_cut(data::LegendData, sel::AnyValiditySelection, global_events::AbstractVector{<:NamedTuple}, e_filter::Symbol)
76-
geds_t0 = global_events.geds.t0_start
77-
75+
function _build_lar_cut(data::LegendData, sel::AnyValiditySelection, global_events::AbstractVector{<:NamedTuple}, geds_t0::AbstractVector{<:Unitful.Time{<:Real}}, e_filter::Symbol)
7876
dataprod_larcut = get_spms_evt_lar_cut_props(data, sel)
7977
dataprod_larcut_filter = dataprod_larcut.energy_types[e_filter]
8078

@@ -94,12 +92,12 @@ function _build_lar_cut(data::LegendData, sel::AnyValiditySelection, global_even
9492
return StructArray(_lar_cut.(Ref(colnames), t_wins, spm_t, spmdc, spm_pe, Ref(pe_ch_threshold), Ref(pe_sum_threshold), Ref(multiplicity_threshold)))
9593
end
9694

97-
function _build_lar_cut(data::LegendData, sel::AnyValiditySelection, global_events::AbstractVector{<:NamedTuple})
95+
function _build_lar_cut(data::LegendData, sel::AnyValiditySelection, global_events::AbstractVector{<:NamedTuple}, geds_t0::AbstractVector{<:Unitful.Time{<:Real}})
9896
dataprod_larcut = get_spms_evt_lar_cut_props(data, sel)
9997
energy_types = keys(dataprod_larcut.energy_types)
10098

10199
is_valid_lar_propfunc = ljl_propfunc(dataprod_larcut.is_valid_lar)
102100

103-
lar_cut = StructArray(merge(columns.(_build_lar_cut.(Ref(data), Ref(sel), Ref(global_events), energy_types))...))
101+
lar_cut = StructArray(merge(columns.(_build_lar_cut.(Ref(data), Ref(sel), Ref(global_events), Ref(geds_t0), energy_types))...))
104102
return StructArray(merge((is_valid_lar = is_valid_lar_propfunc.(lar_cut),), columns(lar_cut)))
105103
end

0 commit comments

Comments
 (0)