5 * Revision 1.1.1.1 1995/10/24 10:19:57 cernlib
9 #include "geant321/pilot.h"
10 *CMZ : 3.21/02 29/03/94 15.41.43 by S.Giani
15 *=== hadriv ===========================================================*
18 *----------------------------------------------------------------------*
20 * Modified version of Hadrin created by Alfredo Ferrari, INFN-Milan *
22 * Last change on 20-jun-92 by Alfredo Ferrari, INFN - MIlan *
24 * hadriv: this is a modified version of Hadrin, used by the Eventv *
25 * package for hadron-hadron interactions below 5 GeV *
27 *----------------------------------------------------------------------*
29 SUBROUTINE HADRIV ( N, PLAB, ELAB, CX, CY, CZ, ITTA )
31 #include "geant321/dblprc.inc"
32 #include "geant321/dimpar.inc"
33 #include "geant321/iounit.inc"
35 #include "geant321/finlsp.inc"
36 #include "geant321/hadflg.inc"
37 #include "geant321/metlsp.inc"
38 #include "geant321/reac.inc"
39 #include "geant321/redver.inc"
40 #include "geant321/split.inc"
42 COMMON / FKGAMR / REDU, AMO, AMM (15)
44 COMMON / FKABLT / AM (110), GA (110), TAU (110), ICH (110),
45 & IBAR (110), K1 (110), K2 (110)
46 COMMON / FKCODS / COD1, COD2, COD3, COF1, COF2, COF3, SIF1, SIF2,
47 & SIF3, ECM1, ECM2, ECM3, PCM1, PCM2, PCM3
48 COMMON / FKRUN / RUNTES, EFTES
50 PARAMETER ( AMPROT = 0.93827231D+00 )
51 DIMENSION WCHANN (40), WCUMCH (0:40), IKIK (40)
58 DATA IKIK / 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
59 & 16, 17, 18 ,19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
60 & 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 /
61 DATA ITPRF/-1,-1,5*1,-1,-1,1,1,1,-1,-1,-1,-1,6*1,-1,-1,-1,85*1/
63 C-----------------------------
64 C*** INPUT VARIABLES LIST:
65 C*** SAMPLING OF HADRON NUCLEON INTERACTION FOR (ABOUT) 0.1 LE PLAB LE 6
66 C*** GEV/C LABORATORY MOMENTUM REGION
67 C*** N - PROJECTILE HADRON INDEX
68 C*** PLAB - LABORATORY MOMENTUM OF N (GEV/C)
69 C*** ELAB - LABORATORY ENERGY OF N (GEV)
70 C*** CX,CY,CZ - DIRECTION COSINES OF N IN THE LABORATORY SYSTEM
71 C*** ITTA - TARGET NUCLEON INDEX
72 C*** OUTPUT VARIABLES LIST OF PARTICLE CHARACTERISTICS IN /FINLSP/
73 C IR COUNTS THE NUMBER OF PRODUCED PARTICLES
74 C*** ITR - PARTICLE INDEX, CXR,CYR,CZR - DIRECTION COSINES (LAB. SYST.)
75 C*** ELR,PLR LAB. ENERGY AND LAB. MOMENTUM OF THE SAMPLED PARTICLE
76 C*** RESPECT., UNITS (GEV/C AND GEV)
77 C----------------------------
79 IF (ITPRF( N ).LT.0) GO TO 99999
81 * STOP Commented out A. Fasso' 1989
84 99998 FORMAT (3(5H ****/),
85 *45H FALSE USE OF THE PARTICLE TYPE INDEX, VALUE ,I4,3(5H ****/))
88 IF (ABS(PLAB-5.D0).GE.4.99999D0) THEN
89 WRITE(LUNOUT,99996) PLAB
90 * STOP Commented out A. Fasso' 1989
93 99996 FORMAT (3(5H ****/),64
94 *H PROJECTILE HADRON MOMENTUM OUTSIDE OF THE ALLOWED REGION, PLAB=,
97 INEWHD = N + 1000 * ITTA
98 IF ( INEWHD .NE. IOLDHD ) THEN
100 ELSE IF ( (AMPROT-AM(1)) .GT. 1.D-6 ) THEN
112 IF (LOWP.GT.20) GO TO 8
114 * +-------------------------------------------------------------------*
115 * | The following condition is never verified
121 * +-------------------------------------------------------------------*
126 * +-------------------------------------------------------------------*
127 * | Select the reaction channel Ire: proton target
128 IF ( ITTA .EQ. 1 ) THEN
131 * +-------------------------------------------------------------------*
137 * +-------------------------------------------------------------------*
138 * Elastic scattering index:
139 IELSCT = MIN (N,ITTA) + 1000 * MAX (N,ITTA)
141 C-----------------------------
142 C*** IE,AMT,ECM,SI DETERMINATION
143 C----------------------------
144 CALL FKSIGI(IRE,PLAB,N,IE,AMT,AMN,ECM,SI,ITTA)
145 * +------------------------------------------------------------------*
146 * | Check if masses have been changed for annihilation treated with
148 IF ( AMPROT - AM(1) .GT. 1.D-6 ) THEN
152 * +------------------------------------------------------------------*
158 * +------------------------------------------------------------------*
161 C-----------------------------
163 C IRE CHARACTERIZES THE REACTION
164 C IE IS THE ENERGY INDEX
165 C----------------------------
166 IF (SI.LT.1.D-10) GO TO 8
167 * The following condition should be always verified
168 IF (N .LE.NSTAB) GO TO 1
170 IF (RUNTES.LT.20.D0) WRITE(LUNOUT,602)N
171 602 FORMAT(3H N=,I10,30H THE PROEKTILE IS A RESONANCE )
173 IF(IBAR(N).EQ.-1) N=9
174 * **** Come here ( 1 continue ) every time we unsuccessfully selected
175 * for more than 50 times the mass of the produced resonaces ****
178 IF (IMACH.GT.10) GO TO 8
182 * CMS energy of the projectile
183 ECMN=(ECM**2+AMN2-AMT2)/(2.D0*ECM)
184 * It should never happen
185 IF(ECMN.LE.AMN) ECMN=AMN
186 * CMS momentum of the projectile (and of the target)
187 PCMN=SQRT(ECMN**2-AMN2)
190 IF (IANTH.GE.0) ECM=2.1D0
191 * From this point starts the random choiche of the reaction channel:
192 * it was extensively modified by A. Ferrari
194 * Initial energy index for the reaction IRE (index 0)
196 * Number of energy intervals for the reaction IRE
197 IDWK=IEII(IRE+1)-IIEI
198 * Initial index for the exit channel weights
200 * Initial index (for 0) of the exit channels
202 * Number of exit channels of reaction ire
203 IKE =IKII(IRE+1)-IIKI
204 * *** Shrinkage to the considered energy region for the use of weights
206 * The following cards assure that Ecm =< Umax + DUmax for this reaction
208 * Umax = max cms energy at which data are tabulated
209 * DUmax = width of the last interval for the tabulated data
210 HUMO=2.D0*UMO(IIEI+IDWK)-UMO(IIEI+IDWK-1)
211 IF (HUMO.LT.ECM) ECM=HUMO
212 * *** Interpolation preparation
213 * Cms energy of the upper limit of the considered energy interval
215 * Cms energy of the lower limit of the considered energy interval
217 * Width of the considered interval
219 * Width from actual value to the lower limit (note that if Ecm > Ecmo
220 * it can be larger than Decm but it is always less than 2xdecm for the
221 * above condition on Humo
223 * Set to 1 the default total weight
231 IOUT1 = NRK (1,IIKI+1)
232 IOUT2 = NRK (2,IIKI+1)
233 IELCHK = MIN ( IOUT1, IOUT2 ) + 1000 * MAX ( IOUT1, IOUT2 )
234 * +-------------------------------------------------------------------*
235 * | Look for "inverse" reactions for which the elastic channel is not
236 * | the first: for these reactions we must exchange the weight of
237 * | the elastic channel with the charge exchange one at minimum, to
238 * | fulfill the detailed balance theorem
239 IF ( IELCHK .NE. IELSCT ) THEN
241 IELCHA = IKCHXG (IRE)
246 * +-------------------------------------------------------------------*
247 * | Loop to find the elastic channel
251 ICXCHA = IKCHXG (IRE)
254 * +-------------------------------------------------------------------*
255 * +-------------------------------------------------------------------*
256 * | Loop on the exit channels:
257 * | Jkk = index for weights
258 * | Ik = index for reaction
259 * | usually they are the same, but for "inverse" reactions where the
260 * | elastic and the charge exchange channels are exchanged, for these
261 * | two channels they are crossed
263 * | Ik : index of the exit channel under consideration
265 * | Get the index for the weight of ikth channel at ieth energy (upper
266 * | limit of the interval in energy)
267 IWK = IIWK + (JKK-1) * IDWK + IE - IIEI
268 * | Cumulative Weight of channels 1...ik at energy Ie
270 * | +----------------------------------------------------------------*
271 * | | Check if we are in the first interval: is so all the weights
272 * | | are set to zero for Ie-1, for all channels, so set them to the
273 * | | same value as for Ie to get the proper normalization to 1,
274 * | | then possible thresholds are accounted for after
275 IF ( IE .LE. IIEI+2 ) THEN
278 * | +----------------------------------------------------------------*
279 * | | Cumulative Weight of channels 1...ik at energy Ie-1
284 * | +----------------------------------------------------------------*
285 * | Compute the weight at Ie for this channel
287 * | Compute the weight at Ie-1 for this channel
288 WIEM1K = WIEM1K - WCUMI0
289 * | +----------------------------------------------------------------*
290 * | | This channel is not open at energies Ie and Ie-1
291 IF ( WIEM1K + WIEK .LE. ANGLGB ) THEN
292 WCHANN (JKK) = 0.D+00
293 WCUMCH (JKK) = WCUMCH (JKK-1)
295 * | +----------------------------------------------------------------*
298 * | | Set Eklim to a negative value to flag for Iefun it is a
299 * | | cms energy and not a lab momentum: this is the cms threshold
300 * | | for the exit channel ik
301 EKLIM = - THRESH (IIKI+IK)
302 * | | Iefun returns the energy index of upper limit of the interval
303 * | | containing the threshold
304 IELIM = IEFUN (EKLIM,IRE)
306 WCHAN0 = WIEM1K + ( WIEK - WIEM1K ) * DEC0 / DECM
307 WCSUM0 = WCSUM0 + WCHAN0
308 * | | +-------------------------------------------------------------*
309 * | | | Check if we are below threshold
310 IF ( ECM .LE. EKLIM ) THEN
311 WCHANN (JKK) = 0.D+00
312 WCUMCH (JKK) = WCUMCH (JKK-1)
313 WCUMIE = WCUMIE + WIEK
314 WCUMI0 = WCUMI0 + WIEM1K
316 WACCUM = WACCUM - RNDRED
318 * | | +-------------------------------------------------------------*
319 * | | | We are above threshold
321 WCUMIE = WCUMIE + WIEK
322 WCUMI0 = WCUMI0 + WIEM1K
323 ECMD = MAX ( EKLIM, ECM1 )
326 WCHANN (JKK) = WIEM1K + ( WIEK - WIEM1K ) * DEC / DECC
327 * | | | If we are beyond the last tabulated point and the xsec for
328 * | | | this channel is going down it can happen that Wchann < 0
329 * | | | set it to 0 and correct according to the usual formalism
330 WCHANN (JKK) = MAX ( WCHANN (JKK), ZERZER )
331 RNDRED = WCHAN0 - WCHANN (JKK)
332 WACCUM = WACCUM - RNDRED
333 * | | | +----------------------------------------------------------*
334 * | | | | Ielflg check: first of all check if this channel
335 * | | | | is the elastic one and if so if reduction must be applied
337 IF ( IK .EQ. IELCHA .AND. IELFLG .NE. 0 ) THEN
338 * | | | | +-------------------------------------------------------*
339 * | | | | | Elastic scattering reduced due to collision in the
340 * | | | | | nucleus and not with a free proton/neutron
341 IF ( IELFLG .LT. 0 ) THEN
342 IF ( IBAR (N) .NE. 0 ) THEN
343 REDUC = PLAB / PPAMXB
344 REDUC = PAUMXB * REDUC / ( 1.D+00 + REDUC**2 )
346 REDUC = PLAB / PPAMXM
347 REDUC = PAUMXM * REDUC / ( 1.D+00 + REDUC**2 )
349 RNDRED = WCHANN (JKK) * ( 1.D+00 - REDUC )
350 WCHANN (JKK) = WCHANN (JKK) - RNDRED
352 * | | | | +-------------------------------------------------------*
353 * | | | | | Elastic scattering forbidden
355 RNDRED = WCHANN (JKK)
356 WCHANN (JKK) = 0.D+00
359 * | | | | +-------------------------------------------------------*
360 WACCUM = WACCUM - RNDRED
362 * | | | +----------------------------------------------------------*
363 * | | | | Icxflg check: first of all check if this channel
364 * | | | | is the charge exchange one and if so if reduction must
365 * | | | | be applied to
366 ELSE IF ( IK .EQ. ICXCHA .AND. ICXFLG .NE. 0 )THEN
367 * | | | | +-------------------------------------------------------*
368 * | | | | | Charge exchange reduced due to collision in the
369 * | | | | | nucleus and not with a free proton/neutron
370 IF ( ICXFLG .LT. 0 ) THEN
371 IF ( IBAR (N) .NE. 0 ) THEN
372 REDUC = PLAB / PPAMXB
373 REDUC = PAUMXB * REDUC / ( 1.D+00 + REDUC**2 )
375 REDUC = PLAB / PPAMXM
376 REDUC = PAUMXM * REDUC / ( 1.D+00 + REDUC**2 )
378 RNDRED = WCHANN (JKK) * ( 1.D+00 - REDUC )
379 WCHANN (JKK) = WCHANN (JKK) - RNDRED
381 * | | | | +-------------------------------------------------------*
382 * | | | | | Charge exchange forbidden
384 RNDRED = WCHANN (JKK)
385 WCHANN (JKK) = 0.D+00
388 * | | | | +-------------------------------------------------------*
389 WACCUM = WACCUM - RNDRED
392 * | | | +----------------------------------------------------------*
393 WCUMCH (JKK) = WCUMCH (JKK-1) + WCHANN (JKK)
396 * | | +-------------------------------------------------------------*
397 RNDMCH = RNDMIK * WACCUM
398 * | | +-------------------------------------------------------------*
399 * | | | Check if a possible decrease/increase of this channel
400 * | | | opened one of the already examinated channels
401 IF ( RNDMCH .LT. WCUMCH (JKK-1) ) THEN
402 * | | | +----------------------------------------------------------*
403 * | | | | Loop on the previous channels
404 DO 1900 JPK = 1, JKK - 1
405 IF ( RNDMCH .LT. WCUMCH (JPK) ) THEN
411 * | | | +----------------------------------------------------------*
413 * | | +-------------------------------------------------------------*
414 * | | | Check if this one is the right channel
415 ELSE IF ( RNDMCH .LT. WCUMCH (JKK) ) THEN
419 * | | +-------------------------------------------------------------*
422 * | +----------------------------------------------------------------*
425 * +-------------------------------------------------------------------*
427 WRITE (LUNERR,*)' **** Hadriv: elastic channel selected when',
428 & ' prohibited ! ****',N,ELAB,PLAB
429 * Finally we selected channel ik
431 * *** Ik is the reaction channel ***
432 * +-------------------------------------------------------------------*
433 * | Set to the default values the array Ikik
436 IKIK (IELCHA) = IELCHA
439 * +-------------------------------------------------------------------*
441 * First resonance to be created
443 * Second resonance to be created
447 * +-------------------------------------------------------------------*
448 * | Rejection loop for the choiche of the resonance masses
450 IF (I1001.GT.50) GO TO 1
451 * | Selection of the resonance mass according to its width
453 * | Selection of the resonance mass according to its width
457 IF ( IT2*AMS .GT. IT2*ECM ) GO TO 1001
458 * |--<--<--<--<--<--< Loop back if m1+m2 > Ecm
459 * +-------------------------------------------------------------------*
462 IF (IANTH.GE.0) ECM=ELAB+AMT+0.00000001D0
465 * +-------------------------------------------------------------------*
466 * | Direct (single) resonances
468 * | Random choice of decay channels of the direct resonance it1
472 * | Here was the mistake in the pseudo-masses treatment!!!!!
483 * +-------------------------------------------------------------------*
484 * +-------------------------------------------------------------------*
487 IF ( RNDM(1) .LT. 0.5D+00 ) THEN
494 * +-------------------------------------------------------------------*
496 C-----------------------------
497 C THE FIRST PARTICLE IS DEFINED TO BE THE FORWARD GOING ONE AT SMALL T
504 * +-------------------------------------------------------------------*
513 * +-------------------------------------------------------------------*
514 C-----------------------------
515 C***IT1,IT2 ARE THE CREATED PARTICLES
516 C***MOMENTA AND DIRECTION COSINA IN THE CM - SYSTEM
517 C------------------------
518 CALL TWOPAR(ECM1,ECM2,PCM1,PCM2,COD1,COD2,COF1,COF2,SIF1,SIF2,
519 *IT1,IT2,ECM,ECMN,PCMN,N,AM1,AM2)
524 C-----------------------------
525 C***TRANSFORMATION INTO LAB SYSTEM AND ROTATION
526 C----------------------------
527 CALL TRAFO(GAM,BGAM,CX,CY,CZ,COD1,COF1,SIF1,PCM1,ECM1,PLS(IST),
528 *CXS(IST),CYS(IST),CZS(IST),ELS(IST))
532 CALL TRAFO(GAM,BGAM,CX,CY,CZ,COD2,COF2,SIF2,PCM2,ECM2,PLS(IST),CXS
533 *(IST),CYS(IST),CZS(IST),ELS(IST))
536 C-----------------------------
537 C***TEST STABLE OR UNSTABLE
538 C----------------------------
539 IF(ITS(IST).GT.NSTAB) GO TO 300
542 C-----------------------------
543 C***IR IS THE NUMBER OF THE FINAL STABLE PARTICLE
544 C----------------------------
545 IF (REDU.LT.0.D0) GO TO 1009
553 IF(IST.GE.1) GO TO 200
557 C RANDOM CHOICE OF DECAY CHANNELS
558 C----------------------------
573 IF (VV.GT.WT(IIK)) GO TO 301
575 C IIK IS THE DECAY CHANNEL
576 C----------------------------
584 IF (IT2-1.LT.0) GO TO 110
589 C IF IIK-KIN.LIM.GT.ACTUAL TOTAL CM-ENERGY, DO AGAIN RANDOM IIK-CHOICE
590 C----------------------------
593 * Note: we can go to 8 also for too many iterations
594 IF (IATMPT.GT.3) GO TO 8
597 IF (I310.GT.50) GO TO 310
598 IF (AMS.GT.ECO) GO TO 1310
600 C FOR THE DECAY CHANNEL
601 C IT1,IT2, IT3 ARE THE PRODUCED PARTICLES FROM IT
602 C----------------------------
603 IF (REDU.LT.0.D0) GO TO 1009
606 IF(IT3.EQ.0) GO TO 400
609 CALL THREPD(ECO,ECM1,ECM2,ECM3,PCM1,PCM2,PCM3,COD1,COF1,SIF1,
610 *COD2,COF2,SIF2,COD3,COF3,SIF3,AM1,AM2,AM3)
613 CALL TWOPAD(ECO,ECM1,ECM2,PCM1,PCM2,COD1,COF1,SIF1,COD2,COF2,SIF2,
619 IF (REDU.GT.0.D0) GO TO 110
621 IF (ITWTHC.GT.100) GO TO 1009
622 IF (ITWTH) 400,400,4001
625 IF (IT2.LE.0) GO TO 305
632 CALL TRAFO(GAM,BGAM,RX,RY,RZ,COD1,COF1,SIF1,PCM1,ECM1,
633 *PLS(IST),CXS(IST),CYS(IST),CZS(IST),ELS(IST))
636 CALL TRAFO(GAM,BGAM,RX,RY,RZ,COD2,COF2,SIF2,PCM2,ECM2,
637 *PLS(IST),CXS(IST),CYS(IST),CZS(IST),ELS(IST))
638 IF (IT3.LE.0) GO TO 305
641 CALL TRAFO(GAM,BGAM,RX,RY,RZ,COD3,COF3,SIF3,PCM3,ECM3,
642 *PLS(IST),CXS(IST),CYS(IST),CZS(IST),ELS(IST))
650 C----------------------------
652 C ZERO CROSS SECTION CASE
654 C----------------------------