Getting started

Before starting with FairRoot you have to install the external packages needed, please see

1. Build Prerequisites
2. Installing the external packages

After that you go and install FairRoot

3. Installing FairRoot

Installing FairRoot you have all the base classes you need to do simulation and reconstruction and some small examples in:

FairRoot_install_dir/share/fairbase/example
or
fairroot/example (if you install in the source directory).

Tutorial1:
How to implement a simple detector using the old ASCII interface to describe the geometry (see Detector Geometry and Media for more details about this geometry interface)
See also Adding new detector for a detailed description of the detector class implementation, MC point class and the CMakeLists.txt

To run this tutorial:

  • After building FairRoot successfully go to the build directory and call the configuration script (config.sh or config.csh according to our shell)
  • cd to the Tutorial1/macros directory
  • run the following command: root run_tutorial1.C (you can also load the macro into root and then run it)

This will start a simulation session with Geant3 and create 10 events generated by a box generator, the input in the box generator can be chosen by the user, by default in this macro we use "pions" (see macro lines 20-22) for details.
To choose Geant4 you just have to change TGeant3 to TGeant4 in line 8 of the macro, or of you are loading the macro to root before exciting it you just give TGeant4 as second argument to the run_tutorial1 call, i.e:

root>.L run_tutorial1.C
root>run_tutorial(10, "TGeant4")

Tutorial2
This example show you how to:

  • Simulate a simple detector (run_tutorial2.C)
  • Read the simulated data, and the digitization parameters from "parameters/tutdet.digi.par" and create digitized data (create_digis.C)
  • Read the digitized data for further reconstruction (read_digis.C)

Tutorial3
This example demonstrate

  • detector simulation
  • event by event digitization
  • time based digitization
  • Message Queue based reconstruction: The Message Queue based reconstruction demonstrates the usage of FairMQ.
    Any number of "sampler" processes (FairMQSampler, FairMQSamplerTask, TestDetectorDigiLoader) send the data generated in the digitization step to a number of "processor" processes which do the reconstruction with the data (FairMQProcessor, FairMQProcessorTask, FairTestDetectorMQRecoTask). After the reconstruction task, the processes send the output data to a number of "sink" processes, which write the data to disk (FairMQFileSink).
    All the communication between these processes is done via FairMQ and can be configured to run over network (tcp) or on a local machine with inter-process communication (ipc).
    Currently, the number of processes and their parameters are configured with bash scripts/command line parameters. The scripts are located in the macro directory, together with README.md for more details on how to configure them.
  • Event display

Tutorial4
This example demonstrate:

  • using ROOT geometry as input for detector description, i.e: the geometry is created and saved to a ROOT file from a macro ( Create_Tutorial4_Geometry.C). The ROOT file is read by the detector classes during simulation

Tutorial5
Shows how to use FairDB interface to write and read parameter to a database system.
Two type of parameter classes are implemented with

  • simple data members ( FairDbTutPar)
  • complex data members i.e ROOT object ( FairDbTutParBin)

In both cases, corresponding macro to read and write as well as a script.
To setup the database to be used (dbconfig.sh) are available from the macro directory.
rutherford
simple simulation of the Rutherford experiment, with event display.

flp2epn
Simple example for Message based processing using FairRoot.