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.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.