Pythia and generated particles

From: Mario Kadastik <>
Date: Sun, 13 Feb 2005 03:52:23 +0200


It seems to me that I'm a bit stuck with Pythia and ROOT trees.

Namely I saved the pythia generated particles as TCloneArrays into a root file. If I open it up in TBrowser or scan it, then I can see all the relevant data there. Now if I want to loop over the information, then I'm stuck.

What I'd like to do is to loop over all events and in every one of them loop over all particles and do something. How should that be accomplished? At the moment I'm having trouble reading the data out of the tree in my code:

TFile f("higgs.root")
TTree *t = (TTree*)f.Get("particles")
Float_t *px;
and after that px won't contain anything useful.

If I swap Float_t *px with Float_t px[1000], no change. I also tried to t->SetMakeClass(1) and the same with chains, but in both cases I get segmentation fault I'm using latest root on Fedora Core 3 (downloaded yesterday).

What works is
t->Draw("sqrt(pow(particles.fPx,2)+pow(particles.fPy,2))>>perp","abs(particles.fKF)==13"); which creates a nice plot of pT distribution of muons.

Ideas are welcome.

Mario Received on Sun Feb 13 2005 - 02:51:55 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:04 MET