Hadd files containing std::vector<TH1F>

I have various Root files containing a std::vector<TH1F> . I’d need to hadd the histograms and obtain a result file with a std::vector of hadded histograms. I think it can be quite easily done by means of straightforward C++ code, but before diving into coding I’d like to know if some standard Root tool similar to hadd is able to do it.

I have created a small program doing what I need for std::vector<TH1F> and std::vector<TH2F>, but easily extensible to other std::vector<TH*>. It’s not very refined and It has been tested only partially but it works more or less. Here’s a link vecthadd.tar.gz (2.3 KB) for those who might be interested, feel free to use the code as you like.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.