Belle II Software development
utility.py
1
8
9'''
10Wrappers around functions defined as static methods of the Belle2::MVA::Utility class.
11'''
12
13
14def available(filename, experiment=0, run=0, event=0):
15 '''
16 Wrapper around bool Belle2::MVA::Utility::available(
17 const std::string& filename, int experiment = 0, int run = 0, int event = 0)
18 '''
19 # Always avoid the top-level 'import ROOT'.
20 import ROOT # noqa
21 return ROOT.Belle2.MVA.Utility.available(filename, experiment, run, event)
22
23
24def download(identifier, filename, experiment=0, run=0, event=0):
25 '''
26 Wrapper around Belle2::MVA::Utility::download(
27 const std::string& identifier, const std::string& filename, int experiment = 0, int run = 0, int event = 0)
28 '''
29 # Always avoid the top-level 'import ROOT'.
30 import ROOT # noqa
31 ROOT.Belle2.MVA.Utility.download(identifier, filename, experiment, run, event)
32
33
34def expert(*args):
35 '''
36 Wrapper around Belle2::MVA::Utility::expert(
37 const std::vector<std::string>& filenames, const std::vector<std::string>& datafiles,
38 const std::string& treename, const std::string& outputfile, int experiment = 0, int run = 0, int event = 0,
39 bool copy_target = true);
40 '''
41 # Always avoid the top-level 'import ROOT'.
42 import ROOT # noqa
43 ROOT.Belle2.MVA.Utility.expert(*args)
44
45
46def extract(filename, directory):
47 '''
48 Wrapper around Belle2::MVA::Utility::extract(const std::string& filename, const std::string& directory)
49 '''
50 # Always avoid the top-level 'import ROOT'.
51 import ROOT # noqa
52 ROOT.Belle2.MVA.Utility.extract(filename, directory)
53
54
55def info(filename):
56 '''
57 Wrapper around std::string Belle2::MVA::Utility::info(const std::string& filename)
58 '''
59 # Always avoid the top-level 'import ROOT'.
60 import ROOT # noqa
61 return ROOT.Belle2.MVA.Utility.info(filename)
62
63
64def save_custom_weightfile(*args):
65 '''
66 Wrapper around Belle2::MVA::Utility::save_custom_weightfile(
67 const GeneralOptions& general_options, const SpecificOptions& specific_options,
68 const std::string& custom_weightfile, const std::string& output_identifier = "")
69 '''
70 # Always avoid the top-level 'import ROOT'.
71 import ROOT # noqa
72 ROOT.Belle2.MVA.Utility.save_custom_weightfile(*args)
73
74
75def teacher(*args):
76 '''
77 Wrapper around Belle2::MVA::Utility::teacher(
78 const GeneralOptions& general_options, const SpecificOptions& specific_options,
79 const MetaOptions& meta_options = MetaOptions())
80 '''
81 # Always avoid the top-level 'import ROOT'.
82 import ROOT # noqa
83 ROOT.Belle2.MVA.Utility.teacher(*args)
84
85
86def teacher_dataset(*args):
87 '''
88 Wrapper around std::unique_ptr<Belle2::MVA::Expert> Belle2::MVA::Utility::teacher_dataset(
89 GeneralOptions general_options, const SpecificOptions& specific_options, Dataset& data)
90 '''
91 # Always avoid the top-level 'import ROOT'.
92 import ROOT # noqa
93 return ROOT.Belle2.MVA.Utility.teacher_dataset(*args)
94
95
96def teacher_sideband_subtraction(*args):
97 '''
98 Wrapper around std::unique_ptr<Belle2::MVA::Expert> Belle2::MVA::Utility::teacher_sideband_subtraction(
99 GeneralOptions general_options, const SpecificOptions& specific_options, const MetaOptions& meta_options)
100 '''
101 # Always avoid the top-level 'import ROOT'.
102 import ROOT # noqa
103 return ROOT.Belle2.MVA.Utility.teacher_sideband_subtraction(*args)
104
105
106def teacher_splot(*args):
107 '''
108 Wrapper around std::unique_ptr<Belle2::MVA::Expert> Belle2::MVA::Utility::teacher_splot(
109 GeneralOptions general_options, const SpecificOptions& specific_options, const MetaOptions& meta_options)
110 '''
111 # Always avoid the top-level 'import ROOT'.
112 import ROOT # noqa
113 return ROOT.Belle2.MVA.Utility.teacher_splot(*args)
114
115
116def teacher_reweighting(*args):
117 '''
118 Wrapper around std::unique_ptr<Belle2::MVA::Expert> Belle2::MVA::Utility::teacher_reweighting(
119 GeneralOptions general_options, const SpecificOptions& specific_options, const MetaOptions& meta_options)
120 '''
121 # Always avoid the top-level 'import ROOT'.
122 import ROOT # noqa
123 return ROOT.Belle2.MVA.Utility.teacher_reweighting(*args)
124
125
126def upload(filename, identifier, exp1=0, run1=0, exp2=-1, run2=-1):
127 '''
128 Wrapper around Belle2::MVA::Utility::upload(
129 const std::string& filename, const std::string& identifier, int exp1 = 0, int run1 = 0, int exp2 = -1,
130 int run2 = -1)
131 '''
132 # Always avoid the top-level 'import ROOT'.
133 import ROOT # noqa
134 ROOT.Belle2.MVA.Utility.upload(filename, identifier, exp1, run1, exp2, run2)
135
136
137def upload_array(*args):
138 '''
139 Wrapper around Belle2::MVA::Utility::upload_array(
140 const std::vector<std::string>& filenames, const std::string& identifier, int exp1 = 0, int run1 = 0,
141 int exp2 = -1, int run2 = -1)
142 '''
143 # Always avoid the top-level 'import ROOT'.
144 import ROOT # noqa
145 ROOT.Belle2.MVA.Utility.upload_array(*args)