Skip to content

Commit 073f977

Browse files
committed
Add tests to plot the normalized A/E ctc distribution
1 parent f71f341 commit 073f977

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

test/test_lplot.jl

+9-4
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,17 @@ end
188188
@testset "A/E ctc correlation plot" begin
189189
# generate fake A/E and Qdrift/E distribution
190190
E0 = 550u"keV"
191-
e_cal = fill(E0, 10_000)
192-
aoe_corr = clamp.(vcat(-rand(Distributions.Exponential(5.0), 2_000), zeros(8_000)) .+ randn(10_000), -49.0, 7.0)
193-
qdrift_e = max.(0, randn(10_000) .+ 5)
194-
@test length(e_cal) == length(aoe_corr) == length(qdrift_e) == 10_000
191+
e_cal = fill(E0, 100_000)
192+
aoe_corr = clamp.(vcat(-rand(Distributions.Exponential(5.0), 20_000), zeros(80_000)) .+ randn(100_000), -49.0, 7.0)
193+
qdrift_e = max.(0, randn(100_000) .+ 5)
194+
# add some fake drift time dependency
195+
fct = 0.1
196+
aoe_corr .-= qdrift_e .* fct
197+
aoe_corr .-= StatsBase.median(aoe_corr)
198+
@test length(e_cal) == length(aoe_corr) == length(qdrift_e) == 100_000
195199
result_aoe_ctc, report_aoe_ctc = LegendSpecFits.ctc_aoe(aoe_corr, e_cal, qdrift_e, [E0-10u"keV"])
196200
@test_nowarn lplot(report_aoe_ctc, figsize = (600,600), title = "Test")
201+
@test_nowarn lplot(report_aoe_ctc, norm = true, figsize = (600,600), title = "Test")
197202
end
198203

199204
@testset "A/E survival fraction plots" begin

0 commit comments

Comments
 (0)