Garfield 0.3
Toolkit for the detailed simulation of particle detectors based on ionization measurement in gases and semiconductors
Loading...
Searching...
No Matches
Garfield::ViewIsochrons Class Reference

Draw equal time contour lines. More...

#include <ViewIsochrons.hh>

Inheritance diagram for Garfield::ViewIsochrons:
Garfield::ViewBase

Public Member Functions

 ViewIsochrons ()
 Constructor.
 ~ViewIsochrons ()=default
 Destructor.
void SetSensor (Sensor *s)
 Set the sensor.
void SetComponent (Component *c)
 Set the component.
void PlotIsochrons (const double tstep, const std::vector< std::array< double, 3 > > &points, const bool rev=false, const bool colour=false, const bool markers=false, const bool plotDriftLines=true)
 Draw equal time contour lines.
void DriftElectrons (const bool positive=false)
 Request electron drift lines with negative (default) or positive charge.
void DriftIons (const bool negative=false)
 Request ion drift lines with positive (default) or negative charge.
void EnableSorting (const bool on=true)
 Sort (or not) the points on a contour line (default: sorting is done).
void CheckCrossings (const bool on=true)
 Check (or not) that drift-lines do not cross isochrons (default: check is done).
void SetAspectRatioSwitch (const double ar)
 Set the aspect ratio above which an isochron is considered linear (as opposed to circular).
void SetLoopThreshold (const double thr)
 Fractional distance between two points for closing a circular isochron (default: 0.2).
void SetConnectionThreshold (const double thr)
 Fractional distance over which isochron segments are connected (default: 0.2).
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 SetPlotLimits ()
void ComputeDriftLines (const double tstep, const std::vector< std::array< double, 3 > > &points, std::vector< std::vector< std::array< double, 3 > > > &driftLines, std::vector< std::array< double, 3 > > &startPoints, std::vector< std::array< double, 3 > > &endPoints, std::vector< int > &statusCodes, const bool rev=false)
void SortContour (std::vector< std::pair< std::array< double, 4 >, unsigned int > > &contour, bool &circle)

Private Attributes

Sensor * m_sensor = nullptr
Component * m_component = nullptr
Particle m_particle = Particle::Electron
bool m_positive = false
short m_markerStyle = 5
short m_lineStyle = 2
bool m_sortContours = true
double m_aspectRatio = 3.
double m_loopThreshold = 0.2
double m_connectionThreshold = 0.2
bool m_checkCrossings = true

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

Draw equal time contour lines.

Definition at line 16 of file ViewIsochrons.hh.

Constructor & Destructor Documentation

◆ ViewIsochrons()

Garfield::ViewIsochrons::ViewIsochrons ( )

Constructor.

◆ ~ViewIsochrons()

Garfield::ViewIsochrons::~ViewIsochrons ( )
default

Destructor.

Member Function Documentation

◆ CheckCrossings()

void Garfield::ViewIsochrons::CheckCrossings ( const bool on = true)
inline

Check (or not) that drift-lines do not cross isochrons (default: check is done).

Definition at line 58 of file ViewIsochrons.hh.

◆ ComputeDriftLines()

void Garfield::ViewIsochrons::ComputeDriftLines ( const double tstep,
const std::vector< std::array< double, 3 > > & points,
std::vector< std::vector< std::array< double, 3 > > > & driftLines,
std::vector< std::array< double, 3 > > & startPoints,
std::vector< std::array< double, 3 > > & endPoints,
std::vector< int > & statusCodes,
const bool rev = false )
private

◆ DriftElectrons()

void Garfield::ViewIsochrons::DriftElectrons ( const bool positive = false)
inline

Request electron drift lines with negative (default) or positive charge.

Definition at line 45 of file ViewIsochrons.hh.

◆ DriftIons()

void Garfield::ViewIsochrons::DriftIons ( const bool negative = false)
inline

Request ion drift lines with positive (default) or negative charge.

Definition at line 50 of file ViewIsochrons.hh.

50 {
52 m_positive = !negative;
53 }

◆ EnableSorting()

void Garfield::ViewIsochrons::EnableSorting ( const bool on = true)
inline

Sort (or not) the points on a contour line (default: sorting is done).

Definition at line 55 of file ViewIsochrons.hh.

◆ PlotIsochrons()

void Garfield::ViewIsochrons::PlotIsochrons ( const double tstep,
const std::vector< std::array< double, 3 > > & points,
const bool rev = false,
const bool colour = false,
const bool markers = false,
const bool plotDriftLines = true )

Draw equal time contour lines.

Parameters
tstepTime interval.
pointsList of starting points.
revIf true, the drift time is measured from the end points of the drift lines.
colourDraw contour lines using colours.
markersDraw markers (as opposed to lines).
plotDriftLinesDraw drift lines together with the isochrons.

◆ SetAspectRatioSwitch()

void Garfield::ViewIsochrons::SetAspectRatioSwitch ( const double ar)

Set the aspect ratio above which an isochron is considered linear (as opposed to circular).

◆ SetComponent()

void Garfield::ViewIsochrons::SetComponent ( Component * c)

Set the component.

◆ SetConnectionThreshold()

void Garfield::ViewIsochrons::SetConnectionThreshold ( const double thr)

Fractional distance over which isochron segments are connected (default: 0.2).

◆ SetLoopThreshold()

void Garfield::ViewIsochrons::SetLoopThreshold ( const double thr)

Fractional distance between two points for closing a circular isochron (default: 0.2).

◆ SetPlotLimits()

bool Garfield::ViewIsochrons::SetPlotLimits ( )
private

◆ SetSensor()

void Garfield::ViewIsochrons::SetSensor ( Sensor * s)

Set the sensor.

◆ SortContour()

void Garfield::ViewIsochrons::SortContour ( std::vector< std::pair< std::array< double, 4 >, unsigned int > > & contour,
bool & circle )
private

Member Data Documentation

◆ m_aspectRatio

double Garfield::ViewIsochrons::m_aspectRatio = 3.
private

Definition at line 81 of file ViewIsochrons.hh.

◆ m_checkCrossings

bool Garfield::ViewIsochrons::m_checkCrossings = true
private

Definition at line 84 of file ViewIsochrons.hh.

◆ m_component

Component* Garfield::ViewIsochrons::m_component = nullptr
private

Definition at line 71 of file ViewIsochrons.hh.

◆ m_connectionThreshold

double Garfield::ViewIsochrons::m_connectionThreshold = 0.2
private

Definition at line 83 of file ViewIsochrons.hh.

◆ m_lineStyle

short Garfield::ViewIsochrons::m_lineStyle = 2
private

Definition at line 78 of file ViewIsochrons.hh.

◆ m_loopThreshold

double Garfield::ViewIsochrons::m_loopThreshold = 0.2
private

Definition at line 82 of file ViewIsochrons.hh.

◆ m_markerStyle

short Garfield::ViewIsochrons::m_markerStyle = 5
private

Definition at line 77 of file ViewIsochrons.hh.

◆ m_particle

Particle Garfield::ViewIsochrons::m_particle = Particle::Electron
private

Definition at line 74 of file ViewIsochrons.hh.

◆ m_positive

bool Garfield::ViewIsochrons::m_positive = false
private

Definition at line 75 of file ViewIsochrons.hh.

◆ m_sensor

Sensor* Garfield::ViewIsochrons::m_sensor = nullptr
private

Definition at line 70 of file ViewIsochrons.hh.

◆ m_sortContours

bool Garfield::ViewIsochrons::m_sortContours = true
private

Definition at line 80 of file ViewIsochrons.hh.


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