Tree depth getter