New methods for tree model for calculating node depths and calculating if a given node is a part of the path until the root