next up previous contents index
Next: Analysis of particle systems: Up: Direct access to particles Previous: Particle name versus integer   Contents   Index


Loops over a particle and its antiparticle

The particle table contains the relation between particles and antiparticles, so loops over particles (or systems of particles) and their corresponding (systems of) antiparticles can be performed easily.

Example: Loop over MC - generated e+ and e-:


              DO 90 IANTI = 0,1
              ITK = KPDIRA ('E+', KMONTE, IANTI)
         10   IF (ITK .EQ. 0)  GO TO 90
        C     ... analysis of the e+ or e- ...
              ITK = KFOLLO (ITK)
              GO TO 10
 
         90   CONTINUE ...
KPDIRA ('particle-name', ICLASS, IANTI)
If IANTI=0, KPDIRA returns the first particle with the given name in the class ICLASS. If IANTI is not equal to 0, the first corresponding antiparticle is given.
To use the integer particle code (see 7.4.3), replace

KPDIRA ('E+', KMONTE, IANTI) with KCDIRA (IP, KMONTE, IANTI).



Joel Closier
2000-02-07