How to move to the next root file in TChain?

Hello ,
I have a bunch of ROOT files which contain calibration data for various gamma sources. I wrote the code to find the calibration parameters for one source. Now if I automate the process to extend the program to find calib. params. for rest of the sources, i thought TChain is a great option.
I used a Makeclass function on the single ROOT file that i used initially.
I also know how to do makeclass on a tchain . But my question is how do i tell the program to move to the next file in makeclass code. which iterator or function can i use ??___
Please read tips for efficient and successful posting and posting code

ROOT Version: 6.26/06
Platform: MAC OSX M1
Compiler:


Changing files is done automatically when you analyze entries in the “Loop” method.
The “ientry” variable is always “0” for the very first entry in every file (“jentry” is “0” only for the very first entry in the whole chain).

Also, in the generated class, there is (managed in the “LoadTree” method):
Int_t fCurrent; //!current Tree number in a TChain
You can easily “extend” the “Notify” method, which is called when a new file is opened.