Hi,
I’ve got trouble working with reading trees from files.
- When I use TChain to read about 200 files and process this, my job gets killed on lxplus (unreasonable memory used), so I’m guessing after the information is read, the files aren’t closed. For this, my macro used the code provided in the documentation:
TObjArray *fileElements=chain->GetListOfFiles();
TIter next(fileElements);
TChainElement *chEl=0;
while (( chEl=(TChainElement*)next() )) {
TFile f(chEl->GetTitle());
... do something with f ...
}
- When I want to proceed the trees one by one (so also files, one by one), I get segmentation violations.
About problem 2, I had the following question: I read the trees from files; after getting all the tree data, can my file be closed? And similar, do TFiles get automatically closed or not if they go out of scope?
Thanks!
Footnote:
About the last question whether files get automatically closed or not: is it possible that CINT has trouble processing scopes?
I tried to do in CINT:
{
TFile *file=TFile::Open("file.root");
}
root [1] TFile file("file.root")
Error: file already declared as different type. ~TFile() called
But about this last problem I do not care much since I want to run my code compiled, this was just a testing case.
When this was o