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

Plot transport coefficients as function of electric and magnetic field. More...

#include <ViewMedium.hh>

+ Inheritance diagram for Garfield::ViewMedium:

Public Member Functions

 ViewMedium ()
 Constructor.
 
 ~ViewMedium ()=default
 Destructor.
 
void SetMedium (Medium *m)
 Set the medium from which to retrieve the transport coefficients.
 
void EnableAutoRangeX (const bool on=true)
 Try to choose the x-axis range based on the field grid.
 
void SetRangeE (const double emin, const double emax, const bool logscale)
 Set the limits of the electric field.
 
void SetRangeB (const double bmin, const double bmax, const bool logscale)
 Set the limits of the magnetic field.
 
void SetRangeA (const double amin, const double amax, const bool logscale)
 Set the limits of the angle between electric and magnetic field.
 
void EnableAutoRangeY (const bool on=true)
 Choose the y-axis range based on the function's minima/maxima.
 
void SetRangeY (const double ymin, const double ymax, const bool logscale=false)
 Set the range of the function (velocity etc.) to be plotted.
 
void SetElectricField (const double efield)
 Set the electric field to use when plotting as function of B or angle.
 
void SetMagneticField (const double bfield)
 Set the magnetic field to use when plotting as function of E or angle.
 
void SetAngle (const double angle)
 Set the angle to use when plotting as function of E or B.
 
void PlotElectronVelocity (const char xaxis, const bool same=false)
 
void PlotHoleVelocity (const char xaxis, const bool same=false)
 Plot the drift velocity components of holes in the medium.
 
void PlotIonVelocity (const char xaxis, const bool same=false)
 Plot the ion drift velocity in the gas.
 
void PlotElectronDiffusion (const char xaxis, const bool same=false)
 Plot the diffusion coefficients in the medium.
 
void PlotHoleDiffusion (const char xaxis, const bool same=false)
 Plot the diffusion coefficients of holes in the medium.
 
void PlotIonDiffusion (const char xaxis, const bool same=false)
 Plot the diffusion coefficients of ions in the gas.
 
void PlotElectronTownsend (const char xaxis, const bool same=false)
 Plot the Townsend coefficient for electrons.
 
void PlotHoleTownsend (const char xaxis, const bool same=false)
 Plot the Townsend coefficient for holes.
 
void PlotElectronAttachment (const char xaxis, const bool same=false)
 Plot the attachment coefficient for electrons.
 
void PlotHoleAttachment (const char xaxis, const bool same=false)
 Plot the attachment coefficient for holes.
 
void PlotElectronLorentzAngle (const char xaxis, const bool same=false)
 Plot the angle between drift velocity and field.
 
void PlotElectronCrossSections ()
 
void SetColours (const std::vector< short > &cols)
 Set the (ROOT) colours to be used in the plots.
 
void SetLabels (const std::vector< std::string > &labels)
 Set user-defined plot labels.
 
- 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)
 
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 ()
 
virtual void SetPlane (const double fx, const double fy, const double fz, const double x0, const double y0, const double z0)
 
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 EnableDebugging (const bool on=true)
 Switch on/off debugging output.
 

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
 
bool RangeSet (TPad *)
 
void SetRange (TPad *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

Plot transport coefficients as function of electric and magnetic field.

Definition at line 17 of file ViewMedium.hh.

Constructor & Destructor Documentation

◆ ViewMedium()

Garfield::ViewMedium::ViewMedium ( )

Constructor.

Definition at line 42 of file ViewMedium.cc.

42: ViewBase("ViewMedium") {}
ViewBase()=delete
Default constructor.

◆ ~ViewMedium()

Garfield::ViewMedium::~ViewMedium ( )
default

Destructor.

Member Function Documentation

◆ EnableAutoRangeX()

void Garfield::ViewMedium::EnableAutoRangeX ( const bool  on = true)
inline

Try to choose the x-axis range based on the field grid.

Definition at line 28 of file ViewMedium.hh.

28{ m_autoRangeX = on; }

◆ EnableAutoRangeY()

void Garfield::ViewMedium::EnableAutoRangeY ( const bool  on = true)
inline

Choose the y-axis range based on the function's minima/maxima.

Definition at line 36 of file ViewMedium.hh.

36{ m_autoRangeY = on; }

◆ PlotElectronAttachment()

void Garfield::ViewMedium::PlotElectronAttachment ( const char  xaxis,
const bool  same = false 
)
inline

Plot the attachment coefficient for electrons.

Definition at line 87 of file ViewMedium.hh.

87 {
88 Plot(GetAxis(xaxis), Charge::Electron, Parameter::Attachment, same);
89 }

◆ PlotElectronCrossSections()

void Garfield::ViewMedium::PlotElectronCrossSections ( )

Definition at line 99 of file ViewMedium.cc.

99 {
100 std::cerr << m_className << "::PlotElectronCrossSections: Not implemented.\n";
101}
std::string m_className
Definition: ViewBase.hh:78

◆ PlotElectronDiffusion()

void Garfield::ViewMedium::PlotElectronDiffusion ( const char  xaxis,
const bool  same = false 
)
inline

Plot the diffusion coefficients in the medium.

Definition at line 67 of file ViewMedium.hh.

67 {
68 PlotDiffusion(GetAxis(xaxis), Charge::Electron, same);
69 }

◆ PlotElectronLorentzAngle()

void Garfield::ViewMedium::PlotElectronLorentzAngle ( const char  xaxis,
const bool  same = false 
)
inline

Plot the angle between drift velocity and field.

Definition at line 95 of file ViewMedium.hh.

95 {
96 PlotLorentzAngle(GetAxis(xaxis), Charge::Electron, same);
97 }

◆ PlotElectronTownsend()

void Garfield::ViewMedium::PlotElectronTownsend ( const char  xaxis,
const bool  same = false 
)
inline

Plot the Townsend coefficient for electrons.

Definition at line 79 of file ViewMedium.hh.

79 {
80 Plot(GetAxis(xaxis), Charge::Electron, Parameter::Townsend, same);
81 }

◆ PlotElectronVelocity()

void Garfield::ViewMedium::PlotElectronVelocity ( const char  xaxis,
const bool  same = false 
)
inline

Plot the drift velocity components of electrons in the medium.

Parameters
xaxisabscissa.
  • 'e': electric field,
  • 'b': magnetic field,
  • 'a': angle between E and B.
sameflag to keep existing plots (true) or not.

Definition at line 55 of file ViewMedium.hh.

55 {
56 PlotVelocity(GetAxis(xaxis), Charge::Electron, same);
57 }

◆ PlotHoleAttachment()

void Garfield::ViewMedium::PlotHoleAttachment ( const char  xaxis,
const bool  same = false 
)
inline

Plot the attachment coefficient for holes.

Definition at line 91 of file ViewMedium.hh.

91 {
92 Plot(GetAxis(xaxis), Charge::Hole, Parameter::Attachment, same);
93 }

◆ PlotHoleDiffusion()

void Garfield::ViewMedium::PlotHoleDiffusion ( const char  xaxis,
const bool  same = false 
)
inline

Plot the diffusion coefficients of holes in the medium.

Definition at line 71 of file ViewMedium.hh.

71 {
72 PlotDiffusion(GetAxis(xaxis), Charge::Hole, same);
73 }

◆ PlotHoleTownsend()

void Garfield::ViewMedium::PlotHoleTownsend ( const char  xaxis,
const bool  same = false 
)
inline

Plot the Townsend coefficient for holes.

Definition at line 83 of file ViewMedium.hh.

83 {
84 Plot(GetAxis(xaxis), Charge::Hole, Parameter::Townsend, same);
85 }

◆ PlotHoleVelocity()

void Garfield::ViewMedium::PlotHoleVelocity ( const char  xaxis,
const bool  same = false 
)
inline

Plot the drift velocity components of holes in the medium.

Definition at line 59 of file ViewMedium.hh.

59 {
60 PlotVelocity(GetAxis(xaxis), Charge::Hole, same);
61 }

◆ PlotIonDiffusion()

void Garfield::ViewMedium::PlotIonDiffusion ( const char  xaxis,
const bool  same = false 
)
inline

Plot the diffusion coefficients of ions in the gas.

Definition at line 75 of file ViewMedium.hh.

75 {
76 PlotDiffusion(GetAxis(xaxis), Charge::Ion, same);
77 }

◆ PlotIonVelocity()

void Garfield::ViewMedium::PlotIonVelocity ( const char  xaxis,
const bool  same = false 
)
inline

Plot the ion drift velocity in the gas.

Definition at line 63 of file ViewMedium.hh.

63 {
64 PlotVelocity(GetAxis(xaxis), Charge::Ion, same);
65 }

◆ SetAngle()

void Garfield::ViewMedium::SetAngle ( const double  angle)
inline

Set the angle to use when plotting as function of E or B.

Definition at line 46 of file ViewMedium.hh.

46{ m_angle = angle; }

◆ SetColours()

void Garfield::ViewMedium::SetColours ( const std::vector< short > &  cols)
inline

Set the (ROOT) colours to be used in the plots.

Definition at line 101 of file ViewMedium.hh.

101{ m_colours = cols; }

◆ SetElectricField()

void Garfield::ViewMedium::SetElectricField ( const double  efield)
inline

Set the electric field to use when plotting as function of B or angle.

Definition at line 42 of file ViewMedium.hh.

42{ m_efield = efield; }

◆ SetLabels()

void Garfield::ViewMedium::SetLabels ( const std::vector< std::string > &  labels)
inline

Set user-defined plot labels.

Definition at line 103 of file ViewMedium.hh.

103{ m_labels = labels; }

◆ SetMagneticField()

void Garfield::ViewMedium::SetMagneticField ( const double  bfield)
inline

Set the magnetic field to use when plotting as function of E or angle.

Definition at line 44 of file ViewMedium.hh.

44{ m_bfield = bfield; }

◆ SetMedium()

void Garfield::ViewMedium::SetMedium ( Medium m)

Set the medium from which to retrieve the transport coefficients.

Definition at line 44 of file ViewMedium.cc.

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

◆ SetRangeA()

void Garfield::ViewMedium::SetRangeA ( const double  amin,
const double  amax,
const bool  logscale 
)

Set the limits of the angle between electric and magnetic field.

Definition at line 76 of file ViewMedium.cc.

76 {
77 if (amin >= amax || amin < 0.) {
78 std::cerr << m_className << "::SetRangeA: Incorrect range.\n";
79 return;
80 }
81
82 m_aMin = amin;
83 m_aMax = amax;
84 m_logA = logscale;
85}

◆ SetRangeB()

void Garfield::ViewMedium::SetRangeB ( const double  bmin,
const double  bmax,
const bool  logscale 
)

Set the limits of the magnetic field.

Definition at line 65 of file ViewMedium.cc.

65 {
66 if (bmin >= bmax || bmin < 0.) {
67 std::cerr << m_className << "::SetRangeB: Incorrect range.\n";
68 return;
69 }
70
71 m_bMin = bmin;
72 m_bMax = bmax;
73 m_logB = logscale;
74}

◆ SetRangeE()

void Garfield::ViewMedium::SetRangeE ( const double  emin,
const double  emax,
const bool  logscale 
)

Set the limits of the electric field.

Definition at line 53 of file ViewMedium.cc.

54 {
55 if (emin >= emax || emin < 0.) {
56 std::cerr << m_className << "::SetRangeE: Incorrect range.\n";
57 return;
58 }
59
60 m_eMin = emin;
61 m_eMax = emax;
62 m_logE = logscale;
63}

◆ SetRangeY()

void Garfield::ViewMedium::SetRangeY ( const double  ymin,
const double  ymax,
const bool  logscale = false 
)

Set the range of the function (velocity etc.) to be plotted.

Definition at line 87 of file ViewMedium.cc.

88 {
89 if (ymin >= ymax || ymin < 0.) {
90 std::cerr << m_className << "::SetRangeY: Incorrect range.\n";
91 return;
92 }
93
94 m_yMin = ymin;
95 m_yMax = ymax;
96 m_logY = logscale;
97}

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