But I want to generate “chainFiles.C” with some job management tool, like Ganga, in a general way, so it is more ideal if I can put only “chain->Add(”…")" lines in “chainFiles.C”, and move the definition of chain in the “main.C” file, you know, it is also possible that there are several TTree’s in the same root file. In this case, we can just change the definition of TChain in “main.C” instead of making difference copy of “chainFiles.C” to process different TTree. What’s the correct way to do this? The following doesn’t work:
Hello, cplager. I am trying to add a list of files (~1000) to a chain and I would like to write the files’ names in a .txt and make the chain read the names of these files. I was trying to implement your code but I have some questions. What do you mean by “source” and “line.c_str() (what kind of file is this)”? Sorry, I am starting to learn about root now…
ps.: file.txt => file with the name of the files.root I want to add.
ch => name of the chain
reMC => name of the tree