Merging TProfiles?


We have code that creates TProfile histograms (normally run on ATLAS grid). If the job is split into multiple subjobs and the files are merged the bin contents are simply added, which of course is not what we want. Is there a solution to this?

Also, if we could merge the TProfiles ourselves within root, is there a built in method to do this correctly?




If you are calling TProfile::Merge, you should be able to do a correct merging, i.e. getting an object which contains the combined information (i.e. sum of weight, sum of weight square and entries) for each bin.
The resulting bin content will be the combined sum of weights divided by the combined entries.

Best Regards