A New Monte Carlo Event Generator for High Energy Physics
Total Page:16
File Type:pdf, Size:1020Kb
Computer Physics Communications 41 (1986) 127—153 127 North-Holland, Amsterdam A NEW MONTE CARLO EVENT GENERATOR FOR HIGH ENERGY PHYSICS S. KAWABATA National Laboratory for High Energy Physics, Tsukuba, Ibaraki, Japan Received 3 August 1985; in revised form 7 December 1985 PROGRAM SUMMARY Title of program: BASES/SPRING No. of lines in combined program and test deck: 2750 Catalogue number: AAFW Keywords: Multidimensional numerical integration, Monte Carlo simulation, event generation and four momentum vector Program obtainable from: CPC Program Library, Queen’s Uni- generation versity of Belfast, N. Ireland (see application form in this issue) Nature of physical problem In high energy physics experiments, it is necessary to generate Computer for which the program is designed and others on which events by the Monte Carlo method for the processes of interest it is operable: FACOM, HITAC, IBM and others with a in order to know the detection efficiencies. It is desirable to FORTRAN77 compiler have such a program that can generate events efficiently once we have the differential cross section of any process. It will be Computer: FACOM-M382, HITAC-M280; Installation: Na- a very powerful tool for the high energy physics experimenta- tional Laboratory for High Energy Physics (KEK), Tsukuba, list. Ibaraki, Japan Method of solution Operating system: OSIV/F4 MSP (FACOM), VOS3 (HITAC) A pair of program packages BASES and SPRING is developed for solving such a problem. By BASES, the differential cross Programming language used: FORTRAN77 section is integrated and a probability distribution is produced. By SPRING, four momentum vectors of events are generated High speed storage required: 145 Kwords each for BASES and according to the probability distribution mad~eby BASES. SPRING Typical running time No. of bits in a word: 32 The running time depends especially on the complexity of the function program which gives the differential cross section for Peripherals used: terminal or card read for input, disc and line the process. If we take the process e+e_ —* (Z°)—‘ v~y as an printer for output example, the integration takes 11 s and the generation rate is 4500 events/s on the FACOM M382 computer. OO1O-4655/86/$03.50 © Elsevier Science Publishers B.V. (North-Holland Physics Publishing Division) 128 S. Kawabata / A new Monte Carlo event generator LONG WRITE-UP A Monte Carlo event generator designed to be lem. Roughly speaking, the method is to construct suitable for high energy particle physics is devel- the generating function by a histogram with varia- oped, by which events of any processes with 10 ble bin size, which is determined by the height of variables in maximum are generated efficiently. the differential cross section. Generation proceeds The program consists of two sets of packages, one with the following two steps: is a numerical integration package BASES pre- (a) By BASES, a probability distribution (gener- paring a probability distribution and the other is ating function) is calculated by integrating the an event generation package SPRING. The central differential cross section over the phase space part of the paper describes how to use the pro- and saved in a file with parameters needed in gram packages in details, the next step. (b) By SPRING, events are generated by the Monte Carlo method according to the above 1. Introduction distribution. The numerical integration program package In high energy physics, when we get physical BASES contains also several facilities, as de- results from experimental raw data, it is necessary scribed in section 4.3, which are helpful for the to know detection efficiencies for the processes of user who wants to integrate singular functions. interest. We generate many events, consisting of The integration method we adopt, is the algorithm the four momentum vector of particles produced of VEGAS [1], devised by Lepage, which has been in these specific processes by the Monte Carlo proved to be very useful for integration of singular method, pass them through a detector simulation functions appearing in the calculation of the program to produce artificial raw data and analyze radiative QED processes. the data by the same analysis program as used for The next section contains a brief description of the real data. the integration method. In section 3 the genera- For generation of Monte Carlo events there is tion method is presented. In sections 4 and 5, how no general method suitable for any process. It is to use these program packages is explained with always necessary but not easy to find a method an example. appropriate to the process being considered. For example, efficient generation of events for radia- 2. Integration method of BASES tive Bhabha scattering or that for two photon processes is difficult, because these processes have We adopt the integration method of VEGAS. many sharp peaks due to singularities in their Since a detailed description of the algorithm is differential cross sections. To generate events by given in ref. [1], we review it here briefly. the Monte Carlo method, we normally look for a For simplicity, we consider the following one- function, whose value is always greater than that dimensional integral as an example: of the differential cross section and whose gener- ~ = dx (1) ating function has an inverse function. When we ./~ find fortunately such a function, we can generate where the integrand f(x) must be non-negative the events efficiently. The generation efficiency for the sake of event generation. depends on the difference between values of the We divide the integration volume (0, 1) into Ng function and the differential cross section. When regions and each of them into m subregions. we fail to find any such a function, we are forced Namely, the whole integration volume consists of to be satisfied with lower efficiency and waste Nd subregions, i.e. much CPU time in some cases. Nd A pair of program packages BASES and Nd = Ngm and ~ ~x 1 = 1, (2) SPRING has been developed to solve this prob- 1=1 S. Kawabata / A new Monte Carlo event generator 129 where 1~x1represents the size of the subregion j. tributed random points are chosen (i.e., in de- We define the probability density p3 for the subre- termining S1). The information about the behav- gion j as ior of f(x) obtained in this first sampling is used Nd to define a new density p1 which reduces a~in the = 1 and ~ ~ = (3) next iteration of the estimation for S2. After each Nd ~x1 ‘ ‘ subsequent iteration, the density p1 is again re- fined for the next one. Namely, sizes of subregions We sample Npg points in each region to estimate ~x1 are adjusted after each iteraction. the integral, such that the total number of sam- In order to prepare the probability distribution pling 15 for the event generation, the following procedure — ~r t~r (4~ is taken: call pg g~ ~. / (1) Grid defining step The estimated value of the integral I is given by To determine the optimum density p1 (i.e., N N. sizes of subregions ~ several iterations of = ~ ~i f(x,) = 1 ~f(x,)Nd ~ the estimastion are performed until the esti- ‘~all i1 p1 Ncaii ,~ mated error given by eq. (9) becomes less than the specified value or the number of iterations where the subregion j2isofthatthe estimateregion whichS is givencon- accuracyreaches itsbecomesupper limitless orthanthe1%.fluctuation of the bytains x,. The variance a (2) Accumulation step N 8 N~5 By using the grids optimized by step (1), itera- 2 = ~ N ~ (F/(xk))2 tions of the estimation are carried out until the a NgNp2g(Npg — 1) ~ estimated error becomes less than the required 2 value or the number of iterations reaches its N~ 8 given upper limit. In this step the probability — ~ F,(x,,~) , (6) distribution is calculated. k = 1 (3) Resulting probability distribution is saved in a where disc file. F/(xk) ==f(xk) ~XINd (7) 3. Method of event generation and Xk E subregion j C region 1. To obtain the final result of the integration, In the N dimensional integration, we have N BASES makes n estimastes of the integral (Sa}~.i’ independent variables. Wedivide a region spanned each of which is calculated by the above method, by each variable into ~ regions and each of those These n estimates are combined to give a cumula- Ng regions into m subregions. Therefore, the whole tive estimate S: integration volume is divided into (N~)N hyper- 2 ~ —~ (8) cubesalong eachby a axis.rectangularA furthergridsubdivisionof Ng subdivisionsdefines a I ~= a a1 cia new grid m times finer on each axis and results in and (Ngm)N sub-hypercubes. Each hypercube has mN sub-hypercubes. 1 — ~!, i The probability distribution is prepared by — ~‘ ‘. ) BASES. By this we mean that both average and a a maximum values of probabilities where a,~is a variance of the ath estimate Sa. F(x 1 x2 ... xN) In BASES, the density p1, namely L~x1,is mod- N ified so as to minimize a~for each iteration of the f(x x ... x )NN fl z~x (10) estimation. In the first estimation, uniformly dis- 1’ 2’ ‘ N d = 130 S. Kawabata / A new Monte Carlo event generator for each hypercube, as well as sampling intervals value or the number of iterations reaches the both for the hypercube and the sub-hypercube, are specified maximum, the integration is terminated. saved in a disc file. In the grid defining step, if fluctuation of the For generation, a hypercube is chosen accord- accuracy becomes less than 1%, the integration is ing to the average probability and a point in a also terminated. The maximum iteration numbers, sub-hypercube in the hypercube is sampled with ITMX1 for the grid defining step and ITMX2 for the density p~’F(x 1,..., xN) is calculated at the the accumulation step, can be given by the user in point and its value is compared with the maxi- the user initialization routine USERIN (default mum value of probabilities Fmax = max numbers of ITMX1 and ITMX2 are 15 and 100, [F(x1 xN)] of the hypercube.