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

"Native" geometry, using simple shapes. More...

#include <GeometrySimple.hh>

Inheritance diagram for Garfield::GeometrySimple:
Garfield::Geometry

Public Member Functions

 GeometrySimple ()
 Constructor.
virtual ~GeometrySimple ()
 Destructor.
Medium * GetMedium (const double x, const double y, const double z, const bool tesselated=false) const override
 Retrieve the medium at a given point.
size_t GetNumberOfSolids () const override
 Return the number of solids in the geometry.
SolidGetSolid (const size_t i) const override
SolidGetSolid (const size_t i, Medium *&medium) const override
void AddSolid (Solid *s, Medium *m)
 Add a solid to the geometry, together with the medium inside.
SolidGetSolid (const double x, const double y, const double z, const bool tesselated=false) const
 Get the solid at a given location (x, y, z).
void SetMedium (Medium *medium)
 Set a background medium.
void Clear ()
 Reset the geometry.
void PrintSolids ()
 Print a summary of the solids present in the geometry.
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 IsInBoundingBox (const double x, const double y, const double z) const
 Determine whether a point is inside the envelope of 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 on/off debugging and warning messages.
Public Member Functions inherited from Garfield::Geometry
 Geometry ()=delete
 Default constructor.
 Geometry (const std::string &name)
 Constructor.
virtual ~Geometry ()
 Destructor.
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 Attributes

std::vector< std::pair< Solid *, Medium * > > m_solids
 List of solids and associated media.
Medium * m_medium = nullptr
 Background medium.
bool m_hasBoundingBox = false
std::array< double, 3 > m_bbMin = {{0., 0., 0.}}
std::array< double, 3 > m_bbMax = {{0., 0., 0.}}
bool m_debug = false
 Switch on/off debugging messages.
Protected Attributes inherited from Garfield::Geometry
std::string m_className = "Geometry"

Detailed Description

"Native" geometry, using simple shapes.

Definition at line 13 of file GeometrySimple.hh.

Constructor & Destructor Documentation

◆ GeometrySimple()

Garfield::GeometrySimple::GeometrySimple ( )

Constructor.

◆ ~GeometrySimple()

virtual Garfield::GeometrySimple::~GeometrySimple ( )
inlinevirtual

Destructor.

Definition at line 18 of file GeometrySimple.hh.

18{}

Member Function Documentation

◆ AddSolid()

void Garfield::GeometrySimple::AddSolid ( Solid * s,
Medium * m )

Add a solid to the geometry, together with the medium inside.

◆ Clear()

void Garfield::GeometrySimple::Clear ( )

Reset the geometry.

◆ EnableDebugging()

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

Switch on/off debugging and warning messages.

Definition at line 57 of file GeometrySimple.hh.

57{ m_debug = on; }
bool m_debug
Switch on/off debugging messages.

◆ GetBoundingBox()

bool Garfield::GeometrySimple::GetBoundingBox ( double & xmin,
double & ymin,
double & zmin,
double & xmax,
double & ymax,
double & zmax )
inlineoverridevirtual

Get the bounding box (envelope of the geometry).

Implements Garfield::Geometry.

Definition at line 45 of file GeometrySimple.hh.

46 {
47 xmin = m_bbMin[0];
48 ymin = m_bbMin[1];
49 zmin = m_bbMin[2];
50 xmax = m_bbMax[0];
51 ymax = m_bbMax[1];
52 zmax = m_bbMax[2];
53 return true;
54 }
std::array< double, 3 > m_bbMin
std::array< double, 3 > m_bbMax

◆ GetMedium()

Medium * Garfield::GeometrySimple::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.

◆ GetNumberOfSolids()

size_t Garfield::GeometrySimple::GetNumberOfSolids ( ) const
inlineoverridevirtual

Return the number of solids in the geometry.

Reimplemented from Garfield::Geometry.

Definition at line 23 of file GeometrySimple.hh.

23{ return m_solids.size(); }
std::vector< std::pair< Solid *, Medium * > > m_solids
List of solids and associated media.

◆ GetSolid() [1/3]

Solid * Garfield::GeometrySimple::GetSolid ( const double x,
const double y,
const double z,
const bool tesselated = false ) const

Get the solid at a given location (x, y, z).

◆ GetSolid() [2/3]

Solid * Garfield::GeometrySimple::GetSolid ( const size_t i) const
override

◆ GetSolid() [3/3]

Solid * Garfield::GeometrySimple::GetSolid ( const size_t i,
Medium *& medium ) const
override

◆ IsInBoundingBox()

bool Garfield::GeometrySimple::IsInBoundingBox ( const double x,
const double y,
const double z ) const

Determine whether a point is inside the envelope of the geometry.

◆ IsInside()

bool Garfield::GeometrySimple::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.

◆ PrintSolids()

void Garfield::GeometrySimple::PrintSolids ( )

Print a summary of the solids present in the geometry.

◆ SetMedium()

void Garfield::GeometrySimple::SetMedium ( Medium * medium)
inline

Set a background medium.

Definition at line 34 of file GeometrySimple.hh.

34{ m_medium = medium; }
Medium * m_medium
Background medium.

Member Data Documentation

◆ m_bbMax

std::array<double, 3> Garfield::GeometrySimple::m_bbMax = {{0., 0., 0.}}
protected

Definition at line 68 of file GeometrySimple.hh.

68{{0., 0., 0.}};

◆ m_bbMin

std::array<double, 3> Garfield::GeometrySimple::m_bbMin = {{0., 0., 0.}}
protected

Definition at line 67 of file GeometrySimple.hh.

67{{0., 0., 0.}};

◆ m_debug

bool Garfield::GeometrySimple::m_debug = false
protected

Switch on/off debugging messages.

Definition at line 71 of file GeometrySimple.hh.

◆ m_hasBoundingBox

bool Garfield::GeometrySimple::m_hasBoundingBox = false
protected

Definition at line 66 of file GeometrySimple.hh.

◆ m_medium

Medium* Garfield::GeometrySimple::m_medium = nullptr
protected

Background medium.

Definition at line 63 of file GeometrySimple.hh.

◆ m_solids

std::vector<std::pair<Solid*, Medium*> > Garfield::GeometrySimple::m_solids
protected

List of solids and associated media.

Definition at line 61 of file GeometrySimple.hh.


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