TClass RuntimeWarnings in BDT generation

Hey everyone, ROOT newbie here. I’m trying to generate a boosted decision tree from some TTrees containing data and have gotten some weird warnings. When I used the same code but an “example.root” file it worked fine, so I believe it has to do with the data itself. From trying to solve the problem on my own I think I’ve gathered that the problem is the data used some dictionaries that my code doesn’t, but I can’t find any documentation on these classes anywhere! Relevant code snippets attached

file1 = ROOT.TFile("file1.root")
file2 = ROOT.TFile("file2.root")
tree_b = file1.Get("treename")
tree_s = file2.Get("treename")
#later
factory.AddSignalTree(tree_s)
factory.AddBackgroundTree(tree_b)

And when I run I get the following:

TClass::Init:0: RuntimeWarning: no dictionary for class L_PAR is available
TClass::Init:0: RuntimeWarning: no dictionary for class PAR is available
TClass::Init:0: RuntimeWarning: no dictionary for class PAR0 is available
TClass::Init:0: RuntimeWarning: no dictionary for class J_PAR is available
TClass::Init:0: RuntimeWarning: no dictionary for class TR_PAR is available
— Factory : You are running ROOT Version: 6.04/14, Feb 3, 2016
— Factory :
— Factory : ////_/ _| _| _| _| ||
— Factory : _/ || || _| _| _| _|
— Factory : _/ _| _| _| | | ||||
— Factory : _/ _| _| _| _| _| _|
— Factory : _/ _| _| _| _| _|
— Factory :
— Factory : ___________TMVA Version 4.2.1, Feb 5, 2015
— Factory :
Traceback (most recent call last):
File “BDT.py”, line 58, in
factory.AddSignalTree(tree_s)
TypeError: none of the 3 overloaded methods succeeded. Full details:
void TMVA::factory::AddSignalTree(TTree* signal, double weight = 1., TMVA::Types::ETreeType treetype = Types::kMaxTreeType) =>
could not convert argument 1
void TMVA::factory::AddSignalTree(TString datFileS, double weight = 1., TMVA::Types::ETreeType treetype = Types::kMaxTreeType) =>
could not convert argument 1
void TMVA::factory::AddSignalTree(TTree* signal, double weight, const TString& treetype) =>
takes at least 3 arguments (1 given)

Any suggestions? Should I post the full code? I think this should have a simple fix, but not being able to find out anything about these classes has me stuck… Thanks!

Hi,

let’s focus on the first problem, i.e. the absence of dictionaries.
If you write in a ROOT file a certain set of class instances, you need to have their dictionaries available to read them back (as a matter of fact also to write them, but in your case this does not apply).
You can always then read back what you wrote even if you do not have anymore the code used to write available with MakeProject (root.cern.ch/doc/master/classTF … 32295e529d). Note that the class methods will not be available.
For more information about how to generate dictionaries, you can refer to root.cern.ch/how/how-create-dictionary and the help of the rootcling and genreflex tools available in every standard root installation.

Cheers,
Danilo