Belle II Software development
TrainLambdaSelector.py
1#!/usr/bin/env python3
2
3
10
11
18
19import basf2 as b2
20import basf2_mva
21import LambdaSelector as LambdaSelector
22
23# Train weight file for V0 Selection.
24# name of output file is specified by the argument 'mva_identifier'.
26 train_data=b2.find_file('LambdaSelector_train_V0Selector.root', 'examples', False),
27 tree_name="tree",
28 mva_identifier="MVA_LGBM_V0Selector.root",
29 target_variable="isSignal"
30)
31
32# Train weight file for V0 Selection.
33# name of output file is specified by the argument 'mva_identifier'.
35 train_data=b2.find_file('LambdaSelector_train_KsVeto.root', 'examples', False),
36 tree_name="tree",
37 mva_identifier="MVA_LGBM_KsVeto.root",
38 target_variable="isSignal"
39)
40
41# apply mva to the training data
42basf2_mva.expert(basf2_mva.vector('MVA_LGBM_V0Selector.root'),
43 basf2_mva.vector(b2.find_file('LambdaSelector_train_V0Selector.root', 'examples', False)),
44 'tree', 'MVAExpert_V0Selector.root')
45basf2_mva.expert(basf2_mva.vector('MVA_LGBM_KsVeto.root'),
46 basf2_mva.vector(b2.find_file('LambdaSelector_train_KsVeto.root', 'examples', False)),
47 'tree', 'MVAExpert_KsVeto.root')
def V0Selector_Training(train_data, tree_name="tree", mva_identifier="MVA_LightGBM_V0Selector.root", target_variable="isSignal", parameters={})
def KsVeto_Training(train_data, tree_name="tree", mva_identifier="MVA_LightGBM_KsVeto.root", target_variable="isSignal", parameters={})