1 \defgroup tutorial_FOAM FOAM tutorials
3 \brief Examples showing how to use FOAM.
7 FOAM is simplified version of multi-dimensional general
8 purpose Monte Carlo
event generator (integrator) with hyper-cubical
9 "foam of cells". Certain features of full version of FOAM are omitted.
10 mFOAM is intended
as an easy to use tool
for MC
11 simulation/integration in few dimensions. It relies heavily on ROOT package,
12 borrowing persistency of classes from ROOT. mFOAM can be easily used from
13 the ROOT shell. For more difficult problems the full FOAM may be better.
15 ### How to run application programs ?
17 The application program can be
run in two modes: it can be simply
18 intepreted by CINT or compiled. The first method is simpler but
19 results in slower execution. The second method employs ACLiC -
20 The Automatic Compiler of Libraries, which automaticates the
21 process of compilation and linking.
23 In $(ROOTSYS)/tutorials there are 3 demonstration programs:
27 mode. To
run this macro issue the following simple command from the
37 root [0] .x foam_kanwa.C
40 Simulation will start and graphical canvas with plot
41 of the distribution
function appear. In
this example
42 we defined the distribution
function simply
as a global
43 function function Camel2.
46 shows usage of FOAM in compiled mode, which is
47 the preferred method. The integrand
function is defined
48 now
as a Density method from
class TFDISTR inheriting from
50 integrand
function according to their needs but they should
51 always remember to define Density method which provides the
53 Enter CINT interpreter and
type:
57 root [1] .x foam_demo.C+
60 to load FOAM library, compile and execute macro foam_demo.C.
61 A shared
object foam_demo_C.so is created in the current
62 directory. At the end of exploration phase FOAM
object
63 including distribution
function will be written to disk.
66 demonstrates persistency of FOAM classes.
70 root [0] .x foam_demopers.C
73 Program reads the FOAM
object from disk, checks its
74 consistency and prints geometry of cells. Next starts the
75 the generation. It can be interpreted directly by CINT
76 because compiled TFDISTR
class is already available in
77 foam_demo_C.so library.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
RooCmdArg What(const char *str)
R__EXTERN TSystem * gSystem
void run(bool only_compile=false)