Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Luigi Dello Stritto committed Sep 30, 2024
1 parent 5ba6678 commit 2865e7f
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions machine_learning_hep/fitting/roofitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@ def create_text_info(x_1, y_1, x_2, y_2):

return text_info

def add_text_info_fit(text_info, frame, ws):
def add_text_info_fit(text_info, frame, roows):
chi2 = frame.chiSquare()
mean_sgn = ws.var("mean")
sigma_sgn = ws.var("sigma_g1")
sigmawide_sgn = ws.var("sigma_wide")
refl_frac = ws.var("frac_refl")
mean_sgn = roows.var("mean")
sigma_sgn = roows.var("sigma_g1")
sigmawide_sgn = roows.var("sigma_wide")
refl_frac = roows.var("frac_refl")
text_info.AddText(f"#chi^{{2}}/ndf = {chi2:.2f}")
text_info.AddText(f"#mu = {mean_sgn.getVal():.3f} #pm {mean_sgn.getError():.3f}")
text_info.AddText(f"#sigma = {sigma_sgn.getVal():.3f} #pm {sigma_sgn.getError():.3f}")
Expand All @@ -207,14 +207,10 @@ def add_text_info_fit(text_info, frame, ws):
if refl_frac:
text_info.AddText(f"refl.frac. = {refl_frac.getVal():.3f} #pm {refl_frac.getError():.3f}")

return


def add_text_info_perf(text_info, sig, sig_err, bkg, bkg_err, s_over_b, s_over_b_err, signif, signif_err):

text_info.AddText(f"S(3#sigma) = {sig:.0f} #pm {sig_err:.0f}")
text_info.AddText(f"B(3#sigma) = {bkg:.0f} #pm {bkg_err:.0f}")
text_info.AddText(f"S/B(3#sigma) = {s_over_b:.3f} #pm {s_over_b_err:.3f}")
text_info.AddText(f"Signif(3#sigma) = {signif:.1f} #pm {signif_err:.1f}")

return

0 comments on commit 2865e7f

Please sign in to comment.