It turns out that adding a calling of Write() function for the TDirectory obj could fix the problem.
ANALYSISTO-874