I would like to read in several chains, and then write out selected entries from these different chains to one output file. For example
vector<TChain*> vecChains;
//set up vecChains
TFile out("output.root", "recreate");
//loop over selected entries
{
vecChains[chain]->GetEntry(entry);
//write this entry to output.root
}
I’ve tried several permutations of calling CloneTree and Fill trying to write out the selected events, but I either get only events from one chain, or multiple trees in my file, not one tree with entries from each chain.
Any ideas how to do this?
Thanks,
Alan