31if __name__ ==
"__main__":
37 if not os.getenv(
'BELLE2_EXAMPLES_DATA_DIR'):
38 b2.B2FATAL(
"You need the example data installed. Run `b2install-data example` in terminal for it.")
41 path = os.getenv(
'BELLE2_EXAMPLES_DATA_DIR')+
'/mva/B2A701_output_'
43 train_data = path +
'train.root'
44 test_data = path +
'test.root'
45 apply_signal_data = path +
'apply_signal.root'
46 apply_qqbar_data = path +
'apply_qqbar.root'
59 'KSFWVariables(pt_sum)',
61 'KSFWVariables(hso00)',
62 'KSFWVariables(hso01)',
63 'KSFWVariables(hso02)',
64 'KSFWVariables(hso03)',
65 'KSFWVariables(hso04)',
66 'KSFWVariables(hso10)',
67 'KSFWVariables(hso12)',
68 'KSFWVariables(hso14)',
69 'KSFWVariables(hso20)',
70 'KSFWVariables(hso22)',
71 'KSFWVariables(hso24)',
72 'KSFWVariables(hoo0)',
73 'KSFWVariables(hoo1)',
74 'KSFWVariables(hoo2)',
75 'KSFWVariables(hoo3)',
76 'KSFWVariables(hoo4)',
88 general_options = basf2_mva.GeneralOptions()
89 general_options.m_datafiles = basf2_mva.vector(train_data)
90 general_options.m_treename =
"tree"
91 general_options.m_identifier =
"MVAFastBDT.root"
92 general_options.m_variables = basf2_mva.vector(*trainVars)
93 general_options.m_target_variable =
"isNotContinuumEvent"
94 fastbdt_options = basf2_mva.FastBDTOptions()
97 basf2_mva.teacher(general_options, fastbdt_options)
100 subprocess.call(
'basf2_mva_evaluate.py '
101 ' -train ' + train_data +
102 ' -data ' + test_data +
103 ' -id ' +
'MVAFastBDT.root' +
104 ' --output qqbarSuppressionEvaluation.pdf',
113 basf2_mva.vector(
'MVAFastBDT.root'),
114 basf2_mva.vector(apply_signal_data),
116 'MVAExpert_signal.root')
118 basf2_mva.vector(
'MVAFastBDT.root'),
119 basf2_mva.vector(apply_qqbar_data),
121 'MVAExpert_qqbar.root')