Tchain output problem

hello;
I wrote a program to combine files ROOT with Tchain

[b]{
gROOT-> Reset();

TChain chain(“Hits”);
chain.Add("/home/root1010.1.root");


chain.Add("/home/root1010.23.root");
chain.Draw(“posX”);
TFile *f = new TFile("1010.root ", “recreate”);
}
[/b]
my problem in TFile *f = new TFile("1010.root ", “recreate”);

ROOT 1010.root the file is created but empty, there is nothing.

Please read documentation of TChain, in particular TChain::Merge ; root.cern.ch/root/html/TChain.html#TChain:Merge
and do:

{ TChain chain("Hits"); chain.Add("/home/root1010.1.root"); ...... .... chain.Add("/home/root1010.23.root"); chain.Merge("1010.root","fast"); }
Rene

hello
thank you

but I have the same problem when I add the command
chain.Merge(“1010.root”,“fast”);

the Hits file is created but empty

[code]{
TChain chain(“Hits”);
chain.Add("/home/root1010.1.root");

chain.Merge(“1010.root”,“fast”);
}
[/code]

Hi,

[quote]the Hits file is created but empty
[/quote]
What is the ‘Hits file’ what is it suppose to contain?

Cheers,
Philippe.

[quote=“pcanal”]Hi,

[quote]the Hits file is created but empty
[/quote]
What is the ‘Hits file’ what is it suppose to contain?

Cheers,
Philippe.[/quote]

all information from examples posX;posY;posZ

this in one root file

but after chain the Hits is empty


Hi,

Could you post the shortest RUNNING example that shows how this is failing for you so that we can attempt to reproduce the problem?

Thanks,
Philippe.