* * $Id$ * * $Log$ * Revision 1.1 2000/06/19 20:00:31 eugenio * Initial revision * * Revision 1.1.1.1 1994/11/22 16:57:04 zfiles * first version of korb in CVS * * #include "sys/CLEO_machine.h" #include "pilot.h" *CMZ : 2.00/00 17/11/94 10.23.59 by Alan J. Weinstein *CMZ : 2.00/00 21/01/93 15.42.37 by Alan Weinstein *-- Author : SUBROUTINE FILHEP(N,IST,ID,JMO1,JMO2,JDA1,JDA2,P4,PINV,PHFLAG) C ---------------------------------------------------------------------- C this subroutine fills one entry into the HEPEVT common C and updates the information for affected mother entries C C written by Martin W. Gruenewald (91/01/28) C C called by : ZTOHEP,BTOHEP,DWLUxy C ---------------------------------------------------------------------- C #include "seq/clinc/qqpars.inc" #include "qqlib/seq/hepevt.inc" C PARAMETER (NMXHEP=2000) C COMMON/HEPEVT/NEVHEP,NHEP,ISTHEP(NMXHEP),IDHEP(NMXHEP), C &JMOHEP(2,NMXHEP),JDAHEP(2,NMXHEP),PHEP(5,NMXHEP),VHEP(4,NMXHEP) C SAVE /HEPEVT/ COMMON/PHOQED/QEDRAD(NMXHEP) LOGICAL QEDRAD SAVE /PHOQED/ LOGICAL PHFLAG C REAL*4 P4(4) C C check address mode IF (N.EQ.0) THEN C C append mode IHEP=NHEP+1 ELSE IF (N.GT.0) THEN C C absolute position IHEP=N ELSE C C relative position IHEP=NHEP+N END IF C C check on IHEP IF ((IHEP.LE.0).OR.(IHEP.GT.NMXHEP)) RETURN C C add entry NHEP=IHEP ISTHEP(IHEP)=IST IDHEP(IHEP)=ID JMOHEP(1,IHEP)=JMO1 IF(JMO1.LT.0)JMOHEP(1,IHEP)=JMOHEP(1,IHEP)+IHEP JMOHEP(2,IHEP)=JMO2 IF(JMO2.LT.0)JMOHEP(2,IHEP)=JMOHEP(2,IHEP)+IHEP JDAHEP(1,IHEP)=JDA1 JDAHEP(2,IHEP)=JDA2 C DO I=1,4 PHEP(I,IHEP)=P4(I) C C KORAL-B and KORAL-Z do not provide vertex and/or lifetime informations VHEP(I,IHEP)=0.0 END DO PHEP(5,IHEP)=PINV C FLAG FOR PHOTOS... QEDRAD(IHEP)=PHFLAG C C update process: DO IP=JMOHEP(1,IHEP),JMOHEP(2,IHEP) IF(IP.GT.0)THEN C C if there is a daughter at IHEP, mother entry at IP has decayed IF(ISTHEP(IP).EQ.1)ISTHEP(IP)=2 C C and daughter pointers of mother entry must be updated IF(JDAHEP(1,IP).EQ.0)THEN JDAHEP(1,IP)=IHEP JDAHEP(2,IP)=IHEP ELSE JDAHEP(2,IP)=MAX(IHEP,JDAHEP(2,IP)) END IF END IF END DO C RETURN END