and then, I need to SetBranchAddress and some calculation, and this is the same for the two files. The critical point is that when the i==1 cycle end, I hope that the first file can be cleared. Does ROOT can achive this?
No need for a loop. But may be that’s not your real code and in reality you define the filename according to i ? Anyway we would need a bit more code to understand your problem.
when i=1, I chaine the first file, and do some something to get a result;
when i=2, I chaine the second file, and do the same thing to get another result;
and last, I need to use the two result to get my final result. So I hope that I can clear the previous root. and every time chaine different root file.