# Check whether there is bias in the fit frame_var, frame_err, frame_pull = DE.check_fit_bias(param_to_study=N_sig, N_toys=100) c_var = ROOT.TCanvas() frame_var.Draw() c_error = ROOT.TCanvas() frame_err.Draw() c_pull = ROOT.TCanvas() frame_pull.Draw() # Export data and model to workspace w = DE.write_to_workspace(poi=N_sig, nuisances=[exp_par, mean, sigma, N_bkgr]) # Calculate statistical significance of signal observation with asymptotic approximation asympt_rrr = DE.asympt_signif(w=w) # DE.asympt_signif_ll(w=w) # another method # Do chi^2 goodness-of-fit test and print fit and test status chi2_results = list(DE.chi2_test(pvalue_threshold=0.05, nbins=-1).values())[0] print( f'\n\nchi2: {chi2_results[0]}\nndf: {chi2_results[1]}\np-value of chi2 test: {chi2_results[2]}\n' ) print(f'fit status: {DE.fit_status}, chi2_test status: {DE.chi2_test_status}') # Calculate signal significance with toys # Note that p-value might be zero if bkgr hypo is very unlikely since it might require lots of toys to get to the observed value of test statistic. c_toy_signif = ROOT.TCanvas() frame_toy_signif, _ = DE.toy_signif(w, n_toys_null=100, n_toys_alt=10) frame_toy_signif.Draw()