4
C... sort HEPEVT by daughter list
9
integer IST(NMXHEP),ID(NMXHEP),JMO(2,NMXHEP),JDA(2,NMXHEP)
10
double precision P1(5,NMXHEP),V1(4,NMXHEP)
11
integer I,IN,J,K,L,LIST(NMXHEP),IREV(NMXHEP)
14
integer NDAU,LDTR(LSIZE),LD,IP,JN1,JN2,JTMP
16
C...zero the temporary arrays
35
C... start by listing all particles with no parent
36
C... or otherwise from initial state
38
if((JMOHEP(1,I).EQ.0 .AND. JMOHEP(2,I).EQ.0) .OR.
39
1 (ISTHEP(I).EQ.3))then
53
C... now start adding the remaining particles
58
C... find the daughters of this particle and add them
59
call STDDAUTRLST(IREV(I),NDAU,LSIZE,LDTR)
64
C... has this particle been listed already?
86
C...did we miss anything?
89
D write(lnhout,1002) I
101
C...get daughters of this particle
102
if(JDAHEP(1,I).GT.0)then
105
do WHILE (JN2.GE.JN1)
107
C... find the daughters of this particle and add them
108
call STDDAUTRLST(IREV(L),NDAU,LSIZE,LDTR)
113
C... has this particle been listed already?
114
if(LIST(IP).EQ.0)then
121
P1(J,IN) = PHEP(J,IP)
124
V1(J,IN) = VHEP(J,IP)
127
write(lnhout,1001) IP
138
C...get mother/daughter info
141
JTMP = JDAHEP(K,IREV(I))
142
JDA(K,I) = LIST(JTMP)
143
JTMP = JMOHEP(K,IREV(I))
144
JMO(K,I) = LIST(JTMP)
147
C...put it all back into the common block
148
if(IN.NE.NHEP) write(lnhout,1003) IN,NHEP
153
JMOHEP(J,I) = JMO(J,I)
154
JDAHEP(J,I) = JDA(J,I)
164
1001 format(' STDSORT: particle ',I5,' is out of order')
165
1002 format(' STDSORT: particle ',I5,
166
1 ' was not found in daughter search')
167
1003 format(' STDSORT: WARNING found only ',I4,' of ',I4,' particles')