8 variablesCombinerLevel=None, categoriesCombinationCode=None,
9 TMVAfbdt=False, downloadFlag=False,
10 useOnlyLocalFlag=False, signal_fraction=-2,
11 filesDirectory="./FlavorTagging/TrainedMethods", path=None):
13 Samples the input data or tests the combiner according to the selected categories.
17 from basf2
import B2INFO, B2FATAL
21 B2INFO(
'COMBINER LEVEL')
23 B2INFO(
"Flavor Tagger: Required Combiner for Categories:")
24 for category
in categories:
27 B2INFO(f
"Flavor Tagger: which corresponds to a weight file with categories\
28 combination code {categoriesCombinationCode}")
31 if variablesCombinerLevel
is None:
32 variablesCombinerLevel = []
33 exp_type = get_Belle_or_Belle2()
35 combiner_method_prefix = f
"FlavorTagger_{exp_type}_{weightFiles}Combiner{categoriesCombinationCode}"
39 identifierFBDT = f
"{combiner_method_prefix}FBDT"
40 if downloadFlag
or useOnlyLocalFlag:
41 identifierFBDT = f
"{filesDirectory}/{combiner_method_prefix}FBDT_1.root"
44 if not os.path.isfile(identifierFBDT):
45 basf2_mva.download(f
"{combiner_method_prefix}FBDT", identifierFBDT)
46 if not os.path.isfile(identifierFBDT):
47 B2FATAL(f
"Flavor Tagger: Weight file {identifierFBDT} was\
48 not downloaded from Database. Please check the\
49 buildOrRevision name. Stopped")
52 if not os.path.isfile(identifierFBDT):
53 B2FATAL(f
"flavorTagger: Combinerlevel FastBDT was not trained\
54 with this combination of categories. Weight file\
55 {identifierFBDT} not found. Stopped")
57 B2INFO(f
"flavorTagger: Ready to be used with weightFile\
58 {combiner_method_prefix}FBDT_1.root")
63 B2INFO(f
"flavorTagger: Apply FBDTMethod {combiner_method_prefix}FBDT")
67 extraInfoName=
'qrCombinedFBDT',
68 signalFraction=signal_fraction,
69 identifier=identifierFBDT