I am using TMVA from ROOT 6.20/04 and try to read a vector of TLorentzVector.
I know that I should generate the dictionary but non of the ways I found are working
here is the part of the code I use
#ifdef __CINT__
#pragma link C++ class std::vector<TLorentzVector>+;
#endif
std::vector <TLorentzVector> *JETS=NULL;
theTree->SetBranchAddress( "JETS", &JETS);
This is perfectly works when I am writing in normal Root code but inside the TMVA iI get this error
Error in <TTree::SetBranchAddress>: The class requested (vector<TLorentzVector>) for the branch "JETS" is an instance of an stl collection and does not have a compiled CollectionProxy. Please generate the dictionary for this collection (vector<TLorentzVector>) to avoid to write corrupted data.
Any help is appreciated as this is very urgent for my work.
Hi,
You would probably need to add the dictionary library when linking your program.
But who is reading the file and calling SetBranchAddress ? The TMVA library or your macro reading the file and doing a TMVA classification or regression ?
The reading and SetBranchAddress are done based on the “TMVAClassificationApplication” which is adopted for my usage.
But how can l link the dictionary library?
Hi,
Then if you are using in a macro, it should work by just calling .L TMVAClassificationApplication.C, you might need to add a + at the end to use ACLIC.
Otherwise if you use ROOT::Math::XYZTVector that is recommended, this is already in the dictionary provided by ROOT See ROOT: tutorials/math/mathcoreVectorCollection.C File Reference