ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
hifun.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file hifun.f
1 C
2 C
3 C The next three subroutines are for Monte Carlo generation
4 C according to a given function FHB. One calls first HIFUN
5 C with assigned channel number I, low and up limits. Then to
6 C generate the distribution one can call HIRND(I) which gives
7 C you a random number generated according to the given function.
8 C
9  SUBROUTINE hifun(I,XMIN,XMAX,FHB)
10  common/hijhb/rr(10,201),xx(10,201)
11  SAVE /hijhb/
12  EXTERNAL fhb
13  fnorm=gauss1(fhb,xmin,xmax,0.001)
14  DO 100 j=1,201
15  xx(i,j)=xmin+(xmax-xmin)*(j-1)/200.0
16  xdd=xx(i,j)
17  rr(i,j)=gauss1(fhb,xmin,xdd,0.001)/fnorm
18 100 CONTINUE
19  RETURN
20  END