treeMean function

Calculate mean across cores in a tree