1 SUBROUTINE PHOTOS_MAKE(IPARR)
2 C.----------------------------------------------------------------------
4 C. PHOTOS_MAKE: General search routine
6 C. Purpose: Search through the /PH_HEPEVT/ standard HEP common, sta-
7 C. rting from the IPPAR-th particle. Whenevr branching
8 C. point is found routine PHTYPE(IP) is called.
9 C. Finally if calls on PHTYPE(IP) modified entries, common
10 C /PH_HEPEVT/ is ordered.
12 C. Input Parameter: IPPAR: Pointer to decaying particle in
13 C. /PH_HEPEVT/ and the common itself,
15 C. Output Parameters: Common /PH_HEPEVT/, either with or without
16 C. new particles added.
18 C. Author(s): Z. Was, B. van Eijk Created at: 26/11/89
19 C. Last Update: 30/08/93
21 C.----------------------------------------------------------------------
24 INTEGER IP,IPARR,IPPAR,I,J,K,L,NLAST
29 PARAMETER (NMXHEP=10000)
30 INTEGER IDHEP,ISTHEP,JDAHEP,JMOHEP,NEVHEP,NHEP
32 COMMON/PH_HEPEVT/NEVHEP,NHEP,ISTHEP(NMXHEP),IDHEP(NMXHEP),
33 &JMOHEP(2,NMXHEP),JDAHEP(2,NMXHEP),PHEP(5,NMXHEP),VHEP(4,NMXHEP)
35 COMMON/PHOQED/QEDRAD(NMXHEP)
37 PARAMETER (NMXPHO=10000)
38 INTEGER ISTACK(0:NMXPHO),NUMIT,NTRY,KK,LL,II,NA,FIRST,LAST
39 INTEGER FIRSTA,LASTA,IPP,IDA1,IDA2,MOTHER2,IDPHO,ISPHO
40 REAL*8 PORIG(5,NMXPHO)
43 C-- Store pointers for cascade treatement...
48 C-- Check decay multiplicity and minimum of correctness..
49 IF ((JDAHEP(1,IP).EQ.0).OR.(JMOHEP(1,JDAHEP(1,IP)).NE.IP)) RETURN
51 C-- single branch mode
52 C-- we start looking for the decay points in the cascade
53 C-- IPPAR is original position where the program was called
55 C-- NUMIT denotes number of secondary decay branches
57 C-- NTRY denotes number of secondary branches already checked for
58 C-- for existence of further branches
60 C-- let's search if IPARR does not prevent searching.
63 DO I=JDAHEP(1,IP),JDAHEP(2,IP)
64 IF (JDAHEP(1,I).NE.0.AND.JMOHEP(1,JDAHEP(1,I)).EQ.I) THEN
66 IF (NUMIT.GT.NMXPHO) THEN
68 CALL PHOERR(7,'PHOTOS',DATA)
73 IF(NUMIT.GT.NTRY) THEN
79 C-- let's do generation
82 FIRST=JDAHEP(1,ISTACK(KK))
83 LAST=JDAHEP(2,ISTACK(KK))
86 PORIG(LL,II)=PHEP(LL,FIRST+II-1)
90 CALL PHTYPE(ISTACK(KK))
92 C-- Correct energy/momentum of cascade daughters
98 IF(JMOHEP(1,IPP).EQ.ISTACK(KK))
99 $ CALL PHOBOS(IPP,PORIG(1,II),PHEP(1,IPP),FIRSTA,LASTA)
104 C-- rearrange /PH_HEPEVT/ to get correct order..
105 IF (NHEP.GT.NLAST) THEN
106 DO 160 I=NLAST+1,NHEP
108 C-- Photon mother and position...
110 POSPHO=JDAHEP(2,MOTHER)+1
111 C-- Intermediate save of photon energy/momentum and pointers
113 90 PHOTON(J)=PHEP(J,I)
120 C-- Exclude photon in sequence !
121 IF (POSPHO.NE.NHEP) THEN
124 C-- Order /PH_HEPEVT/
125 DO 120 K=I,POSPHO+1,-1
126 ISTHEP(K)=ISTHEP(K-1)
127 QEDRAD(K)=QEDRAD(K-1)
130 JMOHEP(L,K)=JMOHEP(L,K-1)
131 100 JDAHEP(L,K)=JDAHEP(L,K-1)
133 110 PHEP(L,K)=PHEP(L,K-1)
135 120 VHEP(L,K)=VHEP(L,K-1)
137 C-- Correct pointers assuming most dirty /PH_HEPEVT/...
140 IF ((JMOHEP(L,K).NE.0).AND.(JMOHEP(L,K).GE.
141 & POSPHO)) JMOHEP(L,K)=JMOHEP(L,K)+1
142 IF ((JDAHEP(L,K).NE.0).AND.(JDAHEP(L,K).GE.
143 & POSPHO)) JDAHEP(L,K)=JDAHEP(L,K)+1
146 C-- Store photon energy/momentum
148 140 PHEP(J,POSPHO)=PHOTON(J)
151 C-- Store pointers for the photon...
152 JDAHEP(2,MOTHER)=POSPHO
155 JMOHEP(1,POSPHO)=MOTHER
156 JMOHEP(2,POSPHO)=MOTHER2
157 JDAHEP(1,POSPHO)=IDA1
158 JDAHEP(2,POSPHO)=IDA2
160 C-- Get photon production vertex position
162 150 VHEP(J,POSPHO)=VHEP(J,POSPHO-1)