TChain Problem?

Demo: Building Chains
{
gROOT->LoadMacro("$ROOTSYS/test/libEvent.so");
TChain chain(“T”) ;
chain->Add(“EventOB.root”) ;
chain->Add(“EventOB40.root”);
chain->Add(“EventOB50.root”);
chain->GetListOfFiles()->Print();
chain->MakeClass(“ChainClass”);
}

What’s the line ( “gROOT->LoadMacro(”$ROOTSYS/test/libEvent.so");" ) used for?
Can the line be deleted when do the above?

The LoadMacro lines load the library that implement the classes of the object stored in the ROOT file mentioned later.

Since the ROOT files are self-describing, you can read those file without this library. However if you do not load the library some functionality is not available (for example you can not call any member function of the classes).

In the example you provided, the result of MakeClass might be slightly different with or without the MakeClass (but the different is not huge).

Cheers,
Philippe.