Garfield++ Installation Examples Documentation

Getting started

Prerequisites

To build the project you need

Instructions for installing ROOT can be found here or here.

Using the LCG software collection

On lxplus (or another system with access to cvmfs) you can select a coherent set of packages through an LCG view by sourcing, for example,


source /cvmfs/sft.cern.ch/lcg/views/LCG_104c/x86_64-el9-gcc13-opt/setup.sh

or, if you are using a (t)csh-type shell,


source /cvmfs/sft.cern.ch/lcg/views/LCG_104c/x86_64-el9-gcc13-opt/setup.csh

Other combinations of architectures and compilers are also available.

Platform-specific instructions

Using a Garfield++ installation from CVMFS

To profit from the latest developments and bug fixes, it is recommended to use the HEAD of the repository and build the project yourself following the instructions below. Alternatively, if you have access to cvmfs, you can pick up a Garfield++ installation from an LCG view, e. g.


source /cvmfs/sft.cern.ch/lcg/views/LCG_104c/x86_64-el9-gcc13-opt/setup.sh
source /cvmfs/sft.cern.ch/lcg/views/LCG_104c/x86_64-el9-gcc13-opt/share/Garfield/setupGarfield.sh

Instead of a release, it is also possible to use the LCG nightly builds


source /cvmfs/sft-nightlies.cern.ch/lcg/views/dev3/latest/x86_64-el9-gcc13-opt/setup.sh
source /cvmfs/sft-nightlies.cern.ch/lcg/views/dev3/latest/x86_64-el9-gcc13-opt/share/Garfield/setupGarfield.sh

Building the project from source

Downloading the source code

To get hold of the source files, please follow the steps below.

Building the project

At present, the code is still frequently modified. To obtain the latest version, use the command git pull origin master and rebuild the project.

Building and running an application

As an example for building an application, we consider the GEM example located in $GARFIELD_HOME/Examples/Gem.

Python interface

Thanks to PyROOT, one can also use the Garfield++ classes in Python. After building the project and setting up the environment following the instructions above (i. e. sourcing the setupGarfield.(c)sh script), one can load the library in the Python interpreter using


import ROOT
import Garfield

Examples can be found here (pythonized version of the drift tube example) and here (GEM example).

Contributing code

Please contact me to be added as a developer of the project.