SUBROUTINE LCWRITE(LUN) ***************************************************************************** ***************************************************************************** * * SUBROUTINE LCWRITE(LUN) * * Purpose: Write HEPEVT common to output file * on unit LUN in Linear Collider workshop formatted form * * NOTES: * All UNSTABLE particles with an average proper lifetime of * less than 10 mm should be decayed by the generator; others * (eg K0, Lambda0) should be left to the simulation. * This can be achieved in JETSET using MSTJ(22)=2 with the * default setting of PARJ(71) * * * If you are using PYTHIA/JETSET remember to fill the * HEPEVT commons with CALL LUHEPC(1) * * * If you are using PYTHIA 6.1 you need PYHEPC(1) * * * You must ensure that the HEPEVT commons are DOUBLE PRECISION * (In JETSET 7.4 they are single precision by default) * * * The event number (NEVHEP) is not written to file; the * simulation will take each event individually * * * For SPARTICLE codes, see * http://d0lblt.lbl.gov/wwwpdg/mc_numbers.htm * * * For the specifications of the HEPEVT commons see the LEP1 * Yellow Report or the PYTHIA/JETSET manual * * * The spin part (SHEP) of the commons is not written to file * * * Input: LUN - output file INTEGER * * Output: to file * * Called: Per event * * Author: Hywel Phillips (H.T.Phillips@rl.ac.uk) * * ***************************************************************************** ***************************************************************************** IMPLICIT NONE * switched to NMXHEP = 4000 for compatibility with PYTHIA 6.1 c M.Dobbs 04.2000 NMXHEP = 2000 for compatibility with PYTHIA 5.7 INTEGER NMXHEP PARAMETER (NMXHEP = 2000) INTEGER NEVHEP, NHEP, ISTHEP(NMXHEP), IDHEP(NMXHEP), & JMOHEP(2,NMXHEP), JDAHEP(2,NMXHEP) DOUBLE PRECISION PHEP(5,NMXHEP), VHEP(4,NMXHEP) COMMON /HEPEVT/ NEVHEP, NHEP, ISTHEP, IDHEP, JMOHEP, JDAHEP, & PHEP, VHEP * The spin part of the HEPEVT commons which is not written DOUBLE PRECISION SHEP(4,NMXHEP) COMMON /HEPSPN/ SHEP INTEGER LUN,I,J,K * * write event data * IF (NHEP.GT.NMXHEP) THEN WRITE(6,*) 'LCWRITE: Error- NHEP ',NHEP,' is too big' WRITE(6,*) 'LCWRITE: Event not written to file' RETURN ENDIF WRITE(LUN,10) NHEP DO I=1,NHEP WRITE(LUN,12,ERR=999) ISTHEP(I),IDHEP(I),(JMOHEP(J,I),J=1,2), & (JDAHEP(K,I),K=1,2) WRITE(LUN,11,ERR=999) (PHEP(J,I),J=1,5) WRITE(LUN,11,ERR=999) (VHEP(K,I),K=1,5) ENDDO 10 FORMAT(1I5) 11 FORMAT(10F17.10) 12 FORMAT(I9,I9,4I5) RETURN 999 WRITE(6,*) 'LCWRITE: Error writing to file on unit ',LUN STOP END