Skip to content

Commit

Permalink
Split out dt cut from aoe (#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggmarshall authored May 8, 2024
1 parent 36efe1a commit 1f9f82f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 35 deletions.
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

0 comments on commit 1f9f82f

Please sign in to comment.