How to use FORtran from a ROOT macro

Under:

Conditions:To use the Fortran subroutines and functions 3 pre-conditions have to be met:

  • Fortran code has to be compiled with the Fortran compiler

    It is provided by "cons" for all source files with the upper case "*.F" extension

  • To call any Fortran Subroutine / Function from C/C++ the Fortran subroutine C++ interface definition has to be provided

    It has to be written "by hand"

  • To execute the the Fortran Subroutines /Functions the Fortran run-time environment may be needed at the run-time.

    The Fortran Run-time libraries are provided by "root4star". They are not provided by the "plain" root.exe

  • (Optional) To be able to call the Fortran function from the Root C++ interpreter (from ROOT prompt) the RootCint dictionary for the C++/Fortran interface should be provided

The STAR "cons" automatically creates the RootCint dictionary for the all header files it discovery.

The examples follow: