Garfield++ v2r0
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>

Public Member Functions

 ViewCell ()
 Constructor.
 
 ~ViewCell ()
 Destructor.
 
void SetCanvas (TCanvas *c)
 Set the canvas on which to draw the cell geometry.
 
void SetComponent (ComponentAnalyticField *comp)
 Set the component for which to draw the cell geometry.
 
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 EnableDebugging (const bool on=true)
 Switch on/off debugging output.
 
void EnableWireMarkers (const bool on=true)
 
void DisableWireMarkers ()
 

Detailed Description

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

Definition at line 15 of file ViewCell.hh.

Constructor & Destructor Documentation

◆ ViewCell()

Garfield::ViewCell::ViewCell ( )

Constructor.

Definition at line 17 of file ViewCell.cc.

18 : m_className("ViewCell"),
19 m_debug(false),
20 m_useWireMarker(true),
21 m_label("Cell Layout"),
22 m_canvas(NULL),
23 m_hasExternalCanvas(false),
24 m_hasUserArea(false),
25 m_xMin(-1.),
26 m_yMin(-1.),
27 m_zMin(-1.),
28 m_xMax(1.),
29 m_yMax(1.),
30 m_zMax(1.),
31 m_component(NULL),
32 m_geo(NULL) {
33
35}
PlottingEngineRoot plottingEngine

◆ ~ViewCell()

Garfield::ViewCell::~ViewCell ( )

Destructor.

Definition at line 37 of file ViewCell.cc.

37 {
38
39 if (!m_hasExternalCanvas && m_canvas) delete m_canvas;
40 if (m_geo) delete m_geo;
41
42}

Member Function Documentation

◆ DisableWireMarkers()

void Garfield::ViewCell::DisableWireMarkers ( )
inline

Definition at line 45 of file ViewCell.hh.

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

◆ EnableDebugging()

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

Switch on/off debugging output.

Definition at line 40 of file ViewCell.hh.

40{ m_debug = on; }

◆ 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 44 of file ViewCell.hh.

44{ m_useWireMarker = on; }

Referenced by DisableWireMarkers().

◆ Plot2d()

void Garfield::ViewCell::Plot2d ( )

Make a two-dimensional drawing of the cell geometry.

Definition at line 84 of file ViewCell.cc.

84 {
85
86 if (!Plot(false)) {
87 std::cerr << m_className << "::Plot2d: Error creating plot.\n";
88 }
89}

◆ Plot3d()

void Garfield::ViewCell::Plot3d ( )

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

Definition at line 91 of file ViewCell.cc.

91 {
92
93 if (!Plot(true)) {
94 std::cerr << m_className << "::Plot3d: Error creating plot.\n";
95 }
96}

◆ SetArea() [1/2]

void Garfield::ViewCell::SetArea ( )
inline

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

Definition at line 32 of file ViewCell.hh.

32{ 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 65 of file ViewCell.cc.

68 {
69
70 // Check range, assign if non-null
71 if (xmin == xmax || ymin == ymax || zmin == zmax) {
72 std::cerr << m_className << "::SetArea: Null area range not permitted.\n";
73 return;
74 }
75 m_xMin = std::min(xmin, xmax);
76 m_yMin = std::min(ymin, ymax);
77 m_zMin = std::min(zmin, zmax);
78 m_xMax = std::max(xmin, xmax);
79 m_yMax = std::max(ymin, ymax);
80 m_zMax = std::max(zmin, zmax);
81 m_hasUserArea = true;
82}

◆ SetCanvas()

void Garfield::ViewCell::SetCanvas ( TCanvas *  c)

Set the canvas on which to draw the cell geometry.

Definition at line 54 of file ViewCell.cc.

54 {
55
56 if (!c) return;
57 if (!m_hasExternalCanvas && m_canvas) {
58 delete m_canvas;
59 m_canvas = NULL;
60 }
61 m_canvas = c;
62 m_hasExternalCanvas = true;
63}

◆ SetComponent()

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

Set the component for which to draw the cell geometry.

Definition at line 44 of file ViewCell.cc.

44 {
45
46 if (!comp) {
47 std::cerr << m_className << "::SetComponent: Null pointer.\n";
48 return;
49 }
50
51 m_component = comp;
52}

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