Introduction

Flyo is a Montecarlo written in C++ for the simulation of nuclear events within a complex experimental apparatus. The user describes the apparatus and the chain of the reactions in ASCII files with .app or .epc extensions. The apparatus is made up of detectors (or devices) that are described into logical segments, called blocks, containing specific keywords (or control words) followed by parameters written in free-format.

Flyo reads from the input files all the data and generates a logical architecture that reflects the experimental set-up and builds a seriee of nuclear reactions as required by the user. After a short initialization, Flyo simulates, for each event, the beam and all the particles partaining the selected reactions. Each particle is then drawn through the experimental apparatus taking into account the materials found in detectors and traversed along the path. In the case of dense material, Flyo, if enabled by the user, generates bremsstrahlung and pair production. It also memorizes, inside the internal buffers of each hit detectors, many information of all particles seen by the device, like coordinates, energy and momentum, etcc.

After the tracking, the hits seen by the various devices are elaborated to generate more specific informations in agreement with the device functions. Now the data are similar to the data “rough” generated by a real experimental set-up, but filled with more information derived by he Monte Carlo generation.

The last phase is the analysis that could be done just at the end of each event generation. So Flyo, if instructed , processes the “rough” data by reconstructing the events (geometrically and kinematic-ally) according to certain hypothesis set by the user in the file type epc.

Flyo produces output in two files, a complete listing (like a debugging) with all the information of the parameters of production and a ROOT file containing all or the events selected by a user-defined criteria.

A first input file type app describes with same details, the optical beam from the target production up to the beginning of the area of the detectors. A second file app describes the detectors used in the experiment as designed by researchers

The file epc is the file that contains all the parameters and the description of the reactions expected in a simulation run. With the same experimental setup, you can use different file epc with descriptions of chains of different reactions. The file epc shall include, at appropriate points, the app files needed for a complete description of the experimental set-up.

In next chapters we will talk mainly of the file app or epc. There we describe the meaning and the format of the keywords that are read by Flyo for the initialization of the various procedures of simulation and analysis. Then we'll turn to specific chapters still in progress.


How and where do you get Flyo

Open a web browser and go to http://pierazzini.unipi.it/giuseppe/FlyoHtml/flyoindex.html and then download.

Here is the place where you can find the latest versions of Flyo in tgz. For example, Flyo62_11.07.24h1825.tgz is the version of Flyo generated in July 24 2011 at 06.25 pm.

With one click, you are prompted to download the file to your computer. The file will be in a directory where you can decompress it with the command gunzip Flyo62_11.07.24h1825.tgz to get Flyo62_11.07.24h1825.tar. Then proceed to extract the software with the command tar-xvf Flyo62_11.07.24h1825.tar

You will get all the informations shown in the figure here at side. The source is all in the folder src while the apparatus and reaction descriptions are in Epc.

Now type make to compile the program that you will find in binary in the bin/ with a name Flyo.

Your computer, running Linux (CERN Scientific Linux or Fedora 6 or even more recently OS like UBUNTU ...), must have good C++ compiler, version 3.2.3 or greater and the Root library of CERN.


How to operate Flyo


When you turn on your computer, navigate to the folder Epc (this is not mandatory, but that's how I work) and here you write .. /bin/Flyo -h to get a mini help, which explains the information to be added to the line command. For example, always in your Epc folder, write:


$> ../bin/Flyo -d path/risultati/ -i kpivv/Kpivv.epc -t root -r 3333 -e 20000


This is a command that prompts you to generate 20,000 events as described in the file Kpivv.epc and creates two files, the file listing and the root with the 3333 run, in the output folder path/results. The output folder can be anywhere, but in order to avoid confusion between the sources of the program and with the results, it is appropriate to call it off! such as in home/user/results and it should be created before using it.

Remember that the paths are subject to change if you put yourself in a folder different from that mentioned earlier. You must then pass the path relative to the point where you run, or you put the absolute path!

If you repeat the run with the same number already used, the old file is not overwritten, but a new file is written with the same run number followed by a + (order num.).

Because root does not handle files larger than 1.4 Gb, attention to defining an adequate total number of events. If it is too large you risk of losing the job. Consider produce more runs with different numbers to force flyo to generate independent series of events ( random initialization dependes on correlation setting; correlation = 1).

Description of equipment

The file app are text files that describe geometrically the detectors with the materials they are made and list the particles that they are able to reveal.
Before going into the contents of the file is good to remember that the lines that begin with some asterisk or slash are considered comment lines and thus ignored by Flyo reading. The real information is usually started by a control word or keyword and are on a line. Multiple lines form a block which is usually closed by an
end or fine. The labels or numbers after the keyword must be separated by one or more spaces, but it is not necessary to write data in fixed format.




The Data Base

The material parameters are wired directly into the program source Flyo. Refer to the source matter.cpp
With the keyword pr_material Flyo prints a list of materials in the listing output.

The parameters that describe the particles are generated by the procedures part_db_dbs.cpp while with the command pr_data_bas Flyo prints out the complete list of particles used into the simulation.
A control word like Unseen nu indicates that the device does not see the neutrino. Other particles may be added if necessary. This control word can also be inserted in the file epc, however, should be used after the database was created!.

Units

We use the following units:

Detectors are described in file.app. To understand better the description you must represent the detector as a solid consisting of an outer surface, an interior region sensitive to particles, and an empty hole for the beam.



The file .app

You can see an example of a file.App, and recognize the keywords described below

The file .epc

The epc file defines the main parameters of a run and reports the descriptions of the reactions.

Let's start with a sample file, the file Kpipi060.epc or similar. This is one of the files that define the parameters of a simulation run, and describe the reactions to generate. The extension epc is different from that used for other files, but that is only for convenience and to avoid confusion with other files of type app. As usual, nothing prevents you to join the file app with this file and use it directly in Flyo. In fact, any file can easily be included with a simple command include set in the right place of a epc file to restore the continuity of information for Flyo. It is preferred to separate them to make easier the editing without the risk of confusion. For example the first two .app files are more stable, but the third, which describes in particular the reactions, should be promptly updated according to user requirements.


Remember that in launching Flyo, as mentioned above you type


../bin/Flyo -d path/risultati/ -i kpivv/Kpivv.epc -r 3333 -e 20000


if you are in in the folder Epc. If you launch Flyo from another location it is necessary to adjust the paths in relation to the new location.

And now we come to the explanation of the contents of this last .epc file. It actually can be divided into two parts: one defines the parameters of running, while a second part describing the nuclear reactions that will be generated in the simulation.

First part: general informations

Second part: The reactions blocks

The reactions are described in a block in which they appear: information on the target, the production of the beam, the maximum deviation of the beam and the specs on the desired reaction. You can write multiple blocks, with different reactions and if you wish, with different beam and target. In general, the target and the beam parameters are the same unless you want to generate events simultaneously from two or more different targets.

In the folder Epc, see source software, there are numerous examples of simple and complex reactions. In some cases the decays into three, four and five bodies appear.


The lists of particles.

The elementary particles are in a data_base with all the information needed to create a list of particles (objects) used by the program in the simulation of various reactions.

Each particle is identified by a


See in detail the part_db.

The reactions

Flyo generates events according to their probability of production, which depends on the rate and on the cross section of production from the beam in the target. So Flyo begins tracing each particle, starting just from the first, the beam, which tracks up to the moment of its natural decay if not terminated prior by a colliding with some part of the apparatus.

The decay is a standard procedure which takes into account the possible phase space and decay matrix. Each particle at the end of its travel, always ended by natural death or by absorption by a detector, is terminated by a code, which is called by Flyo fate and is also stored on the root file output.

A decay to several bodies, such as the Kl -> pi0 pi0 pi0, it is automatically split into two or more sub-decays.





where the particle res is generated dinamically with a mass compatible with the phase space; res is a virtual particle which also appears in Data_Base (among others), but it has the sole purpose of forcing Flyo to use the phase space. This process of fragmenting a decay in easy steps is useful because it allows us to use recursive kinematic procedure for the decay in three or more bodies.

Incidentally I should also mention that the above model allows us to easily enumerate the particles produced in the decay: with id = index of the mother, the first daughter is 2*id, the second 2*id+1; with this technique is easy to trace back the history of a particle.
Today Flyo numbers the particles within a reaction as mentioned above, but more for historical reasons than practical. Really C++ today provides methods (pointers) more flexible to take a complete assessment of a reaction chain.

To return to our problem of decay, we also recall the case where you need to deal with a matrix elementy. The Monte Carlo Flyo generates events according to the matrix of decay. Of course, the procedure for the decay under consideration must be planned and scheduled in the code. The technique is to set up for any particular decay a virtual particle, which is inserted into the appropriate point of the decay chain to force Flyo, when called, to follow specific probability distributions.

The number of particles of a reaction can also be changed dinamically during the generation of an event; that is usually done to take account, for example, of the pair production or of the photon emission by bremsstrhalung, if the control words, pairproduction and / or bremsstrahlung are enabled.


Gmp


next......