Skip to content

A Nim wrapper for the Garfield++ library for gaseous detectors.

Notifications You must be signed in to change notification settings

SciNim/GarfieldNim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GarfieldNim - A Nim wrapper for Garfield++

An (incomplete) Nim wrapper for the Garfield++ library.

From the Garfield++ website:

Garfield++ is a toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors. The main area of application is currently in micropattern gaseous detectors. Garfield++ shares functionality with the Garfield program. The main differences are the more up-to-date treatment of electron transport, the possibility to simulate silicon sensors, and the user interface, which is based on ROOT.

Requirements

This library requires CERN’s ROOT and Garfield++ in your PATH (having sourced thisRoot.sh and setupGarfield.sh respectively).

You will get a compile time error if either cannot be found.

Compatibility with Nim

Both ROOT and Nim define a TFrame data type. This leads to a clash when compiling code. For that reason the files that include ROOT headers that use this type must be modified.

We need to introduce a small hack in our local Garfield++ source files in order to use this Nim library.

For example the header of AvalancheMC.hh must be changed to:

#ifndef G_AVALANCHE_MC_H
#define G_AVALANCHE_MC_H

#include <array>
#include <string>
#include <vector>

#define TFrame TFrameROOT

#include "FundamentalConstants.hh"
#include "GarfieldConstants.hh"
#include "Sensor.hh"
#include "ViewDrift.hh"

#undef TFrame

where we redefine the TFrame locally.

List of currently affected headers:

  • AvalancheMC.hh
  • AvalancheMicroscopic.hh

About

A Nim wrapper for the Garfield++ library for gaseous detectors.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages