Skip to content
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

Split out dt cut from aoe #581

Merged
merged 3 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 15 additions & 34 deletions src/pygama/pargen/AoE_cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1552,24 +1552,15 @@ def get_aoe_cut_fit(
log.error("A/E cut determination failed")
self.low_cut_val = np.nan
data[output_cut_param] = False
if self.dt_cut_param is not None and self.dt_cut_hard is True:
self.update_cal_dicts(
{
output_cut_param: {
"expression": f"({aoe_param}>a) & ({self.dt_cut_param})",
"parameters": {"a": self.low_cut_val},
}
}
)
else:
self.update_cal_dicts(
{
output_cut_param: {
"expression": f"({aoe_param}>a)",
"parameters": {"a": self.low_cut_val},
}

self.update_cal_dicts(
{
output_cut_param: {
"expression": f"({aoe_param}>a)",
"parameters": {"a": self.low_cut_val},
}
)
}
)

def calculate_survival_fractions_sweep(
self,
Expand Down Expand Up @@ -1796,24 +1787,14 @@ def calibrate(
df["AoE_Classifier"] < self.high_cut_val
)

if self.dt_cut_param is not None and self.dt_cut_hard is True:
self.update_cal_dicts(
{
"AoE_High_Side_Cut": {
"expression": f"(a>AoE_Classifier)& ({self.dt_cut_param})",
"parameters": {"a": self.high_cut_val},
}
}
)
else:
self.update_cal_dicts(
{
"AoE_High_Side_Cut": {
"expression": "(a>AoE_Classifier)",
"parameters": {"a": self.high_cut_val},
}
self.update_cal_dicts(
{
"AoE_High_Side_Cut": {
"expression": "(a>AoE_Classifier)",
"parameters": {"a": self.high_cut_val},
}
)
}
)

self.update_cal_dicts(
{
Expand Down
2 changes: 1 addition & 1 deletion src/pygama/pargen/lq_cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ def drift_time_correction(

self.update_cal_dicts(
{
"LQ_Classifier": {
"LQ_Corrected": {
"expression": f"{lq_param} - dt_eff*a - b",
"parameters": {"a": self.dt_fit_pars[0], "b": self.dt_fit_pars[1]},
}
Expand Down