[Gate-users] Merging of many root files with gjm

Jan De Beenhouwer jan.debeenhouwer at ugent.be
Tue Jan 15 09:25:59 CET 2008

On Tue, 2008-01-15 at 01:06 +0100, Hannes Hofmann wrote:
> Hello,
> how can I merge 4800 root files? I am getting the following error:
> SysError in <TFile::TFile>: file ~/mac-files/foo_1019.root can not be
> opened for reading (Too many open files)
> It's probably a limit of the operating system, right?

It seems like it. The root filenames are stored in a vector, but the
trees are merged by type over all the files: singles, hits,... etc.

> Is divide-and-conquer merging possible? Which means to me: merge 8 times
> 600 root files into 8 intermediate files and merge those intermediate
> files again into the final root file. Has someone done that before? What
> could go wrong with that? I am only interested in Singles anyway.

You could, if you don't care about the correct eventID for each single.
You can also easily merge everything with a chain in a simple root
script then.
I wasn't aware of the limitation though. We don't have a 1000+ cpu
cluster ;-)
It could be solved by opening only a few files at a time in the merger.

> Thanks,
> Hannes
> _______________________________________________
> Gate-users mailing list
> Gate-users at lists.healthgrid.org
> http://lists.healthgrid.org/mailman/listinfo/gate-users
MScE Jan De Beenhouwer
Ghent University Hospital
De Pintelaan 185
Block B - 5th floor
B-9000 Ghent
Tel. +32-9-332.43.26
Fax: +32-9-332.33.90
E-mail: <Jan.DeBeenhouwer at UGent.be>

More information about the Gate-users mailing list