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