MPD simulation includes interactions and particles of interest, geometry of the system, materials used, generation of test events of particles, interactions of particles with matter and electromagnetic fields, response to detectors, records of energies and tracks, analysis of the full simulation at different detail and visualization of the detector system and collision events. As the events are processed via the simulation, the information is disintegrated and reduced to that generated by particles when crossing a detector.

Simulation in high energy physics experiments uses transport packages to move the particles through experimental setup from initial state or origin files produced by event generators, such as UrQMD or QGSM described above. Geant (short from “geometry and tracking”) transport package is developed at CERN and most commonly used today. Geant3 was implemented in Fortran programming language whereas Geant4 is developed in C++.

Transport includes detailed description of detector geometries and propagates all particle tracks through detector materials and media. The detector geometries are described by Geant3/Geant4 native geometrical models. During tracking of all particles through detectors, Geant forms the detector responses (hits) which are used in reconstruction task. In order to evaluate the software and detector performance, simulated events are processed through the whole cycle and finally the reconstructed information about particles is compared with the information taken directly from the Monte Carlo generation.

To simulate MPD events of particle collisions with a fixed target, runMC macro is used. The main macro lines are described below.

Initially, all libraries required for simulation and geometries are included by:

#include "commonFunctions.C" 
#include "geometry_stage1.C"

It parses media definition and creates passive volumes, such as cave, pipe, magnet, cradle, and subdetectors: FFD, TPC, TOF, EMC, ZDC, MCORD.

Function parameters of the main body of the macro:

EGenerators generator - used generator, default value BOX
EVMCType vmc - used VMC, default value Geant3
Int_t nStartSeed - initial seed number
TString inFile – path of the input file with generator data if required;
TString outFile – path of the result file with MC data, default value: evetest.root;
Int_t nStartEvent – number (start with zero) of the first event to process, default: 0; Int_t nEvents – number of events to transport (0–all events in the input file), default: 2; Bool_tflag_store_FairRadLenPoint – whether to enable estimate radiation length data, default: kFALSE; Int_t FieldSwitcher - 0 corresponds to the constant field (default), 1 corresponds to the field map stored in the file (default).

Then in the main body of runMC.C macro the simulation run is initialized along with initialization of geometry and the event generator is defined, which will be used to simulate MPD events.

FairRunSim* fRun = new FairRunSim(); 

FairPrimaryGenerator* primGen = new FairPrimaryGenerator();

One can choose and tune one of the following event generators: BOX, FLUID, HSD, ION, LAQGSM, MCDST, PART, SMASH, UNIGEN, URQMD, VHLLE.
To select event generator, Add Generator function of FairPrimaryGenerator class is used.

Files of different event generators are located on the NICA cluster.  If you do not have access to the cluster, you can use, for example, a simple particle BOX generator (default) to propagate selected particles to the desired directions. BOX generator is used without any input files for the simulation macro.

In the next step, the output file name is specified:


The magnetic field set by map (ASCII or ROOT) file or constant field is chosen in the next lines of the macro. In the MPD experiment the transition from a constant magnetic field to real field map, interpolation of the field between map nodes and extrapolation of the field map to out-of-magnet region were made.

The following line enables or disables radiation length manager:

fRun->SetRadLenRegister (flag_store_FairRadLenPoint);

The manager determines the particle fluency through a certain boundary (surface) and deduces a map. Knowing the volume and density of the object of interest and the specific energy loss, dose scan be estimated. Therefore, FairRadLenManager class estimates radiation length data and can answer the questions: “What energy dose will be accumulated during a certain time of operation?” and “How to create physical volumes with correct material assignment?”.

The next function initializes MPD simulation, i.e. Virtual Monte Carlo classes and tasks (if they are used in simulation): fRun->Init(). To run event simulation, the following line is executed: fRun->Run(nEvents). The figure 1 presents the main modules of the MpdRoot framework and their relationship during the simulation.

Figure 1.The scheme of the MpdRoot modules in the simulation

Input/Output manager (shown on the figure as I/O manager) called the Runtime Parameter Manager is the manager class for all parameter containers and based on ROOT TFolder and TTree classes. The Runtime Manager includes container factory, list of parameter containers and list of runs. The parameters are stored in the containers, which are created in the Init() function of the tasks via the container factory or produced from ASCII or ROOT files in the macro.

Subdetector geometries can be defined using different input formats: ASCII or ROOT files (Root Geometry format presented in the form of TGeoVolumes tree) or defined directly in the source code. The ASCII input format for detector geometry consists of volumes defined by the following sequence:

The simulation result is evetest.root (default name) file with Monte Carlo data such as simulated track points and particle tracks in the MPD detector. It also includes MPD detector geometry stored in the FairBaseParSet container and presented by ROOT geometry manager (TGeoManager class) – its global pointer gGeoManager.

Categories: Posts