helper class to determine S and B for a variety of cut settings and looping over the tree only once