Skip to content

Latest commit

 

History

History
88 lines (70 loc) · 3.3 KB

README.md

File metadata and controls

88 lines (70 loc) · 3.3 KB

Turtle version Build Status

G4TURTLE

( Geant4 Topographic Utilities for tRansporting parTicules over Long rangEs )

Description

This is a Geant4 wrapper of the TURTLE library. It allows to efficiently import topographic data in Geant4 as a custom G4VPhysicalVolume. The TURTLE library is encapsulated in a G4Turtle class. Below is a minimal example for building a topography as a Geant4 geometry with TURTLE:

#include "G4Turtle.hh"

G4VPhysicalVolume * DetectorConstruction::Construct()
{
        /* Fetch the topography */
        G4Turtle * turtle = G4Turtle::GetInstance();
        turtle->SetTopographyData("path/to/global/model");

        /* Return the topography as world volume */
        return turtle->GetPhysicalVolume();
}

Note that the Geant4 geometry for the topography is emulated from the data, on the fly. Therefore it can't be visualized. This mechanism however allows to handle very large topographic data sets.

Extra volumes can be placed inside the topography with the G4Turtle::PVPlacement method, e.g. a detector. The daughter volumes are placed by specifying their geographic coordinates, i.e. latitude, longitude, height above ground, etc. Note that they prevail over the topography.

Installation

Building the G4Turtle class requires a vanilla Geant4 installation, including both header files and libraries. Builds have been successfully tested with v10.0 to v10.5 of Geant4, e.g. using Ubuntu Docker images.

A CMakeLists.txt file is provided for building both TURTLE and G4Turtle as shared libraries. This can be done for example as:

cd g4turtle
mkdir build && cd build
cmake ..
make install
  • By default the installation is done to the g4turtle source directory, under lib and include. You can specify a different install location as:

    cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install
  • The test executable can be built as:

    make run-g4goupil
  • The default build of TURTLE requires libpng-dev and libtiff-dev for reading GeoTIFF and PNG topography data. On Debian and derivatives (e.g. Ubuntu) these dependencies can be installed as:

    sudo apt install pkg-config libpng-dev libtiff-dev
  • Alternatively, you can build your own version of TURTLE, e.g. with GEOTIFF disabled and link to it as:

    cmake .. -DTURTLE_PREFIX=/path/to/turtle/install

License

The TURTLE library and the G4Turtle wrapper are under the GNU LGPLv3 license. See the provided LICENSE and COPYING.LESSER files. The test program however has a separate public domain license allowing it to be copied without restrictions.