Garfield 0.3
Toolkit for the detailed simulation of particle detectors based on ionization measurement in gases and semiconductors
Loading...
Searching...
No Matches
Garfield::GeometryRoot Class Reference

Use a geometry defined using the ROOT TGeo package. More...

#include <GeometryRoot.hh>

Inheritance diagram for Garfield::GeometryRoot:
Garfield::Geometry

Public Member Functions

 GeometryRoot ()
 Constructor.
 ~GeometryRoot ()
 Destructor.
void SetGeometry (TGeoManager *geoman)
 Set the geometry (pointer to ROOT TGeoManager).
Medium * GetMedium (const double x, const double y, const double z, const bool tesselated=false) const override
 Retrieve the medium at a given point.
unsigned int GetNumberOfMaterials ()
 Get the number of materials defined in the ROOT geometry.
TGeoMaterial * GetMaterial (const unsigned int i)
 Get a pointer to the ROOT material with a given index.
TGeoMaterial * GetMaterial (const char *name)
 Get a pointer to the ROOT material with a given name.
void SetMedium (const unsigned int imat, Medium *med)
 Associate a ROOT material with a Garfield medium.
void SetMedium (const char *mat, Medium *med)
 Associate a ROOT material with a Garfield medium.
bool IsInside (const double x, const double y, const double z, const bool tesselated=false) const override
 Check if a point is inside the geometry.
bool GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override
 Get the bounding box (envelope of the geometry).
void EnableDebugging (const bool on=true)
 Switch debugging and warning messages on/off.
Public Member Functions inherited from Garfield::Geometry
 Geometry ()=delete
 Default constructor.
 Geometry (const std::string &name)
 Constructor.
virtual ~Geometry ()
 Destructor.
virtual std::size_t GetNumberOfSolids () const
 Return the number of solids in the geometry.
virtual SolidGetSolid (const std::size_t) const
 Get a solid from the list.
virtual SolidGetSolid (const std::size_t, Medium *&) const
 Get a solid from the list, together with the associated medium.

Protected Member Functions

void PrintGeoNotDefined (const std::string &fcn) const

Protected Attributes

TGeoManager * m_geoManager = nullptr
std::map< std::string, Medium * > m_materials
bool m_debug = false
Protected Attributes inherited from Garfield::Geometry
std::string m_className = "Geometry"

Detailed Description

Use a geometry defined using the ROOT TGeo package.

Definition at line 15 of file GeometryRoot.hh.

Constructor & Destructor Documentation

◆ GeometryRoot()

Garfield::GeometryRoot::GeometryRoot ( )

Constructor.

◆ ~GeometryRoot()

Garfield::GeometryRoot::~GeometryRoot ( )
inline

Destructor.

Definition at line 20 of file GeometryRoot.hh.

20{}

Member Function Documentation

◆ EnableDebugging()

void Garfield::GeometryRoot::EnableDebugging ( const bool on = true)
inline

Switch debugging and warning messages on/off.

Definition at line 45 of file GeometryRoot.hh.

45{ m_debug = on; }

◆ GetBoundingBox()

bool Garfield::GeometryRoot::GetBoundingBox ( double & xmin,
double & ymin,
double & zmin,
double & xmax,
double & ymax,
double & zmax )
overridevirtual

Get the bounding box (envelope of the geometry).

Implements Garfield::Geometry.

◆ GetMaterial() [1/2]

TGeoMaterial * Garfield::GeometryRoot::GetMaterial ( const char * name)

Get a pointer to the ROOT material with a given name.

◆ GetMaterial() [2/2]

TGeoMaterial * Garfield::GeometryRoot::GetMaterial ( const unsigned int i)

Get a pointer to the ROOT material with a given index.

◆ GetMedium()

Medium * Garfield::GeometryRoot::GetMedium ( const double x,
const double y,
const double z,
const bool tesselated = false ) const
overridevirtual

Retrieve the medium at a given point.

Implements Garfield::Geometry.

◆ GetNumberOfMaterials()

unsigned int Garfield::GeometryRoot::GetNumberOfMaterials ( )

Get the number of materials defined in the ROOT geometry.

◆ IsInside()

bool Garfield::GeometryRoot::IsInside ( const double x,
const double y,
const double z,
const bool tesselated = false ) const
overridevirtual

Check if a point is inside the geometry.

Implements Garfield::Geometry.

◆ PrintGeoNotDefined()

void Garfield::GeometryRoot::PrintGeoNotDefined ( const std::string & fcn) const
protected

◆ SetGeometry()

void Garfield::GeometryRoot::SetGeometry ( TGeoManager * geoman)

Set the geometry (pointer to ROOT TGeoManager).

◆ SetMedium() [1/2]

void Garfield::GeometryRoot::SetMedium ( const char * mat,
Medium * med )

Associate a ROOT material with a Garfield medium.

◆ SetMedium() [2/2]

void Garfield::GeometryRoot::SetMedium ( const unsigned int imat,
Medium * med )

Associate a ROOT material with a Garfield medium.

Member Data Documentation

◆ m_debug

bool Garfield::GeometryRoot::m_debug = false
protected

Definition at line 55 of file GeometryRoot.hh.

◆ m_geoManager

TGeoManager* Garfield::GeometryRoot::m_geoManager = nullptr
protected

Definition at line 49 of file GeometryRoot.hh.

◆ m_materials

std::map<std::string, Medium*> Garfield::GeometryRoot::m_materials
protected

Definition at line 52 of file GeometryRoot.hh.


The documentation for this class was generated from the following file: