TChain for two different files

Hello!

I am trying to TChain two .root files, each one with a different TTree name and structure . Is it possible?

I first thought to use the MakeClass, with TFriend, but does not work (actually, same problem as in here root.cern.ch/phpBB2/viewtopic.php?t=8238 )

so, my only hope is to TChain them…

By just

[code] TChain * chain = new TChain();

  chain->Add("All.root/LHEF");
 chain->Add("All.root/LHCO");[/code]

fails…

Thanks in advance

Alexis

[quote]each one with a different TTree name and structure[/quote]A TChain assumes that each of the tree have a similar structure (but possibly different tree name). You indeed will need to use Friends (and 2 separate MakeClass)

Cheers,
Philippe.

Can you plz give a specific example?
For example

[code]
TChain *ch1 = new TChain(“Dir1”);
TChain *ch2 = new TChain(“Dir2”);

ch1->Add(“File1.root”);
ch2->Add(“File2.root”);
ch1->AddFriend(ch2, “Dir2”);[/code]

and then what???

if

ch1->MakeClass("name"); ch2->MakeClass("name2");

will create two seperate classes, but how can I have 1 class out of those two above?

Thanks for your time and help

Alex[/code]

See an example in root.cern.ch/phpBB2/viewtopic.php?t=8238

Cheers,
Philippe.