next up previous contents
Next: Q5: Save seeds of Up: Frequently Asked Questions Previous: Q3: How to generate

Q4:How to get generator particle information in JSF?

In JSF, generator particle information is saved as JSFGeneratorParticle objects. PythiaGenerator module generate is from Phythia generator information. If Bases/Spring generator is used, it is created by JSFHadronizer module from SpringParton objects information.

PythiaGenerator module creates JSSFGeneratorParticle objects by essentially making a copy of LUJETS common of FORTAN program created by Pythia Generator. They are four momenta of particles, their particle ID, life time, etc at the interaction point. Particle ID number is defined according to the Particle Data Group convention. It's definition will be found in the PDG book. Some particles decay immediately and create daughter particles. Only few particles such as gamma, pi+/-, p, n, ... have enough lifetime to be observed in the detector. Pythia generator not only generates initial particles at IP but also decays them in to stable particles if their life time are short. So there are two kinds of particle in JSFGeneratorObjects, those decayed or not decayed. If you use GetNDAU method, you will get number of daughter particles. If it is not 0, that means it decayed and has daughter particles. JSFGeneratorParticle class also has pointer to mother particle and first daughter particle so that user can trace decay chain. Pointer to the mother is negative when the particle information is obtained from the documentation line of LUJETS common. These information are used to get initial parton information ( quark, lepton and gauge boson information before they are fragmented to hadrons.)

An example to scan all GeneratorParticle information and sum four momentum of stable particles is as follows.

// ----------------------
void UserAnalysis()
{
  ......
  // -------------------------------------------------------
  // Loop over GeneratorParticleList 
  // -------------------------------------------------------
  JSFGenerator *gen=(JSFGenerator*)jsf->FindModule("JSFGenerator");
  JSFGeneratorBuf *genb=(JSFGeneratorBuf*)gen->EventBuf();
  TClonesArray *gps=genb->GetParticles();
  ANL4DVector psum;
  for(Int_t i=0;i<genb->GetNparticles();i++) {
    JSFGeneratorParticle *gp=(JSFGeneratorParticle*)gps->UncheckedAt(i);
    if( gp->GetNDaughter() > 0 ) continue;  // Select stable particles

    pg=ANL4DVector(gp->GetE(), gp->GetPx(), gp->GetPy(), gp->GetPz());
    psum += pg;
  }
  ...
}

Please see JSFGeneratorParticle.h for other functions defined by JSFGeneratorParticle class to get other information such as particle ID, etc.


next up previous contents
Next: Q5: Save seeds of Up: Frequently Asked Questions Previous: Q3: How to generate
Miyamoto Akiya
2001-11-07