I am looking for an efficient way to save a big array of floats in a TTree.
The number of entries in each array can be VERY big!!! And the maximum
number of entries in each array is not known in advance so I can not use
the usual method:
Int_t filterNumber, numberOfEntries;
TTree* invMass = new TTree(outputTreeName, title);
invMass->Branch(“filterNumber”, &filterNumber, “filterNumber/I”);
invMass->Branch(“numberOfEntries”, &numberOfEntries, “numberOfEntries/I”);
invMass->Branch(“invMass”, invMass, “invMass[numberOfEntries]/F”);
because I do not know MAX_NUMBER_OF_ELEMENTS.
How to do that efficient? I am looking for a rare process and will have to
process hundreds of millions of events several times to adjust breaking of the
event set into correct subsets for the event mixing method.
In particular I was said that TArrayF is going to reallocate memory each time
one adds a new element into it and it is not possible to use TClonesArray
with fundamental types. Is it true?
Is it possible to save (STL) vector in a TTree? (ROOT v3.05/07)
Or I have to save TTrees(TNtuples) in my TTree instead of arrays?
Thanks a lot!!!