Refined MonteCarloEngine.cpp.