13if __name__ ==
"__main__":
14 from basf2
import conditions, find_file
16 conditions.testing_payloads = [
17 'localdb/database.txt'
20 train_file = find_file(
"mva/train_D0toKpipi.root",
"examples")
21 test_file = find_file(
"mva/test_D0toKpipi.root",
"examples")
23 training_data = basf2_mva.vector(train_file)
24 testing_data = basf2_mva.vector(test_file)
27 general_options = basf2_mva.GeneralOptions()
28 general_options.m_datafiles = training_data
29 general_options.m_treename =
"tree"
30 general_options.m_identifier =
"MVADatabaseIdentifier"
31 general_options.m_variables = basf2_mva.vector(
'M',
'p',
'pz',
'pt',
'phi',
'daughter(0, kaonID)',
'daughter(0, pionID)',
32 'daughter(1, kaonID)',
'daughter(1, pionID)',
'chiProb',
'dr',
'dz',
'dphi')
33 general_options.m_target_variable =
"isSignal"
35 fastbdt_options = basf2_mva.FastBDTOptions()
37 basf2_mva.teacher(general_options, fastbdt_options)
40 basf2_mva.download(
'MVADatabaseIdentifier',
'weightfile.root')
43 general_options.m_identifier =
"weightfile2.root"
44 basf2_mva.teacher(general_options, fastbdt_options)
47 basf2_mva.upload(
'weightfile2.root',
'MVADatabaseIdentifier2')
54 'MVADatabaseIdentifier',
55 'MVADatabaseIdentifier2'),