getsubtree function

Determine a tree from the main tree-based structure