ROOT Version: 6.14/09
I have a question about storing a string in a TTree.
When I call the function where the tree is created, if have the name of the output file given as well as
const std::string &outFile
Let’s say, I want to store this string in my tree.
TTree *tree = new TTree("nominal", "nominal"); TBranch *newbranch = tree->Branch("dataset", &outFile);
However, later I store variables eventwise in the same tree, such as
tree->Branch("JetPt", &JetPt); which are around 240*10^3 floats filled in a for loop.
My Problem comes when investigating the produce ROOT-FIle, it is very large.
It seems like, that the event variables are stored In the dataset branch as well.
I suspect this is caused by the wish, to keep all branches at the same amount of entries, such that a event is defined well.
If I save the the string only to another tree e.g.
TTree *metadata = new TTree("metadata", "metadata"); metadata->Branch("out", &outFile);
the processing is way faster, and the output file is way smaller.
But then I don’t have the information stored in tree.
I tried a workaround via friends
tree->AddFriend("metadata"); but that doesn’t work.
Any help would be appreciated.
If you need more information or code snippets, ask