Hi @imanol097 ,
just a guess, but in older ROOT versions multi-thread writing could change ROOT’s gDirectory (i.e. you have to reset it with file.cd() to the value you want).
What ROOT version is this with? Can you provide a reproducer that we can run e.g. on LXPLUS?