Implementation of a tree algorithm in MCNP code for nuclear well logging applications.