MakeProject and TChain

I’ve got a TChain with about 20 root files in it. I depend on MakeProject to make the objects my TTree fully visible (i.e. I have lots of TLorentzVectors). What is the best way to run MakeProject - which needs a TFile?

Many thanks!


Actually, sorry. It woudl seem my first attempt worked: I get the first event, then do TChain::GetFile()->MakeProject(…).

I was fooled because it looks like the TTree Viewer doesn’t display the new functions when used like this. However, I can do TTree::Draw(“Jets.Pt()”) just fine.

Hi Gordon,

Something like:TChain c; c.Add(...); c.GetFile()->MakeProject("....");


Ah, really? Cool. For some reason I was thinking that one had to wait until an entry was loaded. But I guess doing a ->GetEntry(1) would accomplish the same thing! Thanks!