7 #include <TObjString.h>
20 std::vector<TString> parsed_strings;
21 TObjArray* varList_ar =
str.Tokenize(delim);
22 for(
int i = 0;
i != varList_ar->GetEntries(); ++
i){
23 if (
auto *tos =
dynamic_cast<TObjString*
> (varList_ar->At(
i))) {
24 TString
var = tos->String();
25 if(
var.Length()==0)
continue;
26 parsed_strings.push_back(
var);
30 return parsed_strings;
36 for( TString&
str : parsed_strings ){
37 str.ReplaceAll(
" ",
"");
38 if(
str.Contains(
":=")){
42 return parsed_strings;
47 using namespace DiTauRecTools::msgHelperFunction;
48 std::unique_ptr<TFile> fBDT(TFile::Open(weightFile));
50 ANA_MSG_ERROR(
"configureMVABDT: Cannot find tau input BDT file: " << weightFile );
54 TTree* tBDT =
dynamic_cast<TTree*
> (fBDT->Get(
"BDT"));
56 ANA_MSG_ERROR(
"configureMVABDT: Cannot find tau input BDT tree");
60 ANA_MSG_INFO(
"configureMVABDT: opened file: " << weightFile);
62 std::vector<float*> vars;
65 TNamed* n_varList =
dynamic_cast<TNamed*
> (fBDT->Get(
"varList"));
67 ANA_MSG_ERROR(
"configureMVABDT: no Variable List in file: " << weightFile );
73 for(
const TString&
str : varList_ar){
74 if(
str.Length()==0)
continue;
76 if(itr==availableVars.end()){
77 ANA_MSG_ERROR(
"configureMVABDT: Variable : " <<
str <<
" is not available" );
80 vars.push_back( itr->second );
83 auto reader = std::make_unique<MVAUtils::BDT>(tBDT);
84 reader->SetPointers( vars );