13from basf2_mva_util
import chain2dict, calculate_auc_efficiency_vs_background_retention
14from basf2_mva_evaluation
import plotting
17if __name__ ==
"__main__":
18 rootchain = ROOT.TChain(
"variables")
19 rootchain.Add(
'ntuple.root')
21 variables = [
'extraInfo__boFull__bc',
'extraInfo__boOrdinary__bc',
'extraInfo__boPdf__bc',
'extraInfo__boSPlot__bc',
22 'extraInfo__boSPlotCombined__bc',
'extraInfo__boSPlotBoosted__bc',
'extraInfo__boSPlotCombinedBoosted__bc',
24 data = chain2dict(rootchain, variables, variables)
27 p.set_plot_options(dict(linestyle=
'-', lw=6))
28 p.set_errorband_options(
None)
29 p.set_errorbar_options(
None)
30 p.add(data,
'extraInfo__boFull__bc', data[
'isSignal'] == 1, data[
'isSignal'] == 0)
31 p.add(data,
'extraInfo__boOrdinary__bc', data[
'isSignal'] == 1, data[
'isSignal'] == 0)
32 p.add(data,
'extraInfo__boPdf__bc', data[
'isSignal'] == 1, data[
'isSignal'] == 0)
33 p.add(data,
'extraInfo__boSPlot__bc', data[
'isSignal'] == 1, data[
'isSignal'] == 0)
34 p.add(data,
'extraInfo__boSPlotCombined__bc', data[
'isSignal'] == 1, data[
'isSignal'] == 0)
35 p.add(data,
'extraInfo__boSPlotBoosted__bc', data[
'isSignal'] == 1, data[
'isSignal'] == 0)
36 p.add(data,
'extraInfo__boSPlotCombinedBoosted__bc', data[
'isSignal'] == 1, data[
'isSignal'] == 0)
38 p.save(
'evaluation.png')
40 print(
'AUC (Ordinary)', calculate_auc_efficiency_vs_background_retention(data[
'extraInfo__boOrdinary__bc'], data[
'isSignal']))
41 print(
'AUC (Full)', calculate_auc_efficiency_vs_background_retention(data[
'extraInfo__boFull__bc'], data[
'isSignal']))
42 print(
'AUC (Pdf)', calculate_auc_efficiency_vs_background_retention(data[
'extraInfo__boPdf__bc'], data[
'isSignal']))
43 print(
'AUC (SPlot)', calculate_auc_efficiency_vs_background_retention(data[
'extraInfo__boSPlot__bc'], data[
'isSignal']))
45 'AUC (SPlotCombined)',
46 calculate_auc_efficiency_vs_background_retention(
47 data[
'extraInfo__boSPlotCombined__bc'],
51 calculate_auc_efficiency_vs_background_retention(
52 data[
'extraInfo__boSPlotBoosted__bc'],
54 print(
'AUC (SPlotCombinedBoosted)', calculate_auc_efficiency_vs_background_retention(
55 data[
'extraInfo__boSPlotCombinedBoosted__bc'], data[
'isSignal']))