Add missing include of iostream

Fix compilation errors in ROOT6 IB by adding missing include of iostream. To avoid adding an include of iostream in a header, the functions using std::cout were moved into the .cc file. Since these are called in error cases only, there is no performance impact.