Saving selected leaves from one ntuple into a new one

Hi All,

I have created a TChain and chained multiple files together, and used MakeSelector to create a TestSelector.C and TestSelector.h for analysis.

I am wanting to implement in the Process() function of the TestSelector.C files some commands, that saves some selected leaves of the chained-together-ntuple (or variables in the TestSelector.h file) into a new ntuple of a new .root file, for quicker analysis.

(For example, mu_pt, jet_pt, etc…)

Anyone out there has done anything similar?

Cheers
Jason

see example in $ROOTSYS/tutorials/tree/copytree3.C

Rene