Installing specific particles in TTree

Hello! I use Pythia8 to generate events. I tried to find a way to save only some specific particles from each event to TTree and not the whole event, but I didn’t find anything. Is there a way or not? I need a lot of events, in order to have better statistics. Thank you! :smiley:


Not directly (there may be tool in pythia8). In ROOT there is the class TPythia8. You could derive a class from it and overload ImportParticles (and copy the content of the original in TPythia8) to apply your selection. For example if you only wants stable,
final state particles, then you can choose those with status > 0.