Garfield++ 3.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
Garfield::ViewCell Class Reference

Visualize the "cell" defined in an analytic-field component. More...

#include <ViewCell.hh>

+ Inheritance diagram for Garfield::ViewCell:

Public Member Functions

 ViewCell ()
 Constructor.
 
 ~ViewCell ()=default
 Destructor.
 
void SetComponent (ComponentAnalyticField *comp)
 Set the component for which to draw the cell geometry.
 
void SetComponent (ComponentNeBem2d *comp)
 
void SetArea (const double xmin, const double ymin, const double zmin, const double xmax, const double ymax, const double zmax)
 Set the plot range explicitly.
 
void SetArea ()
 Take the plot range from the bounding box of the component class.
 
void Plot2d ()
 Make a two-dimensional drawing of the cell geometry.
 
void Plot3d ()
 Make a three-dimensional drawing of the cell geometry (using TGeo).
 
void EnableWireMarkers (const bool on=true)
 
void DisableWireMarkers ()
 
- Public Member Functions inherited from Garfield::ViewBase
 ViewBase ()=delete
 Default constructor.
 
 ViewBase (const std::string &name)
 Constructor.
 
virtual ~ViewBase ()
 Destructor.
 
void SetCanvas (TCanvas *c)
 Set the canvas to be painted on.
 
TCanvas * GetCanvas ()
 Retrieve the canvas.
 
void EnableDebugging (const bool on=true)
 Switch on/off debugging output.
 

Additional Inherited Members

- Protected Member Functions inherited from Garfield::ViewBase
std::string FindUnusedFunctionName (const std::string &s) const
 
std::string FindUnusedHistogramName (const std::string &s) const
 
- Protected Attributes inherited from Garfield::ViewBase
std::string m_className = "ViewBase"
 
bool m_debug = false
 
TCanvas * m_canvas = nullptr
 
bool m_hasExternalCanvas = false
 
double m_proj [3][3]
 

Detailed Description

Visualize the "cell" defined in an analytic-field component.

Definition at line 18 of file ViewCell.hh.

Constructor & Destructor Documentation

◆ ViewCell()

Garfield::ViewCell::ViewCell ( )

Constructor.

Definition at line 18 of file ViewCell.cc.

18: ViewBase("ViewCell") {}
ViewBase()=delete
Default constructor.

◆ ~ViewCell()

Garfield::ViewCell::~ViewCell ( )
default

Destructor.

Member Function Documentation

◆ DisableWireMarkers()

void Garfield::ViewCell::DisableWireMarkers ( )
inline

Definition at line 43 of file ViewCell.hh.

43{ EnableWireMarkers(false); }
void EnableWireMarkers(const bool on=true)
Definition: ViewCell.hh:42

◆ EnableWireMarkers()

void Garfield::ViewCell::EnableWireMarkers ( const bool  on = true)
inline

Visualize wirers using markers or as a circle with the actual wire radius. The default is markers.

Definition at line 42 of file ViewCell.hh.

42{ m_useWireMarker = on; }

Referenced by DisableWireMarkers().

◆ Plot2d()

void Garfield::ViewCell::Plot2d ( )

Make a two-dimensional drawing of the cell geometry.

Definition at line 54 of file ViewCell.cc.

54 {
55 if (!Plot(false)) {
56 std::cerr << m_className << "::Plot2d: Error creating plot.\n";
57 }
58}
std::string m_className
Definition: ViewBase.hh:28

◆ Plot3d()

void Garfield::ViewCell::Plot3d ( )

Make a three-dimensional drawing of the cell geometry (using TGeo).

Definition at line 60 of file ViewCell.cc.

60 {
61 if (!Plot(true)) {
62 std::cerr << m_className << "::Plot3d: Error creating plot.\n";
63 }
64}

◆ SetArea() [1/2]

void Garfield::ViewCell::SetArea ( )
inline

Take the plot range from the bounding box of the component class.

Definition at line 33 of file ViewCell.hh.

33{ m_hasUserArea = false; }

◆ SetArea() [2/2]

void Garfield::ViewCell::SetArea ( const double  xmin,
const double  ymin,
const double  zmin,
const double  xmax,
const double  ymax,
const double  zmax 
)

Set the plot range explicitly.

Definition at line 37 of file ViewCell.cc.

39 {
40 // Check range, assign if non-null
41 if (xmin == xmax || ymin == ymax || zmin == zmax) {
42 std::cerr << m_className << "::SetArea: Null area range not permitted.\n";
43 return;
44 }
45 m_xMin = std::min(xmin, xmax);
46 m_yMin = std::min(ymin, ymax);
47 m_zMin = std::min(zmin, zmax);
48 m_xMax = std::max(xmin, xmax);
49 m_yMax = std::max(ymin, ymax);
50 m_zMax = std::max(zmin, zmax);
51 m_hasUserArea = true;
52}

◆ SetComponent() [1/2]

void Garfield::ViewCell::SetComponent ( ComponentAnalyticField comp)

Set the component for which to draw the cell geometry.

Definition at line 20 of file ViewCell.cc.

20 {
21 if (!comp) {
22 std::cerr << m_className << "::SetComponent: Null pointer.\n";
23 return;
24 }
25
26 m_component = comp;
27}

◆ SetComponent() [2/2]

void Garfield::ViewCell::SetComponent ( ComponentNeBem2d comp)

Definition at line 29 of file ViewCell.cc.

29 {
30 if (!comp) {
31 std::cerr << m_className << "::SetComponent: Null pointer.\n";
32 return;
33 }
34 m_nebem = comp;
35}

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