Hi @Om_Chaudhary,
sorry for the late reply, it seems like this post must have slipped through the cracks! Always feel free to ping us again if you don’t hear back in a few days.
If I understand your question correctly, you have a TList containing histograms in a TFile, and you would like to modify that TList “in place”, in the TFile, so that some histograms it contained are removed from the TFile. Is that correct?
If that’s it, @pcanal probably knows what the simplest way is.
Cheers,
Enrico
PS. Technically the answer to your question is, open the file in update mode, read the TList, Remove the object you need removed and write the list to the file again (with the option kOverwrite to avoid wasting space)
but this might not be the best to accomplish what you need.
Hello pcanal.
it works for me. Actually I want to add two root files with “hadd”. One of them has an extra object that why I want to delete that one.