-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A/E ctc correction #87
Conversation
…tc.jl, but needs some fixes before it can be applied)
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #87 +/- ##
==========================================
- Coverage 21.89% 21.00% -0.89%
==========================================
Files 34 36 +2
Lines 2973 3356 +383
==========================================
+ Hits 651 705 +54
- Misses 2322 2651 +329 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plotting code for now (very much inspired by the energy_ctc calibration in #67): # This should become a plot recipe at some point
let aoe_final = ljl_propfunc(result.func).(hit_cal), _aoe = ljl_propfunc(result_correction.func).(hit_cal), _qdrift_e = hit_cal.qdrift ./ hit_cal.e_cusp
sel = abs.(aoe_final) .< 100 #.&& mask
plot(fit(Histogram, _aoe[sel], -9:0.1:9), fill = true, xlims = (-9,5), color = :darkgrey, subplot = 1, link = :x, framestyle = :semi, size = (1000,1000), margins = (0,:mm), layout = (2,1), grid = false, st = :stepbins, left_margin = (5,:mm), right_margin = (5,:mm), bottom_margin = (-4,:mm), label = "Before correction")
plot!(fit(Histogram, aoe_final[sel], -9:0.1:9), fill = true, xlims = (-9,5), alpha = 0.5, color = :purple, subplot = 1, link = :x, framestyle = :semi, size = (1000,1000), margins = (0,:mm), layout = (2,1), grid = false, st = :stepbins, left_margin = (5,:mm), right_margin = (5,:mm), bottom_margin = (-4,:mm), label = "After correction", legend = :topleft, ylabel = "counts / 0.1")
plot!(kde((_aoe[sel], (_qdrift_e)[sel])), subplot = 2, c = :binary, colorbar = :none, st = :line, fill = true, label = "After correction", yformatter = :plain, link = :x)
plot!(kde((aoe_final[sel], (_qdrift_e)[sel])), subplot = 2, c = :plasma, link = :x, framestyle = :semi, colorbar = :none, st = :line, fill = false, label = "After correction", yformatter = :plain, xlims = (-9,5), ylims = (0,11), ylabel = "Eff. Drift time / Energy (a.u.)")
plot!(xlabel = "A/E classifier", xtickfontsize = 12, xlabelfontsize = 14, ylabelfontsize = 14, ytickfontsize = 12, legendfontsize = 12, foreground_color_legend = :silver, background_color_legend = :white, fmt = :png)
end |
With the latest commit, I updated the A/E pseudo priors for the double Gaussian mixture model, without modifying the priors used for the single low A/E tail one. It, therefore, should not affect the correction of the energy dependence of I still need to see if these new priors perform well for ALL detectors. They seem to work well on detectors that were problematic before, though. Fingers crossed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! @fhagemann and @verenaaur
Still missing: plot recipe for the ctc code (comparing before and after) |
So, this is @verenaaur's and my approach to the charge trapping correction of the$(A/E) \text{classifier}$ :
The idea is to determine a charge trapping factor$fct$ such that a linear correction of the $(A/E) \text{classifier}$ $Q\text{drift}/E$ results in corrected, $Q\text{drift}/E$ -independent $(A/E) \text{classifier}$ -values.
with respect to
The steps of the algorithm are as follows:
mask
to select all events that fill into thecompton_bands
provided to the function.compton_bands
-->h_before
f_optimize_ctc
h_norm
h_norm
and normalize the resulting peak again toμ = 0
andσ = 1
-->h_after
aoe_ctc_func
.Some things that would need some manual testing
There are some hard-coded values and some pseudo priors need to be improved for the fit to converge towards something reasonable. I will mark the hard coded values right after opening the PR.$fct$ in the fit, etc.
These include histogram ranges, boundaries for
How to use it