Garfield++ 4.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
|
Use a geometry defined using the ROOT TGeo package. More...
#include <GeometryRoot.hh>
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 Medium * | GetMedium (const double x, const double y, const double z, const bool tesselated=false) const =0 |
Retrieve the medium at a given point. | |
virtual size_t | GetNumberOfSolids () const |
Return the number of solids in the geometry. | |
virtual Solid * | GetSolid (const size_t) const |
Get a solid from the list. | |
virtual Solid * | GetSolid (const size_t, Medium *&medium) const |
Get a solid from the list, together with the associated medium. | |
virtual bool | IsInside (const double x, const double y, const double z, const bool tesselated=false) const =0 |
Check if a point is inside the geometry. | |
virtual bool | GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax)=0 |
Get the bounding box (envelope of the geometry). | |
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" |
Use a geometry defined using the ROOT TGeo package.
Definition at line 15 of file GeometryRoot.hh.
Garfield::GeometryRoot::GeometryRoot | ( | ) |
|
inline |
|
inline |
Switch debugging and warning messages on/off.
Definition at line 45 of file GeometryRoot.hh.
|
overridevirtual |
Get the bounding box (envelope of the geometry).
Implements Garfield::Geometry.
Definition at line 134 of file GeometryRoot.cc.
TGeoMaterial * Garfield::GeometryRoot::GetMaterial | ( | const char * | name | ) |
Get a pointer to the ROOT material with a given name.
Definition at line 54 of file GeometryRoot.cc.
TGeoMaterial * Garfield::GeometryRoot::GetMaterial | ( | const unsigned int | i | ) |
Get a pointer to the ROOT material with a given index.
Definition at line 45 of file GeometryRoot.cc.
|
overridevirtual |
Retrieve the medium at a given point.
Implements Garfield::Geometry.
Definition at line 23 of file GeometryRoot.cc.
unsigned int Garfield::GeometryRoot::GetNumberOfMaterials | ( | ) |
Get the number of materials defined in the ROOT geometry.
Definition at line 36 of file GeometryRoot.cc.
|
overridevirtual |
Check if a point is inside the geometry.
Implements Garfield::Geometry.
Definition at line 125 of file GeometryRoot.cc.
|
protected |
Definition at line 157 of file GeometryRoot.cc.
Referenced by GetMaterial(), GetNumberOfMaterials(), and SetMedium().
void Garfield::GeometryRoot::SetGeometry | ( | TGeoManager * | geoman | ) |
Set the geometry (pointer to ROOT TGeoManager).
Definition at line 14 of file GeometryRoot.cc.
void Garfield::GeometryRoot::SetMedium | ( | const char * | mat, |
Medium * | med | ||
) |
Associate a ROOT material with a Garfield medium.
Definition at line 104 of file GeometryRoot.cc.
void Garfield::GeometryRoot::SetMedium | ( | const unsigned int | imat, |
Medium * | med | ||
) |
Associate a ROOT material with a Garfield medium.
Definition at line 63 of file GeometryRoot.cc.
Referenced by SetMedium().
|
protected |
Definition at line 55 of file GeometryRoot.hh.
Referenced by EnableDebugging().
|
protected |
Definition at line 49 of file GeometryRoot.hh.
Referenced by GetBoundingBox(), GetMaterial(), GetMedium(), GetNumberOfMaterials(), IsInside(), SetGeometry(), and SetMedium().
|
protected |
Definition at line 52 of file GeometryRoot.hh.
Referenced by GetMedium(), SetGeometry(), and SetMedium().