TChain chain("myChain"); // create a TChain object with the name "myChain" chain.Add("file1.root/Tree1"); // add the TTree named "Tree1" from file1.root chain.Add("file1.root/Tree2"); // add the TTree named "Tree2" from file1.root
TChain chain("myChain"); // create a TChain object with the name "myChain" chain.Add("file1.root/Tree1"); // add the TTree named "Tree1" from file1.root chain.Add("file2.root/Tree1"); // add the TTree named "Tree1" from file2.root chain.Add("file3.root/Tree1"); // add the TTree named "Tree1" from file3.rootIn this example, we again create a TChain object called "myChain". We then use the Add() function to add the TTree named "Tree1" from three different files. This creates a chain of three TTrees that can be accessed using the TChain object. Package Library: ROOT Library (CERN)