23 if __name__ ==
"__main__":
29 if not os.getenv(
'BELLE2_EXAMPLES_DATA_DIR'):
30 b2.B2FATAL(
"You need the example data installed. Run `b2install-data example` in terminal for it.")
33 path = os.getenv(
'BELLE2_EXAMPLES_DATA_DIR')+
'/mva/'
35 train_data = path +
'train.root'
36 test_data = path +
'test.root'
37 apply_signal_data = path +
'apply_signal.root'
38 apply_qqbar_data = path +
'apply_qqbar.root'
53 'KSFWVariables(hso00)',
54 'KSFWVariables(hso02)',
55 'KSFWVariables(hso04)',
56 'KSFWVariables(hso10)',
57 'KSFWVariables(hso12)',
58 'KSFWVariables(hso14)',
59 'KSFWVariables(hso20)',
60 'KSFWVariables(hso22)',
61 'KSFWVariables(hso24)',
62 'KSFWVariables(hoo0)',
63 'KSFWVariables(hoo1)',
64 'KSFWVariables(hoo2)',
65 'KSFWVariables(hoo3)',
66 'KSFWVariables(hoo4)',
78 general_options = basf2_mva.GeneralOptions()
79 general_options.m_datafiles = basf2_mva.vector(train_data)
80 general_options.m_treename =
"tree"
81 general_options.m_identifier =
"MVAFastBDT.root"
82 general_options.m_variables = basf2_mva.vector(*trainVars)
83 general_options.m_target_variable =
"isNotContinuumEvent"
84 fastbdt_options = basf2_mva.FastBDTOptions()
87 basf2_mva.teacher(general_options, fastbdt_options)
90 subprocess.call(
'basf2_mva_evaluate.py '
91 ' -train ' + train_data +
92 ' -data ' + test_data +
93 ' -id ' +
'MVAFastBDT.root' +
94 ' --output qqbarSuppressionEvaluation.pdf',
102 basf2_mva.expert(basf2_mva.vector(
'MVAFastBDT.root'), basf2_mva.vector(apply_signal_data),
'tree',
'MVAExpert_signal.root')
103 basf2_mva.expert(basf2_mva.vector(
'MVAFastBDT.root'), basf2_mva.vector(apply_qqbar_data),
'tree',
'MVAExpert_qqbar.root')