Is there a way to move a TTree to a already existing TChain ? (without storing the TTree to a root file)

Hi @escalier,
please check this thread about posting code snippets – I edited your post to make things more readable.

If I understand correctly, you successfully create a TTree by selecting certain events from the original TChain. Then you want to construct a TChain that contains both the original TTree and the skimmed TTree, for further processing, but you don’t want to write the skimmed TTree to a file.

@pcanal can correct me if I’m wrong, but I don’t think TChain is able to deal with in-memory TTrees. However, you might get away with writing the skimmed TTree to a TMemFile, i.e. a memory-resident TFile. Would that help?

Cheers,
Enrico