]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TEvtGen/PHOTOS/phofac.F
Adding CMakeLists.txt
[u/mrichter/AliRoot.git] / TEvtGen / PHOTOS / phofac.F
1       FUNCTION PHOFAC(MODE)
2 C.----------------------------------------------------------------------
3 C.
4 C.    PHOTOS:   PHOton radiation in decays control FACtor
5 C.
6 C.    Purpose:  This is the control function for the photon spectrum and
7 C.              final weighting.  It is  called  from PHOENE for genera-
8 C.              ting the raw photon energy spectrum (MODE=0) and in PHO-
9 C.              COR to scale the final weight (MODE=1).  The factor con-
10 C.              sists of 3 terms.  Addition of  the factor FF which mul-
11 C.              tiplies PHOFAC for MODE=0 and divides PHOFAC for MODE=1,
12 C.              does not affect  the results for  the MC generation.  An
13 C.              appropriate choice  for FF can speed up the calculation.
14 C.              Note that a too small value of FF may cause weight over-
15 C.              flow in PHOCOR  and will generate a warning, halting the
16 C.              execution.  PRX  should  be  included for repeated calls
17 C.              for  the  same event, allowing more particles to radiate
18 C.              photons.  At  the  first  call IREP=0, for  more  than 1
19 C.              charged  decay  products, IREP >= 1.  Thus,  PRSOFT  (no
20 C.              photon radiation  probability  in  the  previous  calls)
21 C.              appropriately scales the strength of the bremsstrahlung.
22 C.
23 C.    Input Parameters:  MODE, PROBH, XF
24 C.
25 C.    Output Parameter:  Function value
26 C.
27 C.    Author(s):  S. Jadach, Z. Was               Created at:  01/01/89
28 C.                B. van Eijk                     Last Update: 13/02/90
29 C.
30 C.----------------------------------------------------------------------
31       IMPLICIT NONE
32       REAL*8 PHOFAC,FF,PRX
33       INTEGER MODE
34       INTEGER IREP
35       REAL*8 PROBH,CORWT,XF
36       COMMON/PHOPRO/PROBH,CORWT,XF,IREP
37       SAVE PRX,FF
38       DATA PRX,FF/ 0.D0, 0.D0/
39       IF (MODE.EQ.0) THEN
40         IF (IREP.EQ.0) PRX=1.D0
41         PRX=PRX/(1.D0-PROBH)
42         FF=1.D0
43 C--
44 C--   Following options are not considered for the time being...
45 C--   (1) Good choice, but does not save very much time:
46 C--       FF=(1.0D0-SQRT(XF)/2.0D0)/(1.0+SQRT(XF)/2.0D0)
47 C--   (2) Taken from the blue, but works without weight overflows...
48 C--       FF=(1.D0-XF/(1-(1-SQRT(XF))**2))*(1+(1-SQRT(XF))/SQRT(1-XF))/2
49         PHOFAC=FF*PRX
50       ELSE
51         PHOFAC=1.D0/FF
52       ENDIF
53       END