addsamptree function

To determine whether the sampled tree will be accepted