Garfield 0.3
Toolkit for the detailed simulation of particle detectors based on ionization 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:
Garfield::ViewBase

Public Member Functions

 ViewCell ()
 Default constructor.
 ViewCell (ComponentAnalyticField *cmp)
 Constructor from analytic-field component.
 ViewCell (ComponentNeBem2d *cmp)
 Constructor from two-dimenstional neBEM component.
 ~ViewCell ()=default
 Destructor.
void SetComponent (ComponentAnalyticField *comp)
 Set the component for which to draw the cell geometry.
void SetComponent (ComponentNeBem2d *comp)
void Plot2d ()
 Make a two-dimensional drawing of the cell layout.
void Plot3d ()
 Make a three-dimensional drawing of the cell layout (using TGeo).
void EnableWireMarkers (const bool on=true)
 Visualize wirers using markers (default setting) or as a circle with the actual wire radius.
void DisableWireMarkers ()
Public Member Functions inherited from Garfield::ViewBase
 ViewBase ()=delete
 Default constructor.
 ViewBase (const std::string &name)
 Constructor.
virtual ~ViewBase ()=default
 Destructor.
void SetCanvas (TPad *pad)
 Set the canvas to be painted on.
void SetCanvas ()
 Unset an external canvas.
TPad * GetCanvas ()
 Retrieve the canvas.
void SetArea (const double xmin, const double ymin, const double xmax, const double ymax)
 Set the x- and y-axis limits (in local coordinates of the current viewing plane, if applicable).
virtual void SetArea (const double xmin, const double ymin, const double zmin, const double xmax, const double ymax, const double zmax)
 Set a bounding box (if applicable).
void SetArea ()
 Use default x- and y-axis limits (based on the bounding box of the sensor/component, if applicable).
virtual void SetPlane (const double fx, const double fy, const double fz, const double x0, const double y0, const double z0)
 Set the projection (viewing plane), if applicable.
virtual void SetPlane (const double fx, const double fy, const double fz, const double x0, const double y0, const double z0, const double hx, const double hy, const double hz)
 Set the projection plane specifying a hint for the in-plane x axis.
void Rotate (const double angle)
 Rotate the viewing plane (angle in radian).
void SetPlaneXY ()
 Set the viewing plane to x-y.
void SetPlaneXZ ()
 Set the viewing plane to x-z.
void SetPlaneYZ ()
 Set the viewing plane to y-z.
void SetPlaneZX ()
 Set the viewing plane to z-x.
void SetPlaneZY ()
 Set the viewing plane to z-y.
void EnableDebugging (const bool on=true)
 Switch on/off debugging output.

Private Member Functions

bool Plot (const bool twod)
void PlotWire (const double x, const double y, const double d, const int type)
void PlotWire (const double x, const double y, const double d, const int type, const double lz)
void PlotTube (const double x0, const double y0, const double r, const int n)
void PlotTube (const double x0, const double y0, const double r1, const double r2, const int n, const double lz)
void PlotPlane (const double x0, const double y0, const double x1, const double y1)
void PlotPlane (const double dx, const double dy, const double dz, const double x0, const double y0)
bool PlotNeBem (const bool twod)
void SetupGeo (const double dx, const double dy, const double dz)

Private Attributes

bool m_useWireMarker = true
ComponentAnalyticFieldm_component = nullptr
ComponentNeBem2dm_nebem = nullptr
std::unique_ptr< TGeoManager > m_geo

Additional Inherited Members

Static Public Member Functions inherited from Garfield::ViewBase
static std::string FindUnusedFunctionName (const std::string &s)
 Find an unused function name.
static std::string FindUnusedHistogramName (const std::string &s)
 Find an unused histogram name.
static std::string FindUnusedCanvasName (const std::string &s)
 Find an unused canvas name.
Protected Member Functions inherited from Garfield::ViewBase
void UpdateProjectionMatrix ()
template<typename T>
void ToPlane (const T x, const T y, const T z, T &xp, T &yp) const
template<typename T>
bool InBox (const std::array< T, 3 > &x) const
void Clip (const std::array< float, 3 > &x0, const std::array< float, 3 > &x1, std::array< float, 3 > &xc) const
void DrawLine (const std::vector< std::array< float, 3 > > &xl, const short col, const short lw)
std::string LabelX ()
std::string LabelY ()
std::string PlaneDescription ()
bool PlotLimits (Sensor *sensor, double &xmin, double &ymin, double &xmax, double &ymax) const
bool PlotLimits (Component *cmp, double &xmin, double &ymin, double &xmax, double &ymax) const
bool PlotLimitsFromUserBox (double &xmin, double &ymin, double &xmax, double &ymax) const
bool PlotLimits (std::array< double, 3 > &bbmin, std::array< double, 3 > &bbmax, double &xmin, double &ymin, double &xmax, double &ymax) const
Static Protected Member Functions inherited from Garfield::ViewBase
static bool RangeSet (TVirtualPad *)
static void SetRange (TVirtualPad *pad, const double x0, const double y0, const double x1, const double y1)
Protected Attributes inherited from Garfield::ViewBase
std::string m_className = "ViewBase"
bool m_debug = false
bool m_userPlotLimits = false
double m_xMinPlot = -1.
double m_xMaxPlot = 1.
double m_yMinPlot = -1.
double m_yMaxPlot = 1.
bool m_userBox = false
double m_xMinBox = -1.
double m_xMaxBox = 1.
double m_yMinBox = -1.
double m_yMaxBox = 1.
double m_zMinBox = -1.
double m_zMaxBox = 1.
std::array< std::array< double, 3 >, 3 > m_proj
std::array< double, 4 > m_plane {{0, 0, 1, 0}}
std::array< std::array< double, 3 >, 3 > m_prmat

Detailed Description

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

Definition at line 17 of file ViewCell.hh.

Constructor & Destructor Documentation

◆ ViewCell() [1/3]

Garfield::ViewCell::ViewCell ( )

Default constructor.

◆ ViewCell() [2/3]

Garfield::ViewCell::ViewCell ( ComponentAnalyticField * cmp)

Constructor from analytic-field component.

◆ ViewCell() [3/3]

Garfield::ViewCell::ViewCell ( ComponentNeBem2d * cmp)

Constructor from two-dimenstional neBEM component.

◆ ~ViewCell()

Garfield::ViewCell::~ViewCell ( )
default

Destructor.

Member Function Documentation

◆ DisableWireMarkers()

void Garfield::ViewCell::DisableWireMarkers ( )
inline

Definition at line 40 of file ViewCell.hh.

40{ EnableWireMarkers(false); }
void EnableWireMarkers(const bool on=true)
Visualize wirers using markers (default setting) or as a circle with the actual wire radius.
Definition ViewCell.hh:39

◆ EnableWireMarkers()

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

Visualize wirers using markers (default setting) or as a circle with the actual wire radius.

Definition at line 39 of file ViewCell.hh.

39{ m_useWireMarker = on; }

◆ Plot()

bool Garfield::ViewCell::Plot ( const bool twod)
private

◆ Plot2d()

void Garfield::ViewCell::Plot2d ( )

Make a two-dimensional drawing of the cell layout.

◆ Plot3d()

void Garfield::ViewCell::Plot3d ( )

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

◆ PlotNeBem()

bool Garfield::ViewCell::PlotNeBem ( const bool twod)
private

◆ PlotPlane() [1/2]

void Garfield::ViewCell::PlotPlane ( const double dx,
const double dy,
const double dz,
const double x0,
const double y0 )
private

◆ PlotPlane() [2/2]

void Garfield::ViewCell::PlotPlane ( const double x0,
const double y0,
const double x1,
const double y1 )
private

◆ PlotTube() [1/2]

void Garfield::ViewCell::PlotTube ( const double x0,
const double y0,
const double r,
const int n )
private

◆ PlotTube() [2/2]

void Garfield::ViewCell::PlotTube ( const double x0,
const double y0,
const double r1,
const double r2,
const int n,
const double lz )
private

◆ PlotWire() [1/2]

void Garfield::ViewCell::PlotWire ( const double x,
const double y,
const double d,
const int type )
private

◆ PlotWire() [2/2]

void Garfield::ViewCell::PlotWire ( const double x,
const double y,
const double d,
const int type,
const double lz )
private

◆ SetComponent() [1/2]

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

Set the component for which to draw the cell geometry.

◆ SetComponent() [2/2]

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

◆ SetupGeo()

void Garfield::ViewCell::SetupGeo ( const double dx,
const double dy,
const double dz )
private

Member Data Documentation

◆ m_component

ComponentAnalyticField* Garfield::ViewCell::m_component = nullptr
private

Definition at line 45 of file ViewCell.hh.

◆ m_geo

std::unique_ptr<TGeoManager> Garfield::ViewCell::m_geo
private

Definition at line 49 of file ViewCell.hh.

◆ m_nebem

ComponentNeBem2d* Garfield::ViewCell::m_nebem = nullptr
private

Definition at line 46 of file ViewCell.hh.

◆ m_useWireMarker

bool Garfield::ViewCell::m_useWireMarker = true
private

Definition at line 43 of file ViewCell.hh.


The documentation for this class was generated from the following file:
  • /builds/garfield/docs/source/Include/Garfield/ViewCell.hh