Garfield++ v1r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
GeometrySimple.hh
Go to the documentation of this file.
1// Abstract base class for components
2
3#ifndef G_GEOMETRY_SIMPLE_H
4#define G_GEOMETRY_SIMPLE_H
5
6#include <vector>
7
8#include "GeometryBase.hh"
9#include "Solid.hh"
10
11namespace Garfield {
12
14
15 public:
16 // Constructor
18 // Destructor
19 virtual ~GeometrySimple() {}
20
21 // Add a solid to the geometry
22 void AddSolid(Solid* s, Medium* m);
23 // Get the solid at a given location (x, y, z)
24 Solid* GetSolid(const double x, const double y, const double z) const;
25 // Get the medium at a given location (x, y, z)
26 Medium* GetMedium(const double x, const double y, const double z) const;
27 // Number of solids/media in the geometry
28 unsigned int GetNumberOfSolids() const { return m_nSolids; }
29 unsigned int GetNumberOfMedia() const { return m_nMedia; }
30 // Get a solid/medium from the list
31 Solid* GetSolid(const unsigned int i) const;
32 virtual Medium* GetMedium(const unsigned int i) const;
33 // Reset the geometry
34 void Clear();
35 void PrintSolids();
36
37 bool IsInside(const double x, const double y, const double z) const;
38 // Bounding box (envelope of geometry)
39 bool IsInBoundingBox(const double x, const double y, const double z) const;
40 bool GetBoundingBox(double& xmin, double& ymin, double& zmin, double& xmax,
41 double& ymax, double& zmax) {
42 xmin = m_xMinBoundingBox;
43 ymin = m_yMinBoundingBox;
44 zmin = m_zMinBoundingBox;
45 xmax = m_xMaxBoundingBox;
46 ymax = m_yMaxBoundingBox;
47 zmax = m_zMaxBoundingBox;
48 return true;
49 }
50
51 // Switch on/off debugging and warning messages
52 void EnableDebugging() { m_debug = true; }
53 void DisableDebugging() { m_debug = false; }
54
55 protected:
56 // List of media
57 unsigned int m_nMedia;
58 struct medium {
60 };
61 std::vector<medium> m_media;
62
63 // List of solids
64 unsigned int m_nSolids;
65 struct solid {
67 int medium;
68 };
69 std::vector<solid> m_solids;
70
71 // Bounding box ranges
75
76 // Switch on/off debugging messages
77 bool m_debug;
78};
79}
80
81#endif
std::vector< medium > m_media
unsigned int GetNumberOfSolids() const
bool IsInBoundingBox(const double x, const double y, const double z) const
Medium * GetMedium(const double x, const double y, const double z) const
Solid * GetSolid(const double x, const double y, const double z) const
void AddSolid(Solid *s, Medium *m)
bool IsInside(const double x, const double y, const double z) const
unsigned int GetNumberOfMedia() const
bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax)
std::vector< solid > m_solids