Elsevier Science Home
Computer Physics Communications Program Library
Full text online from Science Direct
Programs in Physics & Physical Chemistry
CPC Home

Manuscript Title: mFOAM-1.02: A Compact Version of the Cellular Event Generator FOAM
Authors: S. Jadach, P. Sawicki
Program title: mFOAM (mini FOAM), version 1.02.
Catalogue identifier: ADYX_v1_0
Distribution format: tar.gz
Journal reference: Comput. Phys. Commun. 177(2007)441
Programming language: ANSI C++.
Computer: Most Unix workstations, supercomputers and PC.
Operating system: Most UNIX systems, Linux and Windows. Application programs were thoroughly tested under Red Hat Linux 7.x, CERN Scientific Linux 3.02, Fedora Linux FC3, UNIX IRIX-6.5. At present mFOAM is distributed with the ROOT package (version 4.04 and later).
RAM: Depends on the complexity of the problem. For the default 2000 cells it is about 25 MB while for 100,000 cells it allocates about 35 MB. These data are for running from CINT command line and include also memory consumption by CINT itself.
Keywords: Monte Carlo (MC) simulation and generation, particle physics, phase space.
PACS: 02.70.Rr.
Classification: 4.14.

Nature of problem:
Monte Carlo integration or generation of unweighted (weight equals 1) events with a given probability distribution is a standard problem in many areas of research, ranging from high-energy physics to economics. In any library of general utilities it is highly desirable to include a general-purpose numerical tool (program) with the MC generation algorithm featuring the built-in capability of automatically adjusting the generation procedure to an arbitrary pattern of singularities in the generated distribution. Our primary goal is the simulation of the differential distribution in the multiparticle Lorentz-invariant phase space for the purpose of comparison between Quantum Field Theory predictions, and results of high-energy experiments. However, the solution may have a much wider area of applications.

Solution method:
In the algorithm, a grid of cells, called "foam", is built in the process of the binary split of the cells. The resulting foam is adapted automatically to the shape of the integrand in such a way that the resulting ratio of the average weight to maximum weight or the variance to average weight is minimized.

Restrictions:
Consumption of computer resources depends on the complexity of the problem. The use of the program is limited to about a million of cells for a relatively small number of dimensions (≤ 20) in view of the memory and CPU time restrictions of a modern desktop computer.

Additional comments:
The general-purpose self-adapting Monte Carlo (MC) event generator/simulator mFOAM (standing for mini-FOAM) is a new compact version of the FOAM program (Catalogue Id: ADMC), with a slightly limited functionality with respect to its parent version. On the other hand, mFOAM is easier to use for the average user. This new version is fully integrated with the ROOT package, the C++ utility library used widely in the particle physics community. The internal structure of the code is simplified and the very valuable feature of the persistency of the objects of the mFOAM class is improved. With the persistency at hand, it is possible to record very easily the complete state of a MC simulator object based on mFOAM and ROOT into a disk-file at any stage of its use: just after object allocation, after full initialization (exploration of the distribution), or at any time during the generation of the long series of MC events. Later on the MC simulator object can be easily restored from the disk-file in the "ready to go" state. Objects of the TFoam class can be used as a stand-alone solution to many everyday problems in the area of the Monte Carlo simulation, or as building blocks in large-scale MC projects, taking full advantage of the object-oriented technology and persistency.

Running time:
The CPU time necessary to build up a foam of cells depends strongly on the number of dimensions and the requested number of cells. On the PC with a 1.6 GHz Intel processor, it takes about 10 seconds to build a hyperrectangular grid of 10,000 cells for simple 3-dimensional distribution.