A scalar result is stored in the first subroutine argument. In QJADDP, the scalar result is the 3-momentum sum of all particles. An output vector is specified by its name, which is the second subroutine argument `vector-name'. If you are interested in the scalar result only and not in the output vector, specify a blank space ` '. QJADDP has exactly one output vector: the sum of all 4-momenta. The following example shows how to use this vector.
CALL QJADDP (PSUM, 'ADD-ALL', KRECO, ...) ISUM = KPDIR ('ADD-ALL', KRECO) CALL HF2 (4711, QP(ISUM), QM(ISUM), 1.)Other routines may output several vectors; a loop using KFOLLO (see 7.4.2) must be constructed to access all of them.
Locking an output vector locks all particles contributing to it (see 10.2.3). You can test whether a track ITK contributes to an output vector ISUM by using the logical symbol XSAME (ITK, ISUM) (Sec. 8.1.7).
The output vectors of ``QJ'' routines are called ``pseudo-particles''. In some routines described below, these pseudo-particles represent an axis rather than a 3- or 4-vector; the momentum value may or may not be meaningful. For consistency, an energy assuming mass = 0 is calculated in these cases.
In addition, pseudo-particles are treated differently than ``real'' particles:
CALL QJADDP (PSUM, 'ADD-ALL', KRECO, ...) CALL QJADDP (PSUM, 'ADD-ALL', KRECO, ...) CALL QJADDP (PSUM, 'ADD-ALL', KMONTE, ...)the output vector of the first call is not available after the second call. Thus, output vectors from different calls are never mixed up. Since the third call refers to a different class, the vector from the second call is not dropped. Note that you are free to invent new names in every new call to a ``QJ'' or any other routine.